/* ============================================================
   johnparsneau.com
   One stylesheet, no build step. Tokens are copied verbatim
   from the John Parsneau design system (tokens/*.css), then
   the component classes translate the system's fourteen
   primitives into plain HTML. If a value here disagrees with
   the design system, the design system wins: fix it there
   first, then here.
   ============================================================ */

/* ---- Webfonts · self-hosted, no CDN ----
   Three faces, six files. Display and headings are weight 400
   by rule, so no serif medium/semibold ships. */

@font-face {
  font-family: 'STIX Two Text';
  src: url("/fonts/STIXTwoText-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'STIX Two Text';
  src: url("/fonts/STIXTwoText-RegularItalic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url("/fonts/PublicSans-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url("/fonts/PublicSans-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url("/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url("/fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---- Tokens ---- */

:root {
  /* Warm ink ramp · shared verbatim with dtrmn */
  --ink-950: #14120f;
  --ink-900: #1c1915;
  --ink-850: #242019;
  --ink-800: #2d2822;
  --ink-700: #3d372f;
  --ink-600: #575145;
  --ink-500: #6f6858;
  --ink-400: #8a847a;
  --ink-300: #b3ac9b;
  --ink-200: #d6d0c2;
  --ink-100: #ebe7dd;
  --ink-50:  #f6f4ee;

  /* Paper */
  --paper:       #f7f5ef;  /* THE FIELD · warm, printed, not clinical */
  --paper-white: #ffffff;  /* raised: cards, form wells, the header bar */

  /* Copper · dtrmn's accent, inherited, demoted to a mark */
  --copper-500: #c2540f;
  --copper-600: #a2430c;
  --copper-700: #8a3608;
  --copper-800: #7d3006;
  --copper-100: #f3ddc9;

  /* Semantic color */
  --bg:             var(--paper);
  --surface:        var(--paper-white);
  --surface-sunken: var(--ink-50);
  --surface-header: var(--paper-white);

  --text:        var(--ink-950);
  --text-body:   var(--ink-800);
  --text-muted:  var(--ink-600);
  --text-subtle: var(--ink-500);
  --text-faint:  var(--ink-400);  /* 3.40:1 · display sizes only, never small text */

  --border:        rgba(20, 18, 15, 0.14);
  --border-strong: rgba(20, 18, 15, 0.28);
  --border-input:  rgba(20, 18, 15, 0.45);

  --mark:      var(--copper-500);
  --mark-text: var(--copper-700);
  --mark-soft: rgba(194, 84, 15, 0.16);

  /* The link underline is the sole non-colour cue: hold it at 3:1 */
  --link:                 var(--ink-950);
  --link-underline:       var(--ink-400);
  --link-hover:           var(--ink-950);
  --link-underline-hover: var(--copper-500);

  --fill:       var(--ink-950);
  --fill-hover: var(--ink-800);
  --fill-press: var(--ink-700);
  --on-fill:    var(--paper-white);

  --selection: rgba(194, 84, 15, 0.20);
  color-scheme: light;

  /* Type */
  --font-serif: 'STIX Two Text', 'STIX Two Math', 'Times New Roman', Georgia, serif;
  --font-sans:  'Public Sans', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono:  'IBM Plex Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;

  --text-hero: clamp(3rem, 7vw, 3.75rem);
  --text-2xl:  1.875rem;
  --text-xl:   1.5rem;
  --text-lg:   1.25rem;
  --text-md:   1.125rem;   /* THE reading body */
  --text-base: 1rem;
  --text-sm:   0.875rem;
  --text-xs:   0.75rem;

  --leading-tight:   1.08;
  --leading-snug:    1.3;
  --leading-relaxed: 1.625;

  --tracking-tight: -0.02em;
  --tracking-label: 0.1em;

  --underline-offset:    4px;
  --underline-thickness: 1px;

  /* Space, measures, rules, motion */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  --measure-read:   42rem;
  --measure-header: 48rem;
  --measure-wide:   56rem;
  --gutter:         var(--space-5);
  --header-height:  4rem;
  --margin-year:    5.5rem;

  --radius: 0;

  --rule-hairline: 1px solid var(--border);
  --rule-strong:   1px solid var(--border-strong);
  --rule-quote:    1px solid var(--ink-300);
  --tick-width:    2px;
  --tick-height:   10px;

  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:      cubic-bezier(0, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 360ms;
  --duration-draw: 600ms;
}

/* ---- Base ---- */

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  animation: arrive var(--duration-slow) var(--ease-standard) both;
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* The signature link: ink word, grey hairline, copper on hover. */
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: var(--underline-thickness);
  text-underline-offset: var(--underline-offset);
  transition: text-decoration-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
a:hover { color: var(--link-hover); text-decoration-color: var(--link-underline-hover); }
a:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; }

hr { border: 0; border-top: var(--rule-hairline); margin: 0; }

::selection { background: var(--selection); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: var(--leading-snug);
  color: var(--text);
  margin: 0;
  text-wrap: pretty;
}

p, dl, dd, figure { margin: 0; }
p { text-wrap: pretty; }

main { flex: 1 0 auto; width: 100%; }

.measure-read { max-width: var(--measure-read); margin: 0 auto; padding: 0 var(--gutter); width: 100%; }
.measure-wide { max-width: var(--measure-wide); margin: 0 auto; padding: 0 var(--gutter); width: 100%; }

/* ---- The copper tick · one per page, on the live thing ---- */

.tick {
  position: absolute;
  width: var(--tick-width);
  background: var(--mark);
}

/* ---- Header · sticky, white, hairline below ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface-header);
  border-bottom: var(--rule-hairline);
  flex: none;
}
.site-header-inner {
  max-width: var(--measure-header);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

/* The brand slot holds the domain, always: a record carries its own
   identifier in the running head. The scroll swap to the serif name was
   cut 2026-07, taking the site's JavaScript count to zero. */
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }

.site-nav { display: flex; align-items: center; gap: var(--space-5); }
.site-nav a {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color var(--duration-fast) var(--ease-standard);
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

/* ---- Eyebrow · the tracked label IS the section heading ---- */

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--text-subtle);
}

/* ---- Hero ---- */

.hero { padding: var(--space-9) 0 var(--space-7); }
.hero h1 {
  margin: 0 0 var(--space-6);
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}
.hero .lede { font-size: var(--text-lg); line-height: var(--leading-relaxed); color: var(--text-body); }

/* The one portrait: an annotation beside the record, never the page's
   first element. The name lands first at every width. */
.hero-with-portrait {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name img"
    "lede img";
  gap: 0 var(--space-6);
  align-items: start;
}
.hero-with-portrait h1 { grid-area: name; }
.hero-with-portrait .lede { grid-area: lede; }
.portrait {
  grid-area: img;
  width: 11rem;
  height: 11rem;
  object-fit: cover;
  border: var(--rule-hairline);
  margin-top: var(--space-2);
}

.page-head { padding: var(--space-9) 0 var(--space-6); }
.page-head .eyebrow { margin-bottom: var(--space-5); }
.page-head h1 {
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}
.page-head .lede {
  max-width: var(--measure-read);
  margin-top: var(--space-5);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
}

/* ---- Panel · the white callout, once per page at full weight ---- */

.panel {
  position: relative;
  background: var(--surface);
  border: var(--rule-hairline);
  border-radius: var(--radius);
  padding: var(--space-6);
}
.panel .tick { left: -1px; top: var(--space-6); height: 22px; }
.panel-label {
  margin: 0 0 var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-subtle);
}
.panel-title {
  font-size: var(--text-2xl);
  line-height: 1.22;
  letter-spacing: -0.01em;
}
.panel-body {
  margin-top: var(--space-3);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
}
.panel-facts {
  margin-top: var(--space-5);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: var(--rule-hairline);
}
.panel-facts > div { padding: var(--space-4) var(--space-4) 0 0; }
.panel-facts > div + div { border-left: var(--rule-hairline); padding-left: var(--space-4); }
.panel-facts dt {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 6px;
}
.panel-facts dd {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: 1.45;
  color: var(--text);
}

/* The demoted sibling: reading-size prose, no facts row, no tick. */
.note {
  background: var(--surface);
  border: var(--rule-hairline);
  padding: var(--space-5);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
}

/* ---- Plain sections on the paper field ---- */

.section { padding: var(--space-7) 0; }
.section > .eyebrow,
.closing-section > .eyebrow { margin-bottom: var(--space-5); }

.current-panel { margin-bottom: var(--space-7); }
.closing-section { padding: var(--space-7) 0 var(--space-9); }

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.plain-list li { font-size: var(--text-md); line-height: var(--leading-relaxed); color: var(--text-body); }
.plain-list .lead-in { color: var(--text); }
.record-link { margin-top: var(--space-5); }

/* ---- Entry · THE signature layout: mono year in the margin ---- */

.entry {
  position: relative;
  display: grid;
  grid-template-columns: var(--margin-year) 1fr;
  gap: var(--space-5);
  border-top: var(--rule-hairline);
  padding: var(--space-6) 0;
}
.entry.first { border-top: none; }
.entry .tick { left: 0; top: -1px; width: var(--tick-height); height: var(--tick-width); }
.entry-year {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.entry.current .entry-year { color: var(--mark-text); }
.entry-period {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-subtle);
  margin-top: 2px;
}
.entry-title { font-size: var(--text-xl); line-height: 1.25; }
.entry-org {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-subtle);
}
.entry-org a { color: var(--text-subtle); }
.entry-org a:hover { color: var(--link-hover); }
.entry-body {
  margin-top: var(--space-3);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
}
.entry-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-4); }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: border-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.tag:hover { border-color: var(--border-strong); color: var(--text); }

/* ---- Index · the compact mono record ---- */

.index-row {
  display: grid;
  grid-template-columns: var(--margin-year) 1fr auto;
  gap: var(--space-5);
  align-items: baseline;
  padding: 10px 0;
  border-top: var(--rule-hairline);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color var(--duration-fast) var(--ease-standard);
}
.index-row:hover { color: var(--text); }
.index-row .year { color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.index-row:hover .year { color: var(--text-muted); }
.index-row .org { color: var(--text-subtle); font-size: var(--text-xs); }
.index-end { border-top: var(--rule-hairline); }

/* ---- Rule draw · left to right, once, on arrival ---- */

.rule-draw {
  height: 1px;
  background: var(--border);
  transform-origin: left center;
  animation: draw var(--duration-draw) var(--ease-out) both;
}
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- Contact ---- */

.direct {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}
.direct dt { color: var(--text-subtle); }
.direct dd a { color: var(--text-subtle); font-family: var(--font-mono); }
.direct dd a:hover { color: var(--link-hover); }

/* ---- Footer ---- */

.site-footer { border-top: var(--rule-hairline); padding: var(--space-7) 0; flex: none; }
.site-footer-inner {
  max-width: var(--measure-read);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.site-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-subtle);
}
.site-footer-row .links { display: flex; gap: var(--space-5); }
.site-footer-row a { color: var(--text-subtle); font-family: var(--font-sans); }
.site-footer-row a:hover { color: var(--link-hover); }
.site-footer-marks {
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-subtle);
}

/* ---- Small screens ---- */

@media (max-width: 640px) {
  .hero-with-portrait { grid-template-columns: 1fr; grid-template-areas: "name" "img" "lede"; }
  .portrait { width: 8.5rem; height: 8.5rem; margin: 0 0 var(--space-5); }

  .entry { grid-template-columns: 1fr; gap: var(--space-2); }
  .entry-margin { display: flex; align-items: baseline; gap: var(--space-3); }
  .entry-period { margin-top: 0; }

  .index-row { grid-template-columns: 3.5rem 1fr; gap: var(--space-2) var(--space-4); }
  .index-row .org { grid-column: 2; }
}

@media (max-width: 560px) {
  .panel-facts { grid-template-columns: 1fr; }
  .panel-facts > div { padding: var(--space-4) 0 0; }
  .panel-facts > div + div { border-left: none; border-top: var(--rule-hairline); margin-top: var(--space-4); padding-left: 0; }
}

@media (max-width: 520px) {
  .site-header-inner { gap: var(--space-4); }
  .site-nav { gap: var(--space-4); }
  .site-nav .nav-home { display: none; }
}

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