:root{
    --bg:#F7F5F0; --card:#FCFBF8; --pill:#ECEAE3; --pill-hover:#E2DFD6;
    --ink:#1C1C1A; --ink-60:rgba(28,28,26,0.62); --ink-25:rgba(28,28,26,0.2); --ink-12:rgba(28,28,26,0.12);
    --word-dim:#C7C4BB;
    --max:1280px;
    --scene-h:clamp(340px, 56vh, 620px);
    --hint-space:34px;
    --shadow:0 10px 28px -14px rgba(0,0,0,0.35);
  }
  [data-theme="dark"]{
    --bg:#111110; --card:#1B1B19; --pill:#2A2A27; --pill-hover:#35352F;
    --ink:#F2F0EA; --ink-60:rgba(242,240,234,0.62); --ink-25:rgba(242,240,234,0.22); --ink-12:rgba(242,240,234,0.13);
    --word-dim:#4A4A45;
    --shadow:0 10px 28px -12px rgba(0,0,0,0.75);
  }
  *{box-sizing:border-box;}
  html{scroll-behavior:smooth;}
  body{
    margin:0; background:var(--bg); color:var(--ink);
    font-family:'Inter',sans-serif; line-height:1.5; letter-spacing:-0.01em;
    -webkit-font-smoothing:antialiased; transition:background .25s ease, color .25s ease;
  }
  h1,h2,h3{ font-weight:600; margin:0; letter-spacing:-0.025em; }
  a{color:inherit;}
  svg{display:block;}
  .wrap{max-width:var(--max); margin:0 auto; padding:0 34px; }
  :focus-visible{ outline:2.5px solid var(--ink); outline-offset:3px; }

  .progress{ position:fixed; top:0; left:0; height:2px; background:var(--ink); width:0; z-index:200; }

  /* ---- slimmer, squarer nav: wordmark left (aligned with hero), links centered ---- */
  header.site{ position:fixed; top:12px; left:0; right:0; z-index:100; }
  .bar{
    max-width:var(--max); margin:0 auto; padding:0 34px;
    position:relative; display:flex; align-items:center; min-height:44px;
  }
  .wordmark{ display:inline-flex; align-items:center; gap:9px; }
  .wordmark .logo{ width:21px; height:auto; fill:var(--ink); }
  .nav{
    position:absolute; left:50%; transform:translateX(-50%);
    display:flex; align-items:center; gap:3px;
    background:var(--card); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
    border:1px solid var(--ink-25); border-radius:9px; padding:3px;
    box-shadow:0 4px 18px -6px rgba(0,0,0,0.28), 0 1px 0 rgba(0,0,0,0.06);
  }
  .wordmark{ font-weight:700; font-size:20px; padding:9px 0; white-space:nowrap; letter-spacing:-0.025em; }
  .nav a, .nav button{
    font-family:inherit; font-size:12px; font-weight:500; text-decoration:none; cursor:pointer;
    padding:5px 11px; border-radius:6px; background:transparent; border:none; color:var(--ink);
    white-space:nowrap; transition:background .15s;
  }
  .nav a:hover, .nav button:hover{ background:var(--pill-hover); }
  .nav a.cta{ background:var(--ink); color:var(--bg); font-weight:600; }
  .nav .util{ padding:5px 9px; font-weight:600; font-size:11.5px; border-left:1px solid var(--ink-12); border-radius:0; }
  .nav .util:last-child{ border-radius:0 6px 6px 0; }

  /* ---- section rule + eyebrow ---- */
  .rule{
    display:flex; align-items:center; gap:14px;
    padding:0 0 22px; margin-bottom:6px;
  }
  .rule::after{ content:''; flex:1; height:1px; background:var(--ink-25); }
  .rule .eyebrow{
    font-size:11.5px; font-weight:600; letter-spacing:0.13em; text-transform:uppercase; color:var(--ink-60);
    white-space:nowrap;
  }
  .rule .num{
    font-size:11.5px; font-weight:600; color:var(--ink-60); font-variant-numeric:tabular-nums;
    padding-right:2px;
  }

  /* ============ STAGE ============ */
  .stage-section{ height:400vh; position:relative; }
  .stage{
    position:sticky; top:0; height:100vh; min-height:0;
    /* rows: statement · callout band · scene. The scene row is minmax(0,1fr) so it
       has a DEFINITE height — that's what lets the drawing size itself to the fold. */
    display:grid; grid-template-rows:auto auto minmax(0,1fr); overflow:hidden;
  }
  .statement{
    padding:72px 34px 0; max-width:var(--max); margin:0 auto; width:100%;
    min-height:0;
  }
  .tag-row{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
  .tag{
    background:var(--pill); border-radius:6px; padding:5px 11px; font-size:11.5px; font-weight:600;
    letter-spacing:0.01em; color:var(--ink-60);
  }
  .statement p{
    margin:0; font-size:clamp(1.4rem, 2.65vw, 2.5rem);
    line-height:1.28; font-weight:600; letter-spacing:-0.03em;
    max-width:none; /* stretch full width */
  }
  .statement .w{ color:var(--word-dim); transition:color .25s ease; }
  .statement .w.on{ color:var(--ink); }

  .scene-viewport{
    width:100%; overflow:hidden; position:relative;
    height:100%; min-height:0; padding-top:8px;
    /* keep the scene clear of the scroll hint chip pinned to the stage floor */
    padding-bottom:var(--hint-space);
    display:flex; align-items:flex-end;
  }
  /* the track is the scene's box: as tall as it wants, but never taller than
     the space the statement leaves behind — otherwise the drawing clips */
  .scene-track{
    position:relative; will-change:transform; width:max-content;
    height:100%; max-height:var(--scene-h); flex:0 0 auto;
  }
  .scene-track svg{ height:100%; width:auto; }
  .ln{ fill:none; stroke:var(--ink); stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round; }
  .lnt{ stroke-width:1.5; }
  .fl{ fill:var(--ink); stroke:none; opacity:0; }
  .txt{ font-family:'Inter',sans-serif; fill:var(--ink); stroke:none; opacity:0; }

  /* the callouts get their own band above the drawing — they never sit on top of it.
     All four slots hold their space from the start, so the scene never shifts. */
  .scene-callouts{
    display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px;
    max-width:var(--max); margin:0 auto; width:100%;
    padding:14px 34px 0; align-items:start;
  }
  .callout{
    opacity:0; transform:translateY(8px);
    transition:opacity .4s ease, transform .4s ease;
  }
  .callout.on{ opacity:1; transform:none; }
  .co-pill{
    display:inline-block; background:var(--pill); border-radius:6px; padding:5px 10px;
    font-size:11.5px; font-weight:600; margin-bottom:6px;
  }
  .co-card{
    background:var(--card); border:1px solid var(--ink-25); border-radius:8px;
    padding:10px 12px; font-size:11.5px; line-height:1.45; color:var(--ink-60);
    box-shadow:var(--shadow);
  }

  .hint{
    position:absolute; left:50%; transform:translateX(-50%); z-index:2;
    bottom:calc(4px + env(safe-area-inset-bottom, 0px));
    display:flex; align-items:center; gap:8px; font-size:12.5px; font-weight:500; color:var(--ink-60);
    background:var(--card); border:1px solid var(--ink-25); border-radius:6px;
    padding:6px 14px; transition:opacity .3s; pointer-events:none;
  }
  .hint .chev{ display:inline-block; animation:nudge 1.4s ease-in-out infinite; }
  @keyframes nudge{ 0%,100%{transform:translateX(0);} 50%{transform:translateX(4px);} }

  /* ============ AMBIENT LIFE ============ */
  /* ambient elements sleep at opacity 0 until their zone finishes drawing (.amb-on) */
  .amb{ opacity:0; transition:opacity .6s ease; }
  .amb-on .amb{ opacity:1; }

  /* typing-indicator dots in the client's speech bubble */
  .talk-dots circle{ fill:var(--ink); opacity:.18; }
  .amb-on .talk-dots circle{ animation:dotPulse 1.25s ease-in-out infinite; }
  @keyframes dotPulse{ 0%,60%,100%{opacity:.18} 30%{opacity:.8} }

  /* mouths open and close while people talk */
  .amb-mouth{ transform-box:fill-box; transform-origin:50% 50%; }
  .amb-on .amb-mouth{ animation:talk 1.4s ease-in-out infinite; }
  @keyframes talk{ 0%,100%{transform:scaleY(1)} 30%{transform:scaleY(.3)} 55%{transform:scaleY(.85)} 80%{transform:scaleY(.45)} }

  /* coffee steam */
  .steam path{ stroke:var(--ink); fill:none; stroke-width:1.5; stroke-linecap:round; opacity:0; }
  .amb-on .steam path{ animation:steamRise 2.8s ease-in-out infinite; }
  @keyframes steamRise{ 0%{opacity:0; transform:translateY(3px)} 35%{opacity:.55} 75%,100%{opacity:0; transform:translateY(-8px)} }

  /* the builder's screen: pulsing chart bars, a line typing itself, blinking caret */
  .bars rect{ fill:var(--ink); opacity:.5; transform-box:fill-box; transform-origin:50% 100%; }
  .amb-on .bars rect{ animation:barPulse 2.2s ease-in-out infinite; }
  @keyframes barPulse{ 0%,100%{transform:scaleY(.45)} 50%{transform:scaleY(1)} }
  .amb-type{ stroke:var(--ink); stroke-width:1.5; fill:none; stroke-linecap:round; stroke-dasharray:40; stroke-dashoffset:40; }
  .amb-on .amb-type{ animation:typeIn 3.6s linear infinite; }
  @keyframes typeIn{ 0%{stroke-dashoffset:40; opacity:1} 55%{stroke-dashoffset:0; opacity:1} 82%{stroke-dashoffset:0; opacity:1} 88%{opacity:0} 100%{stroke-dashoffset:40; opacity:0} }
  .amb-caret{ fill:var(--ink); }
  .amb-on .amb-caret{ animation:caretBlink 1.05s steps(1,end) infinite; }
  @keyframes caretBlink{ 0%,100%{opacity:.9} 50%{opacity:0} }

  /* idea-bulb glow + cat tail */
  .glow{ fill:var(--ink); }
  .amb-on .glow{ animation:glowPulse 2.6s ease-in-out infinite; }
  @keyframes glowPulse{ 0%,100%{opacity:.05} 50%{opacity:.16} }
  .amb-tail{ transform-box:view-box; transform-origin:2498px 342px; }
  .amb-on .amb-tail{ animation:wag 2s ease-in-out infinite; }
  @keyframes wag{ 0%,100%{transform:rotate(0deg)} 50%{transform:rotate(9deg)} }

  /* ============ PRODUCTS ============ */
  .products{ padding:76px 0 12px; }
  .sec-h{
    font-size:clamp(1.4rem, 2.4vw, 2.05rem); line-height:1.28; max-width:22ch; margin:0;
  }
  .sec-sub{ margin:14px 0 0; font-size:15px; color:var(--ink-60); max-width:62ch; line-height:1.6; }
  .prod-grid{ display:grid; grid-template-columns:1fr 1fr; gap:26px; margin-top:34px; }
  .prod-card{
    display:flex; flex-direction:column;
    background:var(--card); border:1px solid var(--ink-25); border-radius:12px;
    padding:24px 24px 22px; box-shadow:var(--shadow);
  }
  .prod-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
  .prod-num{
    font-size:11.5px; font-weight:600; color:var(--ink-60); font-variant-numeric:tabular-nums;
    letter-spacing:0.13em;
  }
  .prod-badge{
    background:var(--pill); border-radius:6px; padding:4px 10px;
    font-size:11px; font-weight:600; color:var(--ink-60); white-space:nowrap;
  }
  .prod-name{ font-size:22px; font-weight:700; letter-spacing:-0.025em; margin:0; }
  .prod-tag{ margin:7px 0 0; font-size:15px; font-weight:600; line-height:1.4; }
  .prod-b{ margin:11px 0 0; font-size:13.5px; line-height:1.6; color:var(--ink-60); }
  .prod-feats{ list-style:none; margin:16px 0 0; padding:0; display:grid; gap:8px; }
  .prod-feats li{
    position:relative; padding-left:17px; font-size:13px; line-height:1.5; color:var(--ink-60);
  }
  .prod-feats li::before{
    content:''; position:absolute; left:0; top:8px;
    width:6px; height:6px; border-radius:1px; background:var(--ink); opacity:.45;
  }
  .prod-fit{
    margin:16px 0 0; padding-top:14px; border-top:1px solid var(--ink-12);
    font-size:12.5px; line-height:1.5; color:var(--ink-60);
  }
  .prod-fit span:first-child{ font-weight:600; color:var(--ink); }
  .prod-link{
    margin-top:auto; padding-top:16px;
    display:inline-flex; align-items:center; gap:7px; align-self:flex-start;
    font-size:13.5px; font-weight:600; text-decoration:none;
    border-bottom:1px solid transparent; transition:border-color .15s, gap .15s;
  }
  .prod-link:hover{ border-bottom-color:var(--ink); gap:10px; }

  /* ============ PRODUCT DETAIL PAGES ============ */
  .page-hero{ padding:104px 0 8px; }
  .back{
    display:inline-flex; align-items:center; gap:7px; margin-bottom:22px;
    font-size:12.5px; font-weight:600; color:var(--ink-60); text-decoration:none;
  }
  .back:hover{ color:var(--ink); }
  .ph-name{ font-size:clamp(2rem, 4.4vw, 3.1rem); font-weight:700; letter-spacing:-0.035em; line-height:1.1; }
  .ph-tag{
    margin:14px 0 0; font-size:clamp(1.05rem, 1.9vw, 1.4rem); font-weight:600;
    line-height:1.35; letter-spacing:-0.02em; max-width:26ch;
  }
  .ph-b{ margin:16px 0 0; font-size:15.5px; line-height:1.65; color:var(--ink-60); max-width:60ch; }
  .page-hero .cta-row{ margin-top:28px; }

  .steps-sec{ padding:64px 0 12px; }
  .steps{ display:grid; grid-template-columns:repeat(4,1fr); gap:26px; }
  .step{ border-top:2px solid var(--ink); padding-top:14px; }
  .step-n{
    display:block; font-size:11.5px; font-weight:600; letter-spacing:0.13em;
    color:var(--ink-60); font-variant-numeric:tabular-nums; margin-bottom:8px;
  }
  .step h3{ font-size:15px; font-weight:600; margin:0 0 8px; letter-spacing:-0.015em; }
  .step p{ margin:0; font-size:13px; line-height:1.55; color:var(--ink-60); }

  .cmp-sec{ padding:64px 0 12px; }
  .cmp{ border:1px solid var(--ink-25); border-radius:12px; overflow:hidden; background:var(--card); }
  .cmp-head, .cmp-row{ display:grid; grid-template-columns:1fr 1fr; }
  .cmp-head{ background:var(--pill); }
  .cmp-label{
    padding:11px 20px; font-size:11.5px; font-weight:600; letter-spacing:0.08em;
    text-transform:uppercase; color:var(--ink-60);
  }
  .cmp-label.strong{ color:var(--ink); }
  .cmp-head span + span, .cmp-row span + span{ border-left:1px solid var(--ink-12); }
  .cmp-row{ border-top:1px solid var(--ink-12); }
  .cmp-row span{ padding:14px 20px; font-size:13.5px; line-height:1.5; color:var(--ink-60); }
  .cmp-row span + span{ color:var(--ink); font-weight:500; }
  .fit-note{ margin:18px 0 0; font-size:13px; color:var(--ink-60); }
  .fit-note span:first-child{ font-weight:600; color:var(--ink); }

  /* ============ PRINCIPLES ============ */
  .principles{ padding:76px 0 20px; }
  .p-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:40px 44px; }
  /* Content is visible by DEFAULT. The reveal only applies once JS confirms it can
     drive it (html.reveal) — otherwise a missed observer would hide the page's copy. */
  .p-item{ transition:opacity .5s ease, transform .5s ease; }
  html.reveal .p-item{ opacity:0; transform:translateY(10px); }
  html.reveal .p-item.on{ opacity:1; transform:none; }
  .p-item h3{
    display:inline-block; background:var(--pill); border-radius:6px;
    padding:7px 13px; font-size:14px; font-weight:600; margin-bottom:11px;
  }
  .p-item p{ margin:0; font-size:14px; color:var(--ink-60); max-width:42ch; }

  /* ============ CLOSING ============ */
  .closing{ padding:60px 0 96px; }
  .closing h2{ font-size:clamp(1.5rem, 2.8vw, 2.3rem); line-height:1.3; max-width:30ch; }
  .closing h2 .w{ color:var(--word-dim); transition:color .25s ease; }
  .closing h2 .w.on{ color:var(--ink); }
  .closing h2 .w.strong{ font-weight:700; }
  .closing .sub{ margin:18px 0 0; font-size:17.5px; font-weight:500; color:var(--ink-60); max-width:54ch; line-height:1.55; }
  .cta-row{ display:flex; align-items:center; gap:20px; flex-wrap:wrap; margin-top:26px; }
  .btn{
    display:inline-flex; align-items:center; gap:8px;
    background:var(--ink); color:var(--bg); text-decoration:none;
    font-weight:600; font-size:15px; padding:13px 26px; border-radius:8px;
    transition:transform .15s ease, opacity .15s;
  }
  .btn:hover{ transform:translateY(-1px); opacity:.88; }
  .cta-note{ font-size:13.5px; color:var(--ink-60); }

  footer{ border-top:1px solid var(--ink-25); padding:20px 0; }
  footer .wrap{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; }
  footer span{ font-size:12.5px; color:var(--ink-60); }

  @media (max-width: 1000px){
    .p-grid{ grid-template-columns:1fr 1fr; gap:36px 40px; }
    .steps{ grid-template-columns:1fr 1fr; gap:24px 30px; }
  }
  @media (max-width: 680px){
    .nav a:not(.cta){ display:none; }
    .bar{ padding:0 16px; }
    .nav{ position:static; transform:none; margin-left:auto; }
    .p-grid{ grid-template-columns:1fr; gap:30px; }
    .prod-grid{ grid-template-columns:1fr; gap:20px; margin-top:26px; }
    .prod-card{ padding:20px; }
    .steps{ grid-template-columns:1fr; gap:20px; }
    .cmp-head, .cmp-row{ grid-template-columns:1fr; }
    .cmp-head span + span, .cmp-row span + span{ border-left:none; border-top:1px solid var(--ink-12); }
    .cmp-row span{ padding:11px 16px; }
    .cmp-label{ padding:9px 16px; }
    .page-hero{ padding-top:92px; }
    .products{ padding-top:56px; }
    .stage-section{ height:340vh; }
    .statement{ padding-top:70px; }
    .tag-row{ gap:8px; margin-bottom:14px; }
    .tag{ padding:6px 11px; font-size:11.5px; }
    .scene-callouts{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:12px 34px 0; }
    .co-card{ font-size:11px; padding:8px 10px; }
    .scene-viewport{ padding-top:6px; }
    :root{ --hint-space:40px; }
  }
  /* short viewports: scale scene and hero down so nothing collides */
  @media (max-height: 860px){
    :root{ --scene-h:clamp(300px, 48vh, 460px); }
    .statement p{ font-size:clamp(1.45rem, 2.65vw, 2.4rem); }
  }
  @media (max-height: 700px){
    :root{ --scene-h:clamp(220px, 38vh, 330px); }
    .statement p{ font-size:clamp(1.2rem, 2.1vw, 1.8rem); }
    .statement{ padding-top:68px; }
    .co-card{ font-size:11px; padding:8px 10px; line-height:1.4; }
    .scene-callouts{ padding-top:10px; gap:12px; }
  }
  @media (max-height: 560px){
    :root{ --scene-h:195px; --hint-space:38px; }
    .statement{ padding-top:60px; }
    .statement p{ font-size:0.98rem; line-height:1.3; }
    .scene-viewport{ padding-top:4px; }
    .tag-row{ margin-bottom:12px; }
  }

  @media (prefers-reduced-motion: reduce){
    html{scroll-behavior:auto;}
    .stage-section{ height:auto; }
    .stage{ position:static; height:auto; padding-bottom:24px; }
    .statement .w{ color:var(--ink); }
    .scene-viewport{ overflow-x:auto; display:block; padding-bottom:0; }
    .scene-track{ height:auto; max-height:none; }
    .scene-track svg{ height:var(--scene-h); }
    .callout{ opacity:1; transform:none; }
    .fl,.txt{ opacity:1!important; }
    .ln{ stroke-dashoffset:0!important; }
    .hint,.progress{ display:none; }
    .p-item{ opacity:1; transform:none; }
    .amb{ opacity:1; }
    .amb, .amb *, .amb-mouth, .amb-tail{ animation:none!important; }
    .steam path{ opacity:.4; }
  }
