/* ============================================================================
   Riding Light — landing page
   Brand: the Riding Light logo pack (docs/figures/brand/riding-light/, README
   there). Paper sections alternate with navy ones; the hero is a night
   harbour. Teal is the waterline, the warm accent is flame / tangerine.
   ========================================================================== */

:root {
  --ink:    #17202a;
  --muted:  #5b6570;
  --paper:  #fbfaf7;
  --paper-2:#f4f2ec;
  --line:   #dfe5e8;
  --teal:   #0e7c7b;
  --teal-2: #12a3a0;
  --navy:   #0a1630;            /* brand navy */
  --navy-2: #0d1c3a;            /* the sea below the waterline (demo section) */

  /* Riding Light brand tokens, light backgrounds (from the pack's README) */
  --flame-top:    #ffc53d;
  --flame-bottom: #f2641f;
  --glass:        #fff0c2;
  --beam:         #ff9a3c;
  --reflection:   #f47a2a;
  --flame-word:   #ee6a22;
  --tangerine:    #f27b1f;
  /* … and the same roles on navy */
  --teal-d:         #3fc9c2;
  --flame-top-d:    #ffd25e;
  --flame-bottom-d: #ff7038;
  --glass-d:        #fff3d1;
  --beam-d:         #ffab52;
  --reflection-d:   #ff8a45;
  --flame-word-d:   #ff9a3c;
  --tangerine-d:    #ff8f3a;
  /* light text on navy */
  --on-navy:       #f2f5f9;
  --on-navy-muted: #cdd7e3;

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter,
          Arial, sans-serif;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* keyboard focus: teal on paper, light teal on the navy sections (≥ 3:1) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.tb-brand:focus-visible,
.scroll-cue:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 8px;
}
.hero :focus-visible, .converge :focus-visible, .demo :focus-visible { outline-color: var(--teal-d); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* shared display type ------------------------------------------------------ */
.kicker {
  color: var(--teal);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-wrap: balance;          /* on phones it breaks into two even lines */
  margin: 0 0 18px;
}
.label-row {
  display: inline-block;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 14px;
}
/* on navy sections */
.label-row.teal-d  { color: var(--teal-d); }
.label-row.flame-d { color: var(--flame-word-d); }

.subtitle { color: var(--muted); font-size: 22px; line-height: 1.4; }

.rule { height: 3px; width: 120px; background: var(--teal); margin: 26px 0; }
.rule.center { margin: 28px auto; }

.mark       { color: var(--teal); }
.mark-flame { color: #e8641e; }   /* flame word, a shade darker: 3.2:1 on paper for large text */
.light .mark-flame { color: var(--flame-word-d); }
.light .mark-teal  { color: var(--teal-d); }

.tiny { font-size: 14px; line-height: 1.45; color: var(--muted); }
.light, .light strong { color: var(--on-navy); }
.light.tiny { color: var(--on-navy-muted); }

.pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  /* solid translucent (no backdrop blur — it sat over the animating hero
     canvas and re-rasterised every frame) */
  background: rgba(255,255,255,0.85);
}
.pill.teal      { color: var(--teal);       border-color: var(--teal); }
.pill.tangerine { color: var(--flame-word); border-color: var(--tangerine); }
.pill.navy      { color: var(--navy);       border-color: var(--navy); }

/* buttons ------------------------------------------------------------------ */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 16px;
  font-weight: 750;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(23,32,42,.14); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: #0b6b6a; border-color: #0b6b6a; }   /* darker on hover keeps white text ≥ 4.5:1 */
.btn.big { font-size: 18px; padding: 15px 32px; margin-top: 26px; }

/* ============================================================ top bar ===== */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  background: var(--paper);   /* opaque: it also sits over the navy sections */
  border-bottom: 1px solid var(--line);
  transform: translateY(-110%);
  transition: transform .35s ease;
}
#topbar.show,
#topbar:focus-within { transform: translateY(0); }   /* tabbing into it brings it in */
/* the compact mark (made for 24–64 px) beside the wordmark; the wordmark's
   baseline is nudged onto the mark's waterline */
.tb-brand { text-decoration: none; display: flex; align-items: center; gap: 8px; }
.tb-mark { width: 28px; height: 28px; display: block; }
.tb-word { height: 18px; width: auto; display: block; position: relative; top: 2px; }
.tb-nav { display: flex; align-items: center; gap: 22px; }
.tb-nav a { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 15px; }
.tb-nav a:hover { color: var(--ink); }
/* active section indicator (set by app.js as you scroll) */
.tb-nav a:not(.tb-cta) { position: relative; }
.tb-nav a:not(.tb-cta).active { color: var(--ink); }
.tb-nav a:not(.tb-cta).active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--teal); border-radius: 2px;
}
.tb-nav a.tb-cta {
  color: var(--teal); border: 1px solid var(--teal);
  padding: 7px 15px; border-radius: 8px;
}
.tb-nav a.tb-cta:hover { background: var(--teal); color: #fff; }

/* ================================================================ hero ==== */
/* a night harbour: the canvas paints sky, sea and waterline; navy is the
   fallback before (or without) JS */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--navy);
  color: var(--on-navy);
}
.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
/* keeps the copy legible where the scene reaches behind it */
.hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(100deg,
    rgba(7,15,34,0.88) 0%,
    rgba(7,15,34,0.66) 38%,
    rgba(7,15,34,0.1) 64%,
    rgba(7,15,34,0) 100%);
  pointer-events: none;
}
.hero .kicker { color: var(--teal-d); }
.hero .subtitle { color: var(--on-navy-muted); }
.hero .rule { background: var(--teal-d); }
.hero .pill { background: rgba(7,15,34,0.72); color: var(--on-navy); border-color: rgba(170,196,225,0.35); }
.hero .pill.teal      { color: var(--teal-d);       border-color: var(--teal-d); }
.hero .pill.tangerine { color: var(--flame-word-d); border-color: var(--tangerine-d); }
.hero .pill.navy      { color: var(--on-navy-muted); border-color: rgba(205,215,227,0.55); }
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
}
/* the pack's lockup: at 60 px the lantern stays above the 48 px minimum, and
   the margin keeps more than one lantern-width of clear space */
.wordmark { margin-bottom: 40px; }
.brand-lockup { height: 60px; width: auto; display: block; }
.hero-title {
  font-size: clamp(46px, 8.2vw, 92px);
  font-weight: 820;
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
  max-width: 14ch;
}
.hero .subtitle { max-width: 600px; }
.hero-pills { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }

/* parallax layers in the hero copy */
[data-depth] { will-change: transform; }

.scroll-cue {
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 3;
  width: 26px; height: 42px;
  border: 2px solid rgba(242,245,249,0.35);
  border-radius: 14px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px;
  width: 4px; height: 8px; margin-left: -2px;
  background: var(--teal-d);
  border-radius: 2px;
  animation: cue 1.6s ease-in-out infinite;
}
@keyframes cue { 0%{opacity:0;transform:translateY(0)} 40%{opacity:1} 80%{opacity:0;transform:translateY(14px)} 100%{opacity:0} }

/* =============================================================== thesis === */
section { position: relative; }
.thesis { padding: 132px 0 120px; }
.big-line {
  font-size: clamp(30px, 4.6vw, 50px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.012em;
  margin: 0 0 40px;
  max-width: 19ch;
}
.big-line.light { max-width: 17ch; }
.thesis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.lead { font-size: 20px; line-height: 1.55; color: var(--muted); margin: 0; }
.lead strong { color: var(--ink); }
.lead.light strong { color: #fff; }
.stack-fig {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 26px;
  box-shadow: 0 18px 50px rgba(23,32,42,0.08);
}
.stack-fig img { display: block; width: 100%; height: auto; }

/* ========================================================== convergence === */
.converge {
  position: relative;
  min-height: 188vh;            /* tall: gives the scroll-driven merge room */
  background: var(--navy);
  color: var(--on-navy);
}
.converge-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}
.converge-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.converge-copy {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: min(720px, 86vw);
  text-align: center;
  pointer-events: none;
}
/* the pinned copy keeps its own transform; don't let reveal fight it */
.converge-copy.reveal { transform: translate(-50%, calc(-50% + 22px)); }
.converge-copy.reveal.in { transform: translate(-50%, -50%); }
/* the heading has a max-width cap; centre that capped box (text-align only
   centres the lines inside it, not the block itself) */
.converge-copy .big-line { margin-left: auto; margin-right: auto; }
.converge-copy .lead { color: var(--on-navy-muted); }
.converge-copy .lead strong { color: #fff; }

/* =========================================================== primitives === */
.primitives { padding: 128px 0 124px; background: var(--paper); }
.section-head {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 820;
  letter-spacing: -0.012em;
  margin: 6px 0 14px;
}
.section-sub { font-size: 20px; color: var(--muted); max-width: 720px; margin: 0 0 52px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--teal);
  border-radius: 16px;
  padding: 22px 24px 26px;
  box-shadow: 0 1px 0 rgba(23,32,42,0.04);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 22px 50px rgba(23,32,42,0.12); }
.card.teal      { border-top-color: var(--teal); }
.card.tangerine { border-top-color: var(--tangerine); }
.card.navy      { border-top-color: var(--navy); }
.card-fig {
  background: #fcfbf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
}
.card-fig img { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.card h3 { font-size: 23px; font-weight: 780; margin: 0 0 8px; }
.card p { font-size: 16.5px; line-height: 1.45; color: var(--muted); margin: 0 0 10px; }
.card .approx { font-size: 14.5px; color: #68727c; margin: 0; }
.card.teal      .approx b { color: var(--teal); }
.card.tangerine .approx b { color: var(--flame-word); }
.card.navy      .approx b { color: var(--navy); }

/* ================================================================ demo ==== */
.demo {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  background: var(--navy-2);    /* slightly lighter navy for variety */
  color: var(--on-navy);
  overflow: hidden;
}
.orbit-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.demo-inner {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin: 0 auto; padding: 96px 32px; width: 100%;
}
.demo-copy { max-width: 560px; }
.demo-copy .lead { color: var(--on-navy-muted); }   /* .lead's grey is for paper */
.demo-links { display: flex; gap: 14px; flex-wrap: wrap; margin: 26px 0 22px; }
.demo .btn { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.22); color: var(--on-navy); }
.demo .btn:hover { background: rgba(255,255,255,0.14); }
.demo .btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.demo .btn.primary:hover { background: #0b6b6a; border-color: #0b6b6a; }   /* darker on hover keeps white text ≥ 4.5:1 */

/* =============================================================== close ==== */
.close { padding: 140px 0 130px; background: var(--paper); text-align: center; }
.quote {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 780;
  line-height: 1.16;
  letter-spacing: -0.01em;
  max-width: 18ch;
  margin: 0 auto;
}
.close-sub { font-size: 20px; color: var(--muted); max-width: 640px; margin: 0 auto; }
.close-sub strong { color: var(--ink); }

.site-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 26px 32px;
  background: var(--ink);
  color: #b8c0c6;
}
.foot-logo { height: 18px; width: auto; display: block; }
.foot-meta {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
}

/* ========================================================= scroll reveal == */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.cards .card { transition: transform .2s ease, box-shadow .2s ease, opacity .7s ease; }
.cards .card.reveal { transition: opacity .7s ease, transform .7s ease; }
.cards .card.reveal.in:nth-child(1) { transition-delay: 0s; }
.cards .card.reveal.in:nth-child(2) { transition-delay: .1s; }
.cards .card.reveal.in:nth-child(3) { transition-delay: .2s; }

/* ============================================================ responsive == */
@media (max-width: 900px) {
  .thesis-grid { grid-template-columns: 1fr; gap: 34px; }
  .cards { grid-template-columns: 1fr; gap: 20px; }
  .tb-nav { gap: 14px; }
  .tb-nav a:not(.tb-cta) { display: none; }
}
@media (max-width: 999px) {
  /* "We run it live." — below this width app.js lays the three orbit nodes out
     in a row under the copy (in this padding); the scrim keeps the copy
     readable over the starfield. Matches the scenes' 1000 px "narrow" switch. */
  .demo-inner { padding-bottom: 190px; }
  .demo-copy {
    background: rgba(13,28,58,0.85);
    border-radius: 14px;
    padding: 20px;
  }
  /* the copy fills the hero's width here; app.js moves the harbour below it
     (into this padding) and fades the sky with height, and this veil quiets
     what still sits behind */
  .hero { padding-bottom: 92px; }
  .scroll-cue { display: none; }            /* it would sit on the harbour */
  .hero-veil {
    background: linear-gradient(180deg,
      rgba(7,15,34,0.55) 0%, rgba(7,15,34,0.55) 72%, rgba(7,15,34,0) 86%);
  }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .wrap, .hero-inner, .demo-inner { padding-left: 22px; padding-right: 22px; }
  .demo-inner { padding-top: 64px; padding-bottom: 180px; }   /* room for the node row */
  .wordmark { margin-bottom: 28px; }
  .brand-lockup { height: 52px; }           /* lantern still above the 48 px minimum */
  .pill { font-size: 13px; padding: 5px 12px; }
  .subtitle { font-size: 19px; }
  .lead, .section-sub { font-size: 18px; }
  .thesis { padding: 96px 0 88px; }
  .primitives { padding: 92px 0 92px; }
  .converge { min-height: 184vh; }
}

/* ===================================================== reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span { animation: none; }
  .btn:hover, .card:hover { transform: none; }
  [data-depth] { transform: none !important; }
}
