/* Home hero (2026-11-29): one prompt box on a neon glyph field, and under it the Studio window, whose preview plays a
   real Gaffo Studio project with Studio's own engine (home-hero.js). Smooth and rounded on purpose: the pixel suite
   look stays in the sections below. Everything here is scoped to .hx. */

.hx {
  --hx-ground: var(--bg); /* the page ground, so the hero ends without a seam */
  --hx-surface: #0c110f;
  --hx-line: rgb(255 255 255 / .09);
  --hx-text-2: #b4c6bd;     /* 10.9:1 on the ground */
  --hx-text-3: #8ea39a;     /* 6.9:1 on the ground, 6.3:1 on the surface */
  --hx-ease: cubic-bezier(0.16, 1, 0.3, 1);
  position: relative; isolation: isolate;
  margin-top: calc(var(--nav-h) * -1);
  padding: calc(var(--nav-h) + clamp(28px, 2.8vw, 44px)) 0 clamp(64px, 8vw, 112px);
  overflow: clip;
  background: var(--hx-ground);
}
.hx ::selection { background: var(--green-hi); color: var(--green-ink); }
.hx :focus-visible { outline: 2px solid var(--green-hi); outline-offset: 3px; }

/* ---------------------------------------------------------------- the glyph field (WebGL; this gradient is the fallback) */
.hx-field {
  position: absolute; inset: 0 0 auto; z-index: -1; height: min(100%, 1280px); pointer-events: none;
  background:
    radial-gradient(40% 36% at 12% 46%, rgb(0 255 133 / .16), transparent 72%),
    radial-gradient(42% 38% at 88% 58%, rgb(0 255 133 / .14), transparent 72%),
    radial-gradient(60% 40% at 50% 72%, rgb(0 255 133 / .1), transparent 70%),
    var(--hx-ground);
  -webkit-mask-image: linear-gradient(#000 62%, transparent);
  mask-image: linear-gradient(#000 62%, transparent);
}
.hx-glyphs { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1200ms ease; }
.hx-glyphs.on { opacity: 1; }

/* ---------------------------------------------------------------- words */
.hx-top { display: grid; justify-items: center; text-align: center; }
.hx-title { font-family: var(--f-display); font-weight: 600; font-size: clamp(2.75rem, 1rem + 6.4vw, 6rem); line-height: 0.98; letter-spacing: -0.04em; text-wrap: balance; }
.hx-title span { display: block; }
.hx-l1 { color: #fff; }
.hx-l2 { color: #93b5a5; font-size: .62em; letter-spacing: -0.03em; margin-top: .1em; }
.hx-lead { margin-top: clamp(16px, 1.6vw, 20px); max-width: 60ch; color: var(--hx-text-2); font-size: clamp(1.0625rem, .98rem + .35vw, 1.25rem); line-height: 1.5; text-wrap: pretty; }

/* ---------------------------------------------------------------- the prompt box */
.hx-box {
  position: relative; width: min(100%, 780px); margin-top: clamp(26px, 2.6vw, 36px); text-align: left;
  background: var(--hx-surface); border: 1px solid rgb(255 255 255 / .11); border-radius: 22px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .06), 0 28px 64px -24px rgb(0 0 0 / .8), 0 10px 22px -12px rgb(0 0 0 / .55);
  transition: border-color 220ms ease, box-shadow 220ms ease;
}
.hx-box:focus-within { border-color: rgb(92 242 177 / .55); }
.hx .hx-box textarea:focus-visible { outline: none; } /* the box's green border is the focus sign; a square ring inside the round box looked broken */
.hx-box textarea {
  display: block; width: 100%; min-height: 84px; resize: none; border: 0; outline: none; background: transparent;
  padding: 20px 22px 6px; color: var(--ink); caret-color: var(--green);
  font: 450 clamp(1.0625rem, 1rem + .3vw, 1.1875rem)/1.5 var(--f-text);
}
.hx-box textarea::placeholder { color: #7f928a; }
.hx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px 12px; }
.hx-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgb(255 255 255 / .045); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); }
.hx-seg button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--hx-text-3); font: 500 .875rem/1 var(--f-text); font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.hx-seg button[aria-pressed="true"] { background: rgb(255 255 255 / .11); color: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .35); }
@media (hover: hover) and (pointer: fine) { .hx-seg button:hover { color: #fff; } }
.hx-ar { width: var(--w); height: var(--h); border: 1.5px solid currentColor; border-radius: 2px; }
/* attaching: the paperclip, the files picked (chips under the text), and a bar while big files are kept for Studio */
.hx-att {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 999px; flex: none;
  background: rgb(255 255 255 / .045); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); color: var(--hx-text-3); cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.hx-att svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .hx-att:hover { color: #fff; background: rgb(255 255 255 / .09); } }
.hx-att:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.hx-att:disabled { opacity: .5; cursor: default; }
.hx-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 0 18px; }
.hx-files[hidden] { display: none; }
.hx-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 30px; padding: 0 6px 0 12px; border-radius: 999px;
  background: rgb(255 255 255 / .06); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .09); color: var(--ink); font: 500 .8125rem/1 var(--f-text);
}
.hx-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.hx-chip small { color: var(--hx-text-3); font-size: .75rem; font-variant-numeric: tabular-nums; }
.hx-chip button { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 999px; background: transparent; color: var(--hx-text-3); font-size: 1rem; line-height: 1; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .hx-chip button:hover { color: #fff; background: rgb(255 255 255 / .1); } }
.hx-note { width: 100%; color: #ffb4a8; font-size: .8125rem; line-height: 1.4; }
.hx-bar { position: relative; width: 56px; height: 4px; border-radius: 2px; background: rgb(255 255 255 / .1); overflow: hidden; flex: none; }
.hx-bar[hidden] { display: none; }
.hx-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 35%; border-radius: 2px; background: var(--green); animation: hx-bar 1.1s ease-in-out infinite alternate; }
@keyframes hx-bar { from { left: 0; } to { left: 65%; } }
@media (prefers-reduced-motion: reduce) { .hx-bar i { animation: none; width: 100%; opacity: .6; } }
.hx-go {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; margin-left: auto; padding: 0 18px 0 20px;
  border: 0; border-radius: 999px; background: var(--green); color: var(--green-ink); font: 600 .9375rem/1 var(--f-text); cursor: pointer;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), 0 6px 16px -6px rgb(0 0 0 / .6);
  transition: background-color 160ms ease, transform 140ms var(--hx-ease);
}
.hx-go svg { width: 17px; height: 17px; transition: transform 220ms var(--hx-ease); }
@media (hover: hover) and (pointer: fine) { .hx-go:hover { background: #5cffaf; } .hx-go:hover svg { transform: translateX(2px); } }
.hx-go:active { transform: scale(.97); }

.hx-ideas { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 16px; }
.hx-ideas > span { color: var(--hx-text-3); font-size: .875rem; margin-right: 2px; }
.hx-ideas .idea {
  padding: 8px 14px; border: 0; border-radius: 999px; background: rgb(255 255 255 / .035); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1);
  color: #d3e0d9; font: 500 .875rem/1.1 var(--f-text); cursor: pointer; transition: background-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}
@media (hover: hover) and (pointer: fine) { .hx-ideas .idea:hover { background: rgb(255 255 255 / .07); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .2); color: #fff; } }

/* ---------------------------------------------------------------- the Studio window
   The real Studio screenshot (app-live.webp: app.png with its moving parts erased and its project made the Gaffo
   launch, by scripts/make-panel-assets.cjs). Over it, in the screenshot's own pixels (1 px = --u), sit the live
   parts: the preview plays the Gaffo launch with Studio's engine, and the play
   button, timecodes, frame counts, scrubber and playhead follow it. */
.hx-stage { margin: clamp(28px, 2.4vw, 36px) auto 0; perspective: 2400px; perspective-origin: 50% 0; }
.hx-app {
  position: relative; container-type: inline-size; overflow: hidden; border-radius: 14px;
  background: #0b0c0e; border: 1px solid rgb(255 255 255 / .12);
  box-shadow: 0 60px 120px -40px rgb(0 0 0 / .9), 0 24px 48px -24px rgb(0 0 0 / .65);
  transform-origin: 50% 0; transform: rotateX(var(--tilt, 0deg)); /* home.js stands it up as you scroll */
}
.hx-app > * { --u: calc(100cqw / 1440); }
.hx-app-img { display: block; width: 100%; height: auto; }

.hx-screen { position: absolute; left: calc(264 * var(--u)); top: calc(105 * var(--u)); width: calc(775 * var(--u)); height: calc(436 * var(--u)); overflow: hidden; background: #04070b; }
.hx-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 500ms ease; }
.hx-player { position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity 500ms ease; }
.hx-app.live .hx-player { opacity: 1; }
.hx-app.live .hx-poster { opacity: 0; }
/* the whole screen plays and pauses (one big target); the small controls under it are shortcuts for the mouse */
.hx-screen-btn { position: absolute; inset: 0; padding: 0; border: 0; background: transparent; cursor: pointer; }
.hx .hx-screen-btn:focus-visible { outline-offset: -3px; }

.hx-play {
  position: absolute; left: calc(263.5 * var(--u)); top: calc(601.5 * var(--u)); width: calc(34 * var(--u)); height: calc(34 * var(--u));
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #edf1ee; color: #111216; cursor: pointer;
}
.hx-play svg { width: 34%; height: 34%; }
.hx-play .i-play { margin-left: 8%; }
.hx-play .i-play, .hx-app.paused .hx-play .i-pause { display: none; }
.hx-app.paused .hx-play .i-play { display: block; }
@media (hover: hover) and (pointer: fine) { .hx-play:hover { background: #fff; } }

.hx-mono { position: absolute; transform: translateY(-50%); font-family: var(--f-mono); line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; color: #848d98; pointer-events: none; }
.hx-mono b { color: #edf1ee; font-weight: 600; }
.hx-tc { left: calc(349.5 * var(--u)); top: calc(618.5 * var(--u)); font-size: calc(12.5 * var(--u)); }
.hx-fc { left: calc(956.5 * var(--u)); top: calc(618.5 * var(--u)); font-size: calc(12.5 * var(--u)); }
.hx-tc2 { left: calc(263 * var(--u)); top: calc(692.5 * var(--u)); font-size: calc(16 * var(--u)); font-weight: 500; color: #9dffcc; }
.hx-fc2 { left: calc(263.5 * var(--u)); top: calc(710.5 * var(--u)); font-size: calc(11 * var(--u)); font-weight: 500; }

.hx-scrub { position: absolute; left: calc(503 * var(--u)); top: calc(617 * var(--u)); width: calc(444 * var(--u)); height: calc(4 * var(--u)); border-radius: calc(2 * var(--u)); background: #343943; cursor: pointer; }
.hx-scrub::before { content: ""; position: absolute; inset: calc(-10 * var(--u)) 0; } /* a bigger target to click */
.hx-scrub i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: #00ff85; }
.hx-scrub b { position: absolute; top: 50%; width: calc(14 * var(--u)); height: calc(14 * var(--u)); border: calc(2 * var(--u)) solid #00ff85; border-radius: 50%; background: #111316; transform: translate(-50%, -50%); }

.hx-scene { position: absolute; top: calc(731 * var(--u)); left: calc(var(--x) * var(--u)); width: calc(var(--w) * var(--u)); height: calc(20 * var(--u)); padding: 0; border: 0; border-radius: calc(4 * var(--u)); background: transparent; cursor: pointer; transition: box-shadow 240ms ease; }
.hx-scene.on { box-shadow: inset 0 0 0 calc(1.5 * var(--u)) rgb(0 255 133 / .75); }
@media (hover: hover) and (pointer: fine) { .hx-scene:hover { background: rgb(255 255 255 / .06); } }

/* the playhead: across the overview bar (686-699), a gap, then down the timeline from its head (705) */
.hx-ph {
  position: absolute; left: calc(944 * var(--u)); top: calc(686 * var(--u)); bottom: 0; width: calc(2 * var(--u)); pointer-events: none;
  background: linear-gradient(#00ff85 0 calc(14 * var(--u)), transparent 0 calc(19 * var(--u)), #00ff85 0);
}
.hx-ph::before {
  content: ""; position: absolute; left: 50%; top: calc(19 * var(--u)); width: calc(14 * var(--u)); height: calc(14 * var(--u));
  background: #00ff85; transform: translateX(-50%); clip-path: polygon(15% 0, 85% 0, 100% 12%, 100% 58%, 50% 100%, 0 58%, 0 12%);
}

/* ---------------------------------------------------------------- one entrance, then everything stays still */
@keyframes hx-in { from { opacity: 0; transform: translateY(18px); filter: blur(8px); } }
.js .hx-title span, .js .hx-lead, .js .hx-box, .js .hx-ideas { animation: hx-in 900ms var(--hx-ease) both; }
.js .hx-l2 { animation-delay: 90ms; }
.js .hx-lead { animation-delay: 180ms; }
.js .hx-box { animation-delay: 260ms; }
.js .hx-ideas { animation-delay: 340ms; }

/* ---------------------------------------------------------------- smaller screens */
@media (max-width: 760px) {
  .hx-box textarea { min-height: 88px; padding: 16px 16px 4px; }
  .hx-row { padding: 8px 10px 10px; }
  .hx-go { width: 100%; justify-content: center; margin-left: 0; }
  .hx-stage { margin-top: 48px; }
  .hx-app { border-radius: 10px; transform: none; }
}
@media (max-width: 420px) {
  .hx-seg button { padding: 0 10px; }
  .hx-ar { display: none; }
  .hx-ideas .idea:nth-of-type(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .js .hx-title span, .js .hx-lead, .js .hx-box, .js .hx-ideas { animation: none; }
  .hx-app { transform: none; }
  .hx-glyphs, .hx-poster, .hx-player { transition: none; }
}
