/* sax.llc — site layer. Uses the Modernist tokens from /modernist.css (kept byte-identical
   to the design-system export). This file only adds page layout and the dark theme. */

:root {
  color-scheme: light;
  --edge: 16px;
  --max: 1160px;
  --measure: 64ch;
  --ink-muted: color-mix(in srgb, var(--color-text) 70%, transparent);
  --ink-accent: var(--color-accent-700);      /* accent for small text, 6.4:1 on the light ground */
  --on-accent: var(--color-bg);
  --poster-bg: var(--color-accent);
  --poster-ink: var(--color-bg);
}
@media (min-width: 720px) { :root { --edge: clamp(24px, 5vw, 64px); } }

/* — dark theme: the same roles, re-derived for a dark ground — */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: #181716;
    --color-surface: #24221f;
    --color-text: #f1efed;
    --color-accent: #ff563c;
    --color-divider: color-mix(in srgb, #f1efed 38%, transparent);
    --color-accent-600: #ff6f57;
    --color-accent-700: #ff9783;
    --ink-accent: var(--color-accent-400);
    --on-accent: #181716;
    --poster-bg: #ae1800;
    --poster-ink: #f1efed;
    --shadow-sm: 0 0 0 1px color-mix(in srgb, #f1efed 10%, transparent);
    --shadow-md: 0 0 0 1px color-mix(in srgb, #f1efed 12%, transparent), 0 6px 18px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 0 0 1px color-mix(in srgb, #f1efed 14%, transparent), 0 14px 36px rgb(0 0 0 / 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #181716;
  --color-surface: #24221f;
  --color-text: #f1efed;
  --color-accent: #ff563c;
  --color-divider: color-mix(in srgb, #f1efed 38%, transparent);
  --color-accent-600: #ff6f57;
  --color-accent-700: #ff9783;
  --ink-accent: var(--color-accent-400);
  --on-accent: #181716;
  --poster-bg: #ae1800;
  --poster-ink: #f1efed;
  --shadow-sm: 0 0 0 1px color-mix(in srgb, #f1efed 10%, transparent);
  --shadow-md: 0 0 0 1px color-mix(in srgb, #f1efed 12%, transparent), 0 6px 18px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 0 0 1px color-mix(in srgb, #f1efed 14%, transparent), 0 14px 36px rgb(0 0 0 / 0.6);
}

html { background: var(--color-bg); -webkit-text-size-adjust: 100%; }
body { background: var(--color-bg); color: var(--color-text); font-size: 16px; text-wrap: pretty; overflow-x: hidden; }
.btn-primary { color: var(--on-accent); }
.btn-primary:active { background: var(--color-accent-700); }
.tag-accent { background: color-mix(in srgb, var(--color-accent) 14%, transparent); color: var(--ink-accent); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--edge); }
.skip { position: absolute; left: -999px; top: 0; padding: 8px 12px; background: var(--color-accent); color: var(--on-accent); z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* — header — */
.site-nav { padding: 10px max(var(--edge), calc((100% - var(--max)) / 2 + var(--edge))); gap: 8px; position: relative; }
.site-nav .nav-brand { display: flex; flex-direction: column; line-height: 1.1; text-decoration: none; color: inherit; font-size: 17px; }
.site-nav .nav-brand small { display: none; }
@media (min-width: 720px) { .site-nav .nav-brand small { display: block; } }
.site-nav .nav-brand small { font-weight: 400; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.site-nav .links { display: none; gap: 18px; }
.site-nav .links a { font-size: 14px; }
.menu { position: static; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5;
  background: var(--color-bg); border-bottom: 2px solid var(--color-divider);
  padding: 4px max(var(--edge), calc((100% - var(--max)) / 2 + var(--edge))) 16px;
}
.menu-panel nav a { display: block; padding: 12px 0; font-size: 18px; font-weight: 800; border-bottom: 1px solid var(--color-divider); }
.menu-panel .btn { margin-top: 16px; display: flex; justify-content: space-between; }
.theme-btn .i-sun, :root[data-theme="dark"] .theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-btn .i-moon { display: none; }
  :root:not([data-theme]) .theme-btn .i-sun { display: block; }
}
.site-nav .book { display: none; }
@media (min-width: 1040px) {
  .site-nav .links { display: flex; }
  .site-nav .book { display: inline-flex; }
  .menu { display: none; }
}

/* — type helpers — */
.kicker { display: block; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-accent); margin: 0 0 10px; font-feature-settings: "tnum" 1; }
.lede { font-size: 18px; line-height: 1.5; max-width: var(--measure); color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.rule { height: 2px; border: 0; margin: 0; background: var(--color-divider); }

/* — page header — */
.page-head { padding: 32px 0 24px; border-bottom: 2px solid var(--color-divider); }
.page-head h1 { font-size: clamp(32px, 7vw, 56px); line-height: 1.05; letter-spacing: -0.02em; max-width: 22ch; }
.page-head .lede { margin-top: 12px; }
@media (min-width: 720px) { .page-head { padding: 56px 0 40px; } }

/* — Markdown prose — */
.prose { max-width: var(--measure); padding: 32px 0 48px; font-size: 17px; line-height: 1.6; }
.prose h2 { font-size: 26px; margin: 40px 0 12px; padding-top: 20px; border-top: 2px solid var(--color-divider); }
.prose > h2:first-child { border-top: 0; padding-top: 0; margin-top: 8px; }
.prose h3 { font-size: 20px; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--color-accent); }
.prose blockquote { margin: 24px 0; padding-left: 16px; border-left: 2px solid var(--color-accent); font-weight: 600; }
.prose strong { font-weight: 800; }
.prose hr { height: 2px; border: 0; background: var(--color-divider); margin: 32px 0; }
.prose a { color: var(--ink-accent); }
.prose table { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; font-size: 14px; line-height: 1.45; margin: 0 0 24px; border-top: 2px solid var(--color-divider); }
.prose th, .prose td { min-width: 8.5em; }
.prose th:first-child, .prose td:first-child { min-width: 7em; font-weight: 600; }
.prose th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); padding: 8px; border-bottom: 2px solid var(--color-divider); vertical-align: bottom; }
.prose td { padding: 8px; border-bottom: 1px solid var(--color-divider); vertical-align: top; }
.prose.wide { max-width: 860px; }

/* — home — */
.hero { display: grid; gap: 16px; padding-top: 20px; padding-bottom: 24px; }
.hero-side { display: grid; gap: 12px; }
.hero-side > .btn { width: 100%; margin: 0; }
.hero-top { display: flex; gap: 14px; align-items: center; }
.portrait { width: 64px; height: 64px; flex: none; background: var(--color-surface); border: 1px solid var(--color-divider); overflow: hidden; display: grid; place-items: center; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait .mono { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; color: var(--ink-muted); }
.hero-name { font-weight: 800; font-size: 17px; line-height: 1.2; margin: 0; }
.hero-name span { display: block; font-weight: 400; font-size: 13px; color: var(--ink-muted); }
.hero h1 { font-size: clamp(30px, 8.4vw, 64px); line-height: 1.04; letter-spacing: -0.025em; margin: 0; max-width: 16ch; }
.proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--color-divider); border-bottom: 2px solid var(--color-divider); }
.proof li { list-style: none; padding: 10px 8px 10px 0; }
.proof li + li { border-left: 1px solid var(--color-divider); padding-left: 8px; }
.proof .num { display: block; font-weight: 800; font-size: clamp(22px, 6vw, 44px); line-height: 1; color: var(--color-accent); letter-spacing: -0.02em; }
.proof .lbl { display: block; font-size: 11.5px; line-height: 1.3; margin-top: 6px; color: var(--ink-muted); }
.proof { margin: 0; padding: 0; }
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.door { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 92px; padding: 12px; background: var(--color-surface); color: inherit; text-decoration: none; border: 1px solid transparent; }
.door:hover { border-color: var(--color-accent); }
.door:active { background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface)); }
.door .k { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-accent); }
.door .t { font-weight: 800; font-size: 17px; line-height: 1.15; display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; }
.btn-lg { min-height: 48px; font-size: 16px; padding: 12px 16px; justify-content: space-between; }
.cta-row { display: grid; gap: 8px; }
.cta-row .btn { width: 100%; }
@media (min-width: 720px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 48px; padding-bottom: 40px; }
  .portrait { width: 96px; height: 96px; }
  .portrait .mono { font-size: 32px; }
  .proof li { padding: 16px 16px 16px 0; }
  .proof li + li { padding-left: 16px; }
  .proof .lbl { font-size: 13px; }
  .door { min-height: 140px; padding: 16px; }
  .door .t { font-size: 22px; }
  .cta-row { grid-template-columns: max-content max-content; }
  .cta-row .btn { width: auto; }
}
@media (min-width: 1040px) {
  .hero { grid-template-columns: 7fr 5fr; column-gap: 48px; align-items: end; }
  .hero-main { grid-column: 1; }
  .hero-side { grid-column: 2; display: grid; gap: 16px; }
  .proof .num { font-size: 34px; }
}

/* — below the fold — */
.band { padding: 40px 0; border-top: 2px solid var(--color-divider); }
.band h2 { font-size: clamp(24px, 4.5vw, 34px); max-width: 24ch; }
.band .lede { margin-top: 8px; }
.poster { background: var(--poster-bg); color: var(--poster-ink); }
.poster .wrap { padding-top: 40px; padding-bottom: 40px; }
.poster h2 { font-size: clamp(30px, 7vw, 60px); line-height: 1.04; letter-spacing: -0.02em; max-width: 18ch; margin: 0 0 20px; }
.poster .line { display: block; }
.poster .btn-poster { background: var(--poster-ink); color: var(--poster-bg); }
.poster .btn-poster:hover { background: color-mix(in srgb, var(--poster-ink) 88%, var(--poster-bg)); }
.poster .kicker { color: var(--poster-ink); opacity: 0.85; }

/* — cards grid (Work, Writing) — */
.grid { display: grid; border-top: 2px solid var(--color-divider); border-bottom: 2px solid var(--color-divider); margin: 0; padding: 0; }
.grid > * + * { border-top: 2px solid var(--color-divider); }
@media (min-width: 720px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.two > * + * { border-top: 0; }
  .grid.two > :nth-child(n+3) { border-top: 2px solid var(--color-divider); }
  .grid.two > :nth-child(odd) { border-right: 2px solid var(--color-divider); }
}
.case { padding: 20px 0; display: grid; gap: 12px; list-style: none; }
@media (min-width: 720px) { .case { padding: 24px; } .grid.two > .case:nth-child(odd) { padding-left: 0; } }
.case h3 { font-size: 22px; margin: 0; }
.case .pair { display: grid; gap: 10px; }
.case .vision { font-size: 16px; font-weight: 600; line-height: 1.4; }
.case .arrow { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-accent); }
.case .arrow::after { content: ""; flex: 1; height: 2px; background: var(--color-accent); }
.case ul { margin: 0; padding-left: 1.1em; font-size: 15px; }
.case li { margin-bottom: 4px; }
.case li::marker { color: var(--color-accent); }
.case .num { font-weight: 800; font-size: 32px; line-height: 1; color: var(--color-accent); }
.case .num small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-muted); margin-top: 4px; line-height: 1.3; }
.case .meta { font-size: 12px; color: var(--ink-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.case .links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.case .links a { color: var(--ink-accent); }

.essay { padding: 20px 0; list-style: none; display: grid; gap: 6px; }
.essay a.title { font-weight: 800; font-size: 21px; line-height: 1.2; color: inherit; text-decoration: none; }
.essay a.title:hover { color: var(--color-accent); }
.essay .meta { font-size: 12px; color: var(--ink-muted); letter-spacing: 0.04em; }
.essay p { margin: 0; color: var(--ink-muted); max-width: var(--measure); }

/* — sign-up — */
.signup { background: var(--color-surface); padding: 20px; display: grid; gap: 10px; margin: 32px 0; max-width: 640px; }
.signup h2 { font-size: 22px; margin: 0; border: 0; padding: 0; }
.signup p { margin: 0; font-size: 15px; color: var(--ink-muted); }
.signup form { display: grid; gap: 8px; }
.signup .row { display: grid; gap: 8px; }
.signup .input { min-height: 48px; font-size: 16px; }
.signup .btn { min-height: 48px; }
.signup .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.signup .status { font-size: 14px; min-height: 1.4em; }
@media (min-width: 560px) { .signup .row { grid-template-columns: 1fr max-content; } }

/* — contact / speaking blocks — */
.facts { display: grid; gap: 2px; background: var(--color-divider); border-top: 2px solid var(--color-divider); border-bottom: 2px solid var(--color-divider); margin: 24px 0; }
.facts > div { background: var(--color-bg); padding: 14px 0; display: grid; gap: 2px; }
.facts dt { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.facts dd { margin: 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.facts dd a { color: var(--ink-accent); }
@media (min-width: 720px) { .facts { grid-template-columns: 1fr 1fr; } .facts > div { padding: 16px 16px 16px 0; } }

/* — closing CTA and footer — */
.closing { border-top: 2px solid var(--color-divider); padding-top: 32px; padding-bottom: 40px; }
.closing h2 { font-size: clamp(24px, 5vw, 36px); max-width: 20ch; }
.closing p { color: var(--ink-muted); max-width: var(--measure); }
.site-foot { border-top: 2px solid var(--color-divider); padding: 24px 0 32px; font-size: 13px; color: var(--ink-muted); }
.site-foot .cols { display: grid; gap: 16px; }
.site-foot a { color: inherit; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
@media (min-width: 720px) { .site-foot .cols { grid-template-columns: 1fr auto; } }

/* — manifesto — */
.poster-fig { margin: 24px 0 32px; }
.poster-fig a { display: block; }
.poster-img { width: 100%; max-width: 640px; height: auto; border: 1px solid var(--color-divider); }
.poster-fig figcaption { font-size: 13px; color: var(--ink-muted); margin-top: 8px; }
.theses { counter-reset: t; list-style: none; padding: 0; margin: 0 0 24px; border-top: 2px solid var(--color-divider); }
.prose ol.theses { padding-left: 0; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.toc a { display: inline-block; font-size: 13px; padding: 4px 10px; border: 1px solid var(--color-divider); color: inherit; text-decoration: none; }
.toc a:hover { border-color: var(--color-accent); color: var(--color-accent); }

@media print {
  .site-nav, .closing, .site-foot, .signup { display: none; }
}
