/* R² Labs — brand system per brand book v4.0 (Harris).
   Vishnu ground · Coconino type · Kaibab captions · Redwall mark/actions only.
   Archivo for humans, JetBrains Mono for machine data. Squares, hairlines, no radius. */
:root {
  --vishnu: #08090C;
  --schist: #101318;
  --rule: #23262D;
  --coconino: #E9E3D6;
  --kaibab: #868A8E;
  --redwall: #C4652B;
  --shadow: 0 1px 22px rgba(8, 9, 12, 0.9), 0 1px 5px rgba(8, 9, 12, 0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--vishnu);
  color: var(--coconino);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase;
}

a { color: var(--coconino); text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--redwall); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
svg { display: block; }

/* ---- the world: fixed behind everything ---- */
#terrain {
  position: fixed; inset: 0; z-index: 0;
  width: 100vw; height: 100vh;
  opacity: 0; transition: opacity 1.1s ease;
}
#terrain.ready { opacity: 1; }
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 130% 100% at 50% 42%, transparent 62%, rgba(8, 9, 12, 0.5) 100%),
    linear-gradient(to bottom, rgba(8, 9, 12, 0.45), transparent 16%, transparent 80%, rgba(8, 9, 12, 0.66));
}

/* ---- top bar: the block leads ---- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.6rem;
}
.tbmk { display: flex; align-items: center; gap: 11px; }
.tbmk svg { width: 30px; height: 30px; }
.tbmk b { font-weight: 800; font-size: 16px; letter-spacing: 0.06em; text-shadow: var(--shadow); }
.toplink {
  color: var(--coconino);
  font-weight: 800; font-size: 12px;
  letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid rgba(232, 227, 214, 0.28);
  padding: 9px 15px;
  background: rgba(8, 9, 12, 0.35);
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}
.toplink:hover { border-color: var(--redwall); color: var(--redwall); background: rgba(8, 9, 12, 0.6); }

/* ---- hero screen ---- */
.hero-screen {
  position: relative; z-index: 2;
  height: 100svh; min-height: 560px;
  display: flex; align-items: center;
}
.hero-inner {
  padding: 0 2rem;
  max-width: 1100px; margin: 0 auto; width: 100%;
  will-change: opacity, transform;
}
h1 {
  font-weight: 800; letter-spacing: -0.035em;
  font-size: clamp(2.9rem, 7.6vw, 5.9rem);
  line-height: 0.96;
  text-shadow: var(--shadow);
}
.hero-sub {
  margin-top: 1.5rem;
  color: var(--coconino); opacity: 0.9;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  text-shadow: var(--shadow);
}
.scroll-hint {
  margin-top: 3rem;
  font-size: 0.9rem; font-weight: 400;
  color: var(--coconino); opacity: 0.62;
  animation: sink 2.6s ease-in-out infinite;
  text-shadow: var(--shadow);
}
@keyframes sink { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---- section heads: plate numbering ---- */
.phead { display: flex; align-items: baseline; gap: 14px; }
.phead h2 {
  font-weight: 800; letter-spacing: -0.022em;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1;
  text-shadow: var(--shadow);
}

/* ---- offerings stage: pinned, floating type ---- */
.stage-wrap { position: relative; z-index: 2; height: 320vh; }
.stage {
  position: sticky; top: 0;
  height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
  will-change: opacity, transform;
}
.stage-inner { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 2rem; }
.stage .phead { margin-bottom: 2.4rem; }
.constellation {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.2rem 3.2rem;
  align-items: start;
}
.offer { will-change: transform; translate: var(--dx, 0px) var(--dy, 0px); }
.offer .num {
  display: block; margin-bottom: 0.35rem;
  font-weight: 600; font-size: 0.8rem; letter-spacing: 0.02em;
  color: var(--redwall);
  font-variant-numeric: tabular-nums;
  text-shadow: var(--shadow);
}
.offer h3 { font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; text-shadow: var(--shadow); }
.offer p {
  margin-top: 0.5rem;
  color: var(--coconino); opacity: 0.72;
  font-size: 0.9rem; max-width: 22em; line-height: 1.5;
  text-shadow: var(--shadow);
}
.offer.t1 h3 { font-size: clamp(2rem, 3.5vw, 3rem); }
.offer.t2 h3 { font-size: clamp(1.6rem, 2.7vw, 2.25rem); }
.offer.t3 h3 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); }
.offer.drop { margin-top: 2rem; }
.offer.lift { margin-top: -1.4rem; }

.js .offer {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.9s ease calc(var(--i) * 90ms), transform 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) calc(var(--i) * 90ms);
}
.js .stage.active .offer { opacity: 1; transform: none; }

/* ---- content ---- */
main { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* ---- selected work: specimens, not screenshots ---- */
#work { padding: 16vh 0 6vh; }
#work .phead { margin-bottom: 1rem; }
.work-sub { color: var(--coconino); opacity: 0.7; font-size: 0.98rem; max-width: 44em; text-shadow: var(--shadow); margin-bottom: 4rem; }
.spec-row {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 2.6rem;
  align-items: center;
  padding: 3.4rem 0;
  border-top: 1px solid var(--rule);
}
.spec-row:last-child { border-bottom: 1px solid var(--rule); }

.spec-meta .spec-url { color: var(--coconino); opacity: 0.8; display: inline-block; margin-bottom: 0.7rem; transition: color 0.3s ease; text-shadow: var(--shadow); }
.spec-meta:hover .spec-url, .spec-url:hover { color: var(--redwall); }
.spec-meta h3 {
  font-weight: 800; letter-spacing: -0.028em;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.08;
  margin-bottom: 0.6rem;
  text-shadow: var(--shadow);
}
.spec-meta p { color: var(--coconino); opacity: 0.74; font-size: 0.95rem; max-width: 34em; text-shadow: var(--shadow); }

/* the demo: a browser window that scrolls the real site */
.site-demo { min-width: 0; }
.browser { background: var(--schist); border: 1px solid var(--rule); }
.browser-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--rule);
}
.bdots { display: flex; gap: 5px; }
.bdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); }
.burl { color: var(--kaibab); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bview { --fh: clamp(280px, 26vw, 360px); height: var(--fh); overflow: hidden; }
.bvid { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

/* the power panel: each system performing its strength */
.power {
  display: flex; align-items: center; gap: 8px;
  background: var(--schist);
  border: 1px solid var(--rule); border-top: 0;
  padding: 10px 13px;
  color: var(--kaibab);
  min-height: 2.4rem;
  overflow: hidden;
}
.power-right { margin-left: auto; color: var(--kaibab); opacity: 0.7; }

/* PROOF: the accuracy meter fills, the numbers count */
.power-proof { display: block; padding: 0; }
.meter { position: relative; height: 30px; border-bottom: 1px solid var(--rule); background: var(--vishnu); }
.meter-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: rgba(217, 164, 65, 0.22);
  border-right: 1px solid #D9A441;
  transition: width 2.2s cubic-bezier(0.2, 0.6, 0.2, 1) 0.4s;
}
.reveal.in .meter-fill { width: 87.8%; }
.meter-label { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: #D9A441; }
.proof-counts { padding: 9px 13px; border-bottom: 1px solid var(--rule); color: var(--kaibab); }
.proof-counts b, .aam-counts b { color: var(--coconino); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip-proof { padding: 9px 13px; color: #D9A441; text-transform: none; letter-spacing: 0.02em; font-size: 0.74rem; min-height: 2.2rem; display: block; }
.chip-proof .cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* AAM: the coverage counts, the market ticks */
.power-aam { display: block; padding: 0; }
.aam-counts { padding: 9px 13px; border-bottom: 1px solid var(--rule); color: var(--kaibab); }
.chip-ticker { padding: 10px 0; overflow: hidden; white-space: nowrap; }


.livedot {
  width: 6px; height: 6px; background: var(--redwall);
  display: inline-block; flex: none;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.ticker-track {
  display: inline-block; white-space: nowrap;
  animation: marquee 30s linear infinite;
  will-change: transform;
}
.chip-ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.up { color: #6FBF8F; }
.down { color: #C96A5E; }

/* ---- studio / contact ---- */
.station { min-height: 62vh; display: flex; align-items: center; }
.studio-block { max-width: 46rem; }
.studio-block .phead { margin-bottom: 1.6rem; }
.studio-text {
  font-weight: 800; letter-spacing: -0.028em;
  font-size: clamp(1.5rem, 2.9vw, 2.2rem); line-height: 1.18;
  text-shadow: var(--shadow);
}
.studio-sub { margin-top: 1.3rem; color: var(--coconino); opacity: 0.72; text-shadow: var(--shadow); }

.contact { min-height: 58vh; }
.contact-line {
  font-weight: 800; letter-spacing: -0.035em;
  font-size: clamp(2.4rem, 5.6vw, 4.2rem);
  margin-bottom: 1.5rem;
  text-shadow: var(--shadow);
}
.contact-btn {
  display: inline-block;
  background: var(--redwall); color: var(--vishnu);
  font-weight: 800; font-size: 0.9rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 13px 24px;
}
.contact-btn:hover { background: #d5763a; color: var(--vishnu); }
.contact-alt { margin-left: 1.2rem; color: var(--coconino); opacity: 0.72; text-shadow: var(--shadow); }
.contact-alt:hover { color: var(--coconino); }

/* ---- footer: the block closes the page ---- */
footer {
  position: relative; z-index: 2;
  background: rgba(8, 9, 12, 0.82);
  border-top: 1px solid var(--rule);
}
.foot-in {
  max-width: 1100px; margin: 0 auto;
  padding: 1.8rem 2rem;
  display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap;
}
.ftmk { display: flex; align-items: center; gap: 10px; color: var(--coconino); }
.ftmk .mono { opacity: 0.78; }
.ftmk svg { width: 18px; height: 18px; }
.colophon { color: var(--coconino); opacity: 0.6; font-size: 0.85rem; text-align: right; max-width: 38em; }

/* ---- reveals (hidden only when JS is running) ---- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s ease, transform 1s ease; }
.js .reveal.in { opacity: 1; transform: none; }

.no3d .vignette { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .offer { opacity: 1; transform: none; transition: none; }
  .scroll-hint, .livedot { animation: none; }
  .ticker-track { animation: none; }
  .meter-fill { transition: none; }
}

@media (max-width: 820px) {
  .stage-wrap { height: auto; }
  .stage { position: static; height: auto; padding: 16vh 0; overflow: visible; }
  .constellation { grid-template-columns: 1fr; gap: 2.4rem; }
  .offer.drop, .offer.lift { margin-top: 0; }
  .spec-row { grid-template-columns: 1fr; gap: 1.6rem; padding: 2.6rem 0; }
  .station { min-height: 52vh; }
  .colophon { text-align: left; }
}
