/* landing.css — the conversion layer over xcaicx.css.
 *
 * The base stylesheet is a datasheet: quiet, light, editorial. That is right
 * for the demo and for the proof, and it is wrong for the first fifteen
 * seconds, where an OEM engineering lead is deciding whether this is worth a
 * meeting. This file adds the persuasion: a dark instrument-panel hero, motion
 * that explains the mechanism rather than decorating it, and CTAs that keep
 * pace with the page.
 *
 * Two rules held throughout:
 *   - Every animation shows how the product works. Nothing moves for the sake
 *     of moving, because the audience reads decoration as compensation.
 *   - All of it collapses cleanly under prefers-reduced-motion. The page has to
 *     be legible with every animation switched off, so nothing is only
 *     communicated by movement.
 */

:root {
  /* A second accent for the industrial register — hi-vis amber against the
   * optical cyan. Used sparingly: the eye should still go to one thing. */
  --hv: #f0a021;
  --hv-ink: #2a1a02;
  --ink-dark: #e8eef5;
  --ink-dark-2: #9aa9b8;
  --ink-dark-3: #66768a;
  --panel: #0b1016;
  --panel-2: #101823;
  --grid-line: rgba(120, 200, 230, .07);
}

[data-theme="dark"] { --hv: #f2ae4a; }

/* ------------------------------------------------------------------ hero */

.lander {
  position: relative;
  background: var(--panel);
  color: var(--ink-dark);
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

/* A faint measurement grid. It reads as an instrument surface rather than a
 * marketing gradient, which is the register the buyer is in. */
.lander::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 78%);
  pointer-events: none;
}
.lander::after {
  content: "";
  position: absolute; inset: -20% -10% auto -10%; height: 70%;
  background: radial-gradient(60% 100% at 20% 0%, rgba(14, 165, 200, .20), transparent 70%),
              radial-gradient(50% 90% at 85% 10%, rgba(240, 160, 33, .10), transparent 72%);
  pointer-events: none;
}
.lander .wrap { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: var(--s8);
  align-items: center;
  padding: var(--s8) 0 var(--s7);
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s7); padding: var(--s8) 0 var(--s7); }
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--mono); font-size: var(--fs-xs);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-dark-2);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--r-full); padding: 5px 14px;
  margin-bottom: var(--s5);
}
.hero-eyebrow .pip {
  width: 6px; height: 6px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  animation: pip 2.4s ease-out infinite;
}
@keyframes pip {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.lander h1 {
  font-size: clamp(36px, 5.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -.04em;
  color: #fff;
  max-width: 15ch;
  margin-bottom: var(--s5);
}
.lander h1 em { color: var(--accent); font-style: normal; }
.lander h1 .hv { color: var(--hv); }

.hero-sub {
  font-size: 19px; line-height: 1.62; color: var(--ink-dark-2);
  max-width: 54ch; margin-bottom: var(--s6);
}
.hero-sub strong { color: var(--ink-dark); font-weight: 500; }

.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s5); }
.btn--xl { padding: 13px var(--s6); font-size: 15px; }
.btn--glow {
  background: var(--accent); border-color: var(--accent); color: #04222c;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, .45);
  animation: glow 3.6s ease-out infinite;
}
@keyframes glow {
  0%   { box-shadow: 0 0 0 0 rgba(56, 189, 248, .40); }
  60%  { box-shadow: 0 0 0 16px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}
.btn--onDark {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .18);
  color: var(--ink-dark);
}
.btn--onDark:hover { border-color: rgba(255, 255, 255, .4); color: #fff; }

.hero-note {
  font-size: var(--fs-sm); color: var(--ink-dark-3); max-width: 52ch;
}
.hero-note b { color: var(--ink-dark-2); font-weight: 500; }

/* -------------------------------------------------------- hero viewport */

/* A stylised camera view. Deliberately SVG/CSS rather than a second canvas
 * pipeline: the real one is a screen away, and burning a core above the fold
 * to preview it would be a strange way to advertise efficiency. */
.viewport {
  position: relative;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #0d1620, #070b10 60%);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.viewport-chrome {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  padding: var(--s3) var(--s4);
  display: flex; justify-content: space-between; align-items: flex-start;
  font-family: var(--mono); font-size: 11px; color: var(--ink-dark-3);
  letter-spacing: .05em;
}
.viewport-chrome .rec { display: inline-flex; align-items: center; gap: 6px; color: #f87171; }
.viewport-chrome .rec::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: blink 2s steps(1) infinite;
}
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .25; } }

.viewport svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Corner brackets, the universal "machine is looking" signal. */
.vp-bracket { stroke: rgba(255, 255, 255, .28); stroke-width: 2; fill: none; }

/* The scan sweep. */
.vp-scan {
  fill: url(#scanGrad);
  animation: scan 4.6s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes scan {
  0%   { transform: translateY(-12%); opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateY(112%); opacity: 0; }
}

/* Detection boxes fade in behind the sweep, hold, and release. */
.vp-box { fill: none; stroke-width: 2; opacity: 0; }
.vp-box rect { fill: rgba(255, 255, 255, .02); }
.vp-box--a { stroke: var(--m-detect); animation: boxIn 4.6s ease-out .55s infinite; }
.vp-box--b { stroke: var(--m-detect); animation: boxIn 4.6s ease-out 1.5s infinite; }
.vp-box--c { stroke: var(--m-ppe);    animation: boxIn 4.6s ease-out 2.1s infinite; }
.vp-box--d { stroke: var(--m-anpr);   animation: boxIn 4.6s ease-out 2.9s infinite; }
@keyframes boxIn {
  0%   { opacity: 0; }
  6%   { opacity: 1; }
  70%  { opacity: 1; }
  86%  { opacity: 0; }
  100% { opacity: 0; }
}
.vp-label {
  font-family: var(--mono); font-size: 9px; fill: currentColor;
  letter-spacing: .04em;
}

.vp-figure { fill: rgba(190, 205, 220, .13); }
.vp-figure--hv { fill: rgba(240, 160, 33, .30); }
.vp-floor { fill: rgba(255, 255, 255, .026); }

/* Live counter under the viewport. */
.vp-meter {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; gap: var(--s4); align-items: center;
  padding: var(--s3) var(--s4);
  background: linear-gradient(transparent, rgba(4, 8, 12, .85) 45%);
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-dark-2);
}
.vp-meter .k { color: var(--ink-dark-3); }
.vp-meter .v { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------- stat strip */

.strip {
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 760px) { .strip { grid-template-columns: repeat(2, 1fr); } }
.strip-cell {
  padding: var(--s5) var(--s4);
  border-right: 1px solid rgba(255, 255, 255, .08);
}
.strip-cell:last-child { border-right: 0; }
.strip .n {
  display: block;
  font-family: var(--mono); font-size: clamp(26px, 3.4vw, 38px); font-weight: 500;
  letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.strip .n.hv { color: var(--hv); }
.strip .l { font-size: var(--fs-sm); color: var(--ink-dark-3); }

/* ------------------------------------------------------------- sections */

.band { padding: var(--s9) 0; border-top: 1px solid var(--line); }
.band--dark {
  background: var(--panel); color: var(--ink-dark);
  border-top: 1px solid rgba(255, 255, 255, .08);
  position: relative; overflow: hidden;
}
.band--dark h2, .band--dark h3 { color: #fff; }
.band--dark p { color: var(--ink-dark-2); }
.band--dark .eyebrow { color: var(--ink-dark-3); }
.band--dark .fine { color: var(--ink-dark-3); }

.kicker {
  display: block; font-family: var(--mono); font-size: var(--fs-xs);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--s3);
}
.band-head { max-width: 60ch; margin-bottom: var(--s8); }
.band-head h2 { font-size: clamp(27px, 3.6vw, 40px); letter-spacing: -.032em; max-width: 20ch; }
.band-head p { font-size: 18px; }

/* ------------------------------------------------------- problem/stakes */

.stakes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
@media (max-width: 900px) { .stakes { grid-template-columns: 1fr; } }
.stake {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s6) var(--s5); background: var(--surface);
  position: relative; overflow: hidden;
}
.band--dark .stake {
  background: var(--panel-2); border-color: rgba(255, 255, 255, .09);
}
.stake .num {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  letter-spacing: .1em; display: block; margin-bottom: var(--s3);
}
.stake h3 { font-size: 20px; margin-bottom: var(--s3); letter-spacing: -.02em; }
.stake p { font-size: var(--fs-sm); margin-bottom: 0; }

/* ------------------------------------------------------------ use cases */

.uses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
@media (max-width: 880px) { .uses { grid-template-columns: 1fr; } }
.use {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; background: var(--surface);
  display: flex; flex-direction: column;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.use:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow);
}
.use-art { height: 132px; position: relative; background: linear-gradient(158deg, #101a26, #0a0f16); overflow: hidden; }
.use-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.use-body { padding: var(--s5); }
.use-body h3 { font-size: 19px; margin-bottom: var(--s2); letter-spacing: -.02em; }
.use-body p { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--s3); }
.use-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  border: 1px solid var(--line-strong); border-radius: var(--r-full);
  padding: 2px 9px; color: var(--text-3);
}
.tag--live { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }

/* Shared art primitives */
.art-sweep { animation: artSweep 5s ease-in-out infinite; }
@keyframes artSweep {
  0%, 100% { transform: translateX(-6%); }
  50%      { transform: translateX(6%); }
}
.art-blink { animation: artBlink 3.2s ease-in-out infinite; }
@keyframes artBlink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------------------------------------------------------- spec builder */

.builder {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
  gap: var(--s7); align-items: start;
}
@media (max-width: 940px) { .builder { grid-template-columns: 1fr; } }

.bq { margin-bottom: var(--s5); }
.bq legend, .bq .q {
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-dark-3); margin-bottom: var(--s3);
  display: block;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt {
  appearance: none; cursor: pointer;
  font-family: var(--sans); font-size: var(--fs-sm);
  background: rgba(255, 255, 255, .04); color: var(--ink-dark-2);
  border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--r-full);
  padding: 7px 15px;
  transition: all .18s var(--ease);
}
.chip-opt:hover { border-color: rgba(255, 255, 255, .35); color: #fff; }
.chip-opt[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent); color: #fff;
}
.bq input[type="text"] {
  width: 100%; background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .14); color: var(--ink-dark);
  border-radius: var(--r-sm); padding: 9px var(--s4); font-size: var(--fs-sm);
}
.bq input[type="text"]::placeholder { color: var(--ink-dark-3); }

.brief {
  border: 1px solid rgba(255, 255, 255, .13); border-radius: var(--r);
  background: var(--panel-2); overflow: hidden;
  position: sticky; top: 84px;
}
.brief-head {
  padding: var(--s3) var(--s4); border-bottom: 1px solid rgba(255, 255, 255, .1);
  font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-dark-3);
  letter-spacing: .06em;
}
.brief pre {
  margin: 0; padding: var(--s4); font-family: var(--mono); font-size: 12px;
  line-height: 1.7; color: var(--ink-dark-2); white-space: pre-wrap;
  max-height: 320px; overflow-y: auto;
}
.brief pre b { color: var(--accent); font-weight: 400; }
.brief-actions {
  display: flex; gap: var(--s2); padding: var(--s4);
  border-top: 1px solid rgba(255, 255, 255, .1);
}

/* --------------------------------------------------------- sticky rail */

/* Appears once the hero CTA is out of view, disappears at the footer. On a
 * page this long the ask has to travel with the reader. */
.rail {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--line);
  transform: translateY(110%);
  transition: transform .32s var(--ease);
}
.rail.up { transform: none; }
.rail .wrap {
  display: flex; align-items: center; gap: var(--s4);
  padding-top: 10px; padding-bottom: 10px;
}
.rail p { margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
.rail p b { color: var(--text); font-weight: 500; }
.rail .btn { margin-left: auto; flex: none; }
@media (max-width: 620px) {
  .rail p { display: none; }
  .rail .btn { margin-left: 0; width: 100%; justify-content: center; }
}

/* ------------------------------------------------------------- reveals */

.rise { opacity: 0; transform: translateY(16px); }
.rise.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }
.rise-1.in { transition-delay: .06s; }
.rise-2.in { transition-delay: .12s; }
.rise-3.in { transition-delay: .18s; }
.rise-4.in { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; transition: none; }
  .vp-scan, .vp-box, .hero-eyebrow .pip, .btn--glow,
  .viewport-chrome .rec::before, .art-sweep, .art-blink {
    animation: none !important;
  }
  .vp-box { opacity: 1; }
  .rail { transition: none; }
}
