/* Cattail.Nu SpaceCube — site design system.
   Transcribed from the app panels (cube_menu_window.svg / distance_window.svg)
   and PanelStyle.swift: teal-black gradients, a faint cyan grid, hairline
   rounded panels, numbered kicker labels, circuit-trace accents, mono values. */

:root {
  color-scheme: dark;

  /* Ink */
  --ink: #d9edf2;
  --ink-bright: #effcff;
  --body: #bbd2d8;
  --muted: #82a6b0;
  --kicker: #7fa5b7;
  --faint: #527580;

  /* Accents (straight from PanelPalette) */
  --cyan: #7debf6;
  --cyan-soft: #62edf3;
  --mint: #70ffeb;
  --link: #8dffac;
  --blue: #70aaff;
  --magenta: #ff78ab;

  /* Axis colours */
  --axis-x: #ff6b6b;
  --axis-y: #70ffab;
  --axis-z: #62a8ff;

  /* Surfaces */
  --void: #02070b;
  --panel: rgba(7, 34, 47, 0.78);
  --card: linear-gradient(160deg, rgba(23, 56, 74, 0.72), rgba(9, 23, 33, 0.9));
  --panel-bg: linear-gradient(145deg, #102b3b, #07151f 52%, #03090e);

  /* Lines */
  --line: rgba(125, 235, 246, 0.16);
  --line-soft: rgba(112, 233, 241, 0.1);
  --line-bright: rgba(103, 243, 194, 0.34);
  --hairline: rgba(125, 235, 246, 0.09);

  --grid: 44px;
  --shell: 1120px;

  /* The app renders in San Francisco: SF Pro for text and labels, SF Mono for
     numeric values only. Match that, with a clean fallback off Apple. */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Inter, ui-sans-serif, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --font-label: var(--font-sans);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--void);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.72;
  background:
    radial-gradient(circle at 18% 12%, rgba(26, 167, 175, 0.18), transparent 26rem),
    radial-gradient(circle at 84% 68%, rgba(79, 145, 255, 0.1), transparent 34rem),
    linear-gradient(rgba(118, 231, 239, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 231, 239, 0.035) 1px, transparent 1px),
    var(--void);
  background-size: auto, auto, var(--grid) var(--grid), var(--grid) var(--grid), auto;
  background-attachment: fixed, fixed, fixed, fixed, fixed;
}

/* Diagonal light sweep + a single bright signal rule near the top, echoing the
   panel's `#bg` sweep and top hairline. */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}
body::before {
  inset: 0;
  background: linear-gradient(115deg, transparent 43%, rgba(66, 217, 226, 0.022) 50%, transparent 57%);
}
body::after {
  top: 0;
  right: 9vw;
  width: 22rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan));
  box-shadow: 0 0 20px var(--cyan);
}

/* ---------- Typography ---------- */

a {
  color: #77e8ee;
  text-decoration-color: rgba(119, 232, 238, 0.32);
  text-underline-offset: 0.18em;
  transition: color 140ms ease, text-decoration-color 140ms ease;
}
a:hover { color: var(--link); text-decoration-color: var(--link); }

strong { color: var(--ink-bright); font-weight: 650; }
em { color: #a9cad2; }

code, .mono {
  font-family: var(--font-mono);
}
code {
  padding: 0.15em 0.42em;
  border: 1px solid rgba(125, 235, 246, 0.16);
  border-radius: 5px;
  color: #8decf2;
  background: rgba(3, 14, 22, 0.72);
  font-size: 0.88em;
}

.kicker {
  display: inline-block;
  margin: 0 0 14px;
  color: var(--kicker);
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.kicker .idx { color: var(--cyan); }

/* ---------- Shell + layout ---------- */

.site-shell {
  width: min(var(--shell), calc(100% - 40px));
  margin: 0 auto;
}
.section { padding: clamp(48px, 8vw, 104px) 0; }
.section + .section { padding-top: 0; }

/* A generic app-style panel: gradient fill, grid texture, hairline stroke. */
.panel {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(rgba(118, 231, 239, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 231, 239, 0.028) 1px, transparent 1px),
    linear-gradient(145deg, rgba(8, 37, 50, 0.92), rgba(3, 19, 29, 0.96));
  background-size: 25px 25px, 25px 25px, auto;
  box-shadow: inset 0 1px 0 rgba(178, 242, 247, 0.05), 0 30px 90px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(22px);
}
.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 11%;
  width: 36%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 18px rgba(125, 235, 246, 0.6);
}

.hairline {
  width: 100%;
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--hairline);
}
.signal-line {
  width: 100%;
  height: 1px;
  margin-top: 34px;
  background: linear-gradient(90deg, var(--mint) 0 7%, rgba(112, 255, 235, 0.12) 7% 78%, transparent 78%);
}

/* ---------- Top navigation ---------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(2, 9, 14, 0.92), rgba(2, 9, 14, 0.68));
  backdrop-filter: blur(18px);
}
.topnav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(var(--shell), calc(100% - 40px));
  margin: 0 auto;
  padding: 12px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink-bright);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(125, 235, 246, 0.34);
  border-radius: 11px;
  background: rgba(14, 64, 76, 0.5);
  box-shadow: inset 0 0 20px rgba(125, 235, 246, 0.08);
}
.brand-mark img { width: 30px; height: 30px; display: block; }
.brand-name { font-weight: 640; letter-spacing: -0.02em; font-size: 0.98rem; }
.brand-name .co {
  display: block;
  font-family: var(--font-label);
  font-size: 0.56rem;
  font-weight: 650;
  letter-spacing: 0.22em;
  color: var(--kicker);
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 9px;
  color: #c1dbe1;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}
.nav-links a:hover { color: var(--ink-bright); background: rgba(23, 94, 105, 0.32); }
.nav-links a.active {
  color: var(--ink-bright);
  border-color: rgba(125, 235, 246, 0.22);
  background: linear-gradient(130deg, rgba(25, 89, 106, 0.5), rgba(23, 56, 78, 0.5));
}
.nav-links a.cta {
  color: #041016;
  font-weight: 620;
  background: linear-gradient(120deg, var(--mint), #4fd6c6);
  border-color: transparent;
}
.nav-links a.cta:hover { background: linear-gradient(120deg, #8bffef, var(--mint)); }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(14, 64, 76, 0.4);
  color: var(--cyan);
  cursor: pointer;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 15px;
  border: 1px solid rgba(125, 235, 246, 0.17);
  font-size: 0.95rem;
  font-weight: 570;
  text-decoration: none;
  color: var(--ink-bright);
  background: #0b1a25;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.btn:hover { transform: translateY(-2px); border-color: var(--line-bright); color: var(--ink-bright); }
.btn .chev { transition: transform 160ms ease; }
.btn:hover .chev { transform: translateX(3px); }
.btn-primary {
  border-color: transparent;
  color: #041016;
  font-weight: 630;
  background: linear-gradient(120deg, var(--mint), #4fd6c6);
  box-shadow: 0 0 26px rgba(112, 255, 235, 0.18);
}
.btn-primary:hover { color: #041016; background: linear-gradient(120deg, #8bffef, var(--mint)); box-shadow: 0 0 34px rgba(112, 255, 235, 0.28); }
.btn-active {
  background: linear-gradient(90deg, #19596a, #17384e);
  border-color: rgba(125, 235, 246, 0.24);
}
.btn-ghost { background: rgba(11, 26, 37, 0.6); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(125, 235, 246, 0.22);
  border-radius: 999px;
  background: rgba(14, 64, 76, 0.4);
  color: var(--cyan);
  font-family: var(--font-label);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(40px, 7vw, 84px) 0 clamp(30px, 5vw, 60px);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 5vw, 60px);
  align-items: center;
}
.hero h1 {
  margin: 18px 0 22px;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 630;
  line-height: 1.04;
  letter-spacing: -0.04em;
  color: var(--ink-bright);
  text-wrap: balance;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--cyan), var(--mint) 60%, var(--link));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lede {
  max-width: 42ch;
  margin: 0 0 30px;
  font-size: 1.12rem;
  color: #a9c6ce;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-meta {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  font-family: var(--font-label);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta span::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--mint); box-shadow: 0 0 8px var(--mint);
}

/* Floating glass cube, ringed like the app's spatial-core glyph. */
.hero-cube {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
}
.hero-cube::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(101, 249, 230, 0.28), rgba(79, 145, 255, 0.1) 45%, transparent 70%);
  filter: blur(8px);
}
.hero-cube .ring {
  position: absolute;
  border: 1px solid rgba(103, 225, 234, 0.16);
  border-radius: 50%;
}
.hero-cube .ring.r1 { inset: 4%; }
.hero-cube .ring.r2 { inset: 15%; border-style: dashed; border-color: rgba(103, 225, 234, 0.12); }
.hero-cube img {
  position: relative;
  width: 82%;
  filter: drop-shadow(0 24px 60px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 40px rgba(101, 249, 230, 0.12));
  animation: float 7s ease-in-out infinite;
}
/* Spinning-logo video, masked into a circle to match the ringed glyph. */
.hero-cube .hero-video {
  position: relative;
  width: 82%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(125, 235, 246, 0.28);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 46px rgba(101, 249, 230, 0.16),
    inset 0 0 46px rgba(2, 7, 11, 0.45);
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(-2%); }
  50% { transform: translateY(2%); }
}
.hero-cube .node {
  position: absolute;
  width: 8px; height: 8px; border-radius: 50%;
}
.hero-cube .node.n1 { top: 16%; right: 20%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.hero-cube .node.n2 { bottom: 20%; left: 16%; background: var(--blue); box-shadow: 0 0 12px var(--blue); }

/* ---------- Section headings ---------- */

.section-head { max-width: 60ch; margin-bottom: 40px; }
.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  font-weight: 620;
  letter-spacing: -0.03em;
  color: var(--ink-bright);
  text-wrap: balance;
}
.section-head p { margin: 14px 0 0; color: #a9c6ce; font-size: 1.05rem; }

/* ---------- Card grids ---------- */

.grid {
  display: grid;
  gap: 16px;
}
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  position: relative;
  overflow: hidden;
  padding: 26px 26px 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: inset 0 1px 0 rgba(180, 241, 246, 0.04);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.card:hover {
  border-color: var(--line-bright);
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgba(180, 241, 246, 0.06), 0 20px 50px rgba(0, 0, 0, 0.3);
}
.card .card-glyph {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  margin-bottom: 18px;
  border: 1px solid rgba(125, 235, 246, 0.2);
  border-radius: 13px;
  background: rgba(14, 64, 76, 0.42);
  color: var(--cyan);
}
.card h3 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 600; color: var(--ink-bright); letter-spacing: -0.02em; }
.card p { margin: 0; color: var(--body); font-size: 0.96rem; }
a.card { text-decoration: none; color: inherit; display: block; }
a.card::after {
  content: "";
  position: absolute;
  right: 22px; bottom: 24px;
  width: 8px; height: 8px;
  border-top: 1px solid var(--faint);
  border-right: 1px solid var(--faint);
  transform: rotate(45deg);
  transition: border-color 160ms ease, transform 160ms ease;
}
a.card:hover::after { border-color: var(--mint); transform: rotate(45deg) translate(2px, -2px); }

/* Feature list rows with a leading node, like the panel interaction hints. */
.feature-row {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--line-soft);
}
.feature-row:first-child { border-top: 0; }
.feature-row .node {
  flex: none;
  width: 9px; height: 9px; margin-top: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px rgba(130, 155, 255, 0.6);
}
.feature-row h3 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 600; color: var(--ink-bright); }
.feature-row p { margin: 0; color: var(--body); font-size: 0.96rem; }

/* ---------- Gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  /* Real screenshots differ in shape; keep cards their own height instead of
     stretching the short ones to match the tall one in the same row. */
  align-items: start;
}
.shot {
  position: relative;
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #030f16;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
  transition: border-color 180ms ease, transform 180ms ease;
}
.shot:hover { border-color: var(--line-bright); transform: translateY(-3px); }
.shot img, .shot object, .shot svg { display: block; width: 100%; height: auto; pointer-events: none; }
.gallery-page .shot img { padding: 25px 100px; }
.gallery-page .gallery-grid-screens .shot img { padding: 25px; }
.shot .caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.85rem;
  color: var(--body);
}
.shot .caption .tag {
  font-family: var(--font-label);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kicker);
}
.shot .desc {
  display: block;
  padding: 0 16px 14px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}

.video-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #030f16;
}
.video-card video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #030f16; }
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.video-card .caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.85rem;
  color: var(--body);
}
.video-card .caption .tag {
  font-family: var(--font-label);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kicker);
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 4vw;
  background: rgba(1, 5, 9, 0.86);
  backdrop-filter: blur(10px);
}
.lightbox.open { display: grid; }
.lightbox img, .lightbox object {
  max-width: min(1000px, 92vw);
  max-height: 88vh;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}
.lightbox .close {
  position: absolute;
  top: 22px; right: 26px;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(14, 64, 76, 0.5);
  color: var(--cyan);
  font-size: 1.4rem;
  cursor: pointer;
}

/* ---------- Download ---------- */

.download-hero { text-align: center; }
.download-hero .app-icon {
  display: block;
  width: clamp(140px, 26vw, 200px);
  margin: 0 auto 26px;
  filter: drop-shadow(0 24px 60px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 40px rgba(101, 249, 230, 0.14));
  animation: float 7s ease-in-out infinite;
}
.download-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.04em; margin: 14px 0 16px; color: var(--ink-bright); }
.download-lede {
  max-width: 58ch;
  margin: 0 auto;
  color: var(--body);
  font-size: 1.05rem;
}
/* Cards read as reference material, so they keep a left-aligned column even
   though the hero above them is centred. */
.download-facts { margin-top: 40px; text-align: left; }

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding: 14px 26px;
  border: 1px solid var(--line-bright);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(23, 56, 74, 0.6), rgba(9, 23, 33, 0.8));
  color: var(--ink-bright);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.store-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 34px rgba(112, 255, 235, 0.22);
}
.store-badge .glyph { display: inline-flex; color: var(--cyan); }
.store-badge .lines { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.store-badge .lines .top { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--kicker); }
.store-badge .lines .bot { font-size: 1.3rem; font-weight: 630; color: var(--ink-bright); }

/* ---------- Help search ---------- */

.help-search { position: relative; margin: 4px 0 8px; }
.help-search input {
  width: 100%;
  padding: 15px 18px 15px 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(3, 14, 22, 0.7);
  color: var(--ink-bright);
  font-size: 1rem;
  font-family: inherit;
}
.help-search input::placeholder { color: var(--faint); }
.help-search input:focus { outline: none; border-color: var(--line-bright); box-shadow: 0 0 0 3px rgba(103, 243, 194, 0.1); }
.help-search .icon {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--cyan);
  pointer-events: none;
}
.help-search kbd {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}
.search-results { margin: 14px 0 0; padding: 0; list-style: none; }
.search-results li { margin: 0 0 8px; padding: 0; }
.search-results a {
  display: block;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 28, 39, 0.5);
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease;
}
.search-results a:hover { border-color: var(--line-bright); background: rgba(23, 94, 105, 0.42); }
.search-results .r-cat {
  font-family: var(--font-label);
  font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--kicker);
}
.search-results .r-title { display: block; margin: 3px 0 4px; color: var(--ink-bright); font-weight: 570; }
.search-results .r-title mark { background: rgba(112, 255, 235, 0.22); color: var(--mint); border-radius: 3px; padding: 0 2px; }
.search-results .r-excerpt { display: block; color: var(--body); font-size: 0.88rem; line-height: 1.5; }
.search-results .r-excerpt mark { background: rgba(112, 255, 235, 0.18); color: #cffcf5; border-radius: 3px; padding: 0 2px; }
.search-empty { padding: 20px; color: var(--muted); text-align: center; }
.search-count {
  margin: 0 0 12px;
  font-family: var(--font-label);
  font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------- Help article ---------- */

.help-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; }
.help-toc {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow: auto;
  font-size: 0.9rem;
}
.help-toc .toc-title {
  font-family: var(--font-label);
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--kicker);
  margin-bottom: 12px;
}
.help-toc a {
  display: block;
  padding: 6px 12px;
  border-left: 1px solid var(--line);
  color: #a9c6ce;
  text-decoration: none;
}
.help-toc a:hover { color: var(--ink-bright); border-color: var(--mint); }

/* App-style breadcrumb/kicker above each help page title. */
.help-crumb {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--kicker);
}
.help-crumb a { color: var(--cyan); text-decoration: none; }
.help-crumb a:hover { color: var(--mint); }
.help-crumb .sep { color: var(--faint); }

/* Figures wide enough to need their own scroll rather than widening the page. */
.table-scroll { overflow-x: auto; margin: 1.4rem 0; }
.data-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-variant-numeric: tabular-nums;
}
.data-table caption {
  text-align: left;
  padding-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.data-table th, .data-table td {
  padding: 0.55rem 0.9rem;
  text-align: right;
  border-bottom: 1px solid var(--hairline);
}
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th {
  color: var(--cyan);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .heavy { color: var(--magenta); }

article { max-width: 790px; }
body.index article, body.wide article { max-width: none; }

article h1 {
  max-width: 850px;
  margin: 0 0 30px;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 620;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--ink-bright);
  text-wrap: balance;
}
article h1::before {
  content: "";
  display: block;
  width: 74px; height: 2px;
  margin-bottom: 22px;
  background: linear-gradient(90deg, var(--mint), rgba(103, 243, 194, 0.06));
  box-shadow: 0 0 15px rgba(103, 243, 194, 0.36);
}
article h2 {
  margin: 46px 0 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-bright);
  text-wrap: balance;
}
article h3 { margin: 30px 0 10px; font-size: 1.12rem; font-weight: 600; color: #e6f7fb; }
article p { margin: 0 0 1.15em; color: var(--body); }
article ul, article ol { margin: 0 0 1.35em; padding-left: 1.35em; }
article li { margin: 0.5em 0; padding-left: 0.28em; color: var(--body); }
article li::marker { color: var(--cyan); font-family: var(--font-mono); }
article li > ul, article li > ol { margin: 0.4em 0 0.7em; }

/* Help index cards (grouped link lists), matching the app's control deck. */
body.index article h2 {
  margin: 40px 0 16px;
  padding-top: 0;
  border-top: 0;
  color: var(--kicker);
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
body.index article h1 + p { max-width: 66ch; color: #a9c6ce; font-size: 1.08rem; }
body.index article h2 + ul {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0;
  list-style: none;
}
body.index article h2 + ul li { display: flex; margin: 0; padding: 0; }
/* Flat app button: dark fill, thin cyan hairline, readable text — no gradient
   or chevron competing with the label. */
body.index article h2 + ul a {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(125, 235, 246, 0.17);
  border-radius: 13px;
  color: #d9f3f8;
  font-weight: 500;
  text-decoration: none;
  background: #0b1a25;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}
body.index article h2 + ul a::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan-soft);
  opacity: 0.5;
  transition: opacity 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
body.index article h2 + ul a:hover {
  border-color: var(--line-bright);
  color: #f2ffff;
  background: #0f2531;
}
body.index article h2 + ul a:hover::before {
  opacity: 1;
  background: var(--mint);
  box-shadow: 0 0 7px rgba(112, 255, 235, 0.5);
}

/* ---------- Maker note ---------- */

.maker-mission {
  max-width: 60ch;
  margin: 24px 0 20px;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--mint);
  color: #e6f7fb;
  font-size: 1.18rem;
  font-style: italic;
  line-height: 1.6;
}
.maker-motto {
  margin: 0;
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--mint);
}
.site-footer .motto {
  margin: 10px 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--mint);
  opacity: 0.92;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  background: linear-gradient(180deg, transparent, rgba(3, 14, 22, 0.6));
}
.footer-inner {
  width: min(var(--shell), calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 54px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
}
.footer-inner .about { max-width: 34ch; color: var(--muted); font-size: 0.92rem; }
.footer-inner .about .brand { margin-bottom: 14px; }
.footer-col h4 {
  margin: 4px 0 14px;
  font-family: var(--font-label);
  font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--kicker);
  font-weight: 650;
}
.footer-col a { display: block; padding: 5px 0; color: #a9c6ce; text-decoration: none; font-size: 0.92rem; }
.footer-col a:hover { color: var(--mint); }
.footer-base {
  width: min(var(--shell), calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-cube { max-width: 380px; margin: 0 auto; order: -1; }
  .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .site-shell { width: min(100% - 22px, var(--shell)); }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(2, 9, 14, 0.98);
    backdrop-filter: blur(18px);
  }
  .nav-toggle { display: grid; place-items: center; }
  .topnav-inner { position: relative; }
  .grid.cols-2, .grid.cols-3, .gallery-grid { grid-template-columns: 1fr; }
  body.index article h2 + ul { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
