/* ───────────────────────────────────────────────────────────────────────
   Prussel — shared stylesheet for landing, privacy, and notes blog.
   Order: tokens → reset → page chrome → landing → privacy → notes.
   ─────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
}

:root {
  --bg:        #fafaf7;
  --ink:       #0a0a08;
  --ink-soft:  #4a4a45;
  --ink-meta:  #5a5147;
  --ink-faint: #7a7466;
  --rule:      rgba(10,10,8,0.12);
  --rule-soft: rgba(10,10,8,0.08);
  --grid:      rgba(10,10,8,0.04);
  --margin:    rgba(10,10,8,0.08);
  --accent:    #c54a2c;

  --sans: "Inter", "Söhne", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --pad-x: clamp(20px, 4.5vw, 64px);
  --pad-y: clamp(20px, 3.5vw, 40px);

  --meta-size: clamp(10px, 0.78vw, 11px);
  --caps-size: clamp(11px, 1.0vw,  13px);
  --hero-size: clamp(32px, 5.2vw, 72px);   /* landing hero */
  --col-h:     clamp(18px, 1.6vw, 22px);   /* triptych key */
  --col-b:     clamp(13px, 1.0vw, 14px);   /* triptych body */

  --measure: 680px;                         /* post reading column */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── PAGE CHROME ─────────────────────────────────────────────────────── */

.page {
  position: relative;
  min-height: 100vh;
  padding: var(--pad-y) var(--pad-x);
  display: flex;
  flex-direction: column;
}
.page::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}
.page::after {
  content: "";
  position: fixed; inset: 0;
  border-left: 1px solid var(--margin);
  border-right: 1px solid var(--margin);
  margin: 0 calc(var(--pad-x) - 8px);
  pointer-events: none;
  z-index: 0;
}
.page > * { position: relative; z-index: 1; }

/* Landing distributes header / hero / footer across the viewport (no scroll). */
.page.landing {
  justify-content: space-between;
  gap: 48px;
}
/* Privacy is a flowing document with generous breathing room. */
.page.privacy { gap: clamp(48px, 6vw, 80px); }
.page.privacy .privacy-article { flex: 1; }

/* meta bars (header + footer) */
.meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  flex-wrap: wrap;
}
.meta a { color: var(--ink); text-decoration: none; }

/* breadcrumb (notes pages) */
.crumb .slash { margin: 0 12px; color: rgba(10,10,8,0.25); }
.crumb a { border-bottom: 1px solid transparent; transition: border-color 200ms; }
.crumb a:hover { border-bottom-color: var(--ink); }

/* live clock */
.clock .sec { opacity: 0.45; }
@media (prefers-reduced-motion: reduce) {
  .clock .sec { opacity: 1; }
}

/* right-side footer link cluster (every page) */
.footer-links { display: inline-flex; gap: 18px; align-items: baseline; flex-wrap: wrap; }
.footer-links a {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 3px;
  transition: color 200ms, border-color 200ms;
}
.footer-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.footer-links a.secondary { border-bottom: 0; padding-bottom: 0; }

/* eyebrow (used on every surface) */
.eyebrow {
  font-size: var(--caps-size);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────────────────
   LANDING — hero + triptych
   ───────────────────────────────────────────────────────────────────────── */

.hero { max-width: 1100px; }
.hero .eyebrow { margin-bottom: 24px; }
.hero h1 {
  font-size: var(--hero-size);
  line-height: 1.0;
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 18ch;
}

.triptych {
  margin-top: clamp(32px, 4.5vw, 56px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
}
.triptych > div {
  padding: 20px 24px 0 0;
  border-right: 1px solid var(--rule);
}
.triptych > div:last-child { border-right: 0; }
.triptych .n {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.triptych .k {
  font-size: var(--col-h);
  margin-top: 12px;
  font-weight: 500;
}
.triptych .v {
  font-size: var(--col-b);
  margin-top: 6px;
  color: var(--ink-soft);
  line-height: 1.5;
  text-wrap: pretty;
}

/* ─────────────────────────────────────────────────────────────────────────
   PRIVACY — flowing document with numbered sections
   ───────────────────────────────────────────────────────────────────────── */

.privacy-article { max-width: 720px; }
.privacy-article .eyebrow { margin-bottom: 24px; }
.privacy-article h1 {
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.1;
  margin: 0 0 clamp(28px, 3vw, 40px) 0;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-wrap: balance;
  max-width: 28ch;
}
.privacy-article .lede {
  font-size: clamp(15px, 1.1vw, 17px);
  color: var(--ink-soft);
  margin: 0 0 clamp(40px, 4.5vw, 56px) 0;
  max-width: 56ch;
}
.privacy-article section {
  border-top: 1px solid var(--rule);
  padding-top: clamp(20px, 2vw, 28px);
  margin-top: clamp(28px, 3vw, 40px);
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: clamp(16px, 2.5vw, 32px);
}
.privacy-article section:first-of-type { border-top: 1px solid var(--ink); }
.privacy-article section .n {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink);
  padding-top: 2px;
}
.privacy-article section h2 {
  font-size: clamp(16px, 1.3vw, 18px);
  margin: 0 0 12px 0;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.privacy-article section p,
.privacy-article section ul {
  font-size: clamp(14px, 1.0vw, 15px);
  color: var(--ink-soft);
  margin: 0 0 12px 0;
  line-height: 1.6;
  text-wrap: pretty;
}
.privacy-article section p:last-child,
.privacy-article section ul:last-child { margin-bottom: 0; }
.privacy-article section ul { padding-left: 1.1em; }
.privacy-article section li { margin-bottom: 4px; }
.privacy-article section a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color 200ms, border-color 200ms;
}
.privacy-article section a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.privacy-article section strong { color: var(--ink); font-weight: 500; }
.privacy-article .updated {
  margin-top: clamp(40px, 4.5vw, 56px);
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ─────────────────────────────────────────────────────────────────────────
   NOTES INDEX
   ───────────────────────────────────────────────────────────────────────── */

.index-body { flex: 1; margin-top: 48px; }
.index-title {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.0;
  margin: 24px 0 0;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.index-lede {
  margin: 14px 0 0;
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 560px;
  line-height: 1.5;
  text-wrap: pretty;
}

.postlist { margin-top: 56px; border-top: 1px solid var(--ink); }

.postlist-head,
.postrow {
  display: grid;
  grid-template-columns: 120px 1fr 200px 80px;
  align-items: baseline;
  gap: 16px;
}
.postlist-head {
  padding: 10px 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
}
.postlist-head .num { text-align: right; }

.postrow {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink);
  text-decoration: none;
}
.postrow:hover .postrow-title .t { border-bottom-color: var(--ink); }
.postrow:hover .postrow-date { color: var(--accent); }

.postrow-date {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-meta);
  transition: color 200ms;
}
.postrow-title .t {
  font-size: 18px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}
.postrow-title .dek {
  font-size: 13px;
  color: var(--ink-meta);
  margin-left: 14px;
}
.postrow-cat {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-meta);
}
.postrow-words {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-meta);
  text-align: right;
}

/* ─────────────────────────────────────────────────────────────────────────
   NOTES POST
   ───────────────────────────────────────────────────────────────────────── */

.post-body { flex: 1; margin-top: 48px; }
.post { max-width: var(--measure); margin: 0 auto; }

.post-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-meta);
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.post-title {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.05;
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.025em;
  max-width: 14ch;
}
.post-dek {
  margin: 14px 0 0;
  font-size: 19px;
  color: var(--ink-soft);
  line-height: 1.5;
  text-wrap: pretty;
}
.post-content { margin-top: 36px; counter-reset: h2; }

.post-content p {
  font-size: 17px;
  line-height: 1.65;
  margin: 0 0 18px;
  color: var(--ink);
  text-wrap: pretty;
}

/* subheading — auto-numbered §NN with hanging indent so long headings wrap */
.post-content h2 {
  counter-increment: h2;
  position: relative;
  margin: 40px 0 18px;
  padding-top: 16px;
  padding-left: 40px;
  border-top: 1px solid var(--ink);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.post-content h2::before {
  content: "§" counter(h2, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 18px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.post-content blockquote {
  margin: 28px 0 28px -24px;
  padding-left: 24px;
  border-left: 2px solid var(--ink);
  font-size: 24px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.post-content sup a,
.post-content .fnref {
  font-family: var(--mono);
  font-size: 10px;
  margin-left: 2px;
  color: var(--accent);
  text-decoration: none;
  vertical-align: super;
}

.post-table { margin: 28px 0; border: 1px solid var(--ink); }
.post-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 13px;
}
.post-table thead tr { background: var(--ink); color: var(--bg); }
.post-table th {
  padding: 10px 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
  text-align: right;
}
.post-table th:first-child { text-align: left; }
.post-table td { padding: 10px 14px; text-align: right; }
.post-table td:first-child { text-align: left; font-weight: 500; }
.post-table tbody tr + tr { border-top: 1px solid rgba(10,10,8,0.1); }

.post-content figure { margin: 28px 0; }
.post-content figcaption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-meta);
  margin-top: 10px;
  line-height: 1.5;
}

.footnotes {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--ink);
}
.footnotes-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-meta);
  margin-bottom: 12px;
}
.footnote {
  display: grid;
  grid-template-columns: 28px 1fr;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 8px 0;
}
.footnote .fn-n { font-family: var(--mono); color: var(--accent); }

.post-nav {
  max-width: var(--measure);
  margin: 48px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.post-nav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}
.post-nav a:hover { border-bottom-color: var(--ink); }

/* ─────────────────────────────────────────────────────────────────────────
   MOBILE
   ───────────────────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  /* landing */
  .triptych { grid-template-columns: 1fr; }
  .triptych > div {
    padding: 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .triptych > div:last-child { border-bottom: 0; }
  .hero h1 { max-width: none; }

  /* notes index */
  .postlist-head { display: none; }
  .postrow {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "date words"
      "title title"
      "cat cat";
    gap: 4px 16px;
    padding: 16px 0;
  }
  .postrow-date  { grid-area: date; }
  .postrow-words { grid-area: words; text-align: right; }
  .postrow-title { grid-area: title; }
  .postrow-title .dek { display: block; margin-left: 0; margin-top: 2px; }
  .postrow-cat   { grid-area: cat; }

  /* post */
  .post-title { max-width: none; }
  .post-content blockquote { margin-left: 0; }
  .post-table { overflow-x: auto; }
}

@media (max-width: 640px) {
  /* privacy */
  .privacy-article section { grid-template-columns: 1fr; gap: 8px; }
  .privacy-article section .n { padding-top: 0; }
}
