/* HolyX landing. Structure and motion timing carried over from HolyLine; colour, type and art are HolyX. */
/* Brand fonts: Geist + Geist Pixel (SIL OFL 1.1, see assets/fonts/OFL.txt), same files as the cover */
@font-face { font-family: "Geist"; src: url("/assets/fonts/Geist-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/assets/fonts/Geist-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Pixel Square"; src: url("/assets/fonts/GeistPixel-Square.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  /* Brand: cover tokens verbatim from holyx-cover-preview.html */
  --hx-bg: #08050c;          /* shared cover colour: boot cover, mosaic, nav cover */
  --hx-ink: #f6f0fa;
  --hx-muted: #b9a9c9;
  --hx-line: #2a2133;        /* decorative rules only */
  --hx-control-line: #5b4a6b; /* control borders, ~3:1 on bg */
  /* Cover colours verbatim from art/cover-source/scripts/10-cover-gif-FINAL.sh */
  --hx-magenta: #e12e82;     /* dither mid-tone only (hood shading) */
  --hx-accent: #ff46b4;      /* cover PINK (255,70,180): CTA, underline, kicker. 6.5:1 on bg */
  --hx-accent-hover: #ff6ec4; /* lighter hover pink: dark label 8.0:1 */
  --hx-gold: #ffc464;        /* cover GOLD rgb(255,196,100). 12:1 on bg */
  --hx-gold-deep: #c98a3a;   /* shaded ring gold for dither + ghost hover border */
  --hx-scrim: rgb(8 5 12 / .78);
  --hx-wake-pink: rgba(255, 70, 180, .7);
  --hx-wake-gold: rgba(255, 196, 100, .75);

  /* Motion: verbatim from HolyLine */
  --hx-ease-control: cubic-bezier(.23, 1, .32, 1);
  --hx-ease-push: cubic-bezier(.2, .65, .35, 1);
  --hx-dur-press: 140ms;
  --hx-dur-color: 180ms;
  --hx-dur-copy: 450ms;
  --hx-dur-scene: 16s;
  --hx-lift: -2px;
  --hx-press: .97;
  --hx-rise: 10px;
  --hx-focus-ring: 3px;
  --hx-focus-offset: 5px;

  --hx-font-pixel: "Geist Pixel Square", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --hx-font-sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hx-font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --hx-gutter: clamp(1rem, 4vw, 4.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--hx-bg);
  color: var(--hx-ink);
  font: 400 1rem/1.5 var(--hx-font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: var(--hx-focus-ring) solid var(--hx-gold); outline-offset: var(--hx-focus-offset); }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 50; padding: .6rem 1rem; background: var(--hx-ink); color: var(--hx-bg); font-weight: 600; }
.skip-link:focus { top: 1rem; }

/* Page frame: one viewport */
.hx-page { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; position: relative; overflow: hidden; isolation: isolate; }
.hx-header, .hx-footer { position: relative; z-index: 3; padding-inline: var(--hx-gutter); }
.hx-header { display: flex; align-items: center; justify-content: space-between; padding-block: 1.25rem; }
.hx-mark { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font: 500 clamp(.8rem, .75vw, .95rem)/1 var(--hx-font-mono); letter-spacing: .18em; color: var(--hx-gold); }
.hx-mark img { width: 28px; height: 28px; border-radius: 6px; }
.hx-state { font: 500 clamp(.75rem, .7vw, .85rem)/1 var(--hx-font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--hx-muted); }

.hx-main { position: relative; z-index: 2; display: grid; align-items: center; padding-inline: var(--hx-gutter); }
.hx-copy { max-width: clamp(34rem, 36vw, 46rem); padding-block: 2rem; }

.hx-wordmark { margin: 0 0 1.75rem; font: 400 clamp(1.6rem, 2.4vw, 2.1rem)/1 var(--hx-font-pixel); letter-spacing: .04em; color: var(--hx-gold); }
.hx-wordmark::after { content: ""; display: block; width: 2.6em; height: 3px; margin-top: .55rem; background: var(--hx-accent); }
.hx-copy h1 { margin: 0; font: 600 clamp(2.5rem, 4.6vw, 6rem)/1.02 var(--hx-font-sans); letter-spacing: -.03em; text-wrap: balance; }
.hx-sub { margin: 1.4rem 0 0; font-size: clamp(1.05rem, 1.5vw, 1.35rem); line-height: 1.45; color: var(--hx-muted); max-width: 30rem; }
.hx-note { margin: .5rem 0 0; font-size: clamp(.9rem, 1vw, 1.05rem); line-height: 1.45; color: var(--hx-muted); max-width: 30rem; }
.hx-kicker { margin: 1.85rem 0 0; font: 400 clamp(.95rem, .95vw, 1.15rem)/1 var(--hx-font-pixel); letter-spacing: .06em; text-transform: uppercase; color: var(--hx-accent); }
.hx-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.1rem; }

.button {
  display: inline-flex; align-items: center; gap: .6rem; min-height: 3rem; padding: .8rem 1.3rem;
  border: 1px solid transparent; border-radius: 2px; font: 600 1rem/1 var(--hx-font-sans); text-decoration: none; cursor: pointer;
  transition: background-color var(--hx-dur-color) var(--hx-ease-control), border-color var(--hx-dur-color) var(--hx-ease-control), color var(--hx-dur-color) var(--hx-ease-control), transform var(--hx-dur-press) var(--hx-ease-control);
}
.button-accent { background: var(--hx-accent); color: var(--hx-bg); }
.button-ghost { background: rgb(8 5 12 / .55); border-color: var(--hx-control-line); color: var(--hx-ink); }
.button-arrow { transition: transform var(--hx-dur-press) var(--hx-ease-control); }
@media (hover: hover) and (pointer: fine) {
  .button:hover { transform: translateY(var(--hx-lift)); }
  .button-accent:hover { background: var(--hx-accent-hover); }
  .button-ghost:hover { border-color: var(--hx-gold-deep); }
  .button:hover .button-arrow { transform: translate(3px, -3px); }
}
.button:active { transform: scale(var(--hx-press)); }
.button[disabled] { opacity: .6; cursor: progress; }

/* Hero art: dithered canvas over the source image */
.hx-art { position: absolute; inset: 0; z-index: 1; margin: 0; overflow: hidden; }
.hx-art img, .hx-art canvas { position: absolute; top: 0; right: 0; height: 100%; width: min(100%, 62vw); object-fit: cover; object-position: center; }
.hx-art img { opacity: 0; }
.no-js .hx-art img, .hx-art:not(:has(.hero-pixels[data-ready])) img { opacity: .9; }
.hero-pixels { image-rendering: pixelated; opacity: 0; transform-origin: 60% 45%; }
.hero-pixels[data-ready] { opacity: 1; }
/* Ring glow pulse (cover: gold through a warm-bright mask, strength on a cosine, 24 x 90 ms).
   Only ring pixels live on this canvas; opacity is the only animated property. */
@keyframes ring-pulse { from { opacity: 0; } to { opacity: .6; } }
.hero-ring { image-rendering: pixelated; mix-blend-mode: screen; opacity: 0; transform-origin: 60% 45%; pointer-events: none; }
.scene-entered .hero-ring[data-ready] { animation: scene-arrive var(--hx-dur-scene) linear infinite alternate, ring-pulse 1.4s cubic-bezier(.37, 0, .63, 1) infinite alternate; animation-delay: var(--scene-phase, 0ms), 0ms; }
.hx-art[data-paused] .hero-pixels, .hx-art[data-paused] .hero-ring { animation-play-state: paused; }
.hero-wake { pointer-events: none; image-rendering: pixelated; mix-blend-mode: screen; width: 100% !important; left: 0; }
/* Scrim: left-to-right darkening keeps copy legible over the art edge */
.hx-art::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--hx-bg) 0%, var(--hx-bg) 34%, rgb(8 5 12 / .6) 46%, rgb(8 5 12 / 0) 62%),
              linear-gradient(0deg, var(--hx-bg) 0%, rgb(8 5 12 / 0) 18%); }

/* Slow drift (HolyLine's eased push, alternate, 32 s cycle) */
@keyframes scene-arrive { 0% { transform: scale(1.02); animation-timing-function: var(--hx-ease-push); } 12.5% { transform: scale(1.07); } 100% { transform: scale(1.1) translateX(-1%); } }
.scene-entered .hero-pixels { animation: scene-arrive var(--hx-dur-scene) linear infinite alternate; animation-delay: var(--scene-phase, 0ms); }

/* Staggered copy entrance, fired by the loader's onReveal */
/* h1 stays painted (transform-only rise) so it is the LCP at first paint. CSS fallback shows copy if JS stalls. */
@keyframes hx-in { to { opacity: 1; transform: none; } }
.js .hx-reveal { transform: translateY(var(--hx-rise)); animation: hx-in .6s ease 2.5s forwards; }
.js .hx-reveal:not(h1) { opacity: 0; }
body.scene-entered .hx-reveal { opacity: 1; transform: none; transition: opacity var(--hx-dur-copy) var(--hx-ease-control), transform var(--hx-dur-copy) var(--hx-ease-control); transition-delay: calc(var(--i, 0) * 70ms + 120ms); }

.hx-footer { padding-block: 1rem 1.25rem; font-size: clamp(.8rem, .7vw, .85rem); color: var(--hx-muted); }
.hx-footer p { margin: 0; display: flex; flex-wrap: wrap; gap: .35rem .9rem; }
.hx-footer a { text-underline-offset: 3px; }
.hx-footer a:hover { color: var(--hx-ink); }

/* Signup */
.hx-form { margin-top: 1.6rem; display: grid; gap: 1rem; max-width: 26rem; }
.input-group label { display: block; margin-bottom: .4rem; font: 500 .75rem/1 var(--hx-font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--hx-muted); }
.input-group input { width: 100%; min-height: 3rem; padding: .7rem .9rem; border: 1px solid var(--hx-control-line); border-radius: 2px; background: rgb(8 5 12 / .8); color: var(--hx-ink); font: 1rem var(--hx-font-sans); transition: border-color var(--hx-dur-color) var(--hx-ease-control); }
.input-group input::placeholder { color: #8f7fa0; }
.input-group input:focus-visible { outline-offset: 2px; border-color: var(--hx-gold); }
.input-group input[aria-invalid=true] { border-color: var(--hx-accent); }
.field-error { margin: .4rem 0 0; color: #ff8cc4; font-size: .9rem; }
.consent-field { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; color: var(--hx-muted); cursor: pointer; }
.consent-field input { width: 1.15rem; height: 1.15rem; margin-top: .15rem; accent-color: var(--hx-accent); }
.honey-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#signup-status { min-height: 1.5em; margin: 0; }
#signup-status[data-state=success] { color: var(--hx-gold); }
#signup-status[data-state=error] { color: #ff8cc4; }
.back-link { display: inline-block; margin-bottom: 1.5rem; color: var(--hx-muted); text-decoration: none; font-size: .9rem; }
.back-link:hover { color: var(--hx-ink); }
.signup-notice { color: var(--hx-muted); }

/* Doc pages */
.hx-doc { max-width: 44rem; margin: 0 auto; padding: 2rem var(--hx-gutter) 4rem; position: relative; z-index: 2; }
.hx-doc h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; margin: .5rem 0 1.5rem; }
.hx-doc h2 { font-size: 1.15rem; margin: 2rem 0 .5rem; }
.hx-doc p, .hx-doc li { color: var(--hx-muted); }
.hx-doc a { color: var(--hx-ink); text-underline-offset: 3px; }
.doc-page .hx-page { overflow: visible; }

/* Mobile: art sits on top, copy below on a scrim */
@media (max-width: 47.99rem) {
  .hx-header { background: rgb(8 5 12 / .8); padding-block: .9rem; }
  .hx-main { align-items: end; padding-top: 40svh; }
  .hx-copy { padding-block: .75rem 1rem; }
  .hx-art img, .hx-art canvas { width: 100%; height: 52svh; top: 56px; object-position: 50% 12%; }
  .hero-wake { height: 100% !important; top: 0; }
  .hx-art::after { background: linear-gradient(0deg, var(--hx-bg) 0%, var(--hx-bg) 50%, rgb(8 5 12 / .8) 58%, rgb(8 5 12 / 0) 75%); }
  .hx-wordmark { margin-bottom: .9rem; }
  .hx-sub { margin-top: .875rem; }
  .hx-kicker { margin-top: 1.1rem; }
  .hx-actions { margin-top: .875rem; }
  .hx-actions .button { min-height: 2.75rem; }
  .hx-actions .button { flex: 1 1 100%; justify-content: center; }
  .signup-page .hx-main { padding-top: 26vh; }
}
@media (min-width: 100rem) { .hx-art img, .hx-art canvas { right: 4vw; width: 58vw; } }

/* Reduced motion: honest stills. Art shows, copy shows, nothing drifts. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .hx-reveal, .js .hx-reveal:not(h1) { opacity: 1; transform: none; }
  .button:hover, .button:active { transform: none; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
