/* ============================================================
   TerraQura — design system
   Editorial + earthy modernist
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,200..700;1,6..72,200..700&family=Geist:wght@300..700&family=JetBrains+Mono:wght@300..600&display=swap');

/* ---------- TOKENS ---------- */
:root {
  /* Surfaces — warm cream canvas */
  --bone:        #f3ecdc;
  --paper:       #f9f4e8;
  --paper-2:     #ede4cf;
  --mist:        #e1d8c2;
  --line:        rgba(20, 30, 24, 0.12);
  --line-strong: rgba(20, 30, 24, 0.22);

  /* Ink */
  --ink:        #14201a;        /* near-black forest */
  --ink-2:      #28342c;
  --ink-3:      #4a554d;
  --ink-soft:   #6c7770;
  --ink-faint:  #94998f;

  /* Accents — same chroma family */
  --moss:    oklch(34% 0.06 155);   /* deep forest */
  --moss-2:  oklch(46% 0.08 155);
  --signal:  oklch(70% 0.16 152);   /* live data green */
  --clay:    oklch(58% 0.13 45);    /* terracotta accent */
  --sun:     oklch(82% 0.10 80);    /* warm highlight */

  /* Reverse (dark sections) */
  --night:      #0d1410;
  --night-2:    #131c17;
  --night-line: rgba(243, 236, 220, 0.10);
  --night-ink:  #e7e1d0;
  --night-ink-soft: rgba(231, 225, 208, 0.62);

  /* Type */
  --serif: "Newsreader", "Times New Roman", serif;
  --sans:  "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono:  "JetBrains Mono", "SFMono-Regular", Menlo, monospace;

  --radius:   2px;
  --radius-2: 6px;
  --shell:    1280px;
  --shell-wide: 1440px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- RESET ---------- */
*,*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--sans);
  background: var(--bone);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4,h5,h6,p { margin: 0; }
ul,ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

::selection { background: var(--ink); color: var(--bone); }

/* ---------- TYPOGRAPHY ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before { content: none; display: none; }
.eyebrow { padding-left: 0; }

.kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.display {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 0.98;
  font-size: clamp(48px, 7.4vw, 116px);
  color: var(--ink);
  text-wrap: balance;
}
.display em {
  font-style: italic;
  font-weight: 300;
  color: var(--moss);
}

.h-xl {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: clamp(44px, 4.4vw, 64px);
  text-wrap: balance;
}
.h-xl em { font-style: italic; color: var(--moss); font-weight: 400; }

.h-l {
  font-family: var(--serif);
  font-weight: 350;
  letter-spacing: -0.015em;
  line-height: 1.05;
  font-size: clamp(32px, 3.6vw, 52px);
  text-wrap: balance;
}
.h-l em { font-style: italic; color: var(--moss); }

.h-m {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
  font-size: clamp(22px, 2vw, 28px);
  text-wrap: balance;
}

.lede {
  font-family: var(--sans);
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 62ch;
  font-weight: 400;
  text-wrap: pretty;
}

.body { color: var(--ink-3); line-height: 1.6; text-wrap: pretty; }

.mono { font-family: var(--mono); }

/* ---------- LAYOUT ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 32px;
}
.shell.wide { max-width: var(--shell-wide); }
@media (max-width: 720px) { .shell { padding: 0 20px; } }

section { position: relative; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 236, 220, 0.78);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease);
}
.site-header.is-dark {
  background: rgba(13, 20, 16, 0.82);
  border-bottom-color: var(--night-line);
  color: var(--night-ink);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  height: 68px;
  max-width: var(--shell-wide);
  margin: 0 auto;
  padding: 0 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: inherit;
}
.brand-mark {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-img { height: 26px; width: auto; display: block; }
.site-header .brand-img { filter: none; }
.site-footer .brand-img { filter: invert(1) brightness(2); height: 24px; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}
.nav a {
  position: relative;
  font-size: 13.5px;
  font-weight: 450;
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: 100px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.site-header.is-dark .nav a { color: var(--night-ink); }
.nav a:hover { background: rgba(20, 30, 24, 0.06); }
.site-header.is-dark .nav a:hover { background: rgba(243, 236, 220, 0.08); }
.nav a[aria-current="page"] {
  color: var(--ink);
}
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 1px;
  background: currentColor;
  opacity: .55;
}

.header-actions { display: flex; align-items: center; gap: 12px; }

.text-link {
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 8px 4px;
  display: inline-flex; align-items: center; gap: 6px;
  border-bottom: 1px solid transparent;
}
.text-link:hover { color: var(--ink); border-bottom-color: var(--ink); }
.site-header.is-dark .text-link { color: var(--night-ink); }

@media (max-width: 1080px) {
  .nav { display: none; }
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 100px;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
  cursor: pointer;
}
.btn .arrow {
  width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .25s var(--ease);
}
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary {
  background: var(--ink);
  color: var(--bone);
}
.btn-primary:hover { background: #1f2d24; }

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); }

.btn-light {
  background: var(--bone);
  color: var(--ink);
}
.btn-light:hover { background: #ffffff; }

.btn-night-ghost {
  background: transparent;
  border-color: var(--night-line);
  color: var(--night-ink);
}
.btn-night-ghost:hover { border-color: var(--night-ink); }

.btn-lg { padding: 14px 22px; font-size: 14.5px; }

.btn-icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--ink); color: var(--bone); border-color: var(--ink); }

/* ---------- ANNOUNCEMENT BAR ---------- */
.marquee {
  background: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  overflow: hidden;
}
.marquee-inner {
  display: flex;
  gap: 56px;
  padding: 10px 0;
  white-space: nowrap;
  animation: marq 60s linear infinite;
  width: max-content;
}
.marquee-inner span { display: inline-flex; align-items: center; gap: 10px; }
.marquee-inner .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--signal); display: inline-block; box-shadow: 0 0 12px var(--signal); }
@keyframes marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- HERO BASE ---------- */
.hero {
  position: relative;
  padding: 72px 0 56px;
}
.hero-eyebrow-row {
  display: flex; align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-bottom: 56px;
}
.hero-eyebrow-row .right { display: flex; gap: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }

/* ---------- LIVE TICKER ---------- */
.ticker {
  background: var(--ink);
  color: var(--night-ink);
  border-radius: var(--radius-2);
  padding: 18px 22px;
  font-family: var(--mono);
  font-size: 12px;
  display: grid;
  gap: 14px;
}
.ticker-head {
  display: flex; align-items: center; gap: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  font-size: 10.5px; color: var(--night-ink-soft);
  border-bottom: 1px solid var(--night-line);
  padding-bottom: 12px;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 10px var(--signal); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.ticker-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  font-size: 11.5px;
  padding: 4px 0;
  color: var(--night-ink);
}
.ticker-row .t { color: var(--night-ink-soft); }
.ticker-row .id { color: var(--signal); }
.ticker-row .v { color: var(--night-ink); font-feature-settings: "tnum"; }

/* ---------- METRICS / NUMBERS ---------- */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metrics-row .m {
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metrics-row .m:last-child { border-right: 0; }
.metrics-row .m .v {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(34px, 3.4vw, 52px);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.metrics-row .m .l {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
@media (max-width: 880px) {
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .metrics-row .m { border-right: 0; border-top: 1px solid var(--line); }
  .metrics-row .m:nth-child(odd) { border-right: 1px solid var(--line); }
}

/* ---------- SECTION HEAD ---------- */
.section { padding: 110px 0; position: relative; }
.section.tight { padding: 80px 0; }
.section.dark {
  background: var(--night);
  color: var(--night-ink);
}
.section.dark .eyebrow,
.section.dark .kicker { color: var(--night-ink-soft); }
.section.dark .lede,
.section.dark .body { color: rgba(231, 225, 208, 0.74); }
.section.dark .display em,
.section.dark .h-xl em,
.section.dark .h-l em { color: var(--signal); }

.section.paper { background: var(--paper); }
.section.paper-2 { background: var(--paper-2); }

.section-head {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 64px;
  align-items: end;
  margin-bottom: 56px;
}
.section-head .lede { margin-top: 0; }
@media (max-width: 880px) {
  .section-head { grid-template-columns: 1fr; gap: 24px; }
  .section { padding: 72px 0; }
}

/* ---------- CARDS ---------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease);
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
  background: var(--mist);
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 24px 24px 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; letter-spacing: -0.01em; line-height: 1.15; }
.card-body p { color: var(--ink-3); font-size: 14.5px; line-height: 1.55; }
.card-meta { display: flex; align-items: center; justify-content: space-between; }

/* dark variant */
.section.dark .card { background: var(--night-2); border-color: var(--night-line); color: var(--night-ink); }
.section.dark .card-body p { color: var(--night-ink-soft); }

/* ---------- BULLETS ---------- */
.bullet {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-2);
}
.bullet:last-child { border-bottom: 1px solid var(--line); }
.bullet .n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
  padding-top: 2px;
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--night);
  color: var(--night-ink);
  padding: 80px 0 32px;
  position: relative;
  overflow: hidden;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(5, 1fr);
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--night-line);
}
.footer-grid h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--night-ink-soft);
  margin-bottom: 18px;
  font-weight: 400;
}
.footer-grid ul { display: grid; gap: 10px; }
.footer-grid a {
  font-size: 14px;
  color: var(--night-ink);
  opacity: 0.85;
  transition: opacity .2s;
}
.footer-grid a:hover { opacity: 1; }
.footer-brand .brand { color: var(--night-ink); margin-bottom: 18px; }
.footer-brand p { color: var(--night-ink-soft); font-size: 14.5px; max-width: 32ch; line-height: 1.55; }
.footer-bottom {
  margin-top: 32px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--night-ink-soft);
}
.footer-bottom-links { display: flex; gap: 28px; }
.footer-bottom-links a:hover { color: var(--night-ink); }

.footer-mark {
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(110px, 18vw, 240px);
  letter-spacing: -0.04em;
  line-height: 0.85;
  color: rgba(243, 236, 220, 0.05);
  margin: 64px 0 -24px;
  user-select: none;
  pointer-events: none;
}

@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; gap: 16px; align-items: flex-start; }
}

/* ---------- DECOR ---------- */
.rule {
  border-top: 1px solid var(--line);
}
.rule-strong { border-top: 1px solid var(--line-strong); }

.tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  padding: 6px 12px;
  background: var(--paper);
}
.tag .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 8px var(--signal); }

.section.dark .tag { background: transparent; border-color: var(--night-line); color: var(--night-ink-soft); }

/* ---------- IMAGE FRAMES ---------- */
.frame {
  position: relative;
  border-radius: var(--radius-2);
  overflow: hidden;
  background: var(--mist);
}
.frame::after {
  content: "";
  position: absolute; inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: inherit;
  pointer-events: none;
}
.frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; display: block; }

.frame-caption {
  position: absolute;
  left: 16px; bottom: 16px;
  background: rgba(13, 20, 16, 0.78);
  backdrop-filter: blur(8px);
  color: var(--night-ink);
  border-radius: 4px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 10px;
}

/* ---------- SCROLL REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in {
  opacity: 1; transform: none;
}
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

/* ---------- DIAGRAM (evidence chain) ---------- */
.chain {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  background: var(--paper);
  overflow: hidden;
}
.chain .step {
  padding: 32px 28px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  background:
    linear-gradient(to right, transparent calc(100% - 1px), var(--line) calc(100% - 1px));
}
.chain .step:last-child { border-right: 0; }
.chain .step .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex; align-items: center; gap: 10px;
}
.chain .step .num .d {
  width: 24px; height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2);
}
.chain .step h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.chain .step p { font-size: 14px; color: var(--ink-3); line-height: 1.55; }

@media (max-width: 880px) {
  .chain { grid-template-columns: 1fr; }
  .chain .step { border-right: 0; border-bottom: 1px solid var(--line); }
  .chain .step:last-child { border-bottom: 0; }
}

/* ---------- IMAGE PLACEHOLDER (fallback) ---------- */
.placeholder {
  background:
    repeating-linear-gradient(135deg, var(--mist) 0 8px, var(--paper-2) 8px 16px);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
}

/* ---------- UTILITIES ---------- */
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 32px; }
.gap-xl { gap: 56px; }
.between { justify-content: space-between; }
.center { justify-content: center; align-items: center; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--ink-soft); }
.tnum { font-feature-settings: "tnum"; }

/* dotted background (used in hero) */
.dotted {
  background-image: radial-gradient(rgba(20,30,24,0.10) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* hero noise overlay */
.noise {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.4; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.078 0 0 0 0 0.118 0 0 0 0 0.094 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* skip-link */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bone);
  padding: 10px 14px; font-size: 12px;
}
.skip-link:focus { left: 16px; top: 16px; z-index: 100; }
