:root {
  --paper: #f6f1e7;
  --paper-soft: #ede5d2;
  --paper-deep: #e3d8be;
  --ink: #15110d;
  --ink-soft: #3a322a;
  --ink-mute: #6e6357;
  --oxblood: #7a1f1f;
  --oxblood-deep: #5c1414;
  --gold: #b9802a;
  --gold-deep: #8b5c14;
  --sage: #6b7d5c;
  --rule: #c9bfa6;
  --rule-soft: #d9cfb8;
  --shadow-card: 0 1px 0 #d9cfb8, 0 18px 36px -18px rgba(21, 17, 13, .26), 0 4px 10px -6px rgba(21, 17, 13, .15);
  --shadow-pop: 0 2px 0 var(--ink), 0 22px 44px -20px rgba(21, 17, 13, .32), 0 6px 14px -8px rgba(21, 17, 13, .18);
  --shadow-deep: 0 30px 60px -28px rgba(21, 17, 13, .42), 0 12px 24px -14px rgba(21, 17, 13, .22);
  --shadow-offset-ox: 6px 6px 0 0 var(--oxblood), 0 18px 36px -18px rgba(21, 17, 13, .28);
  --shadow-offset-ink: 6px 6px 0 0 var(--ink), 0 18px 36px -18px rgba(21, 17, 13, .28);

  /* vertical rhythm scale (4px base) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 36px;
  --space-5: 56px;
  --space-6: 80px;
  --space-7: 112px;
  --space-8: 144px;
}

* { box-sizing: border-box; }

/* paper grain texture overlay - stronger */
html::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.09  0 0 0 0 0.07  0 0 0 0 0.04  0 0 0 0.16 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
  opacity: .9; mix-blend-mode: multiply; z-index: 1;
}
/* second layer: warm vignette + subtle diagonal weave */
html::after {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 80% at 50% 35%, transparent 0%, rgba(120, 75, 30, .07) 65%, rgba(60, 30, 10, .14) 100%),
    repeating-linear-gradient(135deg, rgba(120, 90, 50, .025) 0 2px, transparent 2px 6px);
  z-index: 1;
}

html, body {
  margin: 0; padding: 0;
  background:
    radial-gradient(ellipse 120% 100% at 50% 0%, #faf5eb 0%, var(--paper) 45%, #efe7d4 100%);
  color: var(--ink);
  font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
  font-size: 19px;
  line-height: 1.5;
  font-feature-settings: "kern", "liga", "onum", "pnum";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body { position: relative; z-index: 0; }
body > * { position: relative; z-index: 2; }

h1, h2, h3, h4, .display {
  font-family: 'GFS Didot', 'Didot', 'Bodoni 72', 'Bodoni Moda', serif;
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.005em;
  color: var(--ink);
}

h1 { font-size: clamp(2.4rem, 5.2vw, 4.4rem); margin: 0 0 .35em; font-weight: 400; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); margin: 0 0 .4em; }
h3 { font-family: 'EB Garamond', serif; font-weight: 600; font-size: 1.35rem; margin: 0 0 .35em; letter-spacing: -.005em; }
h4 { font-family: 'EB Garamond', serif; font-weight: 600; font-size: 1.05rem; margin: 0 0 .25em; }

p { margin: 0 0 1.1em; color: var(--ink-soft); font-size: 1.06rem; }
p.lede { font-size: 1.35rem; line-height: 1.45; color: var(--ink-soft); font-style: italic; font-weight: 400; max-width: 38em; }
em, i { font-style: italic; }

.mono { font-family: 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace; }

a { color: var(--oxblood); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; transition: color .12s; }
a:hover { color: var(--oxblood-deep); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 40px; }

/* paragraph rhythm */
p + p { margin-top: 0; }
.lede + .signals { margin-top: var(--space-4); }
h1 + .lede, h2 + .lede, h1 + p, h2 + p { margin-top: var(--space-2); }
.section-mark + h1, .section-mark + h2 { margin-top: 0; }

/* section marker like "§ 01 · An Invitation" */
.section-mark {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex; align-items: center; gap: 14px;
  margin-bottom: var(--space-4);
}
.section-mark::before {
  content: '§'; color: var(--oxblood);
  font-family: 'GFS Didot', serif; font-size: 1.2rem; line-height: 1;
}
.section-mark .num { font-weight: 600; color: var(--ink); }
.section-mark .rule { flex: 1; height: 1px; background: var(--rule); }

/* drop cap */
.dropcap::first-letter {
  font-family: 'GFS Didot', serif;
  font-size: 5.4em;
  float: left;
  line-height: .85;
  padding-right: .08em;
  padding-top: .06em;
  color: var(--oxblood);
  font-weight: 400;
}

/* italicized accent */
.accent { color: var(--oxblood); font-style: italic; }
.accent-gold { color: var(--gold-deep); }

/* archival button (library card style) */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 14px 22px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: background .15s, color .15s, transform .12s, box-shadow .15s;
  box-shadow: 4px 4px 0 0 var(--oxblood);
}
.btn:hover {
  background: var(--oxblood);
  border-color: var(--oxblood);
  color: var(--paper);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 0 var(--ink);
}
.btn .arrow {
  font-family: 'GFS Didot', serif; font-size: 1.1rem; line-height: 1; letter-spacing: 0;
  margin-top: -2px;
}
.btn.btn-oxblood { background: var(--oxblood); border-color: var(--oxblood); box-shadow: 4px 4px 0 0 var(--ink); }
.btn.btn-oxblood:hover { background: var(--ink); border-color: var(--ink); box-shadow: 5px 5px 0 0 var(--oxblood); }
.btn.btn-paper { background: var(--paper); color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 0 var(--ink); }
.btn.btn-paper:hover { background: var(--ink); color: var(--paper); }

/* inputs - library card aesthetic */
input[type="text"], input[type="email"] {
  width: 100%;
  padding: 16px 18px;
  border: none;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  color: var(--ink);
  outline: none;
  font-style: italic;
  transition: border-color .15s, background .15s;
}
input::placeholder { color: var(--ink-mute); font-style: italic; }
input:focus { border-color: var(--oxblood); background: rgba(185, 128, 42, .04); }

/* nav */
.nav {
  border-bottom: 1px solid var(--rule);
  background: rgba(246, 241, 231, .94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--rule-soft), 0 10px 24px -16px rgba(21, 17, 13, .22);
  position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px; max-width: 1280px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px;
  border: 1.5px solid var(--ink);
  display: grid; place-items: center;
  font-family: 'GFS Didot', serif;
  font-weight: 700;
  font-size: 1.3rem;
  background: var(--paper);
  color: var(--oxblood);
}
.brand-name {
  font-family: 'GFS Didot', serif;
  font-size: 1.3rem;
  letter-spacing: .005em;
}
.brand-name .small { font-family: 'IBM Plex Mono', monospace; font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; display: block; color: var(--ink-mute); margin-top: 2px; }
.nav-links {
  display: flex; align-items: center; gap: 32px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .76rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav-links a { color: var(--ink-soft); text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.nav-links a:hover { color: var(--oxblood); border-bottom-color: var(--oxblood); }

/* utility: card pop */
.card-pop { box-shadow: var(--shadow-pop); }
.card-deep { box-shadow: var(--shadow-deep); }
.card-offset-ox { box-shadow: var(--shadow-offset-ox); }
.card-offset-ink { box-shadow: var(--shadow-offset-ink); }

/* alternating section backgrounds for depth */
.section.alt {
  background: linear-gradient(180deg, var(--paper-soft) 0%, #e6dcc4 100%);
  box-shadow:
    inset 0 1px 0 var(--paper-deep),
    inset 0 -1px 0 var(--rule),
    inset 0 10px 24px -18px rgba(21, 17, 13, .25);
  position: relative;
}
.section.alt::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background-image:
    linear-gradient(var(--rule) 0 1px, transparent 1px 5px, var(--rule) 5px 6px);
  opacity: .5;
  pointer-events: none;
}

/* footer */
.footer {
  border-top: 2px solid var(--ink);
  padding: 64px 40px 48px;
  margin-top: 120px;
  background: linear-gradient(180deg, var(--paper-soft) 0%, #e3d8be 100%);
  position: relative;
  box-shadow: inset 0 16px 32px -20px rgba(21, 17, 13, .25);
}
.footer::before {
  content: ''; position: absolute; top: 6px; left: 0; right: 0; height: 1px; background: var(--ink);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .76rem;
  letter-spacing: .08em;
  color: var(--ink-mute);
}
.footer a { color: var(--ink); text-decoration: none; margin-left: 24px; }
.footer a:hover { color: var(--oxblood); }
.footer-colophon { max-width: 36em; line-height: 1.7; }
.footer-colophon strong { color: var(--ink); }

/* exhibits / cards */
.exhibit {
  background: var(--paper-soft);
  border: 1px solid var(--rule);
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-card);
}
.exhibit .figure {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex; gap: 12px;
  margin-bottom: 14px;
}
.exhibit .figure strong { color: var(--ink); font-weight: 600; }

/* big number exhibit */
.big-number {
  font-family: 'GFS Didot', serif;
  font-size: clamp(2.6rem, 5.6vw, 4.8rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--oxblood);
  display: block;
}

/* hand-drawn underline */
.underline-hand {
  position: relative;
  display: inline-block;
}
.underline-hand::after {
  content: '';
  position: absolute;
  left: -2%; right: -2%;
  bottom: -.1em;
  height: 12px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'><path d='M2 8 Q 50 2, 100 7 T 198 6' stroke='%237a1f1f' stroke-width='2.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

/* marginalia */
.marginalia {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--ink-mute);
  letter-spacing: .005em;
  border-left: 2px solid var(--oxblood);
  padding-left: 16px;
}
.marginalia strong { color: var(--ink); font-weight: 600; }
.marginalia .fig { font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; display: block; margin-bottom: 8px; color: var(--oxblood); }

/* divider rules */
.rule { height: 1px; background: var(--rule); border: 0; margin: 80px 0; }
.rule-double {
  position: relative; height: 6px; border: 0; margin: 80px 0;
  background: linear-gradient(var(--rule) 0 1px, transparent 1px 5px, var(--rule) 5px 6px);
}
.rule-ornament {
  border: 0; text-align: center; margin: 80px 0;
  font-family: 'GFS Didot', serif; font-size: 1.4rem; color: var(--oxblood);
}
.rule-ornament::before { content: '✦  ✦  ✦'; letter-spacing: .8em; }

/* kicker / eyebrow */
.kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--oxblood);
  font-weight: 500;
  margin-bottom: 16px;
}

/* mockup banner */
.mockup-banner {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 9px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  position: relative; z-index: 100;
}
.mockup-banner strong { color: var(--gold); font-weight: 500; }

/* footnote refs */
sup.fn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .55em;
  color: var(--oxblood);
  font-weight: 600;
  padding-left: 2px;
  vertical-align: super;
  line-height: 0;
}

/* scroll reveal — progressive enhancement, JS adds .js-reveal to <html> */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity .9s cubic-bezier(.22, .8, .26, 1) var(--reveal-delay, 0ms),
    transform .9s cubic-bezier(.22, .8, .26, 1) var(--reveal-delay, 0ms),
    filter .9s ease var(--reveal-delay, 0ms);
  filter: blur(2px);
  will-change: opacity, transform;
}
.js-reveal .reveal.is-in {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* lighter motion for inline runs (headings) */
.js-reveal h1.reveal, .js-reveal h2.reveal {
  transform: translateY(14px);
}

/* funnel stages slide in from the left, cascaded */
.js-reveal .fstage.reveal {
  transform: translateX(-16px) translateY(0);
}
.js-reveal .fstage.reveal.is-in { transform: none; }

/* drop cap fade rather than slide */
.js-reveal .dropcap.reveal { transform: none; }

/* respect reduced motion */
html.reduced-motion .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }

/* responsive */
@media (max-width: 880px) {
  .nav-inner { padding: 14px 20px; gap: 12px; flex-wrap: nowrap; }
  .brand { gap: 10px; min-width: 0; flex: 0 1 auto; }
  .brand-mark { width: 32px; height: 32px; font-size: 1.1rem; flex-shrink: 0; }
  .brand-name { font-size: 1.05rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand-name .small { display: none; }
  .nav-links { gap: 18px; font-size: .66rem; letter-spacing: .12em; flex: 0 1 auto; min-width: 0; }
  .nav-links a { white-space: nowrap; }
}
@media (max-width: 640px) {
  /* hide secondary nav links; keep only Pricing as conversion CTA */
  .nav-links a:not(:last-child) { display: none; }
  .nav-links a:last-child {
    background: var(--ink);
    color: var(--paper);
    padding: 8px 12px;
    font-weight: 600;
  }
  .nav-links a:last-child:hover { background: var(--oxblood); color: var(--paper); border-bottom-color: transparent; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .container, .narrow { padding: 0 24px; }
}
