/* Vincent Hartline — editorial ledger
   Two faces: Source Serif 4 for display and figures, Inter for everything else. */

:root {
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --paper: #f7f5f0;
  --card: #fdfcf9;
  --ink: #16171a;
  --ink-soft: #2b2d33;
  --muted: #62646b;
  --faint: #b9b7b0;
  --rule: #dcd9d1;
  --accent: #1f5f5b;
  --accent-ring: rgba(31, 95, 91, .18);
  --hover: rgba(22, 23, 26, .035);

  /* Synthwave backdrop (light: pastel dusk) */
  --sky-top: #d8c7f3;
  --sky-mid: #f5c3dc;
  --sky-low: #ffd6b5;
  --sun-top: #ffbe6b;
  --sun-low: #ff4f8b;
  --floor: #f0d3ec;
  --grid: #b8459f;
  --glow: rgba(255, 110, 170, .5);
  --star: #ffffff;
  --star-alpha: 0;
  --meteor: #ff2f7e;
  --veil-top: 64%;
  --veil-low: 78%;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #120f1a;
    --card: #1a1624;
    --ink: #ecebe6;
    --ink-soft: #d6d5cf;
    --muted: #9a9a96;
    --faint: #44454a;
    --rule: #2d2739;
    --accent: #6fbfb6;
    --accent-ring: rgba(111, 191, 182, .2);
    --hover: rgba(236, 235, 230, .04);
    --sky-top: #07021a;
    --sky-mid: #1e0b40;
    --sky-low: #5e1a6e;
    --sun-top: #ffd166;
    --sun-low: #ff2e88;
    --floor: #0b0420;
    --grid: #ff3cac;
    --glow: rgba(255, 60, 172, .55);
    --star: #f3e8ff;
    --star-alpha: .8;
    --meteor: #fff1fa;
    --veil-top: 58%;
    --veil-low: 74%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #120f1a;
  --card: #1a1624;
  --ink: #ecebe6;
  --ink-soft: #d6d5cf;
  --muted: #9a9a96;
  --faint: #44454a;
  --rule: #2d2739;
  --accent: #6fbfb6;
  --accent-ring: rgba(111, 191, 182, .2);
  --hover: rgba(236, 235, 230, .04);
  --sky-top: #07021a;
  --sky-mid: #1e0b40;
  --sky-low: #5e1a6e;
  --sun-top: #ffd166;
  --sun-low: #ff2e88;
  --floor: #0b0420;
  --grid: #ff3cac;
  --glow: rgba(255, 60, 172, .55);
  --star: #f3e8ff;
  --star-alpha: .8;
  --meteor: #fff1fa;
  --veil-top: 58%;
  --veil-low: 74%;
  color-scheme: dark;
}

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

html {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.625;
  font-variant-numeric: tabular-nums lining-nums;
}

h1, h2, h3.serif, .font-display {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.012em;
}

a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Layout */
.wrap {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}
@media (min-width: 640px) {
  .wrap {
    padding-left: max(2rem, env(safe-area-inset-left, 0px));
    padding-right: max(2rem, env(safe-area-inset-right, 0px));
  }
}
.measure { max-width: 40rem; }

/* Masthead */
.masthead {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.masthead .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-top: 1.1rem; padding-bottom: 1.1rem;
}
.wordmark {
  font-family: var(--font-serif); font-weight: 600; font-size: 1.2rem;
  text-decoration: none; letter-spacing: -0.01em;
}
.wordmark:hover { color: var(--ink); }
.nav { display: flex; gap: 1.5rem; flex-wrap: wrap; list-style: none; }
.nav a { font-size: .9rem; font-weight: 500; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] {
  color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

body::before {
  content: ""; position: fixed; inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper);
}

/* Synthwave backdrop: canvas drawn by site.js, veiled so text stays readable */
.synth-bg, .synth-veil { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.synth-veil {
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--paper) var(--veil-top), transparent),
    color-mix(in srgb, var(--paper) var(--veil-low), transparent));
}
main, .footer { position: relative; z-index: 1; }

/* Type scale */
.kicker {
  font-size: .75rem; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 600; color: var(--accent); margin-bottom: .9rem;
}
.label-caps {
  font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 600; color: var(--muted);
}
.hero-title { font-size: 2.6rem; line-height: 1.04; }
@media (min-width: 640px) { .hero-title { font-size: 3.75rem; } }
.page-title { font-size: 2.25rem; line-height: 1.08; }
@media (min-width: 640px) { .page-title { font-size: 3rem; } }
.section-title { font-size: 1.875rem; line-height: 1.15; }
.card-title { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.lead { font-size: 1.125rem; color: var(--muted); line-height: 1.625; max-width: 36rem; margin-top: 1.1rem; }
.small { font-size: .8125rem; color: var(--muted); line-height: 1.45; }

.fig-num { font-family: var(--font-serif); font-size: 2rem; line-height: 1.05; font-weight: 600; letter-spacing: -.01em; }
.fig-src { font-size: .8125rem; color: var(--muted); margin-top: .4rem; line-height: 1.45; }

/* Sections */
.hero { padding-block: 4.5rem 3.5rem; }
.page-head { padding-block: 4rem 2.5rem; }
.section { padding: 3.5rem 0; border-top: 1px solid var(--ink); }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem;
}
@media (min-width: 640px) { .section { padding: 4.5rem 0; } }

/* Buttons */
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; }
.btn {
  display: inline-block; border-radius: 4px; padding: .65rem 1.15rem;
  font-size: .9rem; font-weight: 500; text-decoration: none;
  border: 1px solid var(--ink);
  transition: background-color 120ms, color 120ms, border-color 120ms;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink-soft); border-color: var(--ink-soft); color: var(--paper); }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }

.text-link { font-size: .9rem; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }

/* Panels and figure rows */
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; }

.figures { display: grid; grid-template-columns: 1fr; }
.figures > div { padding: 1.4rem 1.5rem; }
.figures > div + div { border-top: 1px solid var(--rule); }
@media (min-width: 720px) {
  .figures { grid-template-columns: repeat(var(--cols, 3), 1fr); }
  .figures > div + div { border-top: 0; border-left: 1px solid var(--rule); }
}

/* Two-column split */
.split { display: grid; gap: 2rem; }
@media (min-width: 860px) {
  .split { grid-template-columns: 1.4fr 1fr; gap: 0; }
  .split > :first-child { padding-right: 3rem; }
  .split > :last-child { padding-left: 3rem; border-left: 1px solid var(--rule); }
}

.points { list-style: none; }
.points li { padding: .85rem 0; border-bottom: 1px solid var(--rule); }
.points li:first-child { padding-top: 0; }
.points li:last-child { border-bottom: 0; }

/* Ledger rows (experience, education) */
.ledger { list-style: none; }
.ledger > li {
  display: grid; gap: .35rem 2rem; padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.ledger > li:first-child { padding-top: .5rem; }
@media (min-width: 720px) { .ledger > li { grid-template-columns: 11rem 1fr; } }
.ledger .when { font-size: .8125rem; color: var(--muted); padding-top: .3rem; }
.ledger .role { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; line-height: 1.25; }
.ledger .org { font-weight: 500; color: var(--ink-soft); margin-top: .15rem; }
.ledger .desc { color: var(--muted); margin-top: .6rem; max-width: 42rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.ledger-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.ledger-table th {
  text-align: left; font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 600; color: var(--muted); padding: .6rem .75rem .6rem 0;
  border-bottom: 1px solid var(--ink);
}
.ledger-table td { padding: .85rem .75rem .85rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ledger-table tr:hover td { background: var(--hover); }
.ledger-table td.num, .ledger-table th.num { text-align: right; }

/* Cards grid */
.grid-2 { display: grid; gap: 1.25rem; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.card { padding: 1.75rem; display: flex; flex-direction: column; gap: .75rem; }
.card .meta { font-size: .8125rem; color: var(--muted); }
.card p { color: var(--muted); }
.card .foot { margin-top: auto; padding-top: .5rem; display: flex; gap: 1.25rem; flex-wrap: wrap; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .75rem; font-weight: 500; color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 4px; padding: .15rem .5rem;
}
.badge {
  display: inline-block; font-size: .6875rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; border: 1px solid currentColor; border-radius: 999px;
  padding: .1rem .6rem; color: var(--accent);
}

/* Press list */
.press { list-style: none; columns: 1; }
@media (min-width: 640px) { .press { columns: 2; column-gap: 3rem; } }
.press li { break-inside: avoid; padding: .55rem 0; border-bottom: 1px solid var(--rule); }

/* Contact */
.contact-rows { list-style: none; max-width: 36rem; }
.contact-rows li {
  display: grid; grid-template-columns: 7rem 1fr; gap: 1rem;
  padding: .9rem 0; border-bottom: 1px solid var(--rule);
}

/* Footer */
.footer { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; margin-top: 2rem; }
.footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Motion */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity .35s ease-out, transform .35s ease-out; transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
