/* ================= Mercury Ledger — mercuryledger.net ================= */
:root {
  --paper: #f6f1e7;
  --card: #fffdf7;
  --ink: #171a21;
  --flame: #ff4f1f;
  --cobalt: #2b3eff;
  --silver: #74808f;
  --muted: #565d68;
  --line: rgba(23, 26, 33, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Space Grotesk", Arial, sans-serif;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--flame); color: var(--paper); }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }

/* ledger-paper background: faint horizontal rules + red margin line */
.paper-rules {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    repeating-linear-gradient(transparent 0 35px, rgba(23, 26, 33, .045) 35px 36px),
    linear-gradient(90deg, transparent 0 86px, rgba(255, 79, 31, .18) 86px 88px, transparent 88px 100%);
}

/* ---------- shell + header ---------- */
.site-header, .section-shell, footer { width: min(1220px, calc(100% - 64px)); margin: auto; }
.site-header {
  height: 92px; display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 3; border-bottom: 1px solid var(--ink);
}
.brand { display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: 17px; letter-spacing: .14em; }
.brand-mark { display: flex; align-items: center; }
nav { display: flex; align-items: center; gap: 29px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
nav a:not(.nav-contact) { color: var(--muted); }
nav a:hover { color: var(--flame); }
.nav-contact { border: 1.5px solid var(--ink); padding: 12px 15px; color: var(--ink); transition: background .22s, color .22s, border-color .22s; }
.nav-contact:hover { background: var(--flame); border-color: var(--flame); color: var(--paper); }
.nav-contact span { margin-left: 8px; }
.menu-button { display: none; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 1.02fr; gap: 54px; align-items: center;
  min-height: calc(100vh - 92px); padding: 60px 0 72px; position: relative;
}
.eyebrow, .section-kicker {
  font: 500 12px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .14em; color: var(--cobalt);
}
.pulse {
  display: inline-block; width: 8px; height: 8px; margin: 0 8px 1px 0;
  background: var(--flame); border-radius: 50%;
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 79, 31, .18); }
  50% { box-shadow: 0 0 0 9px rgba(255, 79, 31, .05); }
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin: 38px 0 28px; font-size: clamp(50px, 5.6vw, 92px);
  line-height: .97; letter-spacing: -.045em; font-weight: 700;
}
h1 em, .accent-grad {
  font-style: normal; font-weight: 500;
  background: linear-gradient(92deg, var(--flame) 25%, var(--cobalt) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lede { max-width: 470px; color: #3d434d; font-size: 17.5px; line-height: 1.7; }
.hero-actions { display: flex; align-items: center; gap: 34px; margin-top: 38px; flex-wrap: wrap; }
.button-primary {
  display: inline-flex; align-items: center; gap: 12px; padding: 17px 24px;
  background: var(--flame); color: var(--paper); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: .07em; border-radius: 2px;
  box-shadow: 4px 4px 0 0 var(--ink); transition: transform .18s, box-shadow .18s;
}
.button-primary:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 0 var(--ink); }
.text-link {
  display: inline-flex; gap: 14px; color: var(--ink); border-bottom: 2px solid var(--flame); padding-bottom: 4px;
  text-transform: uppercase; font: 600 12px "IBM Plex Mono", monospace; letter-spacing: .08em;
}
.text-link:hover { color: var(--flame); }
.text-link span { font-size: 16px; margin-top: -3px; }

/* hero ledger panel */
.hero-panel { margin: 0; position: relative; }
.orbit-deco {
  position: absolute; top: -48px; right: -26px; width: 300px; height: 194px;
  pointer-events: none; z-index: 0;
}
.orbit-ring { fill: none; stroke: var(--cobalt); stroke-width: 1.3; stroke-dasharray: 5 6; opacity: .55; }
.orbit-sun { fill: var(--flame); }
.orbit-planet {
  fill: var(--ink);
  offset-path: path("M 300 110 A 130 74 0 1 0 300.001 109.9");
  animation: orbit 14s linear infinite;
}
@keyframes orbit { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.orbit-note { font: 500 9.5px "IBM Plex Mono", monospace; fill: var(--silver); letter-spacing: .1em; }
.ledger-svg { width: 100%; height: auto; display: block; position: relative; z-index: 1; filter: drop-shadow(0 20px 44px rgba(23, 26, 33, .18)); }
.card-bg { fill: var(--card); stroke: rgba(23, 26, 33, .28); stroke-width: 1.2; }
.svg-mono { font-family: "IBM Plex Mono", monospace; }
.svg-label { font-size: 13px; letter-spacing: .13em; fill: var(--muted); font-weight: 500; }
.svg-live { font-size: 12px; letter-spacing: .14em; fill: var(--flame); font-weight: 500; }
.live-dot { animation: blink 1.6s ease-in-out infinite; }
.blink { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.col-head { font-size: 10px; letter-spacing: .12em; fill: var(--silver); }
.lrow text { font-size: 12.5px; fill: var(--ink); }
.lrow .seq { fill: var(--silver); }
.lrow .seal { fill: var(--cobalt); }
.lrow .digest { fill: var(--silver); }
.lrow { animation: rowin .5s ease-out backwards; }
.lrow:nth-of-type(1) { animation-delay: .15s; } .lrow:nth-of-type(2) { animation-delay: .3s; }
.lrow:nth-of-type(3) { animation-delay: .45s; } .lrow:nth-of-type(4) { animation-delay: .6s; }
.lrow:nth-of-type(5) { animation-delay: .75s; } .lrow:nth-of-type(6) { animation-delay: .9s; }
@keyframes rowin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.row-hl { fill: rgba(255, 79, 31, .07); }
.cursor { fill: var(--flame); animation: blink 1s step-end infinite; }
.margin-rule { stroke: rgba(255, 79, 31, .5); stroke-width: 1.5; }
.rule { stroke: var(--line); }
.stamp { animation: stampin .45s 1.15s cubic-bezier(.2, 1.6, .4, 1) backwards; }
@keyframes stampin { from { opacity: 0; transform: scale(1.6); } to { opacity: 1; transform: scale(1); } }
.stamp rect { fill: none; stroke: var(--flame); stroke-width: 2.5; }
.stamp .stamp-inner { stroke-width: 1; }
.stamp text { font-size: 15px; font-weight: 600; fill: var(--flame); letter-spacing: .18em; }
.svg-foot { font-size: 9.5px; fill: var(--silver); letter-spacing: .05em; }

/* ---------- principles tape ---------- */
.ticker { border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); overflow: hidden; background: var(--card); }
.ticker-track { display: flex; width: max-content; animation: tape 34s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-group { display: flex; align-items: center; gap: 26px; padding: 16px 13px 16px 26px; }
.ticker-group span { font: 500 12px "IBM Plex Mono", monospace; letter-spacing: .1em; color: var(--ink); white-space: nowrap; }
.ticker-group i { font-style: normal; font-size: 9px; color: var(--flame); }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- statement ---------- */
.statement { padding: 150px 0 140px; display: grid; grid-template-columns: 1fr 2.1fr; }
h2 { font-size: clamp(36px, 4.8vw, 68px); line-height: 1.04; letter-spacing: -.04em; font-weight: 700; margin-bottom: 36px; }
.statement h2 { grid-column: 2; }
.statement-copy {
  grid-column: 2; width: min(660px, 100%); color: #3d434d; font-size: 18px; line-height: 1.75;
  border-left: 3px solid var(--flame); padding-left: 26px;
}

/* ---------- pillars ---------- */
.section-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 54px; }
.section-heading > p:last-child { width: 340px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.pillars { padding: 20px 0 150px; }
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.pillar {
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 4px;
  padding: 34px 30px 38px; box-shadow: 6px 6px 0 0 rgba(23, 26, 33, .12);
  transition: transform .2s, box-shadow .2s;
}
.pillar:hover { transform: translate(-3px, -3px); box-shadow: 10px 10px 0 0 rgba(255, 79, 31, .35); }
.pillar-kicker { font: 500 11px "IBM Plex Mono", monospace; letter-spacing: .16em; color: var(--flame); margin-bottom: 22px; }
.pillar svg { width: 60px; height: 60px; margin-bottom: 24px; }
.pillar h3 { font-size: 24px; letter-spacing: -.03em; margin-bottom: 14px; }
.pillar p { margin: 0; color: #454b55; font-size: 15.5px; line-height: 1.68; }
.pi-line { stroke: var(--ink); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pi-flame { stroke: var(--flame); stroke-width: 2.2; fill: none; stroke-linecap: round; }
.pi-flame-fill { fill: var(--flame); }
.pi-cobalt { stroke: var(--cobalt); stroke-width: 2.2; fill: none; stroke-linecap: round; }

/* ---------- method (dark band) ---------- */
.method { background: var(--ink); color: var(--paper); padding: 120px 0 110px; }
.method .section-kicker { color: var(--flame); }
.method-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 75px; }
.method h2 { margin: 28px 0 0; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 72px 1fr; padding: 26px 0 30px; border-top: 1px solid rgba(246, 241, 231, .22); }
.steps span { color: var(--flame); font: 500 13px "IBM Plex Mono", monospace; }
.steps h3 { margin: 0 0 9px; font-size: 22px; letter-spacing: -.03em; }
.steps p { margin: 0; max-width: 400px; color: #b8bcc4; font-size: 15px; line-height: 1.65; }

.flow-figure { margin: 85px auto 0; }
.flow-svg { width: 100%; height: auto; display: block; }
.flow-lines line { stroke: var(--paper); stroke-width: 1.6; marker-end: url(#arrow); opacity: .7; }
.flow-node rect { fill: rgba(246, 241, 231, .06); stroke: var(--paper); stroke-width: 1.5; }
.flow-node text { font: 700 12.5px "Space Grotesk", sans-serif; letter-spacing: .08em; fill: var(--paper); }
.flow-node.accent rect { fill: rgba(255, 79, 31, .18); stroke: var(--flame); }
.flow-node.accent text { fill: #ffb8a3; }
.flow-node.sub rect { fill: none; stroke-dasharray: 5 4; opacity: .8; }
.flow-node.sub text { font-size: 11.5px; fill: #b8bcc4; }
.flow-caption text { font: 500 11px "IBM Plex Mono", monospace; letter-spacing: .08em; fill: #8b93a1; text-transform: uppercase; }
.packet { fill: var(--flame); stroke: var(--paper); stroke-width: 1.2; }
.mp1 { offset-path: path("M162,88 L614,88"); animation: travel 5s linear infinite; }
.mp2 { offset-path: path("M291,116 L291,196"); animation: travel 2.8s .8s linear infinite; }
.mp3 { offset-path: path("M495,116 L495,196"); animation: travel 2.8s 1.8s linear infinite; }
@keyframes travel { from { offset-distance: 0%; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } to { offset-distance: 100%; opacity: 0; } }
@supports not (offset-path: path("M0,0 L1,1")) { .packet { display: none; } }
.flow-note { margin-top: 22px; font: 500 12px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: #8b93a1; }

/* ---------- status metrics ---------- */
.status { padding: 140px 0 130px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--ink); background: var(--card); }
.metric-grid article {
  min-height: 230px; padding: 34px; border-right: 1.5px solid var(--ink);
  display: flex; flex-direction: column;
}
.metric-grid article:last-child { border-right: 0; }
.metric { margin: 0 0 16px; font: 600 clamp(38px, 4.2vw, 64px) "IBM Plex Mono", monospace; letter-spacing: -.06em; color: var(--flame); }
.metric-grid article:nth-child(2) .metric { color: var(--cobalt); }
.metric-grid article > p:last-of-type { margin: 0 0 auto; color: #454b55; max-width: 260px; font-size: 15.5px; line-height: 1.6; }
.spark { width: min(210px, 100%); height: 40px; margin-top: 24px; opacity: .8; }
.spark path { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.spark-flame { stroke: var(--flame); }
.spark-cobalt { stroke: var(--cobalt); }

/* ---------- contact ---------- */
.contact { padding: 20px 0 100px; }
.contact-panel {
  position: relative; border: 1.5px solid var(--ink); background: var(--card);
  padding: clamp(40px, 6vw, 90px); box-shadow: 8px 8px 0 0 rgba(23, 26, 33, .12);
}
.contact-panel::before, .contact-panel::after {
  position: absolute; color: var(--flame); font: 500 18px "IBM Plex Mono", monospace;
}
.contact-panel::before { content: "+"; top: -11px; left: -7px; }
.contact-panel::after { content: "+"; bottom: -12px; right: -7px; }
.contact h2 { margin: 30px 0 35px; }
.email-link {
  color: var(--ink); font-size: clamp(24px, 4.2vw, 54px); font-weight: 600; letter-spacing: -.04em;
  border-bottom: 3px solid var(--flame); transition: color .2s;
}
.email-link:hover { color: var(--flame); }
.email-link span { font-size: .65em; vertical-align: top; margin-left: 10px; color: var(--flame); }
.contact-note { color: var(--silver); margin: 58px 0 0; font: 500 11.5px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .07em; line-height: 2; }

footer {
  min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  color: var(--silver); border-top: 1.5px solid var(--ink);
  font: 500 11px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .08em;
}
footer a { color: var(--cobalt); }
footer a:hover { color: var(--flame); }

/* ---------- reveal on scroll ---------- */
html.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
html.js .reveal.in { opacity: 1; transform: none; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track, .pulse, .live-dot, .blink, .cursor, .lrow, .stamp,
  .orbit-planet, .packet, .mp1, .mp2, .mp3 { animation: none; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- mobile ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 60px; min-height: 0; padding: 52px 0 64px; }
  .hero-panel { max-width: 620px; }
  .orbit-deco { display: none; }
  .pillar-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .site-header, .section-shell, footer { width: calc(100% - 40px); }
  .site-header { height: 74px; }
  .paper-rules { background: repeating-linear-gradient(transparent 0 35px, rgba(23, 26, 33, .045) 35px 36px); }
  .menu-button {
    display: block; background: none; border: 0; color: var(--ink);
    font: 600 12px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .1em;
  }
  nav {
    position: absolute; display: none; top: 73px; right: 0; left: 0; background: var(--card);
    border: 1.5px solid var(--ink); padding: 20px; align-items: start; flex-direction: column; gap: 20px; z-index: 5;
  }
  nav.open { display: flex; }
  h1 { margin: 32px 0 24px; font-size: clamp(44px, 12.5vw, 68px); }
  .hero-lede { font-size: 16px; }
  .statement { display: block; padding: 95px 0; }
  .statement h2 { margin-top: 30px; }
  .statement-copy { font-size: 16px; padding-left: 20px; }
  .section-heading { display: block; }
  .section-heading > p:last-child { width: auto; margin-top: 22px; }
  .pillars { padding: 10px 0 95px; }
  .method { padding: 82px 0; }
  .method-grid { display: block; }
  .method h2 { margin-bottom: 48px; }
  .flow-figure { margin-top: 60px; overflow-x: auto; }
  .flow-svg { min-width: 640px; }
  .status { padding: 90px 0; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-grid article { min-height: 0; border-right: 0; border-bottom: 1.5px solid var(--ink); }
  .metric-grid article:last-child { border-bottom: 0; }
  .contact-panel { padding: 34px 24px; }
  footer { padding: 25px 0; min-height: 0; align-items: start; flex-direction: column; gap: 13px; }
}

/* ---- Exhibit (terminal screenshot, 2026-08-25) ---- */
.exhibit { padding: 10px 0 100px; }
.exhibit-frame {
  position: relative; margin: 0; background: var(--card);
  border: 1.5px solid var(--ink); border-radius: 4px; padding: 14px 14px 4px;
  box-shadow: 8px 8px 0 0 rgba(23, 26, 33, .12);
}
.exhibit-frame::before, .exhibit-frame::after {
  position: absolute; color: var(--flame); font: 500 18px "IBM Plex Mono", monospace;
}
.exhibit-frame::before { content: "+"; top: -11px; left: -7px; }
.exhibit-frame::after { content: "+"; bottom: -12px; right: -7px; }
.exhibit-frame img { width: 100%; height: auto; display: block; border-radius: 3px; border: 1px solid var(--ink); }
.exhibit-frame figcaption {
  font: 500 13px "IBM Plex Mono", monospace; letter-spacing: .07em;
  color: #454b55; padding: 15px 6px 14px; line-height: 1.6;
}
@media (max-width: 760px) {
  .exhibit-frame { padding: 8px 8px 2px; }
  .exhibit-frame figcaption { font-size: 12px; }
}
