/* Pythia published-site stylesheet.
 * Hand-written, no preprocessor. Tokens per claude.md §12.1.
 * Body face is Instrument Serif — matches the index aesthetic
 * (serif body + display sans + mono accents).
 */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/instrumentserif-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/instrumentserif-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/geistmono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-elevated: #161616;
  --surface-overlay: #1c1c1c;

  --border: #1f1f1f;
  --border-strong: #2a2a2a;
  --border-accent: #34d39933;

  --fg: #ededed;
  --fg-muted: #a1a1aa;
  --fg-subtle: #71717a;
  --fg-faint: #52525b;

  --accent: #6ee7b7;
  --accent-dim: #34d399;
  --accent-wash: #10b9811a;

  --font-display: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Instrument Serif', Georgia, serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;

  --text-xs: 0.7rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.5rem;

  --lh-tight: 1.2;
  --lh-snug: 1.4;
  --lh-prose: 1.6;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  --measure: 65ch;
  --container: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --radius-sm: 2px;
  --radius: 4px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 120ms;
  --duration: 200ms;
}

[data-theme='light'] {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-elevated: #f4f4f5;
  --surface-overlay: #ededed;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --fg: #18181b;
  --fg-muted: #52525b;
  --fg-subtle: #71717a;
  --fg-faint: #a1a1aa;
  --accent: #059669;
  --accent-dim: #10b981;
  --accent-wash: #10b9811a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  background: var(--bg);
  color: var(--fg);
}
[data-theme='light'] html { color-scheme: light; }

body {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--lh-prose);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 0%, #0f1410 0%, transparent 40%),
    radial-gradient(circle at 80% 100%, #0d100e 0%, transparent 40%);
}
[data-theme='light'] body { background-image: none; }

/* Hairline grain overlay — atmospheric, near-invisible. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme='light'] body::before { display: none; }

::selection {
  background: var(--accent-wash);
  color: var(--accent);
}

.page {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--gutter) 4rem;
  position: relative;
  z-index: 2;
}

/* Preview banner for signed draft links + the live editor. */
.preview-banner {
  background: var(--accent-wash);
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border-accent);
  padding: var(--space-2) var(--gutter);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-align: center;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 3;
}

/* ── masthead ─────────────────────────────────────── */
.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.masthead__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  letter-spacing: -0.04em;
  line-height: 1;
}
.masthead__title a {
  color: var(--fg);
  text-decoration: none;
}
.masthead__tagline {
  margin-top: var(--space-2);
  color: var(--fg-muted);
  font-size: var(--text-base);
  font-style: italic;
}
.masthead__chrome {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  padding-bottom: 0.4rem;
}
.masthead__chrome a,
.masthead__chrome button {
  color: var(--fg-subtle);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  transition: color var(--duration-fast) var(--ease);
}
.masthead__chrome a:hover,
.masthead__chrome button:hover {
  color: var(--accent);
}

/* ── year section ─────────────────────────────────── */
.year {
  margin-top: var(--space-12);
}
.year__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: var(--space-8);
}
.year__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  color: var(--fg-subtle);
}
.year__rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.year__count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--fg-faint);
}

/* ── entry list ───────────────────────────────────── */
.entries {
  list-style: none;
}
.entry {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 2.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--duration) var(--ease);
}
.entry:hover {
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--surface) 60%,
    transparent 100%
  );
}
.entry:last-child { border-bottom: none; }
.entry__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-subtle);
  letter-spacing: 0.04em;
  padding-top: 0.5rem;
  text-transform: lowercase;
  white-space: nowrap;
}
.entry__date .num {
  color: var(--fg-muted);
  font-weight: 500;
}
.entry__body {
  min-width: 0;
  max-width: var(--measure);
}
.entry__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-2xl);
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-bottom: var(--space-2);
}
.entry__title a {
  color: var(--fg);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 250ms ease;
  padding-bottom: 2px;
}
.entry__title a:hover { background-size: 100% 1px; }
.entry__excerpt {
  color: var(--fg-muted);
  font-size: var(--text-lg);
  line-height: var(--lh-prose);
  margin-bottom: var(--space-3);
}
.entry__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  text-transform: lowercase;
}
.entry__meta .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-wash);
}
.entry__tags {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}
.entry__tags span {
  color: var(--fg-subtle);
  border: 1px solid var(--border-strong);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
}

.empty {
  color: var(--fg-muted);
  font-style: italic;
  padding: var(--space-12) 0;
  text-align: center;
}

/* ── post page ────────────────────────────────────── */
.post {
  max-width: var(--measure);
  margin: var(--space-12) auto var(--space-16);
}
.post-header {
  margin-bottom: var(--space-12);
}
.post-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-4xl);
  line-height: var(--lh-tight);
  letter-spacing: -0.025em;
}
.post-subtitle {
  margin-top: var(--space-3);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--fg-muted);
}
.post-meta {
  margin-top: var(--space-6);
  color: var(--fg-faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.post-meta__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-wash);
  display: inline-block;
}
.post-meta__sep { color: var(--fg-faint); }

/* ── prose body ───────────────────────────────────── */
.prose {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--lh-prose);
  color: var(--fg);
}
.prose > * + * {
  margin-top: var(--space-6);
}
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: var(--lh-tight);
  margin-top: var(--space-12);
  margin-bottom: var(--space-3);
}
.prose h2 { font-size: var(--text-2xl); }
.prose h3 { font-size: var(--text-xl); }
.prose h4 { font-size: var(--text-lg); color: var(--fg-muted); }
.prose a {
  color: var(--fg);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 1px;
  transition: color var(--duration-fast) var(--ease);
}
.prose a:hover { color: var(--accent); }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface-elevated);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.prose pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  overflow-x: auto;
  position: relative;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}
.prose blockquote {
  padding: var(--space-2) var(--space-6);
  border-left: 2px solid var(--border-accent);
  font-size: var(--text-2xl);
  font-style: italic;
  color: var(--fg-muted);
  line-height: var(--lh-snug);
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-12) 0;
}
.prose figure { margin: var(--space-8) 0; }
.prose figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.prose figcaption {
  margin-top: var(--space-2);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  font-style: italic;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
}
.prose th,
.prose td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
}
.prose th {
  color: var(--fg-muted);
  font-weight: 500;
  font-family: var(--font-display);
  font-size: var(--text-sm);
}
.prose ul,
.prose ol { padding-left: var(--space-6); }
.prose li + li { margin-top: var(--space-2); }
.prose .footnotes {
  margin-top: var(--space-16);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  font-size: var(--text-base);
  color: var(--fg-muted);
}
.prose .footnotes a { color: var(--accent); }

/* Theme toggle (in masthead chrome). */
.theme-toggle {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* Copy-code button — visible on <pre> hover. */
.copy-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: var(--surface-elevated);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  padding: 2px 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease);
}
.prose pre:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--accent); }

.footnote-flash {
  background: var(--accent-wash);
  transition: background 1.5s var(--ease);
}

/* ── colophon ─────────────────────────────────────── */
.colophon {
  margin-top: var(--space-24);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  text-transform: lowercase;
}
.colophon a {
  color: var(--fg-subtle);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}
.colophon a:hover { color: var(--accent); }
.colophon__left,
.colophon__right {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (max-width: 640px) {
  .masthead { grid-template-columns: 1fr; }
  .masthead__chrome { padding-bottom: 0; }
  .entry { grid-template-columns: 1fr; gap: 0.5rem; }
  .entry__date { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  html, body {
    background: #fff;
    color: #000;
  }
  body {
    font-size: 11pt;
    line-height: 1.55;
    background-image: none;
  }
  body::before { display: none; }
  .masthead,
  .colophon,
  .preview-banner,
  .copy-btn,
  .theme-toggle { display: none !important; }
  .page,
  .post {
    max-width: none;
    padding: 0;
  }
  .post-title { font-size: 22pt; }
  .post-meta { color: #444; }
  .prose { max-width: none; }
  .prose a {
    color: #000;
    background: none;
    border-bottom: 1px solid #000;
  }
  .prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }
  .prose pre,
  .prose code {
    background: #f5f5f5 !important;
    color: #000 !important;
    border-color: #999 !important;
  }
  .prose figure { page-break-inside: avoid; }
  .footnotes a.footnote-backref { display: none; }
}
