/* ── Self-hosted type (mirrors meringo.app — no CDN dependency) ── */
@font-face { font-family:'Cormorant Garamond'; font-style:normal; font-weight:300 600; font-display:swap; src:url('fonts/cormorant-normal-latin.woff2') format('woff2'); }
@font-face { font-family:'Cormorant Garamond'; font-style:italic;  font-weight:400;     font-display:swap; src:url('fonts/cormorant-italic-latin.woff2') format('woff2'); }
@font-face { font-family:'Outfit';            font-style:normal; font-weight:300 600; font-display:swap; src:url('fonts/outfit-latin.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono';    font-style:normal; font-weight:400;     font-display:swap; src:url('fonts/jetbrainsmono-latin.woff2') format('woff2'); }

/* ── Meringo "Deep Velvet" tokens (mirrored from meringo.app/colors_and_type.css) ── */
:root {
  --bg:           #1A0E2E;   /* MidnightVelvet */
  --bg-surface:   #261840;   /* VelvetSurface */
  --bg-elevated:  #32204F;   /* VelvetElevated */
  --border-dim:   #3D2D5A;
  --border:       #7A6A52;   /* ParchmentFaint */
  --gold:         #E8B560;   /* CandlelightGold */
  --gold-dim:     #9E7A3E;
  --gold-bright:  #F4D080;
  --gold-subtle:  rgba(232,181,96,0.12);
  --gold-border:  rgba(232,181,96,0.40);
  --teal:         #3D8B8B;   /* RuneTeal */
  --fg:           #F4E8D0;   /* Parchment */
  --fg-dim:       #B8A88A;   /* ParchmentDim */
  --fg-muted:     #7A6A52;   /* ParchmentFaint */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui:      'Outfit', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', Consolas, monospace;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --glow-gold:    0 0 40px rgba(232,181,96,0.20), 0 0 80px rgba(232,181,96,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

/* Soft gold glow + velvet vignette */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(232,181,96,0.10), transparent 70%),
    radial-gradient(80% 60% at 50% 120%, rgba(61,139,139,0.06), transparent 70%);
}
/* Fine film grain — echoes the app's velvet grain */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* Shared labels */
.eyebrow, .kicker {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-dim);
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before, .kicker::before {
  content: ''; width: 26px; height: 1px;
  background: linear-gradient(to right, var(--gold-dim), transparent);
}
.kicker { margin-bottom: 18px; }

/* ── Hero ── */
header.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  padding: clamp(56px, 12vh, 120px) 0 clamp(44px, 8vh, 80px);
}
.hero-text { text-align: left; }
.hero-text .eyebrow { margin-bottom: 26px; }
h1 {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(46px, 8vw, 82px); line-height: 1.02; letter-spacing: -0.02em;
  color: var(--fg); margin-bottom: 14px;
}
.role { font-size: clamp(15px, 2.6vw, 18px); color: var(--fg-dim); font-weight: 400; }
.role b { color: var(--fg); font-weight: 500; }
.role .sep { color: var(--gold-dim); margin: 0 8px; }
.hero-thesis {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(23px, 3.6vw, 31px); line-height: 1.32;
  color: var(--fg-dim); margin: 30px 0 0; max-width: 22ch;
}
.hero-thesis em { color: var(--gold-bright); font-style: italic; }

.hero-portrait {
  position: relative;
  border-radius: 18px; overflow: hidden;
  border: 1px solid var(--gold-border);
  box-shadow: var(--glow-gold), 0 24px 60px rgba(0,0,0,0.45);
  aspect-ratio: 4 / 3;
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 32% 34%; display: block; }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 24px; border-radius: 999px;
  font-family: var(--font-ui); font-size: 15px; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn-gold { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #2A1A0A; box-shadow: var(--glow-gold); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 0 50px rgba(232,181,96,0.32), 0 0 90px rgba(232,181,96,0.10); }
.btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--gold-border); color: var(--gold-bright); transform: translateY(-2px); }
.btn svg { width: 17px; height: 17px; }

/* ── Sections ── */
section { padding: clamp(44px, 8vh, 76px) 0; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border-dim), transparent); border: 0; }
h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(28px, 5vw, 42px); line-height: 1.14; letter-spacing: -0.01em;
  color: var(--fg); margin-bottom: 20px; max-width: 20ch; text-wrap: balance;
}
.lede { font-size: 18px; line-height: 1.7; color: var(--fg-dim); max-width: 60ch; }
.lede b { color: var(--fg); font-weight: 500; }
.lede em { color: var(--gold-bright); font-style: italic; }

/* ── Proof strip ── */
.proof-grid {
  display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 4vw, 52px);
  align-items: center;
}
.proof-card {
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6;
  color: var(--fg-dim);
  background: rgba(10,6,20,0.55);
  border: 1px solid var(--border-dim); border-radius: 12px;
  padding: 20px 22px; margin: 0; width: 100%; max-width: 360px;
  overflow-x: auto; white-space: pre;
  box-shadow: 0 14px 32px rgba(0,0,0,0.40), inset 0 1px 0 rgba(255,255,255,0.03);
}
.proof-card .pf-rule { color: var(--gold-dim); }
.proof-card .pf-key  { color: var(--fg-muted); }
.proof-card .pf-hash { color: var(--teal); }
.proof-card .pf-ok   { color: var(--gold); font-weight: 600; }
.proof-copy .lede { margin-bottom: 20px; }
.proof-verify {
  font-family: var(--font-ui); font-size: 15px; font-weight: 500;
  color: var(--gold); text-decoration: none;
  transition: color .2s var(--ease);
}
.proof-verify:hover { color: var(--gold-bright); }

/* ── Stats ── */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin-top: 42px; padding-top: 34px;
  border-top: 1px solid var(--border-dim);
}
.stat-num {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(28px, 4vw, 40px); color: var(--gold-bright); line-height: 1;
}
.stat-label { display: block; margin-top: 8px; font-size: 13px; color: var(--fg-muted); line-height: 1.4; }

/* ── How I build — two panels ── */
.build-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px; }
.panel {
  border: 1px solid var(--border-dim); border-radius: 16px; padding: 26px;
  background: linear-gradient(165deg, rgba(38,24,64,0.5), rgba(26,14,46,0.2));
}
.panel h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px; color: var(--fg); margin-bottom: 14px; }
.panel ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.panel li { position: relative; padding-left: 20px; font-size: 15px; color: var(--fg-dim); line-height: 1.5; }
.panel li::before { content: ''; position: absolute; left: 0; top: 9px; width: 7px; height: 7px; border-radius: 50%; }
.panel.decide li::before { background: var(--gold); }
.panel.verify li::before { background: var(--teal); }
.build-note { margin-top: 24px; font-size: 15px; color: var(--fg-muted); max-width: 62ch; line-height: 1.6; }
.build-note b { color: var(--fg-dim); font-weight: 500; }

/* ── Timeline ── */
.timeline { list-style: none; border-left: 1px solid var(--gold-border); margin-top: 34px; padding-left: 30px; display: flex; flex-direction: column; gap: 34px; }
.timeline li { position: relative; }
.timeline li::before {
  content: ''; position: absolute; left: -35px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px var(--bg), 0 0 12px rgba(232,181,96,0.5);
}
.tl-era { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-dim); }
.timeline h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px; color: var(--fg); margin: 5px 0 6px; }
.timeline p { font-size: 15px; color: var(--fg-dim); line-height: 1.6; max-width: 62ch; }

/* ── What I build — editorial ledger ── */
.ledger { margin-top: 30px; display: flex; flex-direction: column; }
.entry {
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: start;
  padding: 30px 0; border-top: 1px solid var(--border-dim);
}
.entry:last-child { border-bottom: 1px solid var(--border-dim); }
.entry h3 { font-family: var(--font-display); font-weight: 500; font-size: 25px; color: var(--fg); margin-bottom: 8px; }
.entry p { color: var(--fg-dim); font-size: 15.5px; line-height: 1.65; margin-bottom: 14px; max-width: 58ch; }
.entry .links { display: flex; flex-wrap: wrap; gap: 18px; }
.entry .links a { font-size: 14px; font-weight: 500; text-decoration: none; color: var(--gold); transition: color .2s var(--ease); }
.entry .links a:hover { color: var(--gold-bright); }
.entry-shot { width: 132px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-dim); box-shadow: 0 14px 30px rgba(0,0,0,0.4); }
.entry-shot img { width: 100%; height: auto; display: block; }

/* ── Hire / work-with-me ── */
.hire-card {
  border: 1px solid var(--gold-border); border-radius: 20px;
  padding: clamp(28px, 4vw, 44px);
  background: radial-gradient(120% 120% at 0% 0%, rgba(232,181,96,0.08), transparent 60%), linear-gradient(165deg, var(--bg-surface), var(--bg));
}
.hire-card .lede { margin-bottom: 24px; }
.hire-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ── Notes — shared index/listing ── */
.notes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.notes-head p { color: var(--fg-dim); font-size: 16px; max-width: 56ch; }
.notes-all {
  font-family: var(--font-ui); font-size: 15px; font-weight: 500; white-space: nowrap;
  color: var(--gold); text-decoration: none; transition: color .2s var(--ease);
}
.notes-all:hover { color: var(--gold-bright); }

.note-list { list-style: none; margin-top: 30px; display: flex; flex-direction: column; }
.note-list li { border-top: 1px solid var(--border-dim); }
.note-list li:last-child { border-bottom: 1px solid var(--border-dim); }
.note-list a {
  display: block; padding: 26px 4px 26px 0; text-decoration: none;
  transition: padding-left .25s var(--ease);
}
.note-list a:hover { padding-left: 10px; }
.note-list .n-date {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold-dim);
}
.note-list .n-title {
  display: block; margin: 7px 0 7px;
  font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 3vw, 27px);
  line-height: 1.2; color: var(--fg); transition: color .2s var(--ease);
}
.note-list a:hover .n-title { color: var(--gold-bright); }
.note-list .n-dek { display: block; font-size: 15.5px; line-height: 1.6; color: var(--fg-dim); max-width: 64ch; }

/* ── Notes — the article itself ── */
.site-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 24px 0; border-bottom: 1px solid var(--border-dim);
}
.site-bar .brand {
  font-family: var(--font-display); font-weight: 500; font-size: 21px;
  color: var(--fg); text-decoration: none; transition: color .2s var(--ease);
}
.site-bar .brand:hover { color: var(--gold-bright); }
.site-bar nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-bar nav a {
  font-size: 14px; font-weight: 500; color: var(--fg-dim);
  text-decoration: none; transition: color .2s var(--ease);
}
.site-bar nav a:hover, .site-bar nav a[aria-current="page"] { color: var(--gold-bright); }

.note-head { padding: clamp(44px, 9vh, 84px) 0 0; }
.note-head .n-date {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold-dim);
}
.note-head h1 {
  font-size: clamp(34px, 6vw, 56px); font-weight: 400; line-height: 1.06;
  margin: 14px 0 0; text-wrap: balance;
}
.note-dek {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(19px, 2.8vw, 24px); line-height: 1.4;
  color: var(--gold-bright); margin-top: 18px; max-width: 34ch;
}

.note-body { padding: clamp(30px, 5vh, 48px) 0 0; }
.note-body > * + * { margin-top: 22px; }
.note-body p { font-size: 17px; line-height: 1.78; color: var(--fg-dim); }
.note-body strong { color: var(--fg); font-weight: 500; }
.note-body em { color: var(--gold-bright); font-style: italic; }
.note-body h2 {
  font-size: clamp(23px, 3.4vw, 29px); font-weight: 500;
  color: var(--fg); margin: 40px 0 0; max-width: 26ch;
}
.note-body ul, .note-body ol { padding-left: 4px; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.note-body li { position: relative; padding-left: 26px; font-size: 17px; line-height: 1.7; color: var(--fg-dim); }
.note-body ul > li::before {
  content: ''; position: absolute; left: 2px; top: 12px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
}
.note-body ol { counter-reset: n; }
.note-body ol > li { counter-increment: n; }
.note-body ol > li::before {
  content: counter(n) '.'; position: absolute; left: 0; top: 0;
  font-family: var(--font-mono); font-size: 14px; color: var(--gold-dim);
}
.note-body blockquote {
  border-left: 2px solid var(--gold-border); padding: 4px 0 4px 22px;
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(19px, 2.6vw, 23px); line-height: 1.45; color: var(--fg);
}
.note-body .proof-card { max-width: 100%; margin: 30px auto; }
.note-body figure { margin: 34px 0; }
.note-body figcaption {
  margin-top: 12px; font-size: 13.5px; color: var(--fg-muted);
  font-family: var(--font-mono); line-height: 1.55;
}
.note-body a { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--gold-border); transition: color .2s var(--ease); }
.note-body a:hover { color: var(--gold-bright); }

.note-tail {
  margin-top: 52px; padding: 26px 28px;
  border: 1px solid var(--border-dim); border-radius: 16px;
  background: linear-gradient(165deg, rgba(38,24,64,0.5), rgba(26,14,46,0.2));
}
.note-tail p { font-size: 15.5px; line-height: 1.65; color: var(--fg-dim); margin: 0; }
.note-tail b { color: var(--fg); font-weight: 500; }
.note-tail a { color: var(--gold); text-decoration: none; font-weight: 500; }
.note-tail a:hover { color: var(--gold-bright); }

.note-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--border-dim);
}
.note-nav a { text-decoration: none; display: block; }
.note-nav .nn-dir {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold-dim);
}
.note-nav .nn-title {
  display: block; margin-top: 7px; font-family: var(--font-display);
  font-size: 19px; font-weight: 500; line-height: 1.25; color: var(--fg-dim);
  transition: color .2s var(--ease);
}
.note-nav a:hover .nn-title { color: var(--gold-bright); }
.note-nav .nn-next { text-align: right; }
.note-nav .nn-empty { opacity: 0; pointer-events: none; }

/* ── Support ── */
.support .card {
  border: 1px solid var(--border-dim); border-radius: 20px; padding: 30px; text-align: center;
  background: linear-gradient(165deg, var(--bg-surface), var(--bg));
}
.support p { color: var(--fg-dim); max-width: 54ch; margin: 0 auto 8px; }
.support .sig { font-family: var(--font-display); font-style: italic; color: var(--gold-bright); font-size: 19px; margin-top: 4px; }
.support .btn { margin-top: 26px; }

/* ── Footer ── */
footer { padding: 52px 0 64px; text-align: center; }
.connect { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center; margin-bottom: 26px; }
.connect a { font-family: var(--font-ui); font-size: 14px; font-weight: 500; color: var(--fg-dim); text-decoration: none; transition: color .2s var(--ease); }
.connect a:hover { color: var(--gold-bright); }
.copyright { font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); letter-spacing: 0.04em; }
.copyright a { color: var(--gold-dim); text-decoration: none; }

a:focus-visible, .btn:focus-visible {
  outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); border-radius: 6px;
}

/* ── Responsive ── */
@media (max-width: 820px) {
  header.hero { grid-template-columns: 1fr; gap: 34px; }
  .hero-portrait { order: -1; max-width: 340px; aspect-ratio: 5 / 4; }
  .proof-grid { grid-template-columns: 1fr; gap: 28px; }
  .proof-card { max-width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; gap: 26px 20px; }
  .build-panels { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr; }
  .entry-shot { display: none; }
  .note-nav { grid-template-columns: 1fr; }
  .note-nav .nn-next { text-align: left; }
  .note-nav .nn-empty { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
