/* ============================================================
   SHREVIA INTELLIGENCE LABS — design system
   Paper & ink editorial · copper accents · instrument panels
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  /* surfaces */
  --paper:      #f4f0e6;
  --paper-2:    #ede8da;
  --paper-3:    #e5dfcf;
  --night:      #14110c;
  --night-2:    #1b1812;
  --night-3:    #242019;

  /* ink */
  --ink:        #1a1712;
  --ink-2:      #57503f;
  --ink-3:      #8d8470;
  --ink-faint:  rgba(26, 23, 18, 0.12);
  --line:       rgba(26, 23, 18, 0.14);
  --line-soft:  rgba(26, 23, 18, 0.08);

  /* on dark */
  --bone:       #efe9db;
  --bone-2:     #b3ab97;
  --bone-3:     #7d7663;
  --line-n:     rgba(239, 233, 219, 0.13);
  --line-n-soft:rgba(239, 233, 219, 0.07);

  /* accent */
  --copper:       #b35420;
  --copper-deep:  #8f3f14;
  --copper-soft:  rgba(179, 84, 32, 0.10);
  --copper-line:  rgba(179, 84, 32, 0.35);
  --sage:         #4e7c58;

  /* type */
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:  "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono:  "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  /* scale */
  --text-hero:  clamp(2.9rem, 6.6vw, 6.1rem);
  --text-h1:    clamp(2.5rem, 5.2vw, 4.6rem);
  --text-h2:    clamp(1.9rem, 3.6vw, 3.1rem);
  --text-h3:    clamp(1.25rem, 1.8vw, 1.5rem);
  --text-body:  1.0rem;
  --text-small: 0.875rem;
  --text-micro: 0.6875rem;

  /* rhythm */
  --space-section: clamp(5.5rem, 11vw, 9.5rem);
  --container: 1240px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 9px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-lift: 0 24px 48px -24px rgba(26, 23, 18, 0.28);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(120% 90% at 50% 0%, #f7f4ec 0%, var(--paper) 55%, #efeadc 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

::selection { background: var(--copper); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- grain overlay ---------- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 2000;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 0.04'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- type helpers ---------- */
.serif    { font-family: var(--serif); }
.accent-i {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  letter-spacing: -0.01em;
  color: var(--copper-deep);
}
.band-dark .accent-i { color: #d89a6e; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--mono);
  font-size: var(--text-micro);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow .tick {
  width: 1.6rem;
  height: 1px;
  background: var(--copper);
  display: inline-block;
}
.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--copper);
  display: inline-block;
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(179, 84, 32, 0.45); }
  50%      { box-shadow: 0 0 0 7px rgba(179, 84, 32, 0); }
}

.h-display {
  font-family: var(--serif);
  font-weight: 360;
  font-size: var(--text-hero);
  line-height: 1.02;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.h-section {
  font-family: var(--serif);
  font-weight: 380;
  font-size: var(--text-h2);
  line-height: 1.08;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.lede {
  font-size: clamp(1.02rem, 1.35vw, 1.18rem);
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 36em;
}
.body-dim { color: var(--ink-2); }
.mono-note {
  font-family: var(--mono);
  font-size: var(--text-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* sketch underline — draws itself in on reveal */
.sketch {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.sketch svg {
  position: absolute;
  left: -2%;
  bottom: -0.14em;
  width: 104%;
  height: 0.32em;
  overflow: visible;
}
.sketch svg path {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
}
.in .sketch svg path,
.sketch.in svg path { animation: sketch-draw 1.1s 0.45s var(--ease-out) forwards; }
@keyframes sketch-draw { to { stroke-dashoffset: 0; } }

/* ---------- layout ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-wide { max-width: 1400px; }

.section { padding-block: var(--space-section); position: relative; }
.section-tight { padding-block: clamp(3.5rem, 7vw, 6rem); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
.section-head .lede { margin-top: 1.1rem; }

.rule { border: 0; border-top: 1px solid var(--line); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.45s var(--ease-out), background 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.45s var(--ease-out);
  will-change: transform;
}
.btn:hover {
  background: var(--copper-deep);
  border-color: var(--copper-deep);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -16px rgba(143, 63, 20, 0.55);
}
.btn .arr { transition: transform 0.35s var(--ease-out); }
.btn:hover .arr { transform: translateX(4px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 0 16px 30px -18px rgba(26, 23, 18, 0.5);
}

.band-dark .btn { background: var(--bone); border-color: var(--bone); color: var(--night); }
.band-dark .btn:hover { background: #d89a6e; border-color: #d89a6e; color: var(--night); }
.band-dark .btn-ghost { background: transparent; color: var(--bone); border-color: var(--line-n); }
.band-dark .btn-ghost:hover { background: var(--bone); color: var(--night); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--copper-line);
  padding-bottom: 2px;
  transition: gap 0.3s var(--ease-out), border-color 0.3s;
}
.link-arrow:hover { gap: 0.85rem; border-color: var(--copper); }

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background 0.4s, box-shadow 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(244, 240, 230, 0.82);
  border-bottom-color: var(--line-soft);
}
/* blur lives on a pseudo-element: backdrop-filter on the header
   itself would make it the containing block for the fixed
   .mobile-menu, collapsing the menu to a transparent sliver */
.site-header.scrolled::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 76px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--serif);
  font-weight: 480;
  font-size: 1.28rem;
  letter-spacing: 0.01em;
}
.brand .mark { width: 30px; height: 30px; }
.brand sup {
  font-family: var(--mono);
  font-size: 0.5em;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  margin-left: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 2.6vw, 2.4rem);
}
.nav-links a {
  position: relative;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-2);
  padding: 0.4rem 0;
  transition: color 0.25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--copper);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.active { color: var(--ink); }

.nav-cta {
  font-size: 0.88rem;
  padding: 0.62rem 1.25rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  align-items: center;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.6px;
  background: var(--ink);
  transition: transform 0.35s var(--ease-out), opacity 0.25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.3px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  inset: 76px 0 0 0;
  z-index: 990;
  background: var(--paper);
  padding: 2.5rem var(--gutter) 3rem;
  flex-direction: column;
  gap: 0.4rem;
  border-top: 1px solid var(--line-soft);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 380;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-menu a .mono-note { font-size: 0.62rem; }
.mobile-menu a.active { color: var(--copper-deep); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 110px;
  padding-bottom: clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  width: 100%;
}
.hero-copy { position: relative; z-index: 3; }
.hero-copy .eyebrow { margin-bottom: 2rem; }
.hero-copy .lede { margin-top: 2rem; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.6rem;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.8rem;
  margin-top: clamp(2.8rem, 5vw, 4.2rem);
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.hero-meta div { min-width: 110px; }
.hero-meta .k {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.35rem;
}
.hero-meta .v {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 420;
}

/* hero 3D stage */
.hero-stage {
  position: relative;
  z-index: 1;
  aspect-ratio: 1 / 1.05;
  max-height: 78vh;
}
.hero-stage canvas,
.scene-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
/* home hero only — the substrate stage lifts to face the headline,
   and its canvas bleeds past the stage so the sphere reads
   full-bleed while the camera keeps every particle in frame
   (max-width: none defeats the global canvas reset above).
   Other pages' scenes (e.g. the technology stack) keep the
   default inset:0 geometry. */
.stage-substrate {
  top: -4.5rem;
}
#substrate-scene {
  left: -12%;
  top: -13.5%;
  width: 118% !important;
  height: 118% !important;
  max-width: none;
}
.stage-caption {
  position: absolute;
  left: 50%;
  bottom: -0.5rem;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.stage-caption::before,
.stage-caption::after {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--line);
}
.scene-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0.9;
}
.scene-fallback svg { width: 88%; height: auto; }

/* ---------- marquee ---------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding-block: 1.05rem;
  background: rgba(229, 223, 207, 0.35);
}
.marquee-track {
  display: flex;
  gap: 3.5rem;
  width: max-content;
  animation: marquee 42s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track ul {
  display: flex;
  gap: 3.5rem;
  align-items: center;
  flex-shrink: 0;
}
.marquee-track li {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.marquee-track li::after {
  content: "✳";
  color: var(--copper);
  font-size: 0.8rem;
  letter-spacing: 0;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card {
  background: var(--paper);
  padding: clamp(1.6rem, 2.6vw, 2.4rem);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.2rem;
  position: relative;
  transition: background 0.45s var(--ease-out);
}
.card:hover { background: var(--paper-2); }
.card .icon {
  width: 44px;
  height: 44px;
  color: var(--copper-deep);
  margin-bottom: 1.4rem;
}
.card .icon svg { width: 100%; height: 100%; }
.card h3 {
  font-family: var(--serif);
  font-size: var(--text-h3);
  font-weight: 460;
  letter-spacing: -0.01em;
  margin-bottom: 0.7rem;
}
.card p { color: var(--ink-2); font-size: 0.94rem; }
.card .idx {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card .idx::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
  margin-left: 1rem;
}

/* tilt (set via JS) */
.tilt { transform-style: preserve-3d; transition: transform 0.5s var(--ease-out); }

/* ---------- stats band ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
}
.stat {
  padding: clamp(2rem, 4vw, 3.2rem) clamp(1.2rem, 2.5vw, 2.4rem);
  border-left: 1px solid var(--line);
  position: relative;
}
.stat:first-child { border-left: 0; }
.stat .v {
  font-family: var(--serif);
  font-weight: 330;
  font-size: clamp(2.6rem, 5vw, 4.3rem);
  line-height: 1;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}
.stat .v .suffix { font-size: 0.45em; color: var(--copper-deep); font-style: italic; }
.stat .l {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- dark band ---------- */
.band-dark {
  background: var(--night);
  background-image: radial-gradient(90% 130% at 80% -10%, #221c11 0%, var(--night) 52%);
  color: var(--bone);
}
.band-dark .lede,
.band-dark .body-dim { color: var(--bone-2); }
.band-dark .mono-note { color: var(--bone-3); }
.band-dark .eyebrow { color: var(--bone-2); }
.band-dark .rule { border-color: var(--line-n); }

.quote-block { max-width: 56rem; }
.quote-block blockquote {
  font-family: var(--serif);
  font-weight: 340;
  font-size: clamp(1.7rem, 3.4vw, 2.9rem);
  line-height: 1.28;
  letter-spacing: -0.014em;
  text-wrap: balance;
}
.quote-block blockquote em {
  font-style: italic;
  color: #d89a6e;
}
.quote-block cite {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2.2rem;
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-3);
}
.quote-block cite::before {
  content: "";
  width: 2.4rem;
  height: 1px;
  background: var(--copper);
}

/* ---------- instrument / telemetry panel ---------- */
.instrument {
  background: var(--night);
  color: var(--bone);
  border-radius: var(--radius);
  border: 1px solid rgba(26, 23, 18, 0.7);
  box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(239, 233, 219, 0.07);
  overflow: hidden;
  font-family: var(--mono);
}
.instrument-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line-n-soft);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-3);
}
.instrument-head .lights { display: flex; gap: 6px; }
.instrument-head .lights span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-n);
}
.instrument-head .lights span:first-child { background: var(--copper); }
.instrument-body { padding: 1.25rem; display: grid; gap: 1rem; }

.instrument-foot {
  padding: 0.8rem 1.25rem;
  font-size: 0.68rem;
  color: var(--bone-3);
  border-top: 1px solid var(--line-n-soft);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.cursor-blink::after {
  content: "▍";
  color: var(--copper);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- paper list rows (research papers) ---------- */
.paper-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1.1fr) minmax(0, 1.6fr) auto;
  gap: clamp(1rem, 3vw, 3rem);
  align-items: baseline;
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.paper-row:last-child { border-bottom: 1px solid var(--line); }
/* hover lives on the children + a backdrop pseudo-element, so it
   never fights the .reveal transition that owns the row itself —
   compositor-only, no re-wrap, glides smoothly */
.paper-row::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(229, 223, 207, 0.4);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}
.paper-row:hover::before { opacity: 1; }
.paper-row > * { transition: transform 0.5s var(--ease-out); }
.paper-row:hover > * { transform: translateX(0.75rem); }
.paper-row .rp {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--copper-deep);
}
.paper-row h3 {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  font-weight: 440;
  letter-spacing: -0.012em;
  line-height: 1.2;
}
.paper-row .cat {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.paper-row p { color: var(--ink-2); font-size: 0.94rem; }
.paper-row .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}
.paper-row .tags span {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
}
.paper-row .end {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-3);
  font-size: 1rem;
  white-space: nowrap;
}

/* ---------- chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.chip {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  background: transparent;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.chip:hover { border-color: var(--copper); color: var(--copper-deep); background: var(--copper-soft); }

/* ---------- methodology steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 3rem); }
.step { position: relative; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 3rem;
  height: 1px;
  background: var(--copper);
}
.step .n {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 330;
  font-size: 2rem;
  color: var(--copper-deep);
}
.step h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 450;
  margin: 0.6rem 0 0.6rem;
}
.step p { color: var(--ink-2); font-size: 0.94rem; }

/* ---------- team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.member {
  background: var(--paper);
  padding: clamp(1.6rem, 2.6vw, 2.3rem);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  transition: background 0.45s var(--ease-out);
}
.member:hover { background: var(--paper-2); }
.member-top { display: flex; align-items: center; justify-content: space-between; }
.monogram {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--copper-deep);
  background:
    radial-gradient(closest-side, rgba(179, 84, 32, 0.07), transparent 75%),
    var(--paper);
}
.member .tag {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  border: 1px solid var(--line);
  padding: 0.32rem 0.7rem;
  border-radius: 4px;
  color: var(--ink-2);
}
.member .tag.lead { border-color: var(--copper-line); color: var(--copper-deep); background: var(--copper-soft); }
.member h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 460; }
.member .role {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper-deep);
  margin-top: 0.45rem;
}
.member p { margin-top: 1rem; color: var(--ink-2); font-size: 0.92rem; }

/* ---------- thesis list / checklist ---------- */
.thesis-list { display: grid; gap: 0; }
.thesis-list li {
  display: flex;
  gap: 1.4rem;
  align-items: baseline;
  padding: 1.3rem 0;
  border-top: 1px solid var(--line);
  font-size: 1.02rem;
  color: var(--ink-2);
}
.thesis-list li:last-child { border-bottom: 1px solid var(--line); }
.thesis-list .m {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--copper-deep);
  min-width: 2.6rem;
}
.thesis-list strong { color: var(--ink); font-weight: 600; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 1.6rem; }
.field { display: grid; gap: 0.55rem; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field input,
.field textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0.1rem;
  font-size: 1rem;
  border-radius: 0;
  transition: border-color 0.3s;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-3); }
.field input:focus,
.field textarea:focus { outline: none; border-bottom-color: var(--copper); }
.field input:focus-visible,
.field textarea:focus-visible { outline: none; }
.form-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin-top: 0.6rem;
}
.form-note {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.form-success {
  display: none;
  border: 1px solid var(--copper-line);
  background: var(--copper-soft);
  border-radius: var(--radius-sm);
  padding: 1.6rem 1.8rem;
  font-size: 1rem;
  color: var(--ink);
  align-items: baseline;
  gap: 1rem;
}
.form-success.show { display: flex; }
.form-success .serif { font-style: italic; color: var(--copper-deep); }

/* ---------- roadmap ---------- */
.roadmap { position: relative; display: grid; gap: 0; }
.roadmap-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: 2.2rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
  position: relative;
}
.roadmap-item:last-child { border-bottom: 1px solid var(--line); }
/* same reveal-safe hover treatment as .paper-row */
.roadmap-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(229, 223, 207, 0.4);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}
.roadmap-item:hover::before { opacity: 1; }
.roadmap-item > * { transition: transform 0.5s var(--ease-out); }
.roadmap-item:hover > * { transform: translateX(0.75rem); }
.roadmap-item:hover .phase::before { background: var(--copper); }
.roadmap-item .phase {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper-deep);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.roadmap-item .phase::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--copper);
  border-radius: 50%;
  background: transparent;
  transition: background-color 0.4s var(--ease-out);
}
.roadmap-item.now .phase::before { background: var(--copper); }
.roadmap-item h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 450; margin-bottom: 0.45rem; }
.roadmap-item p { color: var(--ink-2); font-size: 0.96rem; max-width: 44em; }
.roadmap-item .now-chip {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--paper);
  background: var(--copper-deep);
  border-radius: 4px;
  padding: 0.22rem 0.55rem;
  margin-left: 0.7rem;
  vertical-align: middle;
}

/* ---------- principles (vision) ---------- */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-n); border: 1px solid var(--line-n); border-radius: var(--radius); overflow: hidden; }
.principle { background: var(--night); padding: clamp(1.8rem, 3vw, 2.6rem); min-height: 280px; display: flex; flex-direction: column; gap: 1.2rem; }
.principle .n { font-family: var(--serif); font-style: italic; font-weight: 320; font-size: 2.1rem; color: #d89a6e; }
.principle h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 430; color: var(--bone); }
.principle p { color: var(--bone-2); font-size: 0.93rem; margin-top: auto; }

/* ---------- CTA panel ---------- */
.cta-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(2.5rem, 6vw, 5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60% 90% at 50% 110%, rgba(179, 84, 32, 0.10), transparent 70%),
    var(--paper-2);
}
.cta-panel .h-section { max-width: 22ch; margin-inline: auto; }
.cta-panel .lede { margin: 1.4rem auto 2.4rem; max-width: 46ch; }
.cta-panel .actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--night);
  color: var(--bone);
  padding-top: clamp(4rem, 8vw, 7rem);
  position: relative;
  overflow: hidden;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 3rem 2.5rem;
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.footer-brand .brand { color: var(--bone); font-size: 1.45rem; }
.footer-brand p {
  margin-top: 1.3rem;
  color: var(--bone-2);
  font-size: 0.94rem;
  max-width: 34ch;
}
.footer-brand .est {
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-3);
}
.footer-col h4 {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bone-3);
  margin-bottom: 1.3rem;
}
.footer-col ul { display: grid; gap: 0.7rem; }
.footer-col a {
  color: var(--bone-2);
  font-size: 0.94rem;
  transition: color 0.25s, padding-left 0.3s var(--ease-out);
}
.footer-col a:hover { color: var(--bone); padding-left: 0.4rem; }
.footer-col .mail { color: #d89a6e; border-bottom: 1px solid rgba(216, 154, 110, 0.35); padding-bottom: 1px; }
.footer-col .mail:hover { padding-left: 0; border-color: #d89a6e; }

.footer-wordmark {
  font-family: var(--serif);
  font-weight: 420;
  font-size: clamp(4.5rem, 14.5vw, 13.5rem);
  line-height: 0.86;
  letter-spacing: 0.015em;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 1px rgba(239, 233, 219, 0.16);
  user-select: none;
  margin-bottom: 0.6rem;
  transition: -webkit-text-stroke-color 0.6s;
}
.site-footer:hover .footer-wordmark { -webkit-text-stroke-color: rgba(216, 154, 110, 0.3); }

.footer-bottom {
  border-top: 1px solid var(--line-n-soft);
  padding: 1.4rem 0 1.6rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem 2rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--bone-3);
}
.footer-bottom .sep { color: var(--copper); }

/* ---------- page headers (inner pages) ---------- */
.page-head {
  padding-top: clamp(9rem, 16vw, 13rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  position: relative;
  overflow: hidden;
}
.page-head .eyebrow { margin-bottom: 1.8rem; }
.page-head .lede { margin-top: 1.8rem; }
.page-head .h-display { max-width: 17ch; }

/* breadcrumb path note */
.path-note {
  position: absolute;
  top: clamp(6.2rem, 11vw, 8.5rem);
  right: var(--gutter);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: var(--ink-3);
  display: none;
}
@media (min-width: 900px) { .path-note { display: block; } }

/* ---------- reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- terminal (technology) ---------- */
.terminal-line { font-size: 0.8rem; line-height: 1.9; color: var(--bone-2); }
.terminal-line .p { color: #d89a6e; }
.terminal-line .ok { color: #9fc3a3; }
.terminal-line .dim { color: var(--bone-3); }

/* ---------- stack grid (technology) ---------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stack-cell {
  background: var(--paper);
  padding: clamp(1.7rem, 2.6vw, 2.4rem);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  transition: background 0.45s var(--ease-out);
  position: relative;
}
.stack-cell:hover { background: var(--paper-2); }
.stack-cell .module {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper-deep);
}
.stack-cell h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 450; margin-top: 0.8rem; }
.stack-cell p { color: var(--ink-2); font-size: 0.93rem; margin-top: 0.8rem; }
.stack-cell .foot {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
}
.stack-cell.core { background: var(--night); }
.stack-cell.core h3 { color: var(--bone); }
.stack-cell.core p { color: var(--bone-2); }
.stack-cell.core .module { color: #d89a6e; }
.stack-cell.core .foot { color: var(--bone-3); }
.stack-cell.core:hover { background: var(--night-2); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 130px; }
  .hero-stage { max-width: 560px; margin-inline: auto; width: 100%; aspect-ratio: 1/0.92; top: 0; }
  /* freeze the stacked-layout substrate geometry (desktop values differ) */
  #substrate-scene { left: -3%; top: -6%; width: 106% !important; height: 112% !important; }
  .stage-caption { bottom: -2.6rem; }
  .paper-row { grid-template-columns: 90px 1fr; }
  .paper-row p { grid-column: 2; }
  .paper-row .end { display: none; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .principles { grid-template-columns: 1fr; }
  .principle { min-height: 0; }
}

@media (max-width: 840px) {
  .manifesto-grid { grid-template-columns: 1fr !important; gap: 1.2rem !important; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; gap: 2rem; }
  .form-grid { grid-template-columns: 1fr; }
  .roadmap-item { grid-template-columns: 1fr; gap: 0.8rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  :root { --text-hero: clamp(2.3rem, 10.5vw, 2.8rem); }
  .h-display br { display: none; }
  .stage-caption { max-width: 96%; white-space: normal; text-align: center; bottom: -4.6rem; }
  .stage-caption::before, .stage-caption::after { width: 0.9rem; flex-shrink: 0; }
  .hero-stage { margin-bottom: 4.8rem; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .team-grid { grid-template-columns: 1fr; }
  .member { min-height: 0; }
  .stack-grid { grid-template-columns: 1fr; }
  .stack-cell { min-height: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .paper-row { grid-template-columns: 1fr; }
  .paper-row p { grid-column: 1; }
  .footer-grid { grid-template-columns: 1fr; gap: 2.2rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
}
