/* bilal-ahmed.me — one stylesheet for the public site and the admin panel.
   Warm paper and ink, one "approved" green accent; Newsreader for display, Geist for text,
   Geist Mono for labels and figures. Light and dark follow the device unless the visitor picks. */

@font-face { font-family: "Newsreader"; src: url("/static/fonts/newsreader-latin-opsz-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/static/fonts/newsreader-latin-opsz-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/static/fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/static/fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --paper: #f6f5f1;
  --paper-2: #eeece6;
  --surface: #ffffff;
  --ink: #111418;
  --text: #2b3038;
  --muted: #5f6670;
  --rule: #e3e0d7;
  --rule-strong: #ccc8bc;
  --accent: #0b6b4e;
  --accent-ink: #095c43;
  --accent-soft: #dcefe5;
  --on-accent: #ffffff;
  --live: #0b6b4e;
  --live-soft: #dcefe5;
  --pending: #8a5a00;
  --pending-soft: #f6ead2;
  --danger: #a4262c;
  --band: #111418;
  --band-ink: #f4f2ec;
  --band-muted: #a7adb5;
  --shadow: 0 1px 2px rgb(17 20 24 / .04), 0 12px 32px -12px rgb(17 20 24 / .14);
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1013; --paper-2: #13161a; --surface: #171a1f; --ink: #f1efe9; --text: #d2d5da; --muted: #99a0aa;
    --rule: #242930; --rule-strong: #353b44; --accent: #4fcf9f; --accent-ink: #72dcb3; --accent-soft: #11291f; --on-accent: #06140e;
    --live: #4fcf9f; --live-soft: #12291f; --pending: #e9b866; --pending-soft: #2a2213; --danger: #f08a8f;
    --band: #f1efe9; --band-ink: #111418; --band-muted: #4c535c;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 16px 40px -16px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1013; --paper-2: #13161a; --surface: #171a1f; --ink: #f1efe9; --text: #d2d5da; --muted: #99a0aa;
  --rule: #242930; --rule-strong: #353b44; --accent: #4fcf9f; --accent-ink: #72dcb3; --accent-soft: #11291f; --on-accent: #06140e;
  --live: #4fcf9f; --live-soft: #12291f; --pending: #e9b866; --pending-soft: #2a2213; --danger: #f08a8f;
  --band: #f1efe9; --band-ink: #111418; --band-muted: #4c535c;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 16px 40px -16px rgb(0 0 0 / .6);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 16.5px/1.6 var(--sans); font-feature-settings: "ss01", "cv11"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 500; line-height: 1.15; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; }
dl, dd { margin: 0; }
button { font: inherit; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--paper); border-radius: 8px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.wrap.narrow { max-width: 780px; }
.fine { font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); }
.minor { font: 600 13px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------------------------ type */
.eyebrow, .kicker { font: 500 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; text-underline-offset: 3px; }
.display { font: 400 clamp(42px, 6vw, 78px)/1.0 var(--display); letter-spacing: -.032em; color: var(--ink); font-variation-settings: "opsz" 72; }
.display em, .page-title em { font-style: italic; color: var(--accent); font-weight: 400; }
.page-title { font: 400 clamp(38px, 5.6vw, 68px)/1.03 var(--display); letter-spacing: -.03em; max-width: 20ch; font-variation-settings: "opsz" 72; }
.lede { font-size: clamp(17.5px, 1.6vw, 20px); line-height: 1.6; color: var(--text); max-width: 62ch; }

/* ------------------------------------------------------------------ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; font: 550 15px/1 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s, transform .15s; white-space: nowrap; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--accent); color: var(--on-accent); }
.btn.ghost { border-color: var(--rule-strong); color: var(--ink); background: transparent; }
.btn.ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .ico, .ico { width: 18px; height: 18px; flex: none; }
.arrow { display: inline-block; transition: transform .18s ease; }
.textlink { color: var(--accent-ink); font-weight: 600; text-decoration: none; font-size: 15px; }
.textlink:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.textlink:hover .arrow { transform: translateX(3px); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }

.chip { display: inline-flex; align-items: center; gap: 7px; font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.chip.live { color: var(--live); background: var(--live-soft); }
.chip.pending { color: var(--pending); background: var(--pending-soft); }
.chip.done { color: var(--muted); background: color-mix(in srgb, var(--rule) 70%, transparent); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font: 500 12.5px/1.2 var(--mono); color: var(--text); background: var(--paper-2); border: 1px solid var(--rule); padding: 6px 9px; border-radius: 7px; }
.pill { display: inline-flex; align-items: center; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; padding: 7px 12px; border: 1px solid var(--rule-strong); border-radius: 999px; transition: border-color .15s, background-color .15s; }
.pill:hover { border-color: var(--accent); background: var(--accent-soft); }

.theme-switch { display: inline-flex; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--rule-strong); border-radius: 999px; }
.theme-switch button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; transition: color .15s, background-color .15s; }
.theme-switch button:hover { color: var(--ink); background: var(--paper-2); }
.theme-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.theme-switch svg { width: 16px; height: 16px; }

/* Availability: a green status dot that breathes once in a while. */
.avail { display: inline-flex; align-items: flex-start; gap: 11px; margin-top: 26px; padding: 9px 16px 9px 14px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--rule)); background: color-mix(in srgb, var(--accent-soft) 60%, transparent); border-radius: 14px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.avail .dot { margin-top: 7px; }
.avail-extra { color: var(--muted); white-space: nowrap; }
.dot { position: relative; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--accent); }
.dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: ping 3.2s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 0% { transform: scale(.5); opacity: .6; } 60%, 100% { transform: scale(1.5); opacity: 0; } }

/* ------------------------------------------------------------------ header */
.site-head { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 84%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-head:has(+ main .hero) { border-bottom-color: transparent; }
@supports (animation-timeline: scroll()) {
  .site-head { animation: head-rule linear both; animation-timeline: scroll(); animation-range: 0 80px; }
  @keyframes head-rule { to { border-bottom-color: var(--rule); } }
}
.head-row { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; }
.mark { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; background: var(--ink); color: var(--paper); font: 600 14px/1 var(--mono); letter-spacing: .02em; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text b { font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; }
.brand-text span { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.menu { display: flex; align-items: center; gap: 4px; }
.menu a { position: relative; color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 999px; transition: color .15s, background-color .15s; }
.menu a:hover { color: var(--ink); background: var(--paper-2); }
.menu a[aria-current="page"] { color: var(--ink); }
.menu a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent); }
.menu a.nav-cv { margin-left: 8px; border: 1px solid var(--rule-strong); }
.menu a.nav-cv:hover { border-color: var(--ink); background: var(--surface); }
.menu a.nav-cv[aria-current="page"]::after { display: none; }
.head-end { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; position: relative; }
.menu-toggle summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--rule-strong); cursor: pointer; }
.menu-toggle summary::-webkit-details-marker { display: none; }
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 1.6px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger { position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -6px; }
.burger::after { top: 6px; }
.menu-toggle[open] .burger { background: transparent; }
.menu-toggle[open] .burger::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[open] .burger::after { transform: translateY(-6px) rotate(-45deg); }
.mobile-menu { position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 32px)); flex-direction: column; align-items: stretch; gap: 2px; padding: 10px; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--shadow); }
.mobile-menu a { padding: 12px 14px; font-size: 16px; }
.mobile-menu a[aria-current="page"]::after { left: 14px; right: auto; width: 20px; bottom: 6px; }
.mobile-menu a.nav-cv { margin: 6px 0 0; text-align: center; }
.menu-theme { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 12px 6px 4px 14px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }

/* ------------------------------------------------------------------ hero */
.hero { padding: clamp(40px, 7vw, 96px) 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); margin-bottom: 26px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--rule-strong); }
.hero-sub { margin-top: 26px; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.65; max-width: 60ch; }

/* The outcomes panel, set like a card-payment receipt. */
.ledger { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px 20px; }
.ledger::before { content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, transparent)); }
.ledger-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px dashed var(--rule-strong); font: 500 11.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ledger-status { color: var(--accent); }
.ledger-list { list-style: none; display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 20px; }
.ledger-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: baseline; padding: 15px 0; border-bottom: 1px dashed var(--rule); }
.ledger-row:last-child { border-bottom: 0; }
.ledger-row > b { font: 400 34px/1 var(--display); letter-spacing: -.02em; color: var(--ink); font-variation-settings: "opsz" 48; white-space: nowrap; }
.ledger-text { display: grid; gap: 4px; }
.ledger-text span { font-size: 15px; line-height: 1.4; color: var(--ink); }
.ledger-text small { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.ledger-foot { padding-top: 14px; border-top: 1px dashed var(--rule-strong); font: italic 400 15px/1.4 var(--display); color: var(--muted); }

.marks { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 20px; margin-top: clamp(48px, 7vw, 88px); padding-block: 22px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.marks-label { font: 500 11.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); max-width: 16ch; }
.marks-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.marks-list li { font: 500 14px/1.4 var(--mono); color: var(--ink); white-space: nowrap; }
.marks-list li + li::before { content: "·"; margin-right: 22px; margin-left: -22px; position: relative; left: 11px; color: var(--rule-strong); }

/* ------------------------------------------------------------------ sections */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section.tight { padding-top: clamp(32px, 4vw, 56px); }
.section.alt { background: var(--paper-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { font: 400 clamp(30px, 3.6vw, 44px)/1.08 var(--display); letter-spacing: -.024em; font-variation-settings: "opsz" 48; }
.section-intro { color: var(--muted); max-width: 64ch; margin-bottom: 36px; font-size: 17px; }

.focus-grid { list-style: none; counter-reset: focus; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 36px; border-top: 1px solid var(--ink); }
.focus-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.focus-grid li { counter-increment: focus; padding: 22px 22px 6px 0; }
.focus-grid li + li { padding-left: 22px; border-left: 1px solid var(--rule); }
.focus-grid li::before { content: counter(focus, decimal-leading-zero); display: block; font: 500 12px/1 var(--mono); color: var(--accent); margin-bottom: 18px; }
.focus-grid h3 { font: 600 17px/1.3 var(--sans); letter-spacing: -.01em; margin-bottom: 10px; }
.focus-grid p { font-size: 15px; line-height: 1.6; color: var(--text); }

.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.work-grid.list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.work-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 26px 26px 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s, transform .2s; }
.work-card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.work-card:has(:is(h2, h3) a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
/* The first featured case study runs the full width: story on the left, outcome on the right. */
.work-card.large { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: clamp(32px, 5vw, 72px); row-gap: 12px; padding: clamp(28px, 3.4vw, 44px); }
.work-card.large > * { grid-column: 1; }
.work-card.large :is(h2, h3) { font-size: clamp(30px, 3.4vw, 44px); }
.work-card.large .summary { font-size: 16.5px; max-width: 58ch; }
.work-card.large .lead-figure { grid-column: 2; grid-row: 1 / span 4; flex-direction: column; justify-content: center; gap: 14px; margin: 0; padding: 0 0 0 clamp(28px, 4vw, 56px); border-top: 0; border-left: 1px dashed var(--rule-strong); }
.work-card.large .lead-figure b { font-size: clamp(56px, 6.4vw, 88px); }
.work-card.large .lead-figure span { font-size: 16px; max-width: 26ch; }
.work-card.large .more { grid-column: 1; margin-top: 10px; }
.work-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.work-top .when { margin-left: auto; font: 400 12.5px/1 var(--mono); color: var(--muted); }
.work-card :is(h2, h3) { font: 400 26px/1.15 var(--display); letter-spacing: -.018em; font-variation-settings: "opsz" 36; }
.work-card :is(h2, h3) a { text-decoration: none; color: inherit; }
.work-card :is(h2, h3) a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.work-card :is(h2, h3) a:focus-visible { outline: none; }
.work-card .org { font-size: 14px; color: var(--muted); }
.work-card .summary { font-size: 15.5px; line-height: 1.6; }
.lead-figure { display: flex; align-items: baseline; gap: 12px; margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--rule-strong); }
.lead-figure b { font: 400 32px/1 var(--display); color: var(--accent); letter-spacing: -.02em; white-space: nowrap; }
.lead-figure span { font-size: 14px; line-height: 1.4; color: var(--text); }
.lead-figure small { display: block; margin-top: 4px; font: 400 12px/1.4 var(--mono); color: var(--muted); }
.work-card .more { font-size: 14.5px; font-weight: 600; color: var(--accent-ink); margin-top: 4px; }
.work-card:not(:has(.lead-figure)) .more { margin-top: auto; padding-top: 8px; }
.work-card:hover .arrow { transform: translateX(3px); }

.split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.timeline-compact { list-style: none; border-top: 1px solid var(--ink); }
.timeline-compact li { display: grid; grid-template-columns: 11.5em 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.timeline-compact .when, .when { font: 400 13px/1.5 var(--mono); color: var(--muted); }
.timeline-compact .what { display: grid; gap: 2px; }
.timeline-compact .what b { color: var(--ink); font-weight: 600; }
.timeline-compact .what span { font-size: 14.5px; color: var(--muted); }

.writing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.writing-card { position: relative; padding: 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.writing-card .meta { font: 400 12px/1.4 var(--mono); color: var(--muted); margin-bottom: 12px; }
.writing-card h3 { font: 400 23px/1.2 var(--display); margin-bottom: 10px; }
.writing-card h3 a { text-decoration: none; }
.writing-card h3 a::after { content: ""; position: absolute; inset: 0; }
.writing-card p { font-size: 15px; }

.cta-band { background: var(--band); color: var(--band-ink); padding: clamp(56px, 8vw, 96px) 0; }
.cta-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) auto; gap: 40px; align-items: end; }
.cta-band h2 { color: var(--band-ink); font: 400 clamp(30px, 3.8vw, 46px)/1.08 var(--display); letter-spacing: -.024em; max-width: 20ch; }
.cta-band p { margin-top: 16px; max-width: 58ch; color: color-mix(in srgb, var(--band-ink) 82%, transparent); }
.cta-band .fine { color: var(--band-muted); }
.cta-actions { display: grid; gap: 10px; justify-items: stretch; }
.cta-actions .btn { white-space: normal; text-align: center; overflow-wrap: anywhere; }
.cta-band .btn.primary { background: var(--band-ink); color: var(--band); }
.cta-band .btn.primary:hover { background: var(--accent); color: var(--on-accent); }
.cta-band .btn.ghost { color: var(--band-ink); border-color: color-mix(in srgb, var(--band-ink) 30%, transparent); }
.cta-band .btn.ghost:hover { border-color: var(--band-ink); background: color-mix(in srgb, var(--band-ink) 8%, transparent); }

/* ------------------------------------------------------------------ inner pages */
.page-head { padding: clamp(48px, 7vw, 96px) 0 clamp(28px, 4vw, 48px); }
.page-head .eyebrow { margin-bottom: 20px; }
.page-head .lede { margin-top: 22px; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter[hidden] { display: none; }
.filter button { font: 500 14px/1 var(--sans); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--rule-strong); background: transparent; color: var(--text); cursor: pointer; }
.filter button:hover { border-color: var(--ink); color: var(--ink); }
.filter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; margin-top: 40px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts > div { padding: 18px 20px 18px 0; }
.facts > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.facts dt { font: 500 11.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.facts dd { color: var(--ink); font-size: 15.5px; line-height: 1.45; }
.facts.wide { grid-template-columns: 1fr 2fr 1fr; margin-top: 8px; }
.case-link { margin-top: 22px; }

.case-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(40px, 6vw, 88px); align-items: start; padding-top: clamp(32px, 4vw, 56px); padding-bottom: clamp(56px, 7vw, 96px); }
.case-side { position: sticky; top: 96px; display: grid; gap: 14px; }
.side-block { padding: 20px 22px; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; }
.side-block h2 { font: 500 11.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.side-block p { font-size: 15px; }
.figures { display: grid; gap: 16px; }
.figures > div { display: grid; gap: 4px; }
.figures dt { order: 2; font-size: 14.5px; line-height: 1.4; color: var(--ink); }
.figures dd { order: 1; display: grid; gap: 4px; }
.figures dd b { font: 400 40px/1 var(--display); color: var(--accent); letter-spacing: -.02em; }
.figures dd span { order: 3; font: 400 12px/1.4 var(--mono); color: var(--muted); }
.figures.stacked > div { display: flex; flex-direction: column; }
.figures.stacked dd { display: contents; }
.figures.stacked dd b { order: 1; }
.figures.stacked dt { order: 2; }
.figures.stacked dd span { order: 3; }
.next-case { display: grid; gap: 12px; padding-bottom: clamp(56px, 7vw, 96px); }
.next-case a { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; align-items: center; padding: 26px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); text-decoration: none; }
.next-case b { font: 400 clamp(24px, 3vw, 34px)/1.15 var(--display); color: var(--ink); letter-spacing: -.02em; }
.next-case span:not(.arrow) { grid-column: 1; font-size: 14.5px; color: var(--muted); }
.next-case .arrow { grid-row: 1 / span 2; grid-column: 2; font-size: 28px; color: var(--accent); }
.next-case a:hover .arrow { transform: translateX(6px); }

.timeline { list-style: none; border-top: 1px solid var(--ink); }
.role { display: grid; grid-template-columns: 13em minmax(0, 1fr); gap: 32px; padding: 36px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 96px; }
.role:target { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.role-when { display: grid; gap: 10px; align-content: start; justify-items: start; }
.role-body > h2 { font: 400 clamp(26px, 2.6vw, 32px)/1.12 var(--display); letter-spacing: -.018em; }
.role .org { margin-top: 6px; font-size: 15px; color: var(--muted); }
.role-body > p:not(.org, .role-title) { margin-top: 14px; max-width: 70ch; }
.role-title { margin-top: 14px; font-size: 17.5px; font-weight: 600; color: var(--ink); }
.position { margin-top: 24px; padding-left: 20px; border-left: 2px solid var(--accent); }
.position h3 { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 17.5px; font-weight: 600; }
.position .note { margin-top: 2px; }
.position .prose { margin-top: 12px; }
.role-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 22px; }
.earlier { margin-top: 40px; }
.earlier ul { list-style: none; margin-top: 14px; }
.earlier li { display: grid; grid-template-columns: 13em 1fr; gap: 32px; padding: 10px 0; border-bottom: 1px solid var(--rule); }

.edu { list-style: none; border-top: 1px solid var(--ink); }
.edu li { display: grid; grid-template-columns: 13em minmax(0, 1fr) auto; gap: 32px; align-items: start; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.edu .what { display: grid; gap: 3px; }
.edu .what b { color: var(--ink); font-weight: 600; font-size: 17px; }
.edu .what span { color: var(--muted); }
.edu small { font-size: 14px; color: var(--text); }

.about-grid { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.portrait { margin: 0; position: sticky; top: 96px; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: 20px; background: var(--paper-2); filter: saturate(.92); }
.lead-prose { font-size: clamp(17px, 1.5vw, 18.5px); }
.lead-prose p:first-child::first-line { color: var(--ink); }
.skills { display: grid; border-top: 1px solid var(--ink); }
.skills > div { display: grid; grid-template-columns: 13em minmax(0, 1fr); gap: 32px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.skills dt { font-weight: 600; color: var(--ink); }

.prose { max-width: 70ch; font-size: 17px; line-height: 1.72; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font: 400 clamp(24px, 2.4vw, 30px)/1.2 var(--display); letter-spacing: -.016em; margin-top: 1.9em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 19px; font-weight: 600; margin-top: 1.5em; }
.prose a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { padding-left: .3em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin: 1.4em 0; padding-left: 20px; border-left: 2px solid var(--accent); font: italic 400 21px/1.5 var(--display); color: var(--ink); }
.prose code { font: 400 .88em var(--mono); background: var(--paper-2); padding: 2px 5px; border-radius: 5px; }
.prose .figure { display: block; margin: 1.6em 0; }
.prose .figure img { border-radius: 12px; }
.prose .caption { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); }
.prose.small { font-size: 15.5px; line-height: 1.65; }
.prose.small li + li { margin-top: .4em; }
.byline { margin-top: 22px; font: 400 13px/1.4 var(--mono); color: var(--muted); }
.article .prose { padding-bottom: 72px; }
.empty-state { padding: 48px; border: 1px dashed var(--rule-strong); border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty-state a { color: var(--accent-ink); }
.not-found { min-height: 60vh; }

/* ------------------------------------------------------------------ contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 88px); align-items: start; padding-bottom: clamp(56px, 7vw, 96px); }
.contact-email { display: inline-block; font: 400 clamp(26px, 3.4vw, 40px)/1.1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -.02em; border-bottom: 1px solid var(--accent); padding-bottom: 4px; word-break: break-word; }
.contact-email:hover { color: var(--accent); }
.contact-list { list-style: none; margin-top: 32px; border-top: 1px solid var(--rule); }
.contact-list li { display: grid; grid-template-columns: 8.5em 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 15.5px; }
.contact-list li > span:first-child { font: 500 11.5px/1.9 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact-list a { color: var(--ink); text-underline-offset: 3px; }
.contact-direct .fine { margin-top: 16px; max-width: 54ch; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.contact-form { padding: clamp(24px, 3vw, 36px); }
.contact-form form { display: grid; gap: 18px; }
.contact-form .ff { display: grid; gap: 7px; }
.contact-form label { font-size: 14px; font-weight: 600; color: var(--ink); }
.contact-form input, .contact-form select, .contact-form textarea { font: 400 16px/1.4 var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--muted); border-radius: 10px; padding: 12px 14px; width: 100%; min-height: 48px; transition: border-color .15s, background-color .15s; }
.contact-form textarea { min-height: 160px; resize: vertical; }
.contact-form input:hover, .contact-form select:hover, .contact-form textarea:hover { border-color: var(--ink); }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; background: var(--surface); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
/* Form fields shared with the admin panel. */
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea { font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--muted); border-radius: 10px; padding: 11px 13px; width: 100%; min-height: 46px; transition: border-color .15s; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink); }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.notice { padding: 14px 16px; border-radius: 10px; font-size: 15px; }
.notice.ok { background: var(--accent-soft); color: var(--ink); }
.notice.ok h2 { font: 400 26px/1.2 var(--display); margin-bottom: 8px; }
.notice.err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-weight: 500; }

/* ------------------------------------------------------------------ CV */
.cv-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 40px; }
.cv-actions .actions { margin-top: 0; }
.cv-sheet { max-width: 900px; margin: 28px auto clamp(56px, 7vw, 96px); padding: clamp(28px, 5vw, 64px); background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); color: var(--text); font-size: 15px; line-height: 1.55; }
.cv-head { padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.cv-head h1 { font: 400 44px/1 var(--display); letter-spacing: -.02em; }
.cv-title { margin-top: 8px; font-weight: 600; color: var(--ink); }
.cv-contact { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.cv-contact a { color: inherit; }
.cv-sheet section { margin-top: 24px; }
.cv-sheet h2 { font: 600 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); padding-bottom: 6px; margin-bottom: 10px; border-bottom: 1px solid var(--rule); }
.cv-sheet ul { padding-left: 1.1em; }
.cv-sheet li + li { margin-top: 4px; }
.cv-sheet li::marker { color: var(--muted); }
.cv-role { margin-top: 16px; }
.cv-role:first-of-type { margin-top: 0; }
.cv-role h3, .cv-role h4 { display: flex; justify-content: space-between; gap: 16px; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.cv-role h4 { margin-top: 10px; font-size: 15px; }
.cv-role h4 small { font-weight: 400; color: var(--muted); }
.cv-role .when { font-size: 12.5px; white-space: nowrap; }
.cv-sub { font-size: 13.5px; color: var(--muted); }
.cv-role ul { margin-top: 6px; }
.cv-role p { margin-top: 4px; }
.cv-earlier { margin-top: 14px; font-size: 14px; color: var(--muted); }
.cv-skills > div { display: grid; grid-template-columns: 11em 1fr; gap: 16px; padding: 4px 0; }
.cv-skills dt { font-weight: 600; color: var(--ink); }
.cv-edu { list-style: none; padding: 0 !important; }

/* ------------------------------------------------------------------ footer */
.site-foot { border-top: 1px solid var(--rule); padding: 48px 0 calc(36px + env(safe-area-inset-bottom, 0px)); }
.cta-band + .site-foot, main:has(> .cta-band:last-child) + .site-foot { border-top: 0; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.foot-id { display: flex; align-items: center; gap: 14px; }
.foot-id div { display: grid; }
.foot-id b { color: var(--ink); }
.foot-id span { font-size: 14px; color: var(--muted); }
.foot-nav { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 28px; }
.foot-nav a, .foot-contact a { color: var(--text); text-decoration: none; font-size: 15px; }
.foot-nav a:hover, .foot-contact a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot-contact { display: grid; gap: 8px; justify-items: start; }
.foot-base { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule); }
.avail-line { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .focus-grid, .focus-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .focus-grid li { padding: 22px 22px 22px 0; border-bottom: 1px solid var(--rule); }
  .focus-grid li + li { padding-left: 0; border-left: 0; }
  .focus-grid li:nth-child(even) { padding-left: 22px; border-left: 1px solid var(--rule); }
  .case-body { grid-template-columns: minmax(0, 1fr); }
  .case-side { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); grid-row: 1; }
  .writing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .desktop-menu { display: none; }
  .head-end > .theme-switch { display: none; }
  .menu-toggle { display: block; }
  .hero-grid, .split, .about-grid, .contact-grid, .cta-grid { grid-template-columns: minmax(0, 1fr); }
  .cta-actions { justify-items: start; grid-template-columns: repeat(auto-fit, minmax(200px, max-content)); }
  .portrait { position: static; max-width: 420px; }
  .facts, .facts.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .facts > div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .marks { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .marks-label { max-width: none; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .work-grid, .work-grid.list, .writing-grid { grid-template-columns: minmax(0, 1fr); }
  .work-card.large { grid-template-columns: minmax(0, 1fr); padding: 26px; }
  .work-card.large .lead-figure { grid-column: 1; grid-row: auto; flex-direction: row; align-items: baseline; padding: 16px 0 0; border-left: 0; border-top: 1px dashed var(--rule-strong); }
  .work-card.large .lead-figure b { font-size: 40px; }
  .role, .earlier li, .edu li, .skills > div { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .role-when { grid-auto-flow: column; justify-content: start; align-items: center; }
  .timeline-compact li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .focus-grid, .focus-grid.five { grid-template-columns: minmax(0, 1fr); }
  .focus-grid li:nth-child(even) { padding-left: 0; border-left: 0; }
  .ledger { padding: 18px 18px 16px; }
  .ledger::before { left: 18px; right: 18px; }
  .ledger-list { grid-template-columns: minmax(0, 1fr); }
  .ledger-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .contact-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .cv-skills > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cv-role h3, .cv-role h4 { flex-direction: column; gap: 2px; }
  .brand-text span { display: none; }
  .marks-list li + li::before { display: none; }
  .marks-list { gap: 8px; }
  .marks-list li { padding: 5px 9px; border: 1px solid var(--rule); border-radius: 7px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ print (the CV page prints as a clean document) */
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  :root, :root[data-theme], :root:not([data-theme="light"]) { --paper: #fff; --surface: #fff; --ink: #000; --text: #1a1a1a; --muted: #555; --rule: #ddd; --rule-strong: #bbb; --accent: #0b6b4e; color-scheme: light; }
  body { background: #fff; font-size: 10.5pt; }
  .site-head, .site-foot, .no-print, .skip, .cta-band { display: none !important; }
  .cv-sheet { margin: 0; padding: 0; border: 0; box-shadow: none; max-width: none; font-size: 10pt; }
  .cv-role, .cv-sheet section { break-inside: avoid-page; }
  a { color: inherit; text-decoration: none; }
}
