/* ==========================================================================
   Kehrn — pre-product technology narrative site
   Design language: quiet-technical credibility / subtle-motion corporate.
   Neutral-dominant, dark-first. ONE accent: kernel amber (#D99A2B).
   Type-led, numbered sections, generous whitespace, thin rules.
   ========================================================================== */

:root {
  --bg: #0c0d0f;            /* near-black field */
  --bg-raised: #121316;     /* card / band step */
  --ink: #e9e7e1;           /* off-white text */
  --ink-dim: #9b9a94;       /* secondary text */
  --ink-faint: #5d5c57;     /* tertiary / labels */
  --rule: #26272b;          /* hairline rules */
  --accent: #d99a2b;        /* kernel amber — the ONE accent */
  --mark-bracket: #e7d8b8;  /* Bracket K light tone, matching favicon.svg */
  --max: 1080px;
  --measure: 68ch;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

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

/* --- Header / nav ------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(12, 13, 15, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  font-size: 15px; color: var(--ink);
}
.wordmark:hover { text-decoration: none; }
.wordmark .tld { color: var(--ink-faint); font-weight: 400; }
.brand-mark {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}
.mark-bracket { fill: var(--mark-bracket); }
.mark-k { fill: var(--accent); }
.site-nav { display: flex; gap: 28px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-dim); font-size: 13.5px; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); }

/* --- Hero ---------------------------------------------------------------- */

.hero { padding: 16vh 0 12vh; border-bottom: 1px solid var(--rule); }
.hero-system {
  position: relative;
  min-height: calc(100vh - 73px);
  display: flex;
  align-items: center;
  padding: 9vh 0 10vh;
  overflow: hidden;
}
.hero-system::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 42%, rgba(217, 154, 43, 0.12), transparent 32%),
    linear-gradient(90deg, transparent 0%, rgba(233, 231, 225, 0.035) 72%, transparent 100%);
  pointer-events: none;
}
.hero-system-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1fr);
  gap: clamp(42px, 7vw, 88px);
  align-items: center;
}
.hero-system-grid > *,
.concept-hero-grid > * {
  min-width: 0;
}
.kicker {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 28px;
}
.kicker .dot { color: var(--accent); }
.hero h1 {
  font-size: clamp(34px, 5.6vw, 64px);
  line-height: 1.08; letter-spacing: -0.015em; font-weight: 650;
  max-width: 20ch;
}
.hero-system h1 {
  font-size: clamp(38px, 5.4vw, 70px);
  line-height: 1.04;
  max-width: 13ch;
}
.hero h1 span { color: var(--accent); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede {
  margin-top: 32px; max-width: var(--measure);
  font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-dim);
}
.hero .status-line {
  margin-top: 44px; font-family: var(--mono); font-size: 13px;
  color: var(--ink-faint); letter-spacing: 0.04em;
}
.hero .status-line strong { color: var(--ink-dim); font-weight: 500; }

/* --- Motion concept page ------------------------------------------------ */

.concept-hero {
  min-height: calc(100vh - 73px);
  display: flex;
  align-items: center;
  padding: 9vh 0 10vh;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.concept-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 1fr);
  gap: clamp(42px, 7vw, 88px);
  align-items: center;
}
.concept-copy h1 {
  font-size: clamp(38px, 5.7vw, 72px);
  line-height: 1.04;
  font-weight: 650;
  max-width: 12ch;
}
.concept-copy h1 span { color: var(--accent); }
.concept-copy .lede {
  margin-top: 30px;
  max-width: 54ch;
  color: var(--ink-dim);
  font-size: clamp(17px, 1.5vw, 20px);
}
.system-visual {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 560px;
  display: grid;
  place-items: center;
  perspective: 1200px;
}
.system-visual::before {
  content: "";
  position: absolute;
  width: min(82vw, 560px);
  aspect-ratio: 1.35;
  border-radius: 50%;
  background: rgba(217, 154, 43, 0.11);
  filter: blur(58px);
  opacity: 0.72;
}
.system-orbit {
  position: absolute;
  width: min(95vw, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(217, 154, 43, 0.13);
  border-radius: 50%;
  transform: rotateX(66deg) rotateZ(-18deg);
  animation: orbitTurn 22s linear infinite;
}
.system-orbit::before,
.system-orbit::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(233, 231, 225, 0.08);
  border-radius: 50%;
}
.system-orbit::after { inset: 27%; border-color: rgba(217, 154, 43, 0.08); }
.system-slab {
  position: relative;
  width: min(100%, 610px);
  border: 1px solid rgba(233, 231, 225, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(217, 154, 43, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(233, 231, 225, 0.045), transparent 18%),
    linear-gradient(180deg, rgba(18, 19, 22, 0.98), rgba(12, 13, 15, 0.92));
  box-shadow:
    0 34px 96px rgba(0, 0, 0, 0.54),
    0 0 64px rgba(217, 154, 43, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  transform: rotateX(5deg) rotateY(-8deg);
  transform-style: preserve-3d;
  overflow: hidden;
}
.system-mark {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 38px;
  height: 38px;
  color: rgba(217, 154, 43, 0.82);
  opacity: 0.72;
  pointer-events: none;
}
.system-slab::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(110deg, transparent 0%, rgba(217, 154, 43, 0.1) 45%, transparent 62%);
  transform: translateX(-80%);
  animation: slabScan 7s ease-in-out infinite;
  pointer-events: none;
}
.slab-top,
.command-line,
.signal-rows {
  position: relative;
  z-index: 1;
}
.slab-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(233, 231, 225, 0.1);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.command-line {
  margin: 18px;
  padding: 14px 15px;
  border: 1px solid rgba(217, 154, 43, 0.18);
  border-radius: 6px;
  background: rgba(12, 13, 15, 0.72);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 12.5px;
  box-shadow: 0 0 34px rgba(217, 154, 43, 0.06);
}
.command-line::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1.15em;
  margin-left: 8px;
  vertical-align: -0.2em;
  background: var(--accent);
  animation: cursorBlink 1.18s steps(2, end) infinite;
}
.command-line span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.prompt {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg);
}
.memory-map {
  position: relative;
  z-index: 1;
  padding: 4px 12px 2px;
  overflow: hidden;
}
.memory-map::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 92px;
  left: -110px;
  background: linear-gradient(90deg, transparent, rgba(217, 154, 43, 0.16), transparent);
  animation: mapSweep 6.8s ease-in-out infinite;
  pointer-events: none;
}
.memory-map svg {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
}
.map-line {
  fill: none;
  stroke: url(#pulseLine);
  stroke-width: 2.1;
  stroke-dasharray: 14 16;
  animation: lineDrift 8.5s linear infinite;
}
.map-line-b { animation-duration: 15s; animation-direction: reverse; opacity: 0.78; }
.map-line-c { animation-duration: 18s; opacity: 0.64; }
.map-node circle {
  fill: rgba(18, 19, 22, 0.95);
  stroke: rgba(217, 154, 43, 0.72);
  stroke-width: 1.45;
}
.map-node text {
  fill: var(--ink-dim);
  font-family: var(--mono);
  font-size: 13px;
  text-anchor: middle;
  letter-spacing: 0.08em;
}
.node-core circle {
  fill: rgba(217, 154, 43, 0.17);
  stroke-width: 2;
}
.node-core text { fill: var(--ink); font-size: 12px; }
.node-a,
.node-c { animation: nodePulse 5.5s ease-in-out infinite; }
.node-b,
.node-d { animation: nodePulse 6.5s ease-in-out 1s infinite; }
.signal-rows {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(233, 231, 225, 0.1);
}
.signal-rows div {
  padding: 17px 18px 19px;
  border-right: 1px solid rgba(233, 231, 225, 0.1);
}
.signal-rows div:last-child { border-right: none; }
.signal-rows span,
.signal-rows strong {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.signal-rows span { color: var(--ink-faint); }
.signal-rows strong { margin-top: 8px; color: var(--accent); font-weight: 500; }
.signal-rows strong {
  animation: statusGlow 4.8s ease-in-out infinite;
}
.signal-rows div:nth-child(2) strong { animation-delay: 0.8s; }
.signal-rows div:nth-child(3) strong { animation-delay: 1.6s; }
.motion-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.motion-card {
  min-height: 250px;
  padding: 30px 26px;
  background: var(--bg-raised);
}
.motion-card p { color: var(--ink-dim); font-size: 15px; }

@keyframes slabScan {
  0%, 20% { transform: translateX(-90%); opacity: 0; }
  36%, 58% { opacity: 1; }
  80%, 100% { transform: translateX(92%); opacity: 0; }
}
@keyframes mapSweep {
  0%, 24% { transform: translateX(0); opacity: 0; }
  38%, 62% { opacity: 1; }
  84%, 100% { transform: translateX(720px); opacity: 0; }
}
@keyframes lineDrift {
  to { stroke-dashoffset: -180; }
}
@keyframes nodePulse {
  0%, 100% { opacity: 0.62; }
  45% { opacity: 1; }
}
@keyframes orbitTurn {
  to { rotate: 360deg; }
}
@keyframes cursorBlink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}
@keyframes statusGlow {
  0%, 100% { text-shadow: none; }
  45% { text-shadow: 0 0 18px rgba(217, 154, 43, 0.42); }
}

@media (max-width: 920px) {
  .concept-hero-grid,
  .hero-system-grid { grid-template-columns: 1fr; }
  .concept-copy h1 { max-width: 14ch; }
  .system-visual { min-height: 500px; }
  .hero-system h1 { max-width: 14ch; }
}
@media (max-width: 760px) {
  .wrap {
    max-width: 100%;
    padding-left: 24px;
    padding-right: 24px;
  }
  .hero-copy,
  .concept-copy,
  .concept-copy .lede,
  .prose,
  .note {
    max-width: calc(100vw - 48px);
    width: 100%;
    overflow-wrap: break-word;
  }
  .kicker {
    font-size: 11px;
    letter-spacing: 0.16em;
    max-width: 32ch;
    overflow-wrap: anywhere;
  }
  .hero .lede,
  .hero .status-line {
    max-width: 32ch;
    overflow-wrap: anywhere;
  }
  .site-header .wrap {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  .site-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    width: 100%;
  }
  .site-nav a {
    font-size: 12px;
    letter-spacing: 0.04em;
  }
  .brand-mark {
    width: 22px;
    height: 22px;
  }
  .system-mark {
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
  }
  .signal-rows,
  .motion-cards { grid-template-columns: 1fr; }
  .signal-rows div { border-right: none; border-bottom: 1px solid rgba(233, 231, 225, 0.1); }
  .signal-rows div:last-child { border-bottom: none; }
  .system-slab { transform: none; }
  .system-slab {
    width: calc(100vw - 64px);
    justify-self: start;
  }
  .system-visual {
    width: 100%;
    min-height: 390px;
    margin-top: 14px;
  }
  .slab-top { flex-direction: column; gap: 6px; }
  .command-line {
    align-items: flex-start;
    display: flex;
    gap: 10px;
  }
  .prompt {
    flex: 0 0 auto;
    margin-right: 0;
  }
}

/* --- Sections ------------------------------------------------------------ */

.section { padding: 96px 0; border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: none; }

.section-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 44px; }
.sec-num {
  font-family: var(--mono); font-size: 14px; color: var(--accent);
  letter-spacing: 0.08em;
}
.section-head h2 {
  font-size: clamp(24px, 3vw, 34px); font-weight: 650; letter-spacing: -0.01em;
}

.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1.2em; }
.prose .dim { color: var(--ink-dim); }

h3 { font-size: 19px; font-weight: 600; margin-bottom: 10px; }

/* --- Pull quote ----------------------------------------------------------- */

.pull {
  margin: 56px 0 0; padding-left: 28px;
  border-left: 2px solid var(--accent);
  max-width: var(--measure);
}
.pull p { font-size: clamp(20px, 2.4vw, 27px); line-height: 1.35; font-weight: 550; }
.pull cite { display: block; margin-top: 14px; font-style: normal; font-size: 14px; color: var(--ink-faint); }

/* --- Section diagrams ------------------------------------------------------ */

.v-label {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.context-loss-visual,
.stack-visual,
.machine-visual {
  position: relative;
  margin-top: 52px;
  border: 1px solid var(--rule);
  background:
    linear-gradient(135deg, rgba(217, 154, 43, 0.04), transparent 38%),
    linear-gradient(180deg, rgba(233, 231, 225, 0.022), transparent);
  overflow: hidden;
}

.context-loss-visual::before,
.stack-visual::before,
.machine-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(233, 231, 225, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 231, 225, 0.035) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  pointer-events: none;
}

.context-loss-visual {
  display: grid;
  grid-template-columns: 1fr 80px 1fr 150px 1fr;
  gap: 18px;
  align-items: center;
  padding: 28px;
}

.session-card {
  position: relative;
  z-index: 1;
  min-height: 154px;
  padding: 22px 20px;
  border: 1px solid rgba(233, 231, 225, 0.11);
  border-radius: 6px;
  background: rgba(18, 19, 22, 0.82);
}

.session-card strong,
.machine-copy strong {
  display: block;
  font-size: 17px;
  line-height: 1.35;
}

.session-card p,
.machine-copy p {
  margin-top: 10px;
  color: var(--ink-dim);
  font-size: 14.5px;
}

.leak-column {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.leak-column span,
.machine-lines span {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 154, 43, 0.62), transparent);
  animation: signalSlide 4.5s ease-in-out infinite;
}

.leak-column span:nth-child(2),
.machine-lines span:nth-child(2) { animation-delay: 0.7s; opacity: 0.7; }
.leak-column span:nth-child(3),
.machine-lines span:nth-child(3) { animation-delay: 1.4s; opacity: 0.45; }

.memory-core-mini {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 118px;
  aspect-ratio: 1;
  justify-self: center;
  border: 1px solid rgba(217, 154, 43, 0.34);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 154, 43, 0.18), rgba(18, 19, 22, 0.9) 58%);
  box-shadow: 0 0 42px rgba(217, 154, 43, 0.1);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--accent);
  animation: coreBreath 5.6s ease-in-out infinite;
}

.stack-visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px minmax(300px, 0.92fr);
  gap: 22px;
  align-items: center;
  padding: 30px;
}

.stack-sources {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stack-sources span {
  display: block;
  min-height: 50px;
  padding: 14px 14px;
  border: 1px solid rgba(233, 231, 225, 0.1);
  border-radius: 5px;
  background: rgba(18, 19, 22, 0.78);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 12px;
}

.stack-converge {
  position: relative;
  z-index: 1;
  height: 150px;
}

.stack-converge::before,
.stack-converge::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, rgba(217, 154, 43, 0.12), rgba(217, 154, 43, 0.75));
  transform-origin: right center;
}

.stack-converge::before { transform: rotate(24deg); }
.stack-converge::after { transform: rotate(-24deg); }

.stack-core {
  position: relative;
  z-index: 1;
  min-height: 174px;
  padding: 28px;
  border: 1px solid rgba(217, 154, 43, 0.28);
  border-radius: 6px;
  background:
    radial-gradient(circle at 18% 20%, rgba(217, 154, 43, 0.18), transparent 35%),
    rgba(18, 19, 22, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stack-core span,
.stack-core strong {
  display: block;
}

.stack-core span {
  font-size: 22px;
  font-weight: 650;
}

.stack-core strong {
  margin-top: 18px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.machine-visual {
  display: grid;
  grid-template-columns: 260px 140px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 34px 38px;
}

.machine-body {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 150px;
  height: 220px;
  border: 1px solid rgba(233, 231, 225, 0.18);
  border-radius: 52px 52px 18px 18px;
  background:
    linear-gradient(180deg, rgba(233, 231, 225, 0.09), transparent 28%),
    linear-gradient(145deg, rgba(217, 154, 43, 0.08), rgba(18, 19, 22, 0.94));
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.34);
}

.machine-eye {
  position: absolute;
  top: 44px;
  left: 50%;
  width: 54px;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border: 1px solid rgba(217, 154, 43, 0.45);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 154, 43, 0.62) 0 10%, rgba(217, 154, 43, 0.13) 28%, transparent 56%);
  animation: coreBreath 5s ease-in-out infinite;
}

.machine-slot {
  position: absolute;
  left: 36px;
  right: 36px;
  top: 130px;
  height: 8px;
  border-radius: 999px;
  background: rgba(233, 231, 225, 0.16);
}

.machine-base {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: -18px;
  height: 26px;
  border: 1px solid rgba(233, 231, 225, 0.12);
  border-radius: 50%;
  background: rgba(12, 13, 15, 0.96);
}

.machine-lines {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}

.machine-copy {
  position: relative;
  z-index: 1;
  max-width: 42ch;
}

/* --- Architecture layers --------------------------------------------------- */

.layers { display: grid; gap: 0; margin-top: 8px; border-top: 1px solid var(--rule); }
.layer {
  display: grid; grid-template-columns: 90px 240px 1fr; gap: 24px;
  padding: 28px 0; border-bottom: 1px solid var(--rule);
}
.layer .l-num { font-family: var(--mono); font-size: 13.5px; color: var(--accent); padding-top: 3px; }
.layer .l-name { font-weight: 600; font-size: 16.5px; }
.layer .l-desc { color: var(--ink-dim); font-size: 15.5px; max-width: 60ch; }
@media (max-width: 760px) {
  .layer { grid-template-columns: 1fr; gap: 6px; }
}

.note {
  margin-top: 40px; max-width: var(--measure);
  font-size: 14.5px; color: var(--ink-faint);
  border-top: 1px solid var(--rule); padding-top: 18px;
}

/* --- Proof / evidence cards ------------------------------------------------ */

.evidence { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-top: 48px; }
.evidence article { background: var(--bg-raised); padding: 30px 26px; }
.evidence .e-label {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 14px;
}
.evidence h3 { font-size: 17px; }
.evidence p { font-size: 15px; color: var(--ink-dim); margin-top: 8px; }

.north-star-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 44px;
}
.north-star-grid article {
  background:
    linear-gradient(145deg, rgba(217, 154, 43, 0.055), transparent 42%),
    var(--bg-raised);
  padding: 30px 26px;
}
.north-star-grid p { color: var(--ink-dim); font-size: 15px; margin-top: 8px; }

.machine-offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  margin-top: 44px;
  padding: 30px 28px;
  border: 1px solid rgba(217, 154, 43, 0.26);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(217, 154, 43, 0.09), transparent 42%),
    rgba(18, 19, 22, 0.82);
}

.machine-offer h3 {
  font-size: 20px;
}

.machine-offer p {
  max-width: 62ch;
  color: var(--ink-dim);
  font-size: 15px;
  margin-top: 8px;
}

.machine-offer .btn {
  white-space: nowrap;
}

@media (max-width: 820px) {
  .evidence,
  .north-star-grid { grid-template-columns: 1fr; }
  .context-loss-visual,
  .stack-visual,
  .machine-visual {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  .leak-column,
  .machine-lines {
    min-height: 48px;
    transform: rotate(90deg);
    width: 48px;
    justify-self: center;
  }
  .memory-core-mini {
    width: 104px;
  }
  .stack-sources {
    grid-template-columns: 1fr;
  }
  .stack-converge {
    height: 52px;
    transform: rotate(90deg);
  }
  .stack-core span {
    font-size: 19px;
  }
  .machine-body {
    width: 132px;
    height: 194px;
  }
  .machine-offer {
    grid-template-columns: 1fr;
  }
  .machine-offer .btn {
    justify-self: start;
    white-space: normal;
  }
}

/* --- Log entries ------------------------------------------------------------ */

.log { border-top: 1px solid var(--rule); margin-top: 8px; }
.log-entry {
  display: grid; grid-template-columns: 160px 1fr; gap: 28px;
  padding: 34px 0; border-bottom: 1px solid var(--rule);
}
.log-entry time { font-family: var(--mono); font-size: 13.5px; color: var(--accent); padding-top: 3px; }
.log-entry h3 { font-size: 17.5px; }
.log-entry p { color: var(--ink-dim); font-size: 15.5px; margin-top: 8px; max-width: 62ch; }
@media (max-width: 640px) {
  .log-entry { grid-template-columns: 1fr; gap: 8px; }
}

/* --- Paper page --------------------------------------------------------------- */

.paper { padding: 80px 0 110px; }
.paper-head { margin-bottom: 64px; max-width: 56ch; }
.paper-head h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.15; letter-spacing: -0.01em; font-weight: 650; }
.paper-head .paper-meta {
  margin-top: 22px; font-family: var(--mono); font-size: 13px; color: var(--ink-faint);
}
.paper-body { max-width: var(--measure); }
.paper-body h2 {
  font-size: 22px; font-weight: 650; margin: 64px 0 18px;
  padding-top: 28px; border-top: 1px solid var(--rule);
}
.paper-body h2 .pnum { font-family: var(--mono); font-size: 14px; color: var(--accent); margin-right: 14px; font-weight: 400; }
.paper-body h3 { margin: 30px 0 8px; }
.paper-body p + p { margin-top: 1.1em; }
.paper-body p, .paper-body li { color: var(--ink); }
.paper-body .dim, .paper-body li .dim { color: var(--ink-dim); }
.paper-body ul, .paper-body ol { padding-left: 1.3em; margin: 0.9em 0; }
.paper-body li + li { margin-top: 0.55em; }
.paper-body blockquote {
  margin: 1.6em 0; padding-left: 22px; border-left: 2px solid var(--accent);
  color: var(--ink-dim);
}
.pdf-stub {
  display: inline-block; margin-top: 26px; padding: 10px 18px;
  border: 1px solid var(--rule); border-radius: 4px;
  font-family: var(--mono); font-size: 13px; color: var(--ink-faint);
  cursor: default;
}

/* --- Contact form ------------------------------------------------------------- */

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; margin-top: 8px; }
.contact-grid > * { min-width: 0; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; gap: 48px; } }

form .field { margin-bottom: 26px; }
label {
  display: block; font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 9px;
}
input[type="text"], input[type="email"], select, textarea {
  width: 100%; background: var(--bg-raised); border: 1px solid var(--rule);
  border-radius: 4px; padding: 12px 14px; color: var(--ink);
  font-family: var(--font); font-size: 15.5px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
}
textarea { min-height: 130px; resize: vertical; }

.btn {
  display: inline-block; background: var(--accent); color: var(--bg);
  border: none; border-radius: 4px; padding: 13px 26px;
  font-family: var(--font); font-size: 15px; font-weight: 600;
  letter-spacing: 0.02em; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.form-note { margin-top: 16px; font-size: 13.5px; color: var(--ink-faint); max-width: 44ch; }

.inquiry-notes {
  margin-top: 34px;
  border-top: 1px solid var(--rule);
}

.inquiry-notes article {
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}

.inquiry-notes h2 {
  font-size: 16px;
  margin-bottom: 8px;
}

.inquiry-notes p {
  color: var(--ink-dim);
  font-size: 14.5px;
}

/* --- Footer ---------------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--rule); padding: 44px 0 60px; }
.site-footer .wrap {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--ink-faint);
}
.site-footer a { color: var(--ink-dim); }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }

/* --- Motion: subtle scroll reveals (homepage only; honors reduced-motion) ------- */

.reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes signalSlide {
  0%, 100% { transform: scaleX(0.42); opacity: 0.28; }
  45% { transform: scaleX(1); opacity: 1; }
}
@keyframes coreBreath {
  0%, 100% { box-shadow: 0 0 24px rgba(217, 154, 43, 0.08); }
  45% { box-shadow: 0 0 48px rgba(217, 154, 43, 0.18); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .system-slab::before,
  .system-orbit,
  .memory-map::before,
  .command-line::after,
  .signal-rows strong,
  .map-line,
  .map-node,
  .leak-column span,
  .machine-lines span,
  .memory-core-mini,
  .machine-eye { animation: none; }
}

@media (max-width: 760px) {
  .paper .wrap,
  .contact-grid .prose,
  .inquiry-notes,
  .inquiry-notes article {
    width: 100%;
    max-width: calc(100vw - 48px);
    min-width: 0;
  }

  .paper-head,
  .paper-body,
  .contact-grid,
  form {
    width: 100%;
    max-width: calc(100vw - 48px);
    min-width: 0;
    overflow-wrap: break-word;
  }

  .paper-head h1 {
    max-width: 12ch;
    line-height: 1.15;
  }

  .paper-head p,
  .prose p,
  .inquiry-notes p {
    max-width: 100%;
  }

  .paper-head h1,
  .inquiry-notes h2,
  .machine-offer h3 {
    overflow-wrap: anywhere;
  }

  input[type="text"], input[type="email"], select, textarea {
    min-width: 0;
  }
}
/* No-JS fallback: content must never stay hidden */
.no-js .reveal { opacity: 1; transform: none; }
