/* Hero, after Plank and Keyrate: one scene in Davey's own objects. An artboard lies tilted on the desk under the
   title. Someone types what a screen is for into its Describe bar, then the screen draws itself part by part, real
   frames from the engine (hero-demo.js), and the last strip says it was copied as text. Loose parts and typed lines
   ([ OK ], [x], "Email", # Title) drift around it at three depths. hero.js moves every layer at its own scroll speed
   and leans the scene away from the pointer. */
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: calc(100svh - 56px); display: flex; flex-direction: column; align-items: center;
        padding: clamp(72px, 13vh, 144px) 0 calc(var(--unit) * 12); --unit: clamp(18px, 2.4vw, 30px); }
.hero-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; padding: 0 var(--sp-5); text-align: center; }
.hero .lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; }
.hero .cta { margin-top: 32px; justify-content: center; }
.hero .btn { height: 46px; padding: 0 22px; font-size: 16px; }

/* the ground: an artboard tilted onto the desk, feathered at the edges, a soft clearing behind the title */
.backdrop { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
            -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }
.backdrop::after { content: ""; position: absolute; inset: 0;
            background: radial-gradient(ellipse 46% 40% at 50% 30%, color-mix(in srgb, var(--bg) 94%, transparent),
                        color-mix(in srgb, var(--bg) 55%, transparent) 70%, color-mix(in srgb, var(--bg) 10%, transparent)); }
.ground { position: absolute; left: 0; right: 0; bottom: calc(var(--unit) * -1.5); display: flex; justify-content: center; will-change: transform;
          -webkit-mask-image: radial-gradient(ellipse 62% 80% at 50% 40%, #000 55%, transparent 100%);
          mask-image: radial-gradient(ellipse 62% 80% at 50% 40%, #000 55%, transparent 100%); }
.ed { width: min(1180px, 120vw); transform: perspective(1500px) rotateX(38deg); transform-origin: 50% 100%;
      background: var(--bg2); border: 1px solid var(--border); border-radius: calc(var(--unit) * .6);
      box-shadow: 0 calc(var(--unit) * .4) 0 var(--border), 0 40px 80px -30px rgba(0, 0, 0, .25); overflow: hidden; }
.ed-bar { display: flex; align-items: center; gap: calc(var(--unit) * .5); padding: calc(var(--unit) * .5) calc(var(--unit) * .9); border-bottom: 1px solid var(--border);
          font: 600 calc(var(--unit) * .5)/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text2); }
.ed-bar i { width: calc(var(--unit) * .42); height: calc(var(--unit) * .42); border-radius: 50%; background: var(--border); }
.ed-bar b { margin-left: calc(var(--unit) * .3); font-weight: 600; text-transform: none; letter-spacing: 0; }
.stages { margin-left: auto; display: flex; gap: calc(var(--unit) * .25); }
.stages span { padding: calc(var(--unit) * .16) calc(var(--unit) * .4); border-radius: 999px; border: 1px solid var(--border); transition: background-color .25s, color .25s, border-color .25s; }
.stages span.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.stages span.done { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
/* the Describe bar: what someone said, typed */
.ask { display: flex; align-items: center; gap: calc(var(--unit) * .4); margin: calc(var(--unit) * .5) calc(var(--unit) * .9) 0; padding: calc(var(--unit) * .3) calc(var(--unit) * .5);
       border: 1px solid var(--border); border-radius: calc(var(--unit) * .3); background: var(--bg); font: calc(var(--unit) * .56)/1.3 var(--font); color: var(--text); min-height: calc(var(--unit) * 1.3); }
.ask em { font-style: normal; font-weight: 600; color: var(--accent); }
.ask .said.caret::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: -.18em; background: var(--accent); animation: blink 1s steps(1) infinite; }
/* the canvas: a dot grid with the screen drawing on it */
.board { display: flex; justify-content: center; padding: calc(var(--unit) * .6) 0 calc(var(--unit) * .5);
         background-image: radial-gradient(circle, color-mix(in srgb, var(--text) 16%, transparent) 1px, transparent 1.4px); background-size: calc(var(--unit) * .5) calc(var(--unit) * .62); }
.screen { margin: 0; font: calc(var(--unit) * .5)/calc(var(--unit) * .62) var(--mono); color: var(--text); white-space: pre; min-height: calc(var(--unit) * .62 * 18); }
.screen div { transition: background-color .3s, color .3s; }
.screen div.hot { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.term { margin: 0; padding: calc(var(--unit) * .4) calc(var(--unit) * .9) calc(var(--unit) * .5); border-top: 1px solid var(--border);
        font: calc(var(--unit) * .52)/calc(var(--unit) * .8) var(--font); color: var(--text2); white-space: pre; min-height: calc(var(--unit) * 1.7); }
.term b { color: var(--accent); font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ed { box-shadow: 0 calc(var(--unit) * .4) 0 var(--border), 0 40px 80px -30px rgba(0, 0, 0, .7); } }

/* the sky: loose parts and typed lines at three depths, each a keycap */
.sky { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden;
       -webkit-mask-image: linear-gradient(#000 58%, transparent); mask-image: linear-gradient(#000 58%, transparent); }
.sky .layer { position: absolute; inset: 0; will-change: transform; }
.tok { position: absolute; display: grid; place-items: center; height: var(--s); min-width: var(--s); padding: 0 calc(var(--s) * .3);
       border-radius: calc(var(--s) * .22); background: var(--bg2); border: 1px solid var(--border); box-shadow: 0 calc(var(--s) * .06) 0 var(--border);
       font: 600 calc(var(--s) * .4)/1 var(--mono); color: var(--text2); white-space: nowrap; user-select: none;
       animation: drift ease-in-out infinite alternate; }
.tok.hot { color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.sky .far .tok { filter: blur(.8px); }
.sky .near .tok { filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .14)); }
@keyframes drift { from { transform: translateY(-10px) rotate(var(--r)); } to { transform: translateY(10px) rotate(calc(var(--r) + 6deg)); } }

/* the readout under the buttons: the step it is on, and what was said */
.readout { margin-top: 28px; display: flex; align-items: center; gap: 12px; max-width: min(92vw, 620px); font: 15px/1.4 var(--font);
           color: var(--text2); white-space: nowrap; }
.readout .cmd { flex: none; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
                background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.readout .said { overflow: hidden; text-overflow: ellipsis; min-height: 1.4em; }
.readout .said::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -.18em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 560px) {
  .hero { --unit: 4.6vw; padding-bottom: calc(var(--unit) * 14); }
  .ed { width: 150vw; transform: perspective(900px) rotateX(32deg); }
  .stages span:nth-child(n+3) { display: none; }
  .readout { font-size: 13px; }
  .sky .mid { display: none; } /* on a phone the middle layer crossed the title */
  .sky .far .tok { opacity: .25 !important; }
}
@media (prefers-reduced-motion: reduce) { .tok { animation: none; } .readout .said::after, .ask .said.caret::after { animation: none; } }
