/* ============================================================
   Yula — landing page
   Direction: sovereign command console meets the ancient
   signal-fire. Cold night base; ember = human warning fire;
   teal = machine/sensor data. Structure follows the product's
   real designations (LAYER 1–3, M1–M6, MGRS grid).
   ============================================================ */

:root {
  /* Surfaces — cold blue-black (operating at night / under blackout) */
  --void: #0a0e14;
  --void-2: #0c111a;
  --surface: #131b27;
  --surface-2: #1a2432;
  --line: rgba(125, 138, 156, 0.14);
  --line-strong: rgba(125, 138, 156, 0.3);

  /* Text */
  --ink: #e9eef4;
  --ink-dim: #aebccb;
  --muted: #6f7e8e;

  /* Signal-fire amber (warning / human) */
  --ember: #ff6a1a;
  --ember-2: #ffa24b;
  --ember-soft: rgba(255, 106, 26, 0.14);

  /* Cold sensor teal (data / machine) */
  --signal: #34d6c4;
  --signal-soft: rgba(52, 214, 196, 0.12);

  /* APP-6 hostile red — used sparingly, only where it means something */
  --hostile: #ff5252;

  /* Type */
  --font-display: "Chakra Petch", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --text-hero: clamp(2.6rem, 1.2rem + 6vw, 6rem);
  --text-h2: clamp(1.7rem, 1.1rem + 2.4vw, 3rem);
  --text-h3: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  --text-body: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  --text-sm: 0.85rem;
  --text-xs: 0.72rem;

  /* Space */
  --space-section: clamp(4.5rem, 3rem + 7vw, 9rem);
  --gutter: clamp(1.25rem, 0.5rem + 3vw, 3.5rem);
  --maxw: 1240px;

  --radius: 4px;
  --radius-lg: 10px;

  --dur: 320ms;
  --dur-slow: 800ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 240px;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient: faint MGRS grid + drifting scan, behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 78%);
  opacity: 0.5;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}

/* Eyebrow: real designators, mono, teal — a label, not decoration */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--signal);
  opacity: 0.7;
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--gutter);
  background: color-mix(in oklab, var(--void) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
}
.brand .flame {
  width: 16px;
  height: 20px;
  filter: drop-shadow(0 0 8px var(--ember));
}
.brand .flame path { fill: var(--ember); }
.topbar nav {
  display: flex;
  gap: 1.6rem;
  font-size: var(--text-sm);
  color: var(--ink-dim);
}
.topbar nav a { transition: color var(--dur) var(--ease); }
.topbar nav a:hover { color: var(--ember-2); }
.lang {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
}
.lang a {
  padding: 0.2rem 0.45rem;
  border-radius: 3px;
  color: var(--muted);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.lang a:hover { color: var(--ink); }
.lang a.on { color: var(--void); background: var(--signal); font-weight: 500; }
.lang .sep { color: var(--line-strong); }

.status {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px var(--signal);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 16rem;
  padding-bottom: clamp(8rem, 6rem + 8vw, 12rem);
  overflow: hidden;
}
/* Ember glow, off to one side — the fire, not a centered gradient blob */
.hero::after {
  content: "";
  position: absolute;
  left: -10%;
  top: 8%;
  width: 60vw;
  height: 60vw;
  max-width: 760px;
  max-height: 760px;
  background: radial-gradient(circle, var(--ember-soft) 0%, transparent 62%);
  pointer-events: none;
  z-index: 0;
  animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe { 0%,100%{opacity:.85; transform:scale(1)} 50%{opacity:1; transform:scale(1.06)} }

.hero .wrap { display: grid; gap: 2rem; }
.hero-kicker { margin-bottom: 0.4rem; }
.hero h1 {
  font-size: var(--text-hero);
  font-weight: 700;
  max-width: 15ch;
  text-wrap: balance;
}
.hero h1 .glow {
  color: var(--ember);
  text-shadow: 0 0 28px rgba(255, 106, 26, 0.45);
}
.hero-lede {
  max-width: 56ch;
  color: var(--ink-dim);
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
}
.hero-meaning {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--muted);
}
.hero-meaning b { color: var(--ember-2); font-weight: 500; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 0.5rem; }
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
  cursor: pointer;
}
.btn-ember {
  background: var(--ember);
  color: #150a02;
  box-shadow: 0 0 0 rgba(255, 106, 26, 0);
}
.btn-ember:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px var(--ember); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--signal); color: var(--signal); transform: translateY(-2px); }

/* Telemetry strip — the real canonical event subjects */
.telemetry {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.telemetry ul {
  display: flex;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  width: max-content;
  animation: marquee 32s linear infinite;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  letter-spacing: 0.05em;
}
.telemetry li::before { content: "› "; color: var(--signal); }
@keyframes marquee { from { transform: translateX(0) } to { transform: translateX(-50%) } }

/* Signature: beacon ridgeline pinned to the bottom of the hero */
.ridgeline {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: clamp(120px, 18vh, 220px);
  z-index: 0;
  pointer-events: none;
}
.ridge-fill { fill: var(--void-2); stroke: var(--line-strong); stroke-width: 1; }
.beacon { transform-box: fill-box; transform-origin: center bottom; }
.beacon .ember {
  fill: var(--ember);
  filter: drop-shadow(0 0 6px var(--ember)) drop-shadow(0 0 16px var(--ember-2));
  opacity: 0;
  animation: ignite 5s ease-in-out infinite;
}
.beacon:nth-of-type(1) .ember { animation-delay: 0s; }
.beacon:nth-of-type(2) .ember { animation-delay: 0.5s; }
.beacon:nth-of-type(3) .ember { animation-delay: 1s; }
.beacon:nth-of-type(4) .ember { animation-delay: 1.5s; }
.beacon:nth-of-type(5) .ember { animation-delay: 2s; }
@keyframes ignite {
  0%, 100% { opacity: 0.15; transform: scaleY(0.7); }
  40%, 60% { opacity: 1; transform: scaleY(1); }
}

/* ---------- Generic section ---------- */
.section { padding-block: var(--space-section); position: relative; }
.section-head { max-width: 62ch; margin-bottom: 3rem; display: grid; gap: 1rem; }
.section-head h2 { font-size: var(--text-h2); }
.section-head p { color: var(--ink-dim); margin: 0; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Layers (architecture) ---------- */
.layers { display: grid; gap: 1rem; }
.layer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.6rem;
  background: linear-gradient(180deg, var(--surface), var(--void-2));
  border: 1px solid var(--line);
  border-left: 2px solid var(--signal);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.layer:hover { transform: translateX(4px); border-left-color: var(--ember); }
.layer .tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--signal);
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.layer h3 { font-size: var(--text-h3); margin-bottom: 0.4rem; }
.layer p { margin: 0; color: var(--ink-dim); font-size: 0.98rem; }

/* ---------- Card grid (products) ---------- */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  position: relative;
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ember), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.card:hover::before { transform: scaleX(1); }
.card .env {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--signal);
  letter-spacing: 0.08em;
}
.card h3 { font-size: var(--text-h3); margin: 0.6rem 0 0.5rem; }
.card p { margin: 0 0 1rem; color: var(--ink-dim); font-size: 0.95rem; }
.card .subject {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.card .subject b { color: var(--ember-2); font-weight: 500; }

/* ---------- Modules (real designations M1–M6) ---------- */
.modules { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.mod {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  padding: 1.3rem;
  background: var(--void-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.mod:hover { border-color: var(--ember); background: var(--surface); }
.mod .id {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--ember);
  line-height: 1;
}
.mod.star .id::after { content: " ★"; color: var(--ember-2); font-size: 0.9rem; vertical-align: super; }
.mod h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }
.mod p { margin: 0; font-size: 0.9rem; color: var(--muted); }

.flow {
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-dim);
  padding: 1rem 1.2rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}
.flow b { color: var(--signal); font-weight: 500; }
.flow .arrow { color: var(--ember); padding: 0 0.5rem; }

/* ---------- Tech spec sheet ---------- */
.spec {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.spec-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.spec-row:last-child { border-bottom: 0; }
.spec-row:nth-child(even) { background: var(--void-2); }
.spec-row .k {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--signal);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  align-self: center;
}
.spec-row .v { color: var(--ink-dim); }
.spec-row .v b { color: var(--ink); font-weight: 600; }

/* ---------- Principles ---------- */
.principles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.principle {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.principle .n {
  font-family: var(--font-mono);
  color: var(--ember);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
}
.principle h3 { font-size: 1.05rem; margin: 0.5rem 0; }
.principle p { margin: 0; color: var(--ink-dim); font-size: 0.92rem; }

/* Scope boundary — the ethical guardrail, given real weight */
.boundary {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  align-items: center;
  padding: 1.5rem 1.8rem;
  border: 1px solid rgba(255, 82, 82, 0.35);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255, 82, 82, 0.06), transparent);
}
.boundary .mark {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  color: var(--hostile);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 0.4rem 0;
  border-left: 2px solid var(--hostile);
}
.boundary p { margin: 0; color: var(--ink-dim); font-size: 0.98rem; }
.boundary b { color: var(--ink); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 3rem;
  color: var(--muted);
}
.footer .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
.footer .fbrand { font-family: var(--font-display); font-weight: 700; color: var(--ink); letter-spacing: 0.04em; }
.footer .meta { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; }
.footer .meta span { color: var(--signal); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .topbar nav { display: none; }
  .layer { grid-template-columns: 1fr; gap: 0.6rem; }
  .mod { grid-template-columns: auto 1fr; }
}
@media (max-width: 520px) {
  .status { display: none; }
  .spec-row { grid-template-columns: 1fr; gap: 0.3rem; }
  .boundary { grid-template-columns: 1fr; }
  .boundary .mark { writing-mode: horizontal-tb; transform: none; border-left: 0; border-top: 2px solid var(--hostile); padding: 0.4rem 0 0; }
}

/* Accessibility */
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .telemetry ul { animation: none; }
}
