/* Rán's Wake — "Waterline" design system (see DESIGN.md) */
:root {
  color-scheme: dark;
  --bg: #050b10;
  --surface: #0a151c;
  --panel: rgba(8, 20, 28, 0.82);
  --rule: rgba(120, 220, 255, 0.28);
  --text: #dfe8ee;
  --muted: #8fa3ae;
  --white: #ffffff;
  --cyan: #7ee4ff;
  --cyan-fill: #2fb4d6;
  --water-deep: #0f4b5c;
  --orange: #ff7a1a;
  --orange-hover: #ff9a3c;
  --on-orange: #1a0c02;
  --error: #ff6b5c;
  --success: #6ee7b7;
  --r-sm: 4px; --r-md: 8px; --r-lg: 10px;
  --max: 1120px;
  --display: "Cabinet Grotesk", "Archivo Black", "Arial Black", sans-serif;
  --body: "General Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Consolas", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1rem/1.55 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--cyan); }
h1, h2, h3 { margin: 0 0 0.45em; line-height: 1.1; }
h1 { font: 900 clamp(2.6rem, 6.4vw, 4.6rem)/1.02 var(--display); color: var(--white); text-transform: uppercase; letter-spacing: 0.01em; }
h2 { font: 800 clamp(1.5rem, 3vw, 2rem)/1.15 var(--display); color: var(--white); text-transform: uppercase; }
h3 { font: 600 1.15rem var(--body); color: var(--white); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--cyan); color: #000; padding: 8px 12px; z-index: 100; }
.eyebrow, .k, .nav a, .tele { font: 500 0.78rem/1.4 var(--body); letter-spacing: 0.12em; text-transform: uppercase; }
.tele { font-family: var(--mono); letter-spacing: 0.06em; text-transform: none; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; position: relative; z-index: 3; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--white); font: 900 1.15rem var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.brand img { width: 34px; height: 34px; border-radius: var(--r-sm); }
.nav a { color: var(--muted); text-decoration: none; margin-left: 28px; }
.nav a:hover, .nav a:focus, .nav a[aria-current] { color: var(--cyan); }

/* hero with waterline */
.hero-wrap { position: relative; overflow: hidden; }
.hero { position: relative; z-index: 2; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding: 28px 0 120px; }
.hero-text { position: relative; padding-left: 18px; }
/* HUD corner brackets on the text block only */
.hero-text::before, .hero-text::after {
  content: ""; position: absolute; left: 0; width: 14px; height: 14px; border-left: 1px solid var(--rule);
}
.hero-text::before { top: -6px; border-top: 1px solid var(--rule); }
.hero-text::after { bottom: -6px; border-bottom: 1px solid var(--rule); }
.eyebrow { color: var(--cyan); margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--rule); }
.lede { font-size: 1.1rem; color: #c8d4db; max-width: 34em; margin-bottom: 26px; }
.hero-art { position: relative; border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; margin-right: -12vw; }
.hero-art img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.water {
  position: fixed; inset: 0; z-index: 8; pointer-events: none;
}
.water canvas { display: block; width: 100%; height: 100%; }
.water.is-fallback {
  top: auto; height: var(--fill, 35%);
  background: linear-gradient(180deg, rgba(47,180,214,0.16), rgba(15,75,92,0.50) 42%, rgba(5,20,28,0.72));
  box-shadow: inset 0 1px 0 rgba(126,228,255,0.35);
}
.flood-tele {
  position: fixed; left: 20px; bottom: 20px; z-index: 9; margin: 0;
  pointer-events: none; color: var(--muted);
}
.flood-tele b { color: var(--cyan); font-weight: 400; }
.telemetry { margin-top: 26px; display: grid; grid-template-columns: repeat(2, max-content); gap: 4px 28px; color: var(--muted); }
.telemetry b { color: var(--cyan); font-weight: 400; }
.telemetry .rising { color: var(--cyan); }

/* forms */
.cta { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 18px; }
.cta label { display: block; font: 500 0.85rem var(--body); color: var(--muted); margin-bottom: 8px; }
.row { display: flex; gap: 10px; }
input[type=email] {
  flex: 1; min-width: 0; padding: 13px 14px; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,0.18);
  background: #06111a; color: #fff; font: 400 1rem var(--mono);
}
input[type=email]::placeholder { color: #5f7480; }
input[type=email]:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
input[aria-invalid=true] { border-color: var(--error); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px;
  border-radius: var(--r-md); border: 0; cursor: pointer; text-decoration: none; min-width: 170px;
  font: 800 0.95rem/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--orange); color: var(--on-orange);
  transition: transform 80ms ease-out, background 200ms ease-out;
}
.btn:hover, .btn:focus-visible { background: var(--orange-hover); transform: translateY(-1px); }
.btn:disabled { opacity: 0.75; cursor: progress; transform: none; }
.btn.ghost { background: transparent; color: var(--cyan); border: 1px solid var(--rule); }
.btn.ghost:hover { background: rgba(126,228,255,0.08); }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(26,12,2,0.35); border-top-color: var(--on-orange); border-radius: 50%; animation: spin 0.8s linear infinite; display: none; }
.btn.loading .spinner { display: inline-block; }
.btn.loading .label { opacity: 0.6; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: var(--error); font-size: 0.9rem; margin: 8px 0 0; min-height: 1.2em; }
.fine { font-size: 0.8rem; color: var(--muted); margin: 10px 0 0; }

/* sections */
section { padding: 56px 0; border-top: 1px solid rgba(255,255,255,0.06); }
.section-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 22px; }
.section-head .tele { color: var(--muted); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--panel); border: 1px solid rgba(255,255,255,0.08); border-left: 2px solid var(--cyan-fill); border-radius: var(--r-md); padding: 22px; }
.card .k { color: var(--cyan); margin-bottom: 8px; display: block; }
.specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.specs div { background: var(--surface); border-radius: var(--r-md); padding: 14px; border-top: 1px solid var(--rule); }
.specs b { display: block; color: var(--cyan); font: 500 0.78rem var(--body); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 4px; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.gallery figure { margin: 0; border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: #000; }
.gallery img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.gallery figcaption { padding: 10px 14px; font-size: 0.9rem; color: var(--muted); }
.gallery figcaption .tele { color: var(--cyan); margin-right: 10px; }

/* footer */
footer { padding: 40px 0 110px; color: var(--muted); font-size: 0.9rem; border-top: 1px solid rgba(255,255,255,0.06); }
footer .links a { margin-right: 18px; }
address { font-style: normal; margin-top: 10px; }
address a { margin-left: 0.45em; }
.copy { margin-top: 14px; }

/* sticky mobile CTA */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; display: none; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(5, 11, 16, 0.94); border-top: 1px solid var(--rule); backdrop-filter: blur(8px); z-index: 40;
}
.sticky-cta .btn { width: 100%; }

/* cookie notice */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; z-index: 50;
  background: #0b1a23; border: 1px solid var(--rule); border-radius: var(--r-md); padding: 16px 18px;
  display: none;
}
.cookie.show { display: block; }
.cookie p { margin: 0 0 12px; font-size: 0.92rem; }
.cookie .row { justify-content: flex-end; }

/* content pages */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page main { flex: 1; }
.doc { max-width: 760px; padding: 20px 0 80px; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.2rem); }
.doc h2 { font: 800 1.15rem/1.15 var(--display); color: var(--white); text-transform: uppercase; margin-top: 1.8em; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 0.4em; }
.doc .updated { color: var(--muted); font: 400 0.8rem var(--mono); margin: 0 0 1.6em; }
.center { text-align: center; padding: 72px 0 96px; max-width: 36em; margin: 0 auto; }
.center .lede { margin-left: auto; margin-right: auto; }
.big { font: 900 clamp(4rem, 15vw, 9rem)/1 var(--display); color: var(--cyan); margin: 0 0 12px; }
.center .tele { color: var(--muted); display: block; margin-bottom: 22px; }

/* image loading state */
.skel { background: linear-gradient(90deg, #0a151c 25%, #10222c 50%, #0a151c 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
img.lazy { opacity: 0; transition: opacity 350ms ease-out; }
img.lazy.loaded { opacity: 1; }

/* breakpoints */
@media (max-width: 1023px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-bottom: 90px; }
  .hero-art { margin-right: 0; }
  .grid-3, .specs { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 639px) {
  .nav { display: none; }
  .grid-3, .specs, .gallery { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .sticky-cta { display: block; }
  .cookie { bottom: 92px; }
  .flood-tele { bottom: calc(76px + env(safe-area-inset-bottom)); }
  section { padding: 36px 0; }
  .telemetry { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skel, .spinner { animation: none; }
}
