/* ==========================================================================
   Home page. White, airy, big tight type, rounded frames, scroll reveals.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --ink: #131316;
  --muted: #5f6068;
  --line: #e7e7ec;
  --surface: #f4f4f7;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --pad: clamp(20px, 6vw, 96px);
  --radius: 32px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid #4a67e8; outline-offset: 3px; border-radius: 8px; }

h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.04em; line-height: 1.05; }
p { margin: 0; }

/* Pill buttons */
.pill { display: inline-flex; align-items: center; justify-content: center; height: 60px; padding: 0 36px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; text-decoration: none; transition: transform 0.2s ease, background 0.2s ease; }
.pill:hover { background: #2b2b31; transform: translateY(-1px); }
.pill.small { height: 46px; padding: 0 22px; font-size: 16px; }
/* The header button is outlined: black outline, no fill, fills in on hover. */
.nav .pill.small { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.nav .pill.small:hover { background: var(--ink); color: #fff; }

/* Top bar */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px var(--pad); transition: background 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.nav.hidden { transform: translateY(-110%); }     /* slides away while scrolling down, back when scrolling up */
.nav.scrolled { background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
/* Same name style as the full screen experiment page */
.brand { display: inline-flex; align-items: center; font-size: 1.125rem; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.links { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 40px; }   /* centered in the header bar */
.links a { color: var(--muted); text-decoration: none; font-size: 17px; letter-spacing: -0.01em; }
.links a:hover { color: var(--ink); }

/* 1. Intro */
.hero { position: relative; display: grid; place-items: center; min-height: 100svh; min-height: max(100svh, 620px); padding: 96px var(--pad); overflow: hidden; touch-action: pan-y; }
.hero-canvas { position: absolute; inset: 0; pointer-events: none; }
.hero-canvas canvas { display: block; width: 100%; height: 100%; }
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 1000px; pointer-events: none; }
.hero-copy a { pointer-events: auto; }
.lockup { display: inline-flex; align-items: center; font-size: clamp(17px, 1.7vw, 22px); font-weight: 500; letter-spacing: -0.03em; color: #5a5a63; margin-bottom: 24px; }
.hero h1 { font-size: clamp(30px, 4vw, 56px); letter-spacing: -0.04em; line-height: 1; text-wrap: balance; max-width: 13em; }
.hero h1 + .pill { margin-top: 32px; }
.hero .pill { height: 48px; padding: 0 26px; font-size: 16px; }

/* Section headings */
.section-head { max-width: 1280px; margin: 0 auto 48px; padding: 0 var(--pad); }
.eyebrow { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-bottom: 12px; }
.section-head h2 { font-size: clamp(36px, 5vw, 68px); }

/* Skills wave */
.skills { padding: 0 var(--pad); margin-top: clamp(48px, 9svh, 100px); }
.wave { list-style: none; margin: 0 auto; padding: 0; max-width: 1000px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.wave li { padding: 13px 24px; border: 1px solid rgba(0, 0, 0, 0.06); border-radius: 999px; background: #f6f6f8; font-size: 17px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
.skills.live { padding: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.skills.live .wave { position: relative; display: block; max-width: none; height: 116px; }
.skills.live .wave li { position: absolute; left: 0; top: 50%; will-change: transform; }

/* 2. Experiment frame */
.section-title { text-align: center; font-size: clamp(28px, 3vw, 40px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; color: var(--ink, #111); }
.work .section-title { margin-bottom: clamp(28px, 5svh, 55px); }
.experiment { padding: clamp(72px, 12svh, 144px) 0 clamp(96px, 16svh, 180px); }
.experiment .section-title { margin-bottom: clamp(28px, 5svh, 55px); }
.frame { position: relative; width: min(1400px, 100% - 32px); margin: 0 auto; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.frame-btn { position: absolute; bottom: 20px; width: 43px; height: 43px; display: grid; place-items: center; padding: 0; border-radius: 50%; color: rgba(255, 255, 255, 0.88); text-decoration: none; cursor: pointer;
  background: rgba(34, 34, 38, 0.42); border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease; }
.frame-btn svg { width: 16px; height: 16px; stroke-width: 1.75; }
.frame-btn:hover { background: rgba(60, 60, 66, 0.55); border-color: rgba(255, 255, 255, 0.38); transform: scale(1.06); }
.expand { right: 20px; }
.reset { right: 73px; }      /* 20px edge + 43px button + 10px gap */

/* The frame starts small and grows to full width as it scrolls into view (set from js/home.js). */
.js .frame { transform-origin: 50% 0; transform: scale(var(--grow, 0.54)); will-change: transform; }
.js .frame-hint { opacity: 0; }

/* The instructions sit under the frame, not inside it */
.frame-hint { width: min(1400px, 100% - 32px); margin: 18px auto 0; text-align: center; font-size: 15px; color: #a3a3ab; letter-spacing: -0.01em; }

/* 2. Case studies: floating cards.
   Each card is sticky, so the next one scrolls over it. js/home.js grows each card as it rises
   from the bottom and nudges the one underneath back a little. Without JS (or with reduced motion)
   they are simply a list of cards. */
.work { padding: clamp(72px, 12svh, 144px) 0 0; }
.stack { --H: min(78svh, 790px); --peek: 22px; --gap: clamp(56px, 10svh, 110px); width: min(1400px, 100% - 32px); margin: 0 auto; display: flow-root; }
.cs-card { position: relative; display: grid; grid-template-columns: minmax(0, 4.6fr) minmax(0, 7.4fr); align-items: center; gap: clamp(32px, 5vw, 80px);
  height: var(--H); margin-bottom: calc(var(--gap) - var(--peek) * var(--i, 0)); padding: clamp(24px, 3.4vw, 52px); border-radius: var(--radius); overflow: hidden; color: #fff; }
.js .cs-card { position: sticky; top: calc((100svh - var(--H)) / 2 - var(--peek) * (var(--n) - 1) / 2 + var(--peek) * var(--i));
  transform-origin: 50% 0; transform: scale(var(--s, 0.6)); will-change: transform; box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.18); }
.cs-card.navy { background: #3d3e53 url("/css/textures/speckle-dark.svg") 0 0 / 300px 300px; }
.cs-card.green { background: #316a44 url("/css/textures/speckle-light.svg") 0 0 / 300px 300px; }
.cs-card.purple { background: #4650da url("/css/textures/speckle-dark.svg") 0 0 / 300px 300px; }
.cs-card::after { content: ""; position: absolute; inset: 0; background: #000; opacity: var(--dim, 0); pointer-events: none; }   /* darkens a card as others stack on it */
.cs-text h3 { font-weight: 600; font-size: clamp(28px, 3vw, 44px); line-height: 1.18; margin-bottom: 16px; color: #fff; }
.cs-text p { font-size: clamp(18px, 1.7vw, 24px); line-height: 1.5; color: #fff; max-width: 28em; letter-spacing: -0.015em; }
/* The whole card is the link */
.cs-text h3 a { color: inherit; text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: 0.16em; transition: text-decoration-color 0.25s ease; }
.cs-text h3 a:hover, .cs-text h3 a:focus-visible { text-decoration-color: currentColor; }
.js .cs-card { cursor: pointer; }
.cs-media { min-width: 0; display: grid; place-items: center; }
.cs-media img { width: 100%; max-height: calc(var(--H) - 2 * clamp(24px, 3.4vw, 52px)); object-fit: contain; border-radius: 8px; }
/* Sub copy is typed out as you scroll; the untyped part still takes up room so nothing jumps. */
.typed-copy .rest { color: transparent; }
.more.soon { display: inline-block; padding: 4px 12px; border: 3px solid transparent; border-radius: 6px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3;
  /* white fill with a gradient border, in shades of the card's bluish purple (#4650da) */
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(120deg, #3a43c8 0%, #4650da 50%, #6c75f3 100%) border-box; }
.more.soon b { font-weight: 600; background: linear-gradient(120deg, #3a43c8 0%, #4650da 50%, #6c75f3 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }   /* #4650da is the card's purple */
/* Kept for the Firefly Elements card, which comes back after MAX */
.card-glow { background: radial-gradient(120% 90% at 50% 100%, #fbe9a8 0%, rgba(255, 190, 200, 0.7) 28%, rgba(120, 150, 255, 0.55) 62%, #eef1ff 100%); }
.card-warm { background: radial-gradient(120% 90% at 50% 0%, #cfe0ff 0%, rgba(190, 170, 255, 0.55) 40%, rgba(255, 190, 170, 0.6) 75%, #fff2e6 100%); }

/* Footer */
.footer { padding: 56px var(--pad) 64px; background: var(--surface); text-align: center; }
.footer-title { margin: 0 0 6px; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); }
.footer-line { margin: 0 0 18px; font-size: 15px; color: var(--muted); letter-spacing: -0.01em; }
.footer-icons { display: flex; justify-content: center; gap: 12px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #d3d3db; color: var(--ink); text-decoration: none; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.icon-btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Scroll reveal: text and cards fade up as they enter the screen */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .links { display: none; }
  .nav { justify-content: space-between; }
  .cs-card { grid-template-columns: 1fr; align-content: center; gap: 16px; }
  .cs-media img { max-height: 40svh; }
  .frame { aspect-ratio: 4 / 5; border-radius: 24px; }
  .frame-btn { width: 38px; height: 38px; bottom: 14px; }
  .frame-btn svg { width: 14px; height: 14px; }
  .expand { right: 14px; }
  .reset { right: 60px; }    /* 14px edge + 38px button + 8px gap */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .pill, .frame-btn { transition: none; }
}
