/* shanklin.ai — Reeves journal. Set like a printed page, in purple ink.
   Three themes: ai (the machine view — tight plain text, what an AI reads),
   dark (neutral), light (longhorn cream). */
:root, [data-theme="ai"] {
  --bg: #ffffff;
  --panel: #ffffff;
  --line: #e2e2e2;
  --hairline: #eeeeee;
  --accent: #1a0dab;
  --accent-ink: #1a0dab;
  --ink: #111111;
  --body: #1f1f1f;
  --muted: #555555;
  --faint: #888888;
  --green: #0d7a52;
  --red: #c43030;
}
[data-theme="dark"] {
  --bg: #161009;
  --panel: #201711;
  --line: #3a2c1e;
  --hairline: #2b2115;
  --accent: #ff9a3c;
  --accent-ink: #ff9a3c;
  --ink: #faf5e9;
  --body: #d9cbb6;
  --muted: #a39076;
  --faint: #6e6046;
  --green: #34d399;
  --red: #f87171;
}
[data-theme="light"] {
  --bg: #faf5e9;
  --panel: #fffdf6;
  --line: #e3d5b8;
  --hairline: #ece1c8;
  --accent: #bf5700;
  --accent-ink: #9a4500;
  --ink: #1c1410;
  --body: #4a3d2e;
  --muted: #7a6a54;
  --faint: #ab9c80;
  --green: #0e7a4a;
  --red: #b03227;
}
:root {
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --font-hand: "Caveat", cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  font-feature-settings: "onum" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* dark theme atmosphere: faint burnt-orange glow + film grain (portal) */
[data-theme="dark"] body {
  background:
    radial-gradient(60% 42% at 50% 0%, rgba(191,87,0,0.13), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='280' height='280' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
    #161009;
  background-attachment: scroll, fixed, scroll;
}

/* Reeves section: purple identity (portal keeps the Longhorns treatment) */
html[data-section="reeves"][data-theme="light"] {
  --accent: #6d4bc3;
  --accent-ink: #4c3390;
}
html[data-section="reeves"][data-theme="dark"] {
  --bg: #0d0918;
  --panel: #150f24;
  --line: #2a2140;
  --hairline: #1e1830;
  --accent: #a78bfa;
  --accent-ink: #a78bfa;
  --ink: #f2eefb;
  --body: #cfc6e8;
  --muted: #9a8fb8;
  --faint: #6b608a;
  --green: #34d399;
  --red: #f87171;
}
html[data-section="reeves"][data-theme="dark"] body {
  background:
    radial-gradient(60% 42% at 50% 0%, rgba(109,75,195,0.14), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='280' height='280' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
    #0d0918;
  background-attachment: scroll, fixed, scroll;
}

::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 700px; margin: 0 auto; padding: 0 28px; }

/* ---------- masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--hairline);
  padding: 14px 0;
}
.masthead .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  max-width: 960px;
}
.masthead .name {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--ink); text-decoration: none; letter-spacing: 0;
}
.masthead .name em { color: var(--accent); font-style: normal; }
.masthead nav a {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em;
  color: var(--muted); text-decoration: none; margin-left: 22px;
}
.masthead nav a:hover { color: var(--accent); }
.masthead nav a[aria-current="page"] { color: var(--ink); }

/* ---------- type ---------- */
h1, h2, h3 { text-wrap: balance; }
h1 {
  font-family: var(--font-display); font-weight: 750;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-size: clamp(48px, 7vw, 68px);
  letter-spacing: -0.02em; line-height: 1.04;
  margin: 0 0 20px;
}
h1 em { font-style: italic; color: var(--accent-ink); }
h2 {
  font-family: var(--font-display); font-weight: 600;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-size: clamp(26px, 3.4vw, 32px);
  letter-spacing: -0.01em; line-height: 1.22;
  margin: 56px 0 16px;
}
/* heading rhythm: short sections sit tighter, big sections get air */
.article-body h2 { margin-top: 48px; }
.article-body h2.roomy { margin-top: 80px; }
h3 {
  font-family: var(--font-body); font-size: 18px; font-weight: 650;
  letter-spacing: -0.01em; margin: 36px 0 10px;
}
p { margin: 0 0 22px; color: var(--body); }
p.lede {
  font-size: 20px; line-height: 1.62; color: var(--body);
  text-wrap: pretty;
}
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
ul, ol { margin: 0 0 24px 26px; color: var(--body); }
li { margin-bottom: 10px; }
li::marker { color: var(--accent); }
strong { color: var(--ink); }

.kicker {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 22px;
}
.dateline {
  font-family: var(--mono); font-size: 12.5px; color: var(--faint);
  letter-spacing: 0.04em; margin-top: 24px;
}
.dateline .sep { margin: 0 10px; color: var(--line); }

/* ---------- nameplate (blog index hero) ---------- */
.nameplate { padding: 72px 0 0; max-width: 700px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }
.nameplate .who {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  margin-bottom: 26px;
}
.nameplate .who .p { color: var(--accent); }
.nameplate .who .caret {
  display: inline-block; width: 8px; height: 14px;
  background: var(--accent); vertical-align: -2px; margin-left: 6px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.nameplate h1 {
  font-size: clamp(64px, 11vw, 118px);
  letter-spacing: -0.03em; line-height: 0.98;
  margin-bottom: 26px; font-weight: 650;
}
.nameplate h1 .it { font-style: italic; font-weight: 500; color: var(--accent); }
.nameplate .standfirst {
  font-size: 19px; line-height: 1.62; color: var(--muted);
  max-width: 560px; text-wrap: pretty; margin-bottom: 30px;
}
.nameplate .sig {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 0; margin-bottom: 8px;
  border-top: 1px solid var(--hairline);
  font-size: 14px; color: var(--muted);
  max-width: 560px;
}
.nameplate .sig img {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid var(--accent); flex-shrink: 0;
}
.nameplate .sig strong { color: var(--ink); font-weight: 600; }

/* ---------- index (ruled list, not cards) ---------- */
.index { max-width: 700px; margin: 0 auto; padding: 40px 28px 0; }
.index-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px; margin-bottom: 0;
}
.index-head h2 {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  margin: 0;
}
.index-head .count { font-family: var(--mono); font-size: 12px; color: var(--faint); }

.entry {
  display: grid; grid-template-columns: 52px 1fr; gap: 8px 20px;
  padding: 30px 0;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none; color: inherit;
}
.entry .num {
  font-family: var(--mono); font-size: 13px; color: var(--faint);
  padding-top: 6px;
}
.entry h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 27px;
  letter-spacing: -0.01em; line-height: 1.25; color: var(--ink);
  margin: 0 0 10px; transition: color 0.15s;
}
.entry p { font-size: 15px; color: var(--muted); margin: 0 0 10px; line-height: 1.62; max-width: 60ch; }
.entry .date { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.tag {
  display: inline-block;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; margin-bottom: 12px;
}
.entry:hover h3 { color: var(--accent); }
.entry:hover .num { color: var(--accent); }
/* feature slot: the newest entry, larger */
.entry.feature {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 28px 28px 26px; margin: 6px 0 10px;
}
.entry.feature h3 {
  font-size: clamp(26px, 3.6vw, 34px);
  letter-spacing: -0.015em; line-height: 1.18;
}
.entry.feature:hover { border-color: var(--accent); }

/* ---------- article ---------- */
.article-head { padding: 64px 0 0; }
.article-head h1 { max-width: 640px; }
.byline {
  display: flex; align-items: center; gap: 16px;
  margin: 26px 0 0; padding: 0;
  border: none;
  font-size: 14px; color: var(--muted);
}
.byline img {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid var(--accent); flex-shrink: 0;
}
.byline strong { color: var(--ink); font-weight: 600; }
.article-body { padding-top: 28px; }
.article-body > h2:first-child { margin-top: 12px; }

/* hero portrait: Reeves, large */
.hero-reeves {
  width: 132px; height: 132px; border-radius: 50%; object-fit: cover;
  display: block; margin: 0 0 26px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent), 0 16px 44px rgba(0,0,0,0.4);
}

/* pull quote: the biggest moment after the h1 */
.pull {
  margin: 56px -48px; padding: 0 48px;
  border: none;
}
.pull p {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-size: clamp(28px, 4vw, 34px); line-height: 1.35; color: var(--ink);
  margin: 0; text-wrap: pretty; letter-spacing: -0.01em;
}
@media (max-width: 800px) {
  .pull { margin: 44px 0; padding: 0; }
}

/* figures, not cards */
.figures {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin: 40px 0;
}
.figure { padding: 24px 20px 22px; }
.figure + .figure { border-left: 1px solid var(--hairline); }
.figure .k {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.13em; color: var(--muted);
  margin-bottom: 10px;
}
.figure .v {
  font-family: var(--mono); font-size: 27px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.figure .v small { font-size: 13px; color: var(--muted); font-weight: 500; }
.figure .s { font-size: 12.5px; color: var(--faint); margin-top: 8px; line-height: 1.55; }

figure.chart { margin: 44px 0; }
figure.chart .figlabel {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
figure.chart img {
  width: 100%; border-radius: 10px; display: block;
  border: 1px solid var(--hairline);
}
figcaption {
  font-size: 13px; color: var(--faint); line-height: 1.65;
  margin-top: 14px;
}
figcaption .fn { font-family: var(--mono); color: var(--accent); }

/* data table */
table.numbers { width: 100%; border-collapse: collapse; margin: 28px 0 34px; font-size: 15.5px; }
table.numbers th, table.numbers td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--hairline); }
table.numbers thead th {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.11em; color: var(--accent);
  border-bottom: 1px solid var(--line);
}
table.numbers td { color: var(--body); }
table.numbers td.n, table.numbers th.n {
  text-align: right; font-family: var(--mono); font-size: 14px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
table.numbers tr.total td {
  font-weight: 700; color: var(--ink);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
table.numbers tbody tr { transition: background 0.12s; }
table.numbers tbody tr:hover { background: rgba(179,157,255,0.035); }

.callout {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 24px 0; margin: 36px 0; font-size: 15.5px; color: var(--body);
}
.callout .k {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
/* a callout sitting right above the footer: no bottom rule, no double line */
.callout.tail { border-bottom: none; margin-bottom: 0; padding-bottom: 8px; }
.callout strong { color: var(--ink); }
.fineprint { font-size: 13px; color: var(--faint); line-height: 1.7; }

/* timeline */
ul.timeline { list-style: none; margin: 30px 0 34px 0; }
ul.timeline li {
  padding: 22px 0 22px 28px;
  border-left: 1px solid var(--line);
  position: relative;
  margin: 0;
}
ul.timeline li::before {
  content: "";
  position: absolute; left: -4px; top: 30px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--accent);
}
ul.timeline .when {
  display: block;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
ul.timeline li p { margin-bottom: 0; }

/* theme switcher: quiet pill */
.themes {
  display: inline-flex;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  margin-left: 22px;
  vertical-align: baseline;
  opacity: 0.85;
}
.themes:hover { opacity: 1; }
.themes button {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  background: transparent; border: none; cursor: pointer;
  color: var(--faint); padding: 4px 11px; border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.themes button:hover { color: var(--muted); }
.themes button.on { background: var(--hairline); color: var(--ink); }
.masthead nav { display: flex; align-items: center; }

/* chart theme swap: light chart by default (light + ai themes); dark chart only in dark theme */
figure.chart img.chart-dark { display: none; }
[data-theme="dark"] figure.chart img.chart-dark { display: block; }
[data-theme="dark"] figure.chart img.chart-light { display: none; }

/* ---------- ai theme: the machine view ---------- */
/* What an AI actually reads: tight plain text, no decoration. */
[data-theme="ai"] {
  --font-display: var(--font-body);
}
[data-theme="ai"] body {
  font-size: 15px;
  line-height: 1.6;
}
[data-theme="ai"] h1,
[data-theme="ai"] h2,
[data-theme="ai"] h3 {
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
}
[data-theme="ai"] .article-head { padding: 32px 0 8px; }
[data-theme="ai"] .article-head h1 { font-size: 28px; }
[data-theme="ai"] .article-head .lede { font-size: 15px; }
[data-theme="ai"] .article-body h2 { font-size: 19px; margin: 28px 0 8px; }
[data-theme="ai"] .kicker { font-size: 11px; }
[data-theme="ai"] a { text-decoration: underline; }
[data-theme="ai"] a:hover { text-decoration: underline; }
[data-theme="ai"] .byline img,
[data-theme="ai"] .tile.feature { display: block; background: none; padding: 0 0 18px; margin-bottom: 18px; border: none; border-bottom: 1px solid var(--hairline); border-radius: 0; }
[data-theme="ai"] .tile-avatar { display: none; }
[data-theme="ai"] .tile:hover { transform: none; box-shadow: none; }
[data-theme="ai"] .portal .prompt::after { display: none; }
[data-theme="ai"] .portal h1 { font-size: 34px; margin-bottom: 12px; }
[data-theme="ai"] .portal .lede { font-size: 15px; margin-bottom: 28px; }
[data-theme="ai"] .byline { margin: 16px 0; }
[data-theme="ai"] .pull {
  border: none;
  border-left: 3px solid var(--line);
  padding: 0 0 0 14px;
  margin: 20px 0;
}
[data-theme="ai"] .pull p { font-size: 15px; }
[data-theme="ai"] .callout {
  background: none;
  border: 1px solid var(--line);
  padding: 14px 16px;
}
[data-theme="ai"] .figures { display: block; margin: 20px 0; }
[data-theme="ai"] .figure {
  border: none;
  border-bottom: 1px solid var(--hairline);
  padding: 10px 0;
}
[data-theme="ai"] .figure .v { font-size: 20px; }
[data-theme="ai"] .postcards { grid-template-columns: 1fr; gap: 20px; }
[data-theme="ai"] .postcard { border: none; background: none; padding: 0; box-shadow: none; }
[data-theme="ai"] .postcard:hover { transform: none; box-shadow: none; }
[data-theme="ai"] .postmark { display: none; }
[data-theme="ai"] .postcard figcaption { font-family: var(--mono); font-size: 13px; color: var(--muted); text-align: left; padding: 8px 0 0; }
[data-theme="ai"] .hero-reeves { display: none; }
[data-theme="ai"] .work-card { border-radius: 0; }
[data-theme="ai"] .work-card:hover { transform: none; }
[data-theme="ai"] .entry { padding: 14px 0; }
[data-theme="ai"] .corner-themes { position: static; text-align: right; padding: 12px 20px 0; }
[data-theme="ai"] .themes button { text-decoration: none; }
[data-theme="ai"] #boot .lines { font-size: 13px; line-height: 1.9; }

/* postcards: tilted polaroids */
.postcards { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; margin: 40px 0 16px; }
.postcard {
  margin: 0; position: relative;
  background: #fdfcf9;
  padding: 12px 12px 14px;
  border-radius: 3px;
  box-shadow: 0 12px 32px rgba(20,10,40,0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.postcard:nth-child(odd) { transform: rotate(-2deg); }
.postcard:nth-child(even) { transform: rotate(1.6deg); }
.postcard:hover { transform: rotate(0deg) translateY(-5px); box-shadow: 0 18px 44px rgba(20,10,40,0.28); }
.postcard img {
  width: 100%; border-radius: 0; display: block;
  border: none;
  aspect-ratio: 1/1; object-fit: cover;
}
.postcard figcaption {
  font-family: var(--font-hand); font-size: 20px; line-height: 1.35;
  color: #3a3348; text-align: center;
  margin-top: 0; padding: 12px 6px 2px;
}
.postmark {
  position: absolute; top: -13px; right: 16px;
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.12em;
  color: #6d4bc3; border: 2px solid #6d4bc3; border-radius: 4px;
  padding: 4px 8px; transform: rotate(4deg);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 4px 10px rgba(20,10,40,0.18);
  pointer-events: none;
}
/* stamps tilt against their card, like they were stuck on after */
.postcard:nth-child(odd) .postmark { transform: rotate(4deg); }
.postcard:nth-child(even) .postmark { transform: rotate(-5deg); }

/* work principle cards */
.work-cards { display: grid; gap: 12px; margin: 24px 0 8px; }
.work-card {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; display: block;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.work-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.work-card strong {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  color: var(--ink); display: block; margin-bottom: 6px; letter-spacing: -0.01em;
  text-decoration: none;
}
.work-card p { margin: 0; font-size: 14.5px; color: var(--muted); text-decoration: none; }
.work-card .go { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); display: block; margin-top: 10px; text-decoration: underline; text-underline-offset: 3px; }
.work-card:hover .go { color: var(--accent); text-decoration-thickness: 2px; }
.fineprint { font-size: 14px; color: var(--muted); margin-top: 16px; }

/* receipts strip: figures as links */
.figures a.figure { text-decoration: none; display: block; }
.figures a.figure:hover .v { color: var(--accent-ink); }
.figures a.figure:hover .k { color: var(--accent-ink); }

/* boot sequence */
#boot {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.45s ease;
  cursor: pointer;
}
#boot.done { opacity: 0; pointer-events: none; }
#boot.hide { display: none; }
#boot .lines {
  font-family: var(--mono); font-size: 14px; line-height: 2.1;
  color: var(--muted); padding: 0 28px;
}
#boot .lines .p { color: var(--accent-ink); }
#boot .lines .ok { color: var(--green); }
#boot .lines .dim { color: var(--faint); }
#boot .lines .skip {
  margin-top: 18px; font-size: 11px; color: var(--faint); letter-spacing: 0.08em;
}

/* ---------- portal (root landing) ---------- */
.corner-themes {
  position: fixed; top: 20px; right: 22px; z-index: 50;
}
.portal {
  max-width: 880px; margin: 0 auto;
  padding: 72px 28px 32px;
}
.portal .prompt {
  font-family: var(--mono); font-size: 13px;
  color: var(--muted); margin-bottom: 20px;
  letter-spacing: 0.04em;
}
.portal .prompt::after {
  content: "▍"; color: var(--accent-ink);
  animation: blink 1.1s steps(1) infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }
.portal h1 {
  font-size: clamp(40px, 6vw, 60px);
  margin: 0 0 14px;
}
.portal .lede {
  color: var(--muted); font-size: 17px;
  margin: 0 0 40px; max-width: 560px;
}
/* destination tiles */
.tile {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 24px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 14px 34px rgba(20,10,40,0.16);
}
.tile.feature {
  display: grid; grid-template-columns: 88px 1fr; gap: 22px; align-items: center;
  padding: 26px 28px; margin-bottom: 16px;
  background: var(--panel);
}
.tile-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  object-fit: cover; border: 1.5px solid var(--accent);
}
.tile-body { display: block; min-width: 0; }
.tile-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.tile-top strong {
  font-family: var(--font-display); font-size: 22px; font-weight: 650;
  letter-spacing: -0.01em; color: var(--ink);
}
.tile:hover .tile-top strong { color: var(--accent-ink); }
.tile .tag { margin-bottom: 0; }
.tile-desc { display: block; font-size: 15px; color: var(--muted); line-height: 1.6; }
.tile-latest {
  display: block; margin-top: 12px; font-size: 13.5px; color: var(--body);
  border-top: 1px solid var(--hairline); padding-top: 12px;
}
.tile-latest .mono { color: var(--faint); font-size: 12px; margin-right: 6px; }
.chip-inline {
  display: inline-block; width: 18px; height: 18px; border-radius: 5px;
  vertical-align: -3px; margin-right: 10px; border: 1px solid var(--line);
}
.tile-icon {
  width: 42px; height: 42px; border-radius: 10px;
  object-fit: contain; flex-shrink: 0;
  background: var(--panel); border: 1px solid var(--hairline);
}
/* dark mode: icons sit on a light chip so dark-on-transparent marks (Prim, AIC) stay legible */
[data-theme="dark"] .tile-icon {
  background: #f2ead9;
  border-color: #d9c9a6;
}
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tiles.six { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tile-group { margin-top: 36px; }
.tile-group:first-of-type { margin-top: 10px; }
.tile-group-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 12px;
}
@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr; }
  .tile.feature { grid-template-columns: 64px 1fr; gap: 16px; padding: 20px; }
  .tile-avatar { width: 64px; height: 64px; }
}
.door-foot { border-top: none; }

/* ---------- brand page ---------- */
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0 8px; }
.swatch { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.swatch .chip { height: 84px; }
.swatch .meta { padding: 12px 14px; font-size: 13px; }
.swatch .meta strong { display: block; font-size: 14px; margin-bottom: 2px; }
.swatch .meta code { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.swatches.big { grid-template-columns: repeat(2, 1fr); }
.swatches.big .swatch .chip { height: 110px; }

/* part dividers: I. Look / II. Voice / III. Formats */
.part {
  display: flex; align-items: baseline; gap: 18px;
  margin: 72px 0 4px; padding-top: 44px;
  border-top: 2px solid var(--line);
}
.article-body > .part:first-child {
  margin-top: 40px; padding-top: 32px;
}
.part .num {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 44px; line-height: 1; color: var(--accent-ink);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.part .name {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted);
}

/* numbered rails */
ol.rails { list-style: none; counter-reset: rail; margin: 18px 0 8px; padding: 0; }
ol.rails li {
  counter-increment: rail;
  position: relative;
  padding: 14px 0 14px 58px;
  border-bottom: 1px solid var(--hairline);
}
ol.rails li::before {
  content: counter(rail, decimal-leading-zero);
  font-family: var(--mono); font-size: 13px; color: var(--accent-ink);
  position: absolute; left: 0; top: 19px;
}
ol.rails li strong { color: var(--ink); }

/* danger don't cards */
.donts.danger .dont { border-left: 3px solid var(--red); }
[data-theme="ai"] .part .num { font-variation-settings: normal; }
.type-sample { border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin: 12px 0; }
.type-sample .tname { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.type-sample .display { font-family: var(--font-display); font-size: 34px; }
.type-sample .body-t { font-size: 16px; }
.type-sample .mono-t { font-family: var(--mono); font-size: 14px; }
.donts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.dont { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 14px; color: var(--muted); }
.dont strong { color: var(--ink); display: block; margin-bottom: 4px; font-size: 14px; }
.sig-block { border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin: 12px 0; font-size: 14px; }
.sig-block pre { font-family: var(--mono); font-size: 13px; white-space: pre-wrap; color: var(--body); }
.asset-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.asset-row a {
  font-family: var(--mono); font-size: 13px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 20px; color: var(--body);
}
.asset-row a:hover { color: var(--accent-ink); border-color: var(--accent); }

/* letterhead (print page) */
.letterhead-sheet {
  max-width: 720px; margin: 40px auto; background: #fff; color: #111;
  padding: 64px 64px 72px; border: 1px solid var(--line); border-radius: 4px;
}
.letterhead-sheet .lh-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.letterhead-sheet .lh-name { font-family: var(--font-display); font-size: 30px; }
.letterhead-sheet .lh-name em { font-style: normal; color: #6d28d9; }
.letterhead-sheet .lh-contact { font-family: var(--mono); font-size: 12px; color: #555; text-align: right; }
.letterhead-sheet .lh-rule { border: none; border-top: 2px solid #6d28d9; margin: 16px 0 32px; }
.letterhead-sheet .lh-date { font-family: var(--mono); font-size: 13px; color: #555; margin-bottom: 24px; }
.letterhead-sheet .lh-subject { font-weight: 600; margin-bottom: 16px; }
.letterhead-sheet .lh-body p { margin-bottom: 16px; font-size: 15px; line-height: 1.7; color: #222; }
.letterhead-sheet .lh-body .placeholder { color: #999; }
.letterhead-sheet .lh-sign { margin-top: 40px; }
.letterhead-sheet .lh-sign .sig { font-family: var(--font-display); font-size: 26px; font-style: italic; }
.lh-toolbar { max-width: 720px; margin: 24px auto 0; display: flex; gap: 12px; align-items: center; }
.lh-toolbar a.back { font-size: 14px; color: var(--muted); }
.lh-toolbar button {
  font-family: var(--mono); font-size: 13px; cursor: pointer;
  background: var(--accent-ink); color: #fff; border: none;
  padding: 10px 22px; border-radius: 999px;
}
@media print {
  .lh-toolbar, .masthead, footer.site, #boot { display: none !important; }
  body { background: #fff; }
  .letterhead-sheet { border: none; margin: 0; max-width: none; padding: 0; border-radius: 0; }
}

/* lifecycle diagram (inline SVG, theme-aware) */
.lifecycle { width: 100%; height: auto; display: block; margin: 8px 0 4px; }
.lifecycle rect.node { fill: none; stroke: var(--line); stroke-width: 1.5; }
.lifecycle rect.node-hot { fill: none; stroke: var(--accent); stroke-width: 2; }
.lifecycle text { font-family: var(--mono); fill: var(--body); }
.lifecycle text.step { font-size: 11px; fill: var(--faint); letter-spacing: 0.08em; }
.lifecycle text.name { font-size: 13px; font-weight: 600; fill: var(--ink); }
.lifecycle text.sub { font-size: 10px; fill: var(--muted); }
.lifecycle line.arrow { stroke: var(--faint); stroke-width: 1.5; }
.lifecycle polygon.head { fill: var(--faint); }

/* P&L chart: inline SVG, theme-aware */
.pl-chart { width: 100%; height: auto; display: block; margin: 8px 0 4px; }
.pl-chart text { font-family: var(--mono); }
.pl-chart .grp { font-size: 11px; letter-spacing: 0.14em; fill: var(--faint); }
.pl-chart .lbl { font-size: 12.5px; fill: var(--muted); }
.pl-chart .val { font-size: 13px; font-weight: 500; fill: var(--body); }
.pl-chart .val-net { font-weight: 700; fill: var(--accent-ink); }
.pl-chart .total { font-size: 11.5px; fill: var(--muted); }
.pl-chart .div { stroke: var(--hairline); stroke-width: 1; }
.pl-chart .bar-save { fill: var(--green); }
.pl-chart .bar-cost { fill: var(--red); }
.pl-chart .bar-net { fill: var(--accent-ink); }

/* ---------- footer ---------- */
footer.site { margin-top: 96px; border-top: 1px solid var(--hairline); padding: 28px 0 56px; }
footer.site .wrap { max-width: 700px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer.site .colophon { font-family: var(--mono); font-size: 12px; color: var(--faint); }
footer.site .fine { font-size: 12.5px; color: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  .nameplate .who .caret { animation: none; }
  .postcard, .postcard:hover { transform: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .masthead nav { flex-wrap: wrap; row-gap: 10px; justify-content: flex-end; }
  .masthead nav a { margin-left: 16px; }
  .themes { margin-left: 16px; }
  .nameplate, .index { padding-left: 20px; padding-right: 20px; }
  .nameplate { padding-top: 52px; }
  .nameplate h1 { font-size: clamp(56px, 17vw, 84px); }
  .figures { grid-template-columns: 1fr; }
  .figure + .figure { border-left: none; border-top: 1px solid var(--hairline); }
  .postcards { grid-template-columns: 1fr; }
  .donts { grid-template-columns: 1fr; }
  .swatches, .swatches.big { grid-template-columns: 1fr; }
  table.numbers { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .masthead .wrap { max-width: none; }
}
