/* ========================================================
   Tarth · Hub · shared styles
   Inherits the editorial-magenta system from the landing page.
   ======================================================== */
:root {
  --bg: #FCF9F8;
  --bg-2: #F6F3F2;
  --surface: #FFFFFF;
  --surface-2: #F0EDEC;
  --line: #E8E4E2;
  --line-2: #DCD7D3;
  --ink: #2E2635;
  --ink-2: #554E5E;
  --ink-3: #7F7985;
  --ink-4: #ADA8B0;

  --amber: #C8A96E;
  --amber-warm: #A68852;
  --amber-soft: #F3EBD8;

  --magenta: #5A3A4A;
  --magenta-ink: #3D2430;
  --magenta-soft: #E8DAE0;

  --blue: #3A6FCF;
  --blue-soft: #E8EEFA;
  --green: #2F6B46;
  --green-soft: #E6EEE7;

  --sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { font-size: 15.5px; line-height: 1.55; font-weight: 400; letter-spacing: -0.005em; overflow-x: hidden; position: relative; }

/* Quiet parchment wash — same recipe as landing, softened so article pages
   feel like pages of the same publication. */
body::before {
  content: ''; position: fixed; inset: -10%;
  z-index: 0;
  pointer-events: none;
  filter: blur(95px) saturate(110%);
  opacity: 0.72;
  background:
    radial-gradient(ellipse 44% 36% at 88% 10%,  rgba(30, 29, 51, 0.22), transparent 62%),
    radial-gradient(ellipse 50% 40% at 92% 55%,  rgba(120, 112, 108, 0.18), transparent 60%),
    radial-gradient(ellipse 46% 36% at 6% 48%,   rgba(118, 120, 128, 0.14), transparent 62%),
    radial-gradient(ellipse 46% 38% at 10% 80%,  rgba(30, 29, 51, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(245, 240, 228, 0.80) 0%, rgba(245, 240, 228, 0.55) 55%, rgba(245, 240, 228, 0.35) 100%);
}
body::after {
  content: ''; position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='800' height='800'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.34' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.11  0 0 0 0 0.18  0 0 0 1.15 0'/><feComponentTransfer><feFuncA type='discrete' tableValues='0 0 0 0 0.35 0.55 0.75 0.95 1 1'/></feComponentTransfer></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 800px 800px;
  image-rendering: pixelated;
  opacity: 0.55;
  mix-blend-mode: overlay;
}
body > * { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--magenta-soft); color: var(--magenta); }

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

/* Typography */
h1, h2, h3, h4 { margin: 0; font-family: var(--sans); font-weight: 500; letter-spacing: -0.025em; color: var(--ink); line-height: 1.08; }
h1 { font-size: clamp(40px, 4.6vw, 60px); letter-spacing: -0.032em; font-weight: 500; line-height: 1.05; }
h2 { font-size: clamp(28px, 3vw, 38px); letter-spacing: -0.022em; font-weight: 500; line-height: 1.1; }
h3 { font-size: clamp(18px, 1.5vw, 22px); letter-spacing: -0.015em; font-weight: 500; line-height: 1.3; }
h4 { font-size: 14px; font-weight: 500; letter-spacing: -0.005em; }

.eyebrow {
  font-family: var(--sans); font-size: 11.5px;
  letter-spacing: 0.02em; color: var(--ink-3); font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}

p.lede { font-size: clamp(16.5px, 1.2vw, 18.5px); line-height: 1.6; color: var(--ink-2); font-weight: 400; max-width: 560px; }

/* =============== Nav =============== */
nav.top {
  position: relative;
  z-index: 50;
  width: 100%;
  padding: 18px 0;
  background: transparent;
  border: 0;
}
nav.top .wrap { padding: 0 32px; }
nav.top .row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  position: relative;
}
.brand {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 19px; font-weight: 700;
  letter-spacing: -0.045em; color: var(--ink);
}
.brand-mark { width: 24px; height: 24px; display: inline-block; flex-shrink: 0; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-size: 13.5px; color: var(--ink-3); font-weight: 450;
  padding: 6px 0; border-bottom: 1px solid transparent;
  transition: color 180ms;
}
.nav-links a:hover, .nav-links a.current { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-ghost { font-size: 13.5px; color: var(--ink-2); padding: 8px 0; }
.nav-ghost:hover { color: var(--ink); }
.nav-cta {
  background: var(--ink); color: var(--bg);
  padding: 9px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 500; letter-spacing: -0.005em;
  transition: background 200ms, transform 200ms;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-cta:hover { background: #1F1825; transform: translateY(-1px); }

/* =============== Page header (hub index + post) =============== */
.page-head {
  padding: 32px 0 56px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 56px;
}
.page-head .kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.page-head h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 5vw, 68px);
  letter-spacing: -0.025em;
  line-height: 1;
  max-width: 14ch;
  margin-bottom: 18px;
}
.page-head h1 em { font-style: italic; color: var(--magenta); font-weight: 500; }
.page-head .sub {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
  font-weight: 400;
}

/* =============== Hub grid (card list) =============== */
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.hub-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  display: flex; flex-direction: column;
  transition: transform 300ms cubic-bezier(.2,.9,.3,1), border-color 300ms, box-shadow 300ms;
}
.hub-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 20px 40px -26px rgba(21, 19, 31, 0.12); }
.hub-card .cover {
  aspect-ratio: 1.6; border-radius: 12px; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.hub-card .cover svg { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.hub-card .cover::after {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.3' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.07  0 0 0 0 0.06  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.42;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.hub-card .tag {
  font-size: 10.5px; font-weight: 500; color: var(--magenta);
  letter-spacing: 0.02em; margin-bottom: 8px;
}
.hub-card .tag.blue { color: var(--blue); }
.hub-card .tag.amber { color: var(--amber-warm); }
.hub-card .tag.plum { color: var(--rust); }
.hub-card h3 { font-size: 16.5px; font-weight: 500; letter-spacing: -0.015em; margin-bottom: 10px; line-height: 1.3; }
.hub-card p { font-size: 13px; color: var(--ink-3); line-height: 1.55; margin: 0 0 14px; flex-grow: 1; }
.hub-card .meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--ink-4);
  padding-top: 14px; border-top: 1px solid var(--line);
}

/* =============== Hub section wrapper =============== */
section.hub-section { padding: 0 0 96px; }

/* =============== Back link (on posts) =============== */
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 20px;
  transition: color 180ms;
}
.back-link:hover { color: var(--ink); }
.back-link svg { width: 12px; height: 12px; }

/* =============== Post header =============== */
.post-head {
  padding: 24px 0 48px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.post-head .tag-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 22px;
}
.post-head .tag-row .tag {
  color: var(--magenta);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.post-head .tag-row .tag.blue { color: var(--blue); }
.post-head .tag-row .tag.amber { color: var(--amber-warm); }
.post-head .tag-row .tag.plum { color: var(--rust); }
.post-head .tag-row .sep {
  width: 3px; height: 3px; border-radius: 999px; background: var(--ink-4);
  display: inline-block;
}
.post-head h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4.2vw, 54px);
  letter-spacing: -0.022em;
  line-height: 1.08;
  max-width: 22ch;
  margin-bottom: 18px;
  color: var(--ink);
}
.post-head .dek {
  font-size: 18.5px;
  line-height: 1.55;
  color: var(--ink-2);
  font-weight: 400;
  max-width: 52ch;
  letter-spacing: -0.008em;
}

/* =============== Article body =============== */
.post-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  max-width: 62ch;
}
.post-body > * { margin: 0 0 22px; }
.post-body h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin-top: 48px;
  margin-bottom: 16px;
  line-height: 1.2;
}
.post-body h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-top: 32px;
  margin-bottom: 12px;
}
.post-body p { color: var(--ink); }
.post-body p.lead {
  font-size: 19px;
  color: var(--ink-2);
  font-weight: 400;
  margin-bottom: 28px;
}
.post-body a {
  color: var(--magenta);
  border-bottom: 1px solid var(--magenta-soft);
  transition: border-color 180ms;
}
.post-body a:hover { border-color: var(--magenta); }
.post-body blockquote {
  margin: 32px 0;
  padding: 18px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--magenta);
  border-radius: 0 12px 12px 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: -0.01em;
  max-width: 56ch;
}
/* Featured pull-quote — used once per article; larger, unboxed, for the moment
   an author wants to slow the reader. Longer multi-sentence quotes become a small
   editorial block of their own rather than a sidebar. */
.post-body .pullquote {
  margin: 56px -40px;
  padding: 0 40px;
  border-left: 2px solid var(--rust);
  font-family: var(--serif);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.32;
  letter-spacing: -0.018em;
  color: var(--ink);
  max-width: none;
}
.post-body .pullquote em, .post-body .pullquote i {
  font-style: italic;
  color: var(--rust);
}
@media (max-width: 640px) {
  .post-body .pullquote { margin: 40px 0; padding: 0 0 0 22px; }
}
/* Byline row — sits just under the dek on opinion / founder-note pieces */
.post-head .byline {
  margin-top: 24px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13.5px; color: var(--ink-2);
}
.post-head .byline .avatar {
  width: 36px; height: 36px; border-radius: 999px;
  background: linear-gradient(135deg, var(--rust-soft), var(--plum-soft));
  color: var(--rust);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 600; font-size: 13px;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
}
.post-head .byline .who { color: var(--ink); font-weight: 500; }
.post-head .byline .sep {
  width: 3px; height: 3px; border-radius: 999px; background: var(--ink-4);
}
.post-body ul, .post-body ol {
  padding-left: 22px;
  color: var(--ink);
}
.post-body li { margin-bottom: 8px; }
.post-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}
.post-body code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
}
.post-body img, .post-body figure {
  display: block;
  width: 100%;
  margin: 32px 0;
  border-radius: 12px;
  overflow: hidden;
}

/* Post meta — kept at bottom near related */
.post-meta-foot {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--mono);
  letter-spacing: 0.02em;
  max-width: 62ch;
}

/* Related section */
.related {
  margin-top: 96px;
  padding-top: 48px;
  border-top: 1px solid var(--line);
}
.related-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 32px;
}
.related-head h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.015em;
}
.related-head .all-link {
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color 180ms;
}
.related-head .all-link:hover { color: var(--ink); }
.related-head .all-link svg { width: 12px; height: 12px; }

/* Placeholder notice for posts that don't have content yet */
.draft-notice {
  padding: 18px 22px;
  background: var(--amber-soft);
  border: 1px solid rgba(168, 140, 90, 0.25);
  border-radius: 14px;
  font-size: 13.5px;
  color: var(--amber-warm);
  line-height: 1.55;
  max-width: 62ch;
  margin-bottom: 32px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.draft-notice svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.draft-notice b { color: var(--amber-warm); font-weight: 600; }

/* =============== End-of-post CTA =============== */
.cta-block {
  margin-top: 56px;
  padding: 36px 40px;
  background: #FDFCFA;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.cta-block h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.cta-block p {
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.6;
  max-width: 62ch;
  margin-bottom: 22px;
}

/* =============== Footer =============== */
footer { border-top: 1px solid var(--line); padding: 56px 0 40px; background: #FDFCFA; position: relative; z-index: 3; margin-top: 96px; }
footer .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 48px; }
footer .brand-col { max-width: 260px; }
footer .brand-col .tag { font-size: 13px; color: var(--ink-3); margin-top: 10px; line-height: 1.55; }
footer .cols { display: grid; grid-template-columns: 1fr; gap: 40px; }
footer h4 { font-size: 11px; color: var(--ink-4); font-weight: 600; margin: 0 0 14px; letter-spacing: 0.02em; }
footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
footer ul a { font-size: 13px; color: var(--ink-2); }
footer ul a:hover { color: var(--ink); }
footer .legal { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 22px; display: flex; flex-direction: column; gap: 16px; font-size: 11.5px; color: var(--ink-4); }
footer .legal-disclaimer { font-size: 11.5px; line-height: 1.55; color: var(--ink-4); max-width: none; margin: 0; }
footer .legal-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
footer ul.footer-nav {
  list-style: none; padding: 0; margin: 12px 0 0;
  display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-start;
  gap: 18px;
  white-space: nowrap;
}
footer .footer-nav li { display: inline-flex; flex: 0 0 auto; }
footer .footer-nav a { font-size: 12.5px; color: var(--ink-2); letter-spacing: 0.01em; white-space: nowrap; }
footer .footer-nav a:hover { color: var(--ink); }
footer .footer-nav-sep { color: var(--ink-4); font-size: 12px; user-select: none; opacity: 0.45; }
@media (max-width: 640px) {
  footer .footer-nav { gap: 6px; padding: 14px 0; }
  footer .footer-nav a { font-size: 11px; }
  footer .footer-nav-sep { font-size: 11px; }
}

/* =============== Reveal =============== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 800ms cubic-bezier(.2,.9,.3,1), transform 800ms cubic-bezier(.2,.9,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 100ms; }
.reveal.d2 { transition-delay: 200ms; }
.reveal.d3 { transition-delay: 300ms; }
.reveal.d4 { transition-delay: 400ms; }

/* Responsive */
@media (max-width: 820px) {
  .hub-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  footer .row { flex-direction: column; }
}
