/* ==========================================================================
   /home draft — every section is a face of a cube turning vertically.
   Faces cycle: dark → accent → light → deep (accent variation) → dark …
   The turn itself is driven from scroll in /assets/cube.js.
   ========================================================================== */

.cube-page { background: #050605; }
.cube { position: relative; overflow-x: clip; }

.face {
  position: relative;
  color: var(--text);
  transform-origin: 50% 100%;           /* outgoing: hinges on its bottom edge */
  backface-visibility: hidden;
  will-change: transform;
}
.face__in {
  position: relative;
  background: var(--bg);
  /* every side is at least one screen tall, so each one rests flat before the next turn */
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  transform-origin: 50% 0;              /* incoming: hinges on its top edge */
  backface-visibility: hidden;
  will-change: transform;
}
/* the edge where two faces meet catches a little light while turning */
.face__in::after {
  content: ""; position: absolute; inset: 0;
  pointer-events: none; z-index: 3;
  background: linear-gradient(to bottom, rgba(0, 0, 0, var(--shade-in, 0)) 0%, transparent 60%),
              linear-gradient(to top, rgba(0, 0, 0, var(--shade-out, 0)) 0%, transparent 60%);
}

/* ---------- Face palettes ---------- */
.face--dark, .header[data-t="dark"], .guides[data-t="dark"] { --bg: #0A0B0A; }

.face--deep, .header[data-t="deep"], .guides[data-t="deep"] {
  --bg: #12361A;
  --text: #EEF5EC;
  --muted: #A9C2A6;
  --dim: #93AE90;
  --line: #24502C;
  --accent: #6CFF63;
  --accent-50: rgba(108, 255, 99, .7);
}

.face--accent, .header[data-t="accent"], .guides[data-t="accent"],
.face--light, .header[data-t="light"], .guides[data-t="light"] {
  --text: #0A0B0A;
  --white: #0A0B0A;
  --deep: #0A0B0A;
}
.face--accent, .header[data-t="accent"], .guides[data-t="accent"] {
  --bg: #56F24E;
  --muted: #1D4A1A;
  --dim: #2A5C26;
  --line: #45C93E;
  --accent: #0A0B0A;
  --accent-50: rgba(10, 11, 10, .62);
  --node: #0A0B0A;
}
.face--light, .header[data-t="light"], .guides[data-t="light"] {
  --bg: #ECEEE8;
  --muted: #50564D;
  --dim: #5E655B;
  --line: #D3D7CE;
  --accent: #1E8A19;
  --accent-50: rgba(30, 138, 25, .8);
  --node: #1E8A19;
}

/* hard-coded whites in the base stylesheet, re-pointed for the two bright faces */
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .btn--solid { background: #0A0B0A; color: #FFFFFF; }
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .btn--solid:hover { background: rgba(10, 11, 10, .82); }
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .btn--ghost { color: #0A0B0A; }
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .btn--ghost::before { --fc: rgba(10, 11, 10, .4); }
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .btn--ghost:hover { background: rgba(10, 11, 10, .08); }
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .tag::before { --fc: rgba(10, 11, 10, .28); }
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .tag__muted { color: var(--muted); }
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .loop__step { color: rgba(10, 11, 10, .7); }
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .loop__step::before { --fc: rgba(10, 11, 10, .35); }
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .memory__desc,
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .features__key,
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .quote figcaption { color: var(--muted); }
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .tool:hover { background: rgba(10, 11, 10, .04); }
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .tool__logo { opacity: .7; }
:is(.face--accent, .face--light, .header[data-t="accent"], .guides[data-t="accent"], .header[data-t="light"], .guides[data-t="light"]) .stat { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.face--deep .stat { background: rgba(18, 54, 26, .72); }

/* ---------- Sharp corners everywhere on the sides (pixel language, no rounding) ---------- */
.cube-page .face *, .cube-page .face *::before, .cube-page .face *::after { border-radius: 0 !important; }

/* ---------- Product UI as frosted glass ----------
   Widget cards and the embedded consoles are translucent and blur what is behind them
   (the side's colour and its pixel field). Each side tints the glass its own way:
     dark   smoked glass, the original dark UI
     accent black glass on neon: the UI stays dark, the green glows through the edges
     light  milk glass: the UI is inverted to a light theme
     deep   green-tinted dark glass                                                        */
.face { --glass: rgba(20, 21, 20, .56); --glass-edge: rgba(255, 255, 255, .09); --glass-blur: 18px; --stage-dot: rgba(255, 255, 255, .06); }
.face--accent { --glass: rgba(8, 9, 8, .8); --glass-edge: rgba(10, 11, 10, .9); --stage-dot: rgba(10, 11, 10, .2); }
.face--light { --glass: rgba(255, 255, 255, .55); --glass-edge: rgba(10, 11, 10, .12); --stage-dot: rgba(10, 11, 10, .1); }
.face--deep { --glass: rgba(6, 26, 11, .55); --glass-edge: rgba(150, 255, 150, .12); --stage-dot: rgba(200, 255, 200, .07); }

.cube-page .console { background: transparent; }
.cube-page .stage {
  background: radial-gradient(var(--stage-dot) 1px, transparent 1.2px) 0 0 / 10px 10px;
}
.cube-page .wcard {
  --w-surface: var(--glass);
  --w-panel: rgba(255, 255, 255, .035);
  --w-raised: rgba(255, 255, 255, .07);
  --w-hair: rgba(255, 255, 255, .08);
  background: var(--glass);
  border-color: var(--glass-edge);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4); backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .55);
}
/* iframe consoles: the window inside is translucent (cube.js styles it), the iframe blurs the page behind */
.cube-page .embed {
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4); backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  max-width: 1240px; margin: 0 auto; outline: 1px solid var(--glass-edge); outline-offset: -1px;
}
.cube-page #developers .embed { max-width: 1100px; }

/* light side: milk glass, the card's contents inverted to a light UI */
.face--light .wcard { box-shadow: 0 30px 60px -40px rgba(10, 11, 10, .25); }
.face--light .wcard > * { filter: invert(1) hue-rotate(180deg); }
/* accent side: hard black frame instead of a soft shadow */
.face--accent .wcard, .face--accent .embed { box-shadow: 8px 8px 0 rgba(10, 11, 10, .9); }

/* ---------- Build-up on scroll (cube.js adds .is-in once a side has landed) ---------- */
.js .build {
  opacity: 0; transform: translateY(36px);
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.16, .84, .24, 1);
  transition-delay: var(--d, 0ms);
}
.js .build.cell { transform: translateY(36px) scale(.97); }
.js .build.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .build { opacity: 1; transform: none; transition: none; } }

/* ---------- Grid lines follow the side ---------- */
.guides__inner::before, .guides__inner::after { transition: background-color .35s ease; }

/* ---------- Hero pixel field: fills guide to guide, finer grid ---------- */
.cube-page .hero-wrap { max-width: none; width: 100%; margin: 0; }  /* flex child: auto margins would shrink it */
.cube-page .pxfield--hero {
  --inset: max(var(--gx), calc(50% - 900px + var(--gx)));
  left: var(--inset); right: auto; width: calc(100% - 2 * var(--inset));   /* canvas is a replaced element: size it explicitly */
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.7) 0%, rgba(0,0,0,.8) 30%, #000 55%);
  mask-image: linear-gradient(90deg, rgba(0,0,0,.7) 0%, rgba(0,0,0,.8) 30%, #000 55%);
}

/* ---------- Face index, pinned in the corner ---------- */
.cube-dots {
  position: fixed; right: 14px; top: 50%; z-index: 10; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px;
}
.cube-dots button {
  width: 8px; height: 8px; padding: 0; border: 1px solid rgba(255, 255, 255, .55); cursor: pointer;
  background: transparent; transition: transform .25s ease, background-color .25s ease;
}
.cube-dots button[data-t="accent"] { border-color: #56F24E; }
.cube-dots button[data-t="light"] { border-color: #ECEEE8; }
.cube-dots button[data-t="deep"] { border-color: #2E8A3C; }
.cube-dots button[aria-current="true"] { transform: scale(1.35); background: currentColor; }
.cube-dots button[data-t="dark"] { color: #878D84; }
.cube-dots button[data-t="accent"] { color: #56F24E; }
.cube-dots button[data-t="light"] { color: #ECEEE8; }
.cube-dots button[data-t="deep"] { color: #2E8A3C; }
@media (max-width: 582px) { .cube-dots { right: 6px; gap: 6px; } .cube-dots button { width: 6px; height: 6px; } }

@media (prefers-reduced-motion: reduce) {
  .face, .face__in { transform: none !important; will-change: auto; }
  .face__in::after { display: none; }
}

/* ---------- Header: solid, always the colour of the side on screen ----------
   cube.js sets data-t (text palette) and --hbg (background, blended through each turn). */
.cube-page .header {
  background: var(--hbg, #0A0B0A);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  color: var(--text);
}
.cube-page .header .logo { color: var(--text); }
.cube-page .header .logo__sup { color: var(--accent); }
.cube-page .header .nav a:not(.btn) { color: var(--muted); }
.cube-page .header .nav a:not(.btn):hover { color: var(--text); }
.cube-page .header .menu-btn i { background: var(--text); }
@media (max-width: 950px) { .cube-page .header .nav { background: var(--hbg, var(--bg)); } }
@media (max-width: 582px) {
  .cube-page .pxfield--hero { -webkit-mask-image: linear-gradient(transparent 25%, #000 70%); mask-image: linear-gradient(transparent 25%, #000 70%); }
}
