/* KESTREL-9 marketing landing (SPEC addendum §A7).
   Loaded ONLY by landing.html. Everything is scoped under body.lp-body or
   the .lp- prefix so none of it can reach the authenticated app.

   The landing deliberately pins its own dark cinematic palette instead of
   reading theme tokens: it is a fixed piece of art sitting over a starfield,
   and a visitor who once picked the light theme must not get white panels
   over black space. The app behind /register is fully themed as before. */

body.lp-body {
  --lp-bg: #06101c;
  --lp-panel-a: rgba(17, 35, 53, 0.93);
  --lp-panel-b: rgba(8, 21, 34, 0.94);
  --lp-line: rgba(135, 184, 213, 0.25);
  --lp-text: #f5f8fb;
  --lp-muted: #b8c5d4;
  --lp-dim: #95a5b6;
  --lp-teal: #22e2d0;
  --lp-amber: #ffae32;
  --lp-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  background: var(--lp-bg);
  color: var(--lp-text);
  overflow-x: hidden;
}

/* the app shell is built for a 1080px column; the landing is full-bleed */
body.lp-body .page { max-width: none; margin: 0; padding: 0; }
body.lp-body .page > * { animation: none; }   /* hero drives its own entrance */

/* ---- chrome ------------------------------------------------------------- */

body.lp-body .topnav {
  gap: 46px;
  padding: 0 32px;
  height: 74px;
  background: rgba(3, 10, 18, 0.82);
  border-bottom: 1px solid rgba(131, 181, 209, 0.2);
  position: sticky;
  top: 0;
  z-index: 50;
}
/* The nav bar here is dark in every theme, so pin the cream lockup. Under
   clean-light app.css swaps in the ink one, which is all but invisible on
   this bar. Specificity beats the [data-theme] rule without !important. */
body.lp-body .topnav .brand .brand-on-dark { display: block; }
body.lp-body .topnav .brand .brand-on-light { display: none; }

body.lp-body .topnav nav { gap: 34px; margin-right: auto; }
body.lp-body .topnav nav a {
  padding: 6px 2px;
  color: #f5f7fb;
  opacity: 0.9;
  font-size: 14px;
  font-weight: 650;
  background: none;
}
body.lp-body .topnav nav a:hover { color: var(--lp-teal); opacity: 1; background: none; }
body.lp-body .footer {
  border-top: 1px solid rgba(131, 181, 209, 0.18);
  background: rgba(3, 10, 18, 0.6);
  color: var(--lp-dim);
}

.lp-signin {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border: 1px solid rgba(110, 177, 210, 0.28);
  border-radius: 999px;
  background: rgba(9, 20, 31, 0.7);
  color: var(--lp-teal);
  font: 600 12px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.lp-signin:hover { border-color: rgba(34, 226, 208, 0.6); text-decoration: none; }
.lp-signin i {
  width: 7px; height: 7px;
  transform: rotate(45deg);
  background: var(--lp-teal);
  box-shadow: 0 0 12px rgba(34, 226, 208, 0.7);
}

/* ---- background layers -------------------------------------------------- */

.lp-stars, .lp-grid { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.lp-stars {
  opacity: 0.36;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.9) 0 1px, transparent 1.3px),
    radial-gradient(circle at 22% 73%, rgba(188,220,255,.72) 0 1px, transparent 1.2px),
    radial-gradient(circle at 67% 20%, rgba(255,255,255,.7) 0 1px, transparent 1.2px),
    radial-gradient(circle at 83% 78%, rgba(188,220,255,.7) 0 1px, transparent 1.2px),
    radial-gradient(circle at 45% 58%, rgba(255,255,255,.55) 0 1px, transparent 1.2px);
  background-size: 190px 190px, 240px 240px, 280px 280px, 330px 330px, 370px 370px;
}
.lp-grid {
  background-image:
    linear-gradient(rgba(99,160,193,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,160,193,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%);
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

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

.lp-hero {
  position: relative;
  padding: 42px 34px 22px;
  max-width: 1720px;
  margin: auto;
  isolation: isolate;
  overflow: hidden;
}
/* Painted plate (tools/make_nebula.py) carries the cloud structure; the
   gradients below only tint and seat it. CSS gradients alone read as a flat
   smudge no matter how they are tuned — there is no noise in them. */
.lp-art {
  position: absolute; inset: 0; z-index: -3; overflow: hidden;
  background:
    radial-gradient(circle at 62% 30%, rgba(38,132,200,.10), transparent 52%),
    url("/static/img/nebula.jpg") center right / cover no-repeat,
    linear-gradient(180deg, #05101d 0, #071421 58%, #06111d 100%);
}
.lp-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(90deg, rgba(2,8,15,.4) 0%, rgba(2,8,15,.08) 42%,
                                      rgba(2,8,15,.05) 75%, rgba(2,8,15,.32) 100%);
}
.lp-nebula { position: absolute; opacity: .45; mix-blend-mode: screen; }
.lp-nebula-a {
  width: 1120px; height: 560px; left: 36%; top: -110px;
  transform: rotate(-12deg); filter: blur(20px);
  /* Sized ellipses that reach transparent well inside the box. Tight stops
     made the cloud a faint smudge; a full-width diagonal band instead showed
     the box's own straight edges. Explicit extents avoid both. */
  background:
    radial-gradient(ellipse 46% 54% at 40% 46%, rgba(96,190,255,.55), transparent 70%),
    radial-gradient(ellipse 38% 46% at 61% 60%, rgba(112,102,255,.38), transparent 72%),
    radial-gradient(ellipse 26% 32% at 66% 38%, rgba(214,238,255,.22), transparent 70%);
}
.lp-nebula-b {
  width: 880px; height: 440px; left: 46%; top: 90px; filter: blur(38px);
  background: radial-gradient(ellipse at center, rgba(38,158,240,.30), transparent 58%);
}
.lp-planet {
  position: absolute; width: 340px; height: 340px; border-radius: 50%;
  right: 9%; top: -64px;
  background: radial-gradient(circle at 34% 32%, rgba(104,155,204,.40), rgba(12,38,66,.70) 50%, rgba(2,10,20,.96) 74%);
  box-shadow: inset -34px -30px 66px rgba(0,0,0,.82),
              0 0 0 2px rgba(82,151,196,.12), 0 0 150px rgba(25,112,190,.18);
}
.lp-planet::after {
  content: ""; position: absolute; width: 450px; height: 156px;
  border: 2px solid rgba(28,180,250,.58);
  border-color: rgba(56,196,255,.8) transparent transparent transparent;
  border-radius: 50%; left: -56px; top: 96px; transform: rotate(15deg);
}
.lp-ship {
  /* top/width tuned so the dish clears the Bridge panel below it — the panel
     paints over the art layer, so any overlap reads as a chopped-off ship */
  position: absolute; width: min(1010px, 64vw); height: auto;
  right: 5%; top: 24px; object-fit: contain;
  /* True straight-alpha PNG, difference-matted from the scene
     (tools/make_hero_ship.py) — so no blend mode and no mask. Screen-blending
     an opaque plate made the hull ghostly; masking one left a soft rectangle.
     Exposure and bloom are baked into the plate; this only adds the ambient
     halo that seats the ship in the nebula. */
  filter: drop-shadow(0 0 54px rgba(38,168,220,.30));
  transform: scale(1.05);
}
/* No painted thruster glow: the ship render carries the reactor's real bloom,
   and a second synthetic glow read as a stray highlight under the hull. */

.lp-copy { position: relative; z-index: 3; width: 610px; padding: 16px 0 0 8px; }
.lp-eyebrow {
  margin: 0 0 13px; color: var(--lp-teal);
  font: 600 12px/1.2 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .16em;
}
.lp-eyebrow i {
  display: inline-block; width: 10px; height: 10px; margin-right: 8px;
  border: 1px solid var(--lp-teal);
  background: linear-gradient(135deg, var(--lp-teal) 0 48%, transparent 49%);
}
.lp-copy h1 {
  margin: 0; font-family: Inter, system-ui, sans-serif; font-weight: 800;
  font-size: clamp(46px, 5.3vw, 88px); line-height: .96; letter-spacing: -.052em;
  text-shadow: 0 4px 34px rgba(0,0,0,.4);
}
.lp-copy h1 span { display: inline-block; margin-top: 8px; }
.lp-lede { max-width: 500px; margin: 20px 0 22px; color: #d1dae5; font-size: 19px; line-height: 1.45; }

.lp-actions { display: flex; gap: 18px; align-items: center; }
.lp-btn {
  min-height: 54px; padding: 0 24px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  font-weight: 800;
  transition: transform .18s var(--ease-out, ease), box-shadow .18s ease, border-color .18s ease;
}
.lp-btn:hover { transform: translateY(-2px); text-decoration: none; }
.lp-btn-primary {
  color: #07101a; border: 1px solid #ffc66a;
  background: linear-gradient(180deg, #ffc45d, #f49d23);
  box-shadow: 0 10px 28px rgba(255,161,37,.22), 0 0 0 1px rgba(255,192,96,.2) inset;
}
.lp-btn-primary:hover { box-shadow: 0 14px 36px rgba(255,161,37,.3), 0 0 0 1px rgba(255,232,182,.28) inset; }
.lp-btn-secondary {
  border: 1px solid rgba(167,206,229,.42); background: rgba(6,16,26,.66); color: #f6f8fb;
}
.lp-btn-secondary:hover { border-color: rgba(115,246,234,.72); box-shadow: 0 10px 35px rgba(0,0,0,.25); }
.lp-proof { display: flex; gap: 26px; margin-top: 17px; color: #cbd5e1; font-size: 14px; }
.lp-proof span::first-letter { color: var(--lp-teal); }

/* ---- telemetry ---------------------------------------------------------- */

.lp-telemetry {
  position: absolute; z-index: 4; right: 26px; top: 18px; width: 312px;
  padding: 14px 15px 12px; border: 1px solid rgba(133,187,217,.27); border-radius: 10px;
  background: linear-gradient(180deg, rgba(12,28,44,.84), rgba(7,18,30,.82));
  box-shadow: 0 18px 70px rgba(0,0,0,.28);
  -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
}
.lp-telemetry-top {
  display: flex; justify-content: space-between; color: #b5c1cf;
  font: 10px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .08em;
}
.lp-telemetry-top b { font-weight: 500; color: #a2adbb; }
.lp-telemetry-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 12px; }
.lp-telemetry-stats > div { padding: 0 11px; border-left: 1px solid rgba(130,177,205,.13); }
.lp-telemetry-stats > div:first-child { padding-left: 0; border-left: 0; }
.lp-telemetry-stats small, .lp-telemetry-stats em {
  display: block; color: #8193a7; font: 9px 'JetBrains Mono', ui-monospace, monospace; font-style: normal;
}
.lp-telemetry-stats strong {
  display: block; font: 22px 'JetBrains Mono', ui-monospace, monospace; margin: 3px 0 0;
}
.lp-telemetry-stats .teal { color: var(--lp-teal); }
.lp-wave { width: 100%; height: 34px; margin-top: 9px; overflow: visible; }
.lp-wave polyline { fill: none; stroke: var(--lp-teal); stroke-width: 1.3; opacity: .78; }

/* ---- lower layout ------------------------------------------------------- */

.lp-lower {
  display: grid; grid-template-columns: minmax(600px, .98fr) minmax(660px, 1.02fr);
  gap: 30px; align-items: end; margin-top: 34px; position: relative; z-index: 3;
}
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.lp-card {
  min-height: 272px; padding: 22px 20px 18px;
  border: 1px solid var(--lp-line); border-radius: 10px;
  background: linear-gradient(180deg, var(--lp-panel-a), var(--lp-panel-b));
  box-shadow: var(--lp-shadow);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  display: flex; flex-direction: column;
}
.lp-card-icon {
  height: 34px; line-height: 1; color: var(--lp-teal);
  text-shadow: 0 0 22px rgba(34,226,208,.18);
}
.lp-card-icon svg { width: 34px; height: 34px; filter: drop-shadow(0 0 14px rgba(34,226,208,.35)); }
.lp-card-icon.code { font-size: 29px; font-weight: 800; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.lp-card h2 { font-size: 20px; line-height: 1.24; margin: 15px 0 14px; letter-spacing: -.025em; }
.lp-card p { margin: 0; color: var(--lp-muted); font-size: 13.5px; line-height: 1.55; }
.lp-card-tag {
  margin-top: auto; padding-top: 15px; color: var(--lp-teal);
  font: 10px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .08em;
}

/* ---- bridge preview ----------------------------------------------------- */

.lp-bridge {
  border: 1px solid rgba(152,199,224,.3); border-radius: 11px;
  background: linear-gradient(180deg, rgba(13,27,42,.95), rgba(6,17,29,.97));
  box-shadow: var(--lp-shadow); overflow: hidden;
}
.lp-bridge-head {
  height: 41px; padding: 0 16px; display: flex; align-items: center; gap: 20px;
  border-bottom: 1px solid rgba(148,189,213,.18);
  font: 10px 'JetBrains Mono', ui-monospace, monospace;
}
.lp-bridge-head strong { font-size: 13px; letter-spacing: .05em; }
.lp-bridge-head span { margin-left: auto; color: var(--lp-dim); }
.lp-bridge-head i { width: 8px; height: 8px; border: 2px solid var(--lp-teal); border-radius: 50%; box-shadow: 0 0 10px rgba(34,226,208,.4); }
.lp-bridge-main { display: grid; grid-template-columns: 1.05fr .95fr; gap: 8px; padding: 9px; }
.lp-camera, .lp-mission, .lp-hardline {
  border: 1px solid rgba(131,176,203,.22); border-radius: 8px; background: #08131f;
}
.lp-camera {
  position: relative; overflow: hidden; min-height: 244px;
  background:
    radial-gradient(circle at 62% 46%, rgba(24,70,104,.35), transparent 62%),
    linear-gradient(180deg, #071523, #050f1a);
}
.lp-camera img {
  /* No mask here: this panel is an exterior camera feed, so a hard rectangular
     frame is exactly right. cover fills it edge to edge. */
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: brightness(1.35) contrast(1.03) saturate(1.06);
}
.lp-camera-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 64% 50%, transparent 0 18%, rgba(13,104,130,.08) 40%, rgba(1,8,13,.18) 82%);
}
.lp-camera-pills { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 7px; }
.lp-camera-pills span {
  padding: 5px 8px; border: 1px solid rgba(34,226,208,.35); border-radius: 999px;
  background: rgba(3,17,24,.82); color: var(--lp-teal);
  font: 8px 'JetBrains Mono', ui-monospace, monospace;
}
.lp-mission { padding: 13px 14px; }
.lp-mission h3 { margin: 0 0 8px; font: 700 11px 'JetBrains Mono', ui-monospace, monospace; }
.lp-mission p { margin: 0 0 9px; color: #b5c1cf; font-size: 10.5px; line-height: 1.45; }
.lp-mission ul { list-style: none; padding: 0; margin: 0; }
.lp-mission li {
  display: grid; grid-template-columns: 25px 1fr auto; gap: 4px; align-items: center;
  color: #c7d1dc; font-size: 10.5px; padding: 3px 0;
}
.lp-mission li span { color: var(--lp-teal); font-family: 'JetBrains Mono', ui-monospace, monospace; }
.lp-mission li b {
  color: var(--lp-amber); font: 500 9px 'JetBrains Mono', ui-monospace, monospace;
  border: 1px solid rgba(255,174,50,.65); padding: 2px 6px; border-radius: 999px;
}
.lp-hardline { margin: 0 9px 9px; padding: 10px; }
.lp-hardline-top {
  display: flex; justify-content: space-between; color: #aeb9c7;
  font: 9px 'JetBrains Mono', ui-monospace, monospace;
}
.lp-hardline-top strong { color: #d6dee7; }
.lp-console {
  margin-top: 8px; height: 54px; border: 1px solid rgba(136,176,199,.16); border-radius: 6px;
  background: #07121c; display: flex; align-items: center; padding: 0 10px; gap: 8px;
  color: #dce6ef; font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.lp-cursor {
  width: 2px; height: 21px; background: var(--lp-teal);
  box-shadow: 0 0 12px rgba(34,226,208,.55); animation: lp-blink 1s steps(1) infinite;
}
.lp-console a {
  margin-left: auto; width: 44px; height: 38px; border: 1px solid rgba(34,226,208,.45);
  border-radius: 7px; display: grid; place-items: center; color: var(--lp-teal);
  background: rgba(14,66,68,.18);
}
@keyframes lp-blink { 50% { opacity: .15; } }

/* ---- metric strip + closing --------------------------------------------- */

.lp-metrics {
  position: relative; z-index: 4; margin-top: 14px;
  display: grid; grid-template-columns: repeat(6, 1fr);
  border: 1px solid rgba(135,184,213,.2); border-radius: 9px;
  background: linear-gradient(180deg, rgba(13,28,43,.9), rgba(7,18,30,.92));
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
}
.lp-metrics > div {
  min-height: 75px; padding: 11px 16px;
  display: grid; grid-template-columns: 30px 1fr; grid-template-rows: 1fr 1fr;
  border-left: 1px solid rgba(127,170,198,.14);
}
.lp-metrics > div:first-child { border-left: 0; }
.lp-metric-icon { grid-row: 1 / 3; align-self: center; color: var(--lp-teal); line-height: 0; }
.lp-metric-icon svg { width: 21px; height: 21px; }
.lp-metrics strong { align-self: end; font-size: 13px; }
.lp-metrics small { align-self: start; color: #9eadbc; font-size: 10px; margin-top: 2px; }

.lp-close {
  max-width: 1450px; margin: 0 auto; padding: 100px 34px 120px;
  display: flex; align-items: center; justify-content: space-between; gap: 50px;
  position: relative; z-index: 3;
}
.lp-close > div { max-width: 820px; }
.lp-close h2 {
  font-family: Inter, system-ui, sans-serif; font-weight: 800;
  font-size: clamp(34px, 5vw, 72px); line-height: 1; letter-spacing: -.045em; margin: 0 0 18px;
}
.lp-close p:not(.lp-eyebrow) { color: #aebccc; font-size: 18px; line-height: 1.6; margin: 0; }

/* ---- responsive --------------------------------------------------------- */

@media (max-width: 1320px) {
  body.lp-body .topnav { gap: 24px; }
  body.lp-body .topnav nav { gap: 20px; }
  .lp-hero { padding-left: 26px; padding-right: 26px; }
  .lp-copy { width: 520px; }
  .lp-ship { right: 2%; width: 66vw; }
  .lp-lower { grid-template-columns: 1fr; }
  .lp-metrics { grid-template-columns: repeat(3, 1fr); }
  .lp-metrics > div:nth-child(4) { border-left: 0; }
}
@media (max-width: 900px) {
  body.lp-body .topnav { height: 66px; padding: 0 18px; gap: 20px; }
  body.lp-body .topnav nav { display: none; }
  .lp-hero { padding: 36px 20px 20px; overflow: visible; }
  /* the art stops short of the fold here, so fade its bottom — a hard edge
     where the starfield ends reads as a seam across the page */
  .lp-art {
    height: 650px;
    -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
  }
  .lp-planet { right: -60px; top: 0; }
  /* the ship becomes wallpaper here: it sits under the CTAs, so it has to
     drop back far enough that button labels stay legible over it */
  .lp-ship { width: 820px; max-width: none; right: -390px; top: 210px; opacity: .42; }
  .lp-telemetry { display: none; }
  .lp-copy { width: min(560px, 100%); }
  .lp-lede { max-width: 480px; }
  .lp-lower { margin-top: 120px; }
  .lp-features { grid-template-columns: 1fr; }
  .lp-card { min-height: 0; }
  .lp-bridge-main { grid-template-columns: 1fr; }
  .lp-camera { min-height: 320px; }
  .lp-metrics { grid-template-columns: repeat(2, 1fr); }
  .lp-metrics > div:nth-child(odd) { border-left: 0; }
  .lp-close { padding: 80px 22px 100px; flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .lp-signin { display: none; }
  .lp-hero { padding: 28px 16px 16px; }
  .lp-art { height: 560px; }
  .lp-lede { font-size: 17px; }
  .lp-actions { flex-direction: column; align-items: stretch; }
  .lp-btn { width: 100%; }
  .lp-proof { flex-direction: column; gap: 6px; }
  .lp-lower { margin-top: 90px; }
  .lp-camera { min-height: 260px; }
  .lp-metrics { grid-template-columns: 1fr; }
  .lp-metrics > div { border-left: 0; border-top: 1px solid rgba(127,170,198,.14); }
  .lp-metrics > div:first-child { border-top: 0; }
}

/* The app already zeroes animation globally under reduced motion; the blink
   and hover lift are restated here because they are landing-only rules. */
@media (prefers-reduced-motion: reduce) {
  .lp-cursor { animation: none; }
  .lp-btn { transition: none; }
  .lp-btn:hover { transform: none; }
}
[data-reduced-motion="true"] .lp-cursor { animation: none; }
[data-reduced-motion="true"] .lp-btn { transition: none; }
[data-reduced-motion="true"] .lp-btn:hover { transform: none; }
