/* ============================================================================
   Tessera — landing page
   Palette and type reuse the deck (deck-tech-2026-06-15-demo.md) and the
   browser demo (demo-gui/static/style.css). Warm editorial paper, not space.
   ========================================================================== */

:root {
  --ink:    #17202a;
  --muted:  #5b6570;
  --paper:  #fbfaf7;
  --paper-2:#f4f2ec;
  --line:   #dfe5e8;
  --teal:   #0e7c7b;
  --teal-2: #12a3a0;
  --coral:  #d96c55;
  --amber:  #c9962b;
  --green:  #4b8f6a;
  --navy:   #23395b;

  --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-2 reads on both the paper and the navy sections */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.tb-brand:focus-visible,
.scroll-cue:focus-visible {
  outline: 3px solid var(--teal-2);
  outline-offset: 3px;
  border-radius: 8px;
}

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;
  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;
}
.label-row.coral { color: var(--coral); }
.label-row.amber { color: var(--amber); }
.label-row.green { color: var(--green); }
.label-row.navy  { color: var(--navy); }

.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-coral  { color: var(--coral); }
.mark-green  { color: var(--green); }

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

.pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  margin: 0 8px 0 0;
  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.coral { color: var(--coral); border-color: var(--coral); }
.pill.amber { color: var(--amber); border-color: var(--amber); }
.pill.green { color: var(--green); border-color: var(--green); }

/* 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: var(--teal-2); border-color: var(--teal-2); }
.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: rgba(251,250,247,0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-110%);
  transition: transform .35s ease;
}
#topbar.show { transform: translateY(0); }
.tb-brand { text-decoration: none; display: flex; align-items: center; gap: 9px; }
.tb-mark { width: 22px; height: 22px; display: block; }
.tb-word { font-weight: 800; letter-spacing: 0.16em; color: var(--navy); font-size: 19px; }
.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 ==== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 78% 18%, #ffffff 0%, var(--paper) 46%, #f1efe8 100%);
}
.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
/* keeps text legible over the busiest part of the mosaic */
.hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(100deg,
    rgba(251,250,247,0.92) 0%,
    rgba(251,250,247,0.74) 38%,
    rgba(251,250,247,0.18) 66%,
    rgba(251,250,247,0.0) 100%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
}
.wordmark { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; flex-wrap: wrap; }
.brand-mark { width: 38px; height: 38px; display: block; }
.brand-word {
  font-weight: 800; letter-spacing: 0.2em; color: var(--navy);
  font-size: 30px; line-height: 1;
}
.brand-by {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.brand-by img { height: 17px; display: block; position: relative; top: 1px; }
.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; }

/* 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(23,32,42,0.32);
  border-radius: 14px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px;
  width: 4px; height: 8px; margin-left: -2px;
  background: var(--teal);
  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: #f3f1ea;
}
.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: #c9d6d4; }
.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.green { border-top-color: var(--green); }
.card.amber { border-top-color: var(--amber); }
.card.teal  { border-top-color: var(--teal); }
.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%; height: 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: #7b858d; margin: 0; }
.card.green .approx b { color: var(--green); }
.card.amber .approx b { color: var(--amber); }
.card.teal  .approx b { color: var(--teal); }

/* ================================================================ demo ==== */
.demo {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  background: #182a45;          /* slightly lighter navy for variety */
  color: #f3f1ea;
  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-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: #f3f1ea; }
.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: var(--teal-2); border-color: var(--teal-2); }

/* =============================================================== 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 { font-weight: 800; letter-spacing: 0.16em; color: #f3f1ea; font-size: 16px; }
.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: 560px) {
  body { font-size: 17px; }
  .wrap, .hero-inner, .demo-inner { padding-left: 22px; padding-right: 22px; }
  .wordmark { margin-bottom: 28px; }
  .wordmark img { height: 32px; }
  .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; }
}
