/* Fortune Johnson — portfolio design system (editorial light theme).
   Palette: warm off-white paper, deep navy ink, charcoal, one clay accent.
   Type: Fraunces (display) + IBM Plex Sans (text). Hairlines over shadows. */

:root {
  --paper: #f6f1e9;
  --paper-2: #eee7da;
  --paper-3: #e7dece;
  --ink: #15242f;
  --ink-2: #2f424e;
  --muted: #5c6c76;
  --faint: #8a949a;
  --line: #d9d0bf;
  --line-2: #bfb3a0;
  --accent: #9c4a14;
  --accent-deep: #7e3a0d;
  --accent-soft: rgba(156, 74, 20, 0.09);
  --night: #070b14;
  --night-2: #0c1424;
  --night-ink: #e9edf5;
  --night-muted: #9aa7bd;
  --night-faint: #5f6d86;
  --night-line: #1b2740;
  --night-accent: #e0913f;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --shell: 1120px;
  --shell-narrow: 760px;
  --gutter: clamp(20px, 5vw, 56px);
  --section: clamp(72px, 10vw, 128px);
  --radius: 3px;
  --radius-lg: 6px;

  --t-display: clamp(2.75rem, 6.6vw, 5.4rem);
  --t-h2: clamp(1.95rem, 3.7vw, 3.05rem);
  --t-h3: clamp(1.2rem, 2vw, 1.45rem);
  --t-lede: clamp(1.08rem, 1.6vw, 1.28rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

p, li, h1, h2, h3, h4, span, a, td, th, strong, em, figcaption, dd, dt {
  overflow-wrap: break-word;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0125rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

button, input, textarea, select { font: inherit; color: inherit; }

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

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

.shell {
  width: min(var(--shell), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.shell-narrow {
  width: min(var(--shell-narrow), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: -64px;
  left: 16px;
  z-index: 80;
  background: var(--ink);
  color: var(--paper);
  padding: 11px 16px;
  font-size: 0.85rem;
  transition: top 0.2s;
}

.skip-link:focus { top: 12px; text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
  flex: none;
}

.eyebrow.no-rule::before { display: none; }

.section-no {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.display {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 480;
  letter-spacing: -0.022em;
  line-height: 1.04;
  color: var(--ink);
}

h1.display { font-size: var(--t-display); }

h2.display {
  font-size: var(--t-h2);
  margin-top: 14px;
}

h2.display em,
h1.display em {
  font-style: italic;
  font-weight: 420;
  color: var(--accent);
}

.lede {
  font-size: var(--t-lede);
  line-height: 1.66;
  color: var(--ink-2);
  max-width: 58ch;
}

.small-note {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.7;
}

.muted { color: var(--muted); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn .arrow { font-size: 1.05em; line-height: 1; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}

.btn-ghost:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn-light {
  background: var(--night-ink);
  border-color: var(--night-ink);
  color: var(--night);
}

.btn-light:hover {
  background: var(--night-accent);
  border-color: var(--night-accent);
  color: var(--night);
}

.btn-ghost-light {
  background: transparent;
  color: var(--night-ink);
  border-color: var(--night-faint);
}

.btn-ghost-light:hover {
  background: var(--night-ink);
  border-color: var(--night-ink);
  color: var(--night);
}

.text-link {
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(126, 58, 13, 0.35);
  text-underline-offset: 3px;
}

.text-link:hover { text-decoration-color: var(--accent-deep); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.back-link:hover { color: var(--accent-deep); text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 241, 233, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-lockup:hover { text-decoration: none; }

.brand-name {
  font-family: var(--serif);
  font-size: 1.14rem;
  font-weight: 520;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-name .dot { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 32px);
}

.site-nav .nav-link {
  font-size: 0.86rem;
  font-weight: 550;
  color: var(--ink-2);
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
}

.site-nav .nav-link:hover {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.site-nav .btn { padding: 9px 16px; font-size: 0.82rem; }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 9px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ---------- Flash ---------- */
.flash-stack { padding-top: 14px; }

.flash {
  padding: 11px 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper-2);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.flash-success { border-color: #2f6b46; background: #2f6b46; color: #f2f7f1; }
.flash-error { border-color: #8b3027; background: #8b3027; color: #fdf1ef; }

/* ---------- Portfolio hero ---------- */
.hero {
  padding: clamp(48px, 7vw, 92px) 0 clamp(40px, 5vw, 64px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(36px, 6vw, 84px);
  align-items: center;
}

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 22px;
}

.hero-practice {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.hero-practice li { display: flex; align-items: baseline; gap: 14px; }

.hero-practice li:not(:last-child)::after {
  content: "·";
  color: var(--accent);
  font-weight: 700;
}

.hero-lede { margin-top: 24px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-photo-wrap {
  position: relative;
  padding: 10px;
  border: 1px solid var(--line-2);
  background: var(--paper-2);
}

.hero-photo-wrap img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 18%;
}

.hero-photo-wrap figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 2px;
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-photo-wrap figcaption b {
  font-weight: 600;
  color: var(--ink-2);
}

/* Credentials ledger */
.ledger {
  border-block: 1px solid var(--line);
  background: var(--paper);
}

.ledger-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.ledger-cell {
  padding: clamp(22px, 3vw, 34px) clamp(14px, 2.4vw, 30px);
  border-left: 1px solid var(--line);
}

.ledger-cell:first-child { border-left: 0; padding-left: 0; }

.ledger-num {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.4vw, 2.65rem);
  font-weight: 480;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}

.ledger-num sup {
  font-size: 0.5em;
  color: var(--accent);
  top: -0.7em;
}

.ledger-label {
  margin-top: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.55;
  max-width: 22ch;
}

/* ---------- Sections ---------- */
.section { padding: var(--section) 0; }

.section-alt {
  background: var(--paper-2);
  border-block: 1px solid var(--line);
}

.section-dark {
  background: var(--night);
  color: var(--night-ink);
}

.section-dark .eyebrow { color: var(--night-accent); }
.section-dark .eyebrow::before { background: var(--night-accent); }
.section-dark .display { color: var(--night-ink); }
.section-dark .display em { color: var(--night-accent); }
.section-dark .lede { color: var(--night-muted); }
.section-dark .small-note { color: var(--night-faint); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  margin-bottom: clamp(38px, 5vw, 64px);
}

.section-head .head-desc {
  font-size: 0.98rem;
  line-height: 1.8;
  color: var(--muted);
  padding-bottom: 6px;
}

.section-head .head-desc p + p { margin-top: 12px; }

/* ---------- Photo spread (In person) ---------- */
.photo-spread {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(16px, 2.6vw, 28px);
  align-items: start;
}

.photo-item { margin: 0; }

.photo-item img {
  width: 100%;
  border: 1px solid var(--line-2);
  background: var(--paper-3);
}

.photo-item figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

.photo-item figcaption b {
  font-family: var(--serif);
  font-weight: 540;
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.photo-a { grid-column: 1 / span 5; }
.photo-a img { aspect-ratio: 1068 / 1473; object-fit: cover; object-position: 50% 12%; }

.photo-b { grid-column: 8 / span 4; margin-top: clamp(36px, 6vw, 88px); }
.photo-b img { aspect-ratio: 441 / 599; object-fit: cover; object-position: 50% 12%; }

.photo-c { grid-column: 3 / span 5; margin-top: clamp(24px, 4vw, 56px); }
.photo-c img { aspect-ratio: 900 / 1150; object-fit: cover; object-position: 50% 40%; }

.photo-d { grid-column: 8 / span 5; margin-top: clamp(40px, 7vw, 104px); }
.photo-d img { aspect-ratio: 1120 / 747; object-fit: cover; object-position: 50% 45%; }

.photo-e { grid-column: 2 / span 4; margin-top: clamp(28px, 5vw, 64px); }
.photo-e img { aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% 35%; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: clamp(36px, 6vw, 88px);
  align-items: start;
}

.about-body p { max-width: 62ch; }

.about-body p + p { margin-top: 1.15em; }

.about-sign {
  margin-top: 26px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.12rem;
  color: var(--ink-2);
}

.now-panel {
  border: 1px solid var(--line-2);
  background: var(--paper);
  padding: clamp(22px, 3vw, 30px);
  position: sticky;
  top: 100px;
}

.now-panel h3 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.now-panel li {
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-2);
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.now-panel li::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  transform: translateY(-1px);
}

.now-panel .panel-link {
  display: inline-flex;
  margin-top: 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-deep);
}

/* ---------- Skills index ---------- */
.skill-index { border-top: 1px solid var(--line-2); }

.skill-row {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(18px, 4vw, 56px);
  padding: clamp(22px, 3vw, 32px) 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.skill-row h3 {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 500;
  letter-spacing: -0.012em;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.skill-row h3 .skill-sub {
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.skill-row h3 .idx {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.skill-list {
  font-size: 1.02rem;
  line-height: 2.05;
  color: var(--ink-2);
}

.skill-list span { display: inline-block; }

.skill-list span:not(:last-child)::after {
  content: "·";
  margin: 0 0.55em;
  color: var(--line-2);
  font-weight: 700;
}

/* ---------- Work index ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 6px;
}

.filter-bar .filter-label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-right: 6px;
}

.filter-btn:focus-visible,
.menu-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.filter-btn {
  background: none;
  border: 0;
  padding: 6px 0;
  font-size: 0.92rem;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
}

.filter-btn:hover { color: var(--ink); }

.filter-btn.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.work-index { border-top: 0; }

.work-row {
  display: grid;
  grid-template-columns: 64px 132px minmax(0, 1fr) auto;
  gap: clamp(14px, 2.6vw, 34px);
  align-items: baseline;
  padding: clamp(20px, 2.8vw, 30px) 8px;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s var(--ease);
}

.work-row:hover { background: var(--accent-soft); text-decoration: none; }

.work-row:hover .work-title { color: var(--accent-deep); }

.work-row:hover .work-arrow { transform: translateX(4px); color: var(--accent-deep); }

.work-row[hidden] { display: none; }

.work-num {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 480;
  color: var(--faint);
}

.work-track {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}

.work-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.work-title {
  font-family: var(--serif);
  font-size: clamp(1.22rem, 2.1vw, 1.52rem);
  font-weight: 510;
  letter-spacing: -0.012em;
  line-height: 1.25;
  transition: color 0.2s var(--ease);
}

.work-summary {
  display: block;
  margin-top: 8px;
  font-size: 0.945rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 62ch;
}

.work-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.work-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.work-arrow {
  font-size: 1.25rem;
  color: var(--faint);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
  align-self: center;
}

/* Concepts band */
.concept-row .work-track { color: var(--ink-2); }

.concept-row .work-status::before { border: 1.5px solid var(--accent); background: none; }

.work-live {
  margin-left: 10px;
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.meta-link {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
}

.concept-note {
  margin-top: 30px;
  padding: 18px 22px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 78ch;
}

/* ---------- Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.edu-block h3 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.edu-degree {
  font-family: var(--serif);
  font-size: 1.42rem;
  font-weight: 510;
  letter-spacing: -0.012em;
  line-height: 1.3;
}

.edu-meta {
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.75;
}

.edu-meta b { color: var(--ink-2); font-weight: 600; }

.edu-lines { border-top: 1px solid var(--line); margin-top: 6px; }

.edu-lines li {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.955rem;
  color: var(--ink-2);
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.edu-lines li::before {
  content: "·";
  color: var(--line-2);
  flex: none;
}

/* ---------- Contact / footer ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: end;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.contact-email {
  font-family: var(--serif);
  font-size: clamp(1.18rem, 2.4vw, 1.62rem);
  font-weight: 480;
  letter-spacing: -0.01em;
  color: var(--night-ink);
  border-bottom: 1px solid var(--night-faint);
  padding-bottom: 6px;
  transition: color 0.2s, border-color 0.2s;
}

.contact-email:hover {
  color: var(--night-accent);
  border-color: var(--night-accent);
  text-decoration: none;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 6px;
}

.contact-links a {
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--night-muted);
}

.contact-links a:hover { color: var(--night-ink); }

.site-footer {
  background: var(--night);
  color: var(--night-muted);
  border-top: 1px solid var(--night-line);
  padding: 34px 0 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
  align-items: center;
  font-size: 0.84rem;
}

.footer-brand {
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--night-ink);
}

.footer-brand .dot { color: var(--night-accent); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.footer-links a { color: var(--night-muted); }

.footer-links a:hover { color: var(--night-ink); }

.footer-fine {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--night-line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 0.78rem;
  color: var(--night-faint);
  letter-spacing: 0.02em;
}

/* ---------- Case study (work detail) ---------- */
.detail-hero { padding: clamp(40px, 6vw, 76px) 0 clamp(28px, 4vw, 44px); }

.detail-hero .back-link { margin-bottom: 28px; }

.detail-hero h1 { max-width: 21ch; }

.detail-lede {
  margin-top: 22px;
  font-size: var(--t-lede);
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 58ch;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: clamp(30px, 4vw, 46px);
  border-block: 1px solid var(--line);
}

.meta-row > .meta-item { flex: 1 1 210px; }

.meta-item {
  padding: 18px 22px;
  border-left: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.meta-item:first-child { border-left: 0; padding-left: 0; }

@media (max-width: 560px) {
  .meta-row > .meta-item { flex-basis: 100%; border-left: 0; padding-inline: 0; }
  .meta-row > .meta-item + .meta-item { border-top: 1px solid var(--line); }
}

.meta-item strong {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 7px;
}

.kind-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  padding: 8px 15px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  background: var(--paper-2);
}

.kind-flag.concept {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.body-blocks { padding-bottom: clamp(36px, 5vw, 60px); }

.body-block {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: clamp(16px, 3.4vw, 48px);
  padding: clamp(24px, 3.4vw, 36px) 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.body-block:first-child { border-top: 1px solid var(--line-2); }

.block-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.block-text {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--ink-2);
  max-width: 64ch;
}

.block-text p + p { margin-top: 1em; }

.detail-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: var(--section);
}

/* ---------- Listing / article / error ---------- */
.listing-hero {
  padding: clamp(40px, 6vw, 72px) 0 clamp(26px, 4vw, 40px);
}

.listing-hero h1 { margin-top: 12px; }

.listing-hero .lede { margin-top: 18px; }

.listing-main { padding-bottom: var(--section); }

.entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: baseline;
  padding: 26px 8px;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s var(--ease);
}

.entry-row:first-child { border-top: 1px solid var(--line-2); }

.entry-row:hover { background: var(--accent-soft); text-decoration: none; }

.entry-row:hover .entry-title { color: var(--accent-deep); }

.entry-kind {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}

.entry-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 510;
  letter-spacing: -0.012em;
  margin-top: 8px;
  transition: color 0.2s;
}

.entry-summary {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.75;
  max-width: 62ch;
}

.empty-state {
  border: 1px dashed var(--line-2);
  background: var(--paper-2);
  padding: clamp(30px, 5vw, 52px);
  text-align: left;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
  max-width: 60ch;
}

.article { padding-bottom: var(--section); }

.article .body-blocks { border: 0; }

.error-page {
  padding: clamp(80px, 14vw, 150px) 0;
  text-align: center;
}

.error-page .display { font-size: clamp(3.4rem, 10vw, 6rem); }

.error-page p { margin: 18px auto 30px; max-width: 42ch; color: var(--muted); }

.error-page .eyebrow { justify-content: center; }

/* ---------- Reveal motion ----------
   Content is visible by default. The hidden start state only applies once the
   inline head script has confirmed IntersectionObserver support, so a blocked,
   cached, or failed script can never leave the page blank. */
.reveal { opacity: 1; transform: none; }

html.js .reveal {
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

html.js .reveal:not(.in) {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .work-row, .work-arrow, .work-title, .entry-row, .entry-title, .contact-email {
    transition: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .work-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .work-track { grid-column: 2; grid-row: 1; }
  .work-main { grid-column: 2; grid-row: 2; }
  .work-num { grid-row: 1 / span 2; align-self: start; padding-top: 4px; }
  .work-arrow { grid-column: 3; grid-row: 1 / span 2; }
  .skill-row { grid-template-columns: 1fr; gap: 12px; }
  .skill-row h3 { flex-wrap: wrap; }
  .skill-row h3 .skill-sub { flex-basis: 100%; padding-left: 28px; white-space: normal; }
  .section-head { grid-template-columns: 1fr; gap: 18px; align-items: start; }
  .section-head .head-desc { padding-bottom: 0; }
}

@media (max-width: 920px) {
  html { scroll-padding-top: 78px; }
  body.nav-open { overflow: hidden; }
  .menu-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line-2);
    padding: 10px var(--gutter) 22px;
    box-shadow: 0 24px 40px -30px rgba(21, 36, 47, 0.35);
  }
  .site-nav.open { display: flex; }
  .site-nav .nav-link {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
  }
  .site-nav .btn { margin-top: 16px; justify-content: center; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo-wrap { max-width: 460px; }
  .ledger-grid { grid-template-columns: 1fr 1fr; }
  .ledger-cell { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-right: 16px; }
  .ledger-cell:nth-child(-n+2) { border-top: 0; }
  .about-grid, .edu-grid, .contact-grid { grid-template-columns: 1fr; }
  .now-panel { position: static; }
  .photo-a { grid-column: 1 / span 7; }
  .photo-b { grid-column: 8 / span 5; margin-top: 36px; }
  .photo-c { grid-column: 1 / span 12; }
  .meta-row { grid-template-columns: 1fr; border: 0; }
  .meta-item { border-left: 0; border-top: 1px solid var(--line); padding: 15px 0; }
  .meta-item:first-child { border-top: 1px solid var(--line-2); }
  .body-block { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 560px) {
  body { font-size: 0.995rem; }
  .brand-name { font-size: 1.02rem; }
  .hero-practice { font-size: 0.7rem; gap: 6px 10px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .ledger-grid { grid-template-columns: 1fr 1fr; }
  .ledger-num { font-size: 1.75rem; }
  .photo-spread { gap: 26px; }
  .photo-a, .photo-b, .photo-c, .photo-d, .photo-e { grid-column: 1 / span 12; margin-top: 0; }
  .work-row { grid-template-columns: 40px minmax(0, 1fr); row-gap: 6px; }
  .work-num { grid-row: 1; }
  .work-track { grid-column: 2; grid-row: 1; }
  .work-main { grid-column: 1 / span 2; grid-row: 2; }
  .work-arrow { display: none; }
  .work-summary { font-size: 0.92rem; }
  .filter-bar { gap: 6px 18px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .contact-email { font-size: 1.08rem; word-break: break-all; }
}
