/* danielyoung.work
   Type: Timeless Serif (display + text) and Timeless Sans.
   Colour, spacing and type live in the tokens below. */

@font-face {
  font-family: "Timeless Serif";
  src: url("/fonts/TimelessSerifVF.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Timeless Serif";
  src: url("/fonts/TimelessSerifItalicVF.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Timeless Sans";
  src: url("/fonts/TimelessSansVF.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --serif: "Timeless Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Timeless Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --paper: #ffffff;
  --paper-2: #f4f4f3;
  --paper-3: #e9e9e7;
  --ink: #0a0a0a;
  --ink-2: #4b4b49;
  --ink-3: #8b8b88;
  --rule: rgba(10, 10, 10, 0.12);
  --rule-strong: rgba(10, 10, 10, 0.3);
  --accent: #77776f;
  --accent-soft: rgba(10, 10, 10, 0.06);
  --select: rgba(10, 10, 10, 0.14);
  --shadow: 0 1px 0 rgba(10, 10, 10, 0.04), 0 18px 40px -24px rgba(10, 10, 10, 0.3);

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1360px;
  --measure: 38rem;
  --reading-size: 1.1875rem;

  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0a0a0a;
  --paper-2: #141414;
  --paper-3: #1e1e1e;
  --ink: #f2f2f0;
  --ink-2: #b4b4b1;
  --ink-3: #7a7a77;
  --rule: rgba(242, 242, 240, 0.13);
  --rule-strong: rgba(242, 242, 240, 0.3);
  --accent: #9a9a96;
  --accent-soft: rgba(242, 242, 240, 0.08);
  --select: rgba(242, 242, 240, 0.22);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a0a0a;
    --paper-2: #141414;
    --paper-3: #1e1e1e;
    --ink: #f2f2f0;
    --ink-2: #b4b4b1;
    --ink-3: #7a7a77;
    --rule: rgba(242, 242, 240, 0.13);
    --rule-strong: rgba(242, 242, 240, 0.3);
    --accent: #9a9a96;
    --accent-soft: rgba(242, 242, 240, 0.08);
    --select: rgba(242, 242, 240, 0.22);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 18px 40px -24px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.28s; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 380;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
  overflow-x: hidden;
}
::selection { background: var(--select); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: var(--gutter); top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 6px; text-decoration: none;
}
.skip:focus { top: 12px; }

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

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

/* Type */
.display {
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "STYL" 0;
  letter-spacing: -0.025em;
  line-height: 0.98;
  margin: 0;
  text-wrap: balance;
}
.display em, .h2 em, .h3 em { font-style: italic; font-weight: 300; color: var(--accent); }
.h2 {
  font-family: var(--serif); font-weight: 300; font-variation-settings: "STYL" 0;
  font-size: clamp(2rem, 4.2vw, 3.5rem); line-height: 1.04; letter-spacing: -0.02em; margin: 0; text-wrap: balance;
}
.h3 {
  font-family: var(--serif); font-weight: 400; font-variation-settings: "STYL" 0;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0;
}
.label {
  font-family: var(--sans); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
}
.lede {
  font-family: var(--serif); font-variation-settings: "STYL" 100; font-weight: 340;
  font-size: clamp(1.2rem, 1.7vw, 1.45rem); line-height: 1.45; color: var(--ink-2); max-width: 36rem; margin: 0; text-wrap: pretty;
}
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* Progress bar (all pages, shows on long pages) */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; pointer-events: none;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background-color 0.35s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; white-space: nowrap; }
.brand-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 420; letter-spacing: -0.01em; }
.brand-role { font-size: 0.8125rem; color: var(--ink-3); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; font-size: 0.9375rem; padding: 8px 12px; border-radius: 999px; color: var(--ink-2);
  transition: color 0.2s, background-color 0.2s;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; display: block; height: 1px; background: var(--accent); margin-top: 2px;
}
.header-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--rule); background: transparent; cursor: pointer; color: var(--ink-2);
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--rule-strong); }
.icon-btn svg { width: 18px; height: 18px; }

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

.menu-btn { display: none; }
@media (max-width: 860px) {
  .brand-role { display: none; }
  .nav {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule); padding: 8px var(--gutter) 24px;
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0.2s;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav a { font-family: var(--serif); font-size: 1.75rem; padding: 12px 0; border-radius: 0; border-bottom: 1px solid var(--rule); color: var(--ink); }
  .nav a:hover { background: none; }
  .nav a[aria-current="page"]::after { display: none; }
  .nav a[aria-current="page"] { color: var(--accent); }
  .menu-btn { display: inline-grid; }
}
@media (max-width: 420px) {
  .theme-switch button { width: 28px; height: 28px; }
}

/* Sections */
main { display: block; }
.section { padding: clamp(72px, 10vw, 144px) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px 48px; align-items: end;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-head .label { display: flex; gap: 12px; align-items: baseline; }
.section-head .label b { color: var(--accent); font-weight: 500; }
@media (max-width: 760px) { .section-head { grid-template-columns: 1fr; } }

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px;
  text-decoration: none; font-size: 0.9375rem; font-weight: 500; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; color: var(--ink); }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.link {
  text-decoration: none; background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.3s var(--ease), color 0.2s;
}
.link:hover { color: var(--accent); }

/* Hero */
.hero { padding: clamp(56px, 9vw, 128px) 0 clamp(64px, 8vw, 112px); }
.hero-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 24px; }
.hero .eyebrow { grid-column: 1 / -1; margin-bottom: clamp(28px, 4vw, 48px); display: flex; gap: 10px; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.hero h1 { grid-column: 1 / -1; font-size: clamp(2.5rem, 6vw, 6.25rem); max-width: 25ch; }
.hero-foot {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px 24px;
  margin-top: clamp(40px, 6vw, 80px); padding-top: 28px; border-top: 1px solid var(--rule);
}
.hero-foot .lede { grid-column: 1 / span 6; }
.hero-foot .actions { grid-column: 9 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: flex-end; }
@media (max-width: 900px) {
  .hero h1 { grid-column: 1 / -1; }
  .hero-foot .lede, .hero-foot .actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Margin note: Dan's handwriting-in-the-margin voice */
.note {
  font-family: var(--serif); font-style: italic; font-weight: 340; color: var(--accent);
  font-size: 1.0625rem; line-height: 1.4; max-width: 18rem; position: relative; padding-left: 18px;
}
.note::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 10px; height: 1px; background: currentColor;
}

/* Work index (home and work page) */
.work-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.work-row { border-bottom: 1px solid var(--rule); }
.work-row > a, .work-row > details > summary {
  display: grid; grid-template-columns: 56px minmax(0, 5fr) minmax(0, 4fr) 88px 28px; gap: 16px; align-items: baseline;
  padding: 26px 0; text-decoration: none; cursor: pointer; list-style: none; position: relative;
}
.work-row summary::-webkit-details-marker { display: none; }
.work-row .idx { font-size: 0.8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.work-row .title {
  font-family: var(--serif); font-weight: 340; font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.05; letter-spacing: -0.015em;
  transition: transform 0.35s var(--ease), color 0.2s;
}
.work-row .what { color: var(--ink-2); font-size: 0.9375rem; }
.work-row .year { color: var(--ink-3); font-size: 0.875rem; text-align: right; font-variant-numeric: tabular-nums; }
.work-row .go { color: var(--ink-3); justify-self: end; transition: transform 0.3s var(--ease), color 0.2s; }
.work-row > a:hover .title, .work-row summary:hover .title { transform: translateX(8px); }
.work-row > a:hover .go, .work-row summary:hover .go { color: var(--accent); transform: translateX(3px); }
.work-row details[open] .go { transform: rotate(45deg); color: var(--accent); }
.work-row .tag {
  display: inline-block; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500;
  color: var(--ink-3); border: 1px solid var(--rule); border-radius: 999px; padding: 2px 8px; margin-left: 10px; vertical-align: middle;
}
.work-detail {
  display: grid; grid-template-columns: 56px minmax(0, 5fr) minmax(0, 4fr) 116px; gap: 16px; padding: 0 0 36px;
}
.work-detail > div:first-child { grid-column: 2; }
.work-detail p { margin: 0 0 12px; max-width: 34rem; color: var(--ink-2); }
.work-detail dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 0.875rem; }
.work-detail dt { color: var(--ink-3); }
.work-detail dd { margin: 0; }
@media (max-width: 760px) {
  .work-row > a, .work-row > details > summary { grid-template-columns: 36px minmax(0, 1fr) 24px; row-gap: 6px; }
  .work-row .what { grid-column: 2; grid-row: 2; }
  .work-row .year { display: none; }
  .work-row .go { grid-column: 3; grid-row: 1; }
  .work-detail { grid-template-columns: 1fr; padding-left: 52px; }
  .work-detail > div:first-child { grid-column: auto; }
}

/* Hover preview that follows the cursor on the work list */
.preview {
  position: fixed; left: 0; top: 0; width: 280px; aspect-ratio: 4 / 3; z-index: 40; pointer-events: none;
  border-radius: 6px; overflow: hidden; opacity: 0; transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.25s, transform 0.35s var(--ease); box-shadow: var(--shadow);
}
.preview.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: none) { .preview { display: none; } }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 28px; }
.chip {
  border: 1px solid var(--rule); background: transparent; border-radius: 999px; padding: 8px 14px; cursor: pointer;
  font-size: 0.875rem; color: var(--ink-2); transition: all 0.2s;
}
.chip:hover { border-color: var(--rule-strong); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .count { color: var(--ink-3); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .count { color: color-mix(in srgb, var(--paper) 60%, transparent); }
.filters .status { margin-left: auto; font-size: 0.8125rem; color: var(--ink-3); }

/* Services */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--rule); }
.service { padding: 28px 28px 32px 0; border-bottom: 1px solid var(--rule); }
.service + .service { padding-left: 28px; border-left: 1px solid var(--rule); }
.service .label { display: block; margin-bottom: 40px; }
.service h3 { margin-bottom: 12px; }
.service p { margin: 0; color: var(--ink-2); font-size: 0.9688rem; max-width: 22rem; }
.service.is-new h3::after {
  content: "New"; font-family: var(--sans); font-size: 0.625rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: 2px 7px; margin-left: 10px; vertical-align: 0.4em;
}
@media (max-width: 980px) {
  .service + .service { padding-left: 0; border-left: 0; }
  .service { padding-right: 0; }
}

/* Projects: image-led cards on a 12-column grid. Drop an <img> into .shot to fill a slot. */
.projects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(36px, 5vw, 64px) 24px; }
.project { grid-column: span 4; }
.project.p-wide { grid-column: span 7; }
.project.p-tall { grid-column: span 5; }
.project > a { display: block; text-decoration: none; }
.shot { position: relative; overflow: hidden; border-radius: 6px; background: var(--paper-2); border: 1px solid var(--rule); aspect-ratio: 4 / 3; }
.p-wide .shot { aspect-ratio: 8 / 5; }
.p-tall .shot { aspect-ratio: 8 / 7; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ease); }
.project > a:hover .shot img { transform: scale(1.035); }
.shot.is-empty {
  display: grid; place-items: end start; padding: 18px;
  background: repeating-linear-gradient(135deg, var(--paper-2) 0 14px, var(--paper-3) 14px 15px);
  transition: border-color 0.3s;
}
.project > a:hover .shot.is-empty { border-color: var(--rule-strong); }
.shot .slot { font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.project-meta { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 2px 12px; padding-top: 16px; align-items: baseline; }
.project-meta .idx { font-size: 0.8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; grid-row: 1; }
.project-meta .title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.4rem, 2.2vw, 1.9rem); line-height: 1.15; margin: 0; transition: color 0.2s; }
.project > a:hover .title { color: var(--accent); }
.project-meta .year { color: var(--ink-3); font-size: 0.875rem; font-variant-numeric: tabular-nums; grid-row: 1; grid-column: 3; }
.project-meta .what { grid-column: 2 / -1; color: var(--ink-2); font-size: 0.9375rem; }
@media (max-width: 860px) {
  .project, .project.p-wide, .project.p-tall { grid-column: 1 / -1; }
  .p-wide .shot, .p-tall .shot { aspect-ratio: 4 / 3; }
}

/* How I work: stages run left to right, machine above, me below */
.ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 20px; border-top: 1px solid var(--ink); }
.stage { position: relative; display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 12px; padding-top: 28px; }
.stage::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.stage .h3 { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.stage .idx { font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stage p { margin: 0; }
.machine-col, .me-col { padding: 18px 18px 20px; border-radius: 6px; font-size: 0.9375rem; }
.machine-col { background: var(--paper-2); color: var(--ink-2); }
.me-col { background: var(--accent-soft); color: var(--ink); }
.machine-col::before, .me-col::before {
  display: block; font-family: var(--sans); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; color: var(--ink-3);
}
.machine-col::before { content: "The machine"; }
.me-col::before { content: "Me"; color: var(--accent); }
.ledger-toggle { display: inline-flex; gap: 6px; margin-bottom: 28px; }
.ledger[data-view="machine"] .me-col, .ledger[data-view="me"] .machine-col { opacity: 0.18; }
.machine-col, .me-col { transition: opacity 0.35s var(--ease); }
@media (max-width: 960px) {
  .ledger {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px;
    margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); scroll-padding-left: var(--gutter);
  }
  .stage { flex: 0 0 min(78%, 320px); scroll-snap-align: start; display: flex; flex-direction: column; gap: 12px; }
}

/* Pull quote */
.pull { padding: clamp(80px, 12vw, 168px) 0; text-align: center; border-top: 1px solid var(--rule); }
.pull blockquote {
  margin: 0 auto; max-width: 18ch; font-family: var(--serif); font-weight: 300; font-size: clamp(2.4rem, 6.4vw, 5.5rem);
  line-height: 1.02; letter-spacing: -0.025em; text-wrap: balance;
}
.pull blockquote em { color: var(--accent); }
.pull figcaption { margin-top: 28px; }

/* Notes list */
.notes-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.notes-list li { border-bottom: 1px solid var(--rule); }
.notes-list a {
  display: grid; grid-template-columns: 140px minmax(0, 1fr) 140px; gap: 24px; padding: 28px 0; text-decoration: none; align-items: baseline;
}
.notes-list .h3 { transition: color 0.2s; }
.notes-list a:hover .h3 { color: var(--accent); }
.notes-list .excerpt { color: var(--ink-2); margin: 10px 0 0; max-width: 40rem; }
.notes-list .meta { font-size: 0.875rem; color: var(--ink-3); }
.notes-list .meta.right { text-align: right; }
.notes-list .is-read .meta.right::before { content: "Read · "; color: var(--accent); }
@media (max-width: 760px) {
  .notes-list a { grid-template-columns: 1fr; gap: 8px; }
  .notes-list .meta.right { text-align: left; order: 3; }
}

/* CTA */
.cta { padding: clamp(80px, 11vw, 160px) 0; border-top: 1px solid var(--rule); }
.cta-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: end; }
.cta .display { font-size: clamp(2.6rem, 7vw, 6.5rem); }
.cta-side { display: grid; gap: 22px; justify-items: start; }
@media (max-width: 860px) { .cta-grid { grid-template-columns: 1fr; } }

.clock { display: flex; gap: 12px; align-items: center; font-size: 0.9375rem; color: var(--ink-2); }
.clock .pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.clock[data-state="awake"] .pulse { background: #3f9b5e; }
.clock[data-state="awake"] .pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid #3f9b5e; animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 56px 0 40px; font-size: 0.875rem; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2fr)); gap: 32px 24px; }
.footer-grid h2 { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; color: var(--ink-3); margin: 0 0 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--accent); }
.colophon { max-width: 26rem; }
.colophon p { margin: 0 0 10px; }
.footer-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 20px;
  border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 0.8125rem;
}
kbd {
  font-family: var(--sans); font-size: 0.75rem; border: 1px solid var(--rule-strong); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 6px; color: var(--ink-2); background: var(--paper-2);
}
.kbd-hint { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; font-size: inherit; }
.kbd-hint:hover { color: var(--ink); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .colophon { grid-column: 1 / -1; } }
@media (hover: none) { .kbd-hint { display: none; } }

/* Page intro (inner pages) */
.page-intro { padding: clamp(56px, 8vw, 112px) 0 clamp(48px, 6vw, 80px); }
.page-intro .label { margin-bottom: 28px; display: block; }
.page-intro .display { font-size: clamp(2.8rem, 7.4vw, 7rem); max-width: 14ch; }
.page-intro .lede { margin-top: 36px; }
.intro-split { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 48px; align-items: end; }
@media (max-width: 860px) { .intro-split { grid-template-columns: 1fr; } }

/* Long-form reading: notes and case studies */
.article-head { padding: clamp(48px, 7vw, 104px) 0 40px; }
.crumbs { display: flex; gap: 10px; font-size: 0.875rem; color: var(--ink-3); margin-bottom: 40px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.article-head .display { font-size: clamp(2.5rem, 6vw, 5.25rem); max-width: 18ch; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--rule);
  font-size: 0.875rem; color: var(--ink-3);
}
.article-meta b { color: var(--ink); font-weight: 500; }

.reading { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 7fr) minmax(0, 2fr); gap: 48px; padding-bottom: 96px; }
.reading-aside { position: relative; }
.reading-aside .sticky { position: sticky; top: 104px; display: grid; gap: 32px; }
.toc ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--rule); }
.toc a {
  display: block; text-decoration: none; padding: 5px 0 5px 14px; margin-left: -1px; font-size: 0.875rem; color: var(--ink-3);
  border-left: 1px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--accent); }
.reader-tools { display: grid; gap: 10px; }
.reader-tools .row { display: flex; gap: 6px; align-items: center; }
.reader-tools button {
  border: 1px solid var(--rule); background: none; border-radius: 999px; height: 32px; min-width: 36px; padding: 0 10px; cursor: pointer;
  font-size: 0.8125rem; color: var(--ink-2);
}
.reader-tools button:hover { border-color: var(--rule-strong); color: var(--ink); }
.reader-tools button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.time-left { font-size: 0.875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.prose {
  font-family: var(--serif); font-variation-settings: "STYL" 100; font-weight: 360;
  font-size: var(--reading-size); line-height: 1.62; max-width: var(--measure); text-wrap: pretty;
  hanging-punctuation: first;
}
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose h2 {
  font-variation-settings: "STYL" 0; font-weight: 400; font-size: 1.75em; line-height: 1.12; letter-spacing: -0.015em;
  margin: 2.2em 0 0.6em; scroll-margin-top: 104px;
}
.prose h3 { font-family: var(--sans); font-size: 0.85em; font-weight: 600; margin: 2em 0 0.4em; }
.prose a { text-decoration-color: var(--accent); }
.prose a:hover { color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--ink-3); }
.prose blockquote {
  margin: 1.8em 0; padding: 0; font-size: 1.45em; line-height: 1.25; font-variation-settings: "STYL" 0; font-weight: 300;
  font-style: italic; color: var(--accent); text-wrap: balance;
}
.prose .dropcap::first-letter {
  float: left; font-variation-settings: "STYL" 0; font-weight: 300; font-size: 4.1em; line-height: 0.82; margin: 0.06em 0.08em 0 -0.02em; color: var(--accent);
}
.prose figure { margin: 2em 0; }
.prose figcaption, .figure figcaption { font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-3); margin-top: 10px; }
.reading-margin { position: relative; }
.reading-margin .note { position: sticky; top: 104px; }

.disclosure {
  margin-top: 56px; padding: 22px 24px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper-2);
  font-family: var(--sans); font-size: 0.9375rem; line-height: 1.55; color: var(--ink-2);
}
.disclosure .label { display: block; margin-bottom: 8px; color: var(--accent); }
.disclosure p { margin: 0; }

.article-end { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 40px; font-family: var(--sans); }
.pager { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); }
.pager a { padding: 36px 0; text-decoration: none; display: grid; gap: 8px; }
.pager a + a { text-align: right; padding-left: 24px; border-left: 1px solid var(--rule); }
.pager a:first-child { padding-right: 24px; }
.pager a:hover .h3 { color: var(--accent); }
@media (max-width: 1080px) {
  .reading { grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); }
  .reading-margin { display: none; }
}
@media (max-width: 860px) {
  .reading { grid-template-columns: 1fr; gap: 0; }
  .reading-aside .sticky { position: static; grid-template-columns: 1fr auto; align-items: start; margin-bottom: 36px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
  .toc { display: none; }
  .pager { grid-template-columns: 1fr; }
  .pager a + a { text-align: left; padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
}

/* Case study */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--rule); }
.facts dt { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin-bottom: 6px; }
.facts dd { margin: 0; font-size: 0.9375rem; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr 1fr; } }
.figure { margin: 0; }
.figure img { border-radius: 6px; background: var(--paper-2); }
.figure-wide { margin: 0 0 clamp(56px, 7vw, 96px); }
.figure-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); margin: 2.4em 0; }
@media (max-width: 600px) { .figure-row { grid-template-columns: 1fr 1fr; } .figure-row .figure:nth-child(3) { display: none; } }
.bleed { width: min(100vw - 2 * var(--gutter), var(--max) - 2 * var(--gutter)); }

/* About */
.principles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.principles li { padding: 32px 32px 40px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 48px 1fr; gap: 8px; }
.principles li:nth-child(even) { padding-left: 32px; border-left: 1px solid var(--rule); }
.principles .idx { color: var(--accent); font-size: 0.875rem; padding-top: 6px; }
.principles p { margin: 10px 0 0; color: var(--ink-2); max-width: 28rem; }
@media (max-width: 760px) {
  .principles { grid-template-columns: 1fr; }
  .principles li:nth-child(even) { padding-left: 0; border-left: 0; }
}
.cv { border-top: 1px solid var(--ink); }
.cv-row { display: grid; grid-template-columns: 120px minmax(0, 4fr) minmax(0, 5fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.cv-row .when { color: var(--ink-3); font-size: 0.875rem; font-variant-numeric: tabular-nums; padding-top: 4px; }
.cv-row h3 { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; margin: 0; line-height: 1.2; }
.cv-row .sub { color: var(--ink-3); font-size: 0.875rem; margin-top: 4px; }
.cv-row p { margin: 0; color: var(--ink-2); }
.cv-group { margin-top: 48px; }
.cv-group > .label { display: block; margin-bottom: 14px; }
@media (max-width: 760px) { .cv-row { grid-template-columns: 1fr; gap: 6px; } }
.cv-points { margin: 0; padding: 0 0 0 1.1em; color: var(--ink-2); display: grid; gap: 8px; }
.cv-points li::marker { color: var(--accent); }
.cv-intro .display { max-width: none; }
.cv-meta .facts { grid-template-columns: 1fr; gap: 14px; margin-top: 0; }
.cv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.portrait {
  aspect-ratio: 4 / 5; border-radius: 6px; background: var(--paper-2); border: 1px solid var(--rule);
  display: grid; place-items: end start; padding: 22px; position: relative; overflow: hidden;
}
.portrait .mono { position: absolute; right: -0.06em; top: -0.18em; font-family: var(--serif); font-weight: 200; font-size: 15rem; line-height: 1; color: var(--paper-3); letter-spacing: -0.05em; }
.portrait span:last-child { position: relative; }

/* Contact */
.contact-email {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px;
}
.contact-email a { font-family: var(--serif); font-weight: 300; font-size: clamp(1.8rem, 5vw, 4.25rem); letter-spacing: -0.02em; text-decoration: none; line-height: 1.1; overflow-wrap: anywhere; }
.contact-email a:hover { color: var(--accent); }
.builder { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 48px; }
.builder fieldset { border: 0; margin: 0 0 32px; padding: 0; }
.builder legend { margin-bottom: 14px; padding: 0; }
.builder .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.builder textarea, .builder input[type="text"] {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: 8px; padding: 14px 16px; resize: vertical;
}
.builder textarea:focus, .builder input:focus { outline: none; border-color: var(--ink); }
.draft {
  font-family: var(--serif); font-variation-settings: "STYL" 100; font-size: 1.0625rem; line-height: 1.6; white-space: pre-wrap;
  padding: 22px 24px; border-left: 2px solid var(--accent); background: var(--paper-2); border-radius: 0 8px 8px 0; color: var(--ink-2); margin: 0 0 20px;
}
@media (max-width: 860px) { .builder { grid-template-columns: 1fr; } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); font-size: 0.875rem; padding: 10px 16px; border-radius: 999px; transition: all 0.3s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Shortcuts dialog */
dialog.keys {
  border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); color: var(--ink); padding: 28px 30px; width: min(420px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}
dialog.keys::backdrop { background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(2px); }
dialog.keys h2 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 0 0 18px; }
dialog.keys dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; font-size: 0.9375rem; }
dialog.keys dd { margin: 0; color: var(--ink-2); }
dialog.keys form { margin-top: 22px; text-align: right; }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.hero .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero .line > span { display: inline-block; }
.js .hero .line > span { transform: translateY(105%); transition: transform 1.1s var(--ease); }
.js.is-loaded .hero .line > span { transform: none; }
.hero .line:nth-child(2) > span { transition-delay: 0.08s; }
.hero .line:nth-child(3) > span { transition-delay: 0.16s; }
/* Hero words come into focus one after another, as if being brought into line */
.hero .w { display: inline-block; }
.js .hero .w { opacity: 0; filter: blur(10px); transform: translateY(0.16em); transition: opacity 0.9s var(--ease), filter 1.1s var(--ease), transform 1.1s var(--ease); }
.js.is-loaded .hero .w { opacity: 1; filter: none; transform: none; }
.hero .lede { font-family: var(--sans); font-size: clamp(1.15rem, 1.7vw, 1.5rem); line-height: 1.4; max-width: 34ch; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal, .hero .line > span, .hero .w { opacity: 1; transform: none; filter: none; }
  @view-transition { navigation: none; }
}

/* Print: the CV and notes print cleanly */
@media print {
  .site-header, .site-footer, .progress, .reading-aside, .reading-margin, .cta, .no-print, .toast { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .reading { display: block; }
  .section { padding: 24px 0; }
  a { text-decoration: none; color: inherit; }
  .cv-intro { padding: 0 0 12px; }
  .cv-intro .display { font-size: 30pt; }
  .cv-intro .intro-split { grid-template-columns: 2fr 1fr; gap: 24px; }
  .cv-intro .crumbs { display: none; }
  .cv-section .section-head { margin-bottom: 10px; display: block; }
  .cv-section .section-head .h2 { display: none; }
  .cv-row { padding: 10px 0; break-inside: avoid; grid-template-columns: 90pt 1.3fr 2fr; }
  .cv-points { gap: 3px; }
  .section + .section { border-top: 0; }
  @page { margin: 14mm; }
}

/* Client case study galleries */
.case-gallery { display: grid; gap: clamp(12px, 2vw, 24px); padding-bottom: clamp(56px, 7vw, 96px); }
.case-gallery .figure { margin: 0; }
.case-gallery .figure img { width: 100%; height: auto; display: block; }
.case-gallery .figure-wide { margin: 0; }
.figure-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 24px); }
.figure-pair > .figure:only-child { grid-column: 1 / -1; width: calc(50% - clamp(6px, 1vw, 12px)); justify-self: center; }
@media (max-width: 600px) { .figure-pair { gap: 12px; } }

/* Case study text blocks and extras */
.case-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px clamp(24px, 4vw, 64px); padding: clamp(36px, 5vw, 72px) 0; border-top: 1px solid var(--rule); }
.case-text p { margin: 0 0 1em; max-width: 62ch; font-size: 1.0625rem; line-height: 1.6; }
.case-text p:last-child { margin-bottom: 0; }
.case-gallery + .case-text { margin-top: 0; }
.figure-narrow { max-width: min(100%, 380px); justify-self: center; }
.scroll-frame { margin: 0; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--paper-2); }
.scroll-frame__view { max-height: min(78vh, 760px); overflow-y: auto; overscroll-behavior: contain; }
.scroll-frame__view img { width: 100%; height: auto; display: block; }
.scroll-frame figcaption { padding: 10px 14px; border-top: 1px solid var(--rule); font-size: 0.8125rem; color: var(--ink-3); }
@media (max-width: 760px) { .case-text { grid-template-columns: 1fr; } }

/* Portfolio style pass: monochrome, mono eyebrow labels, numbered rows, black cover panels,
   square images that run to the page edge. Taken from the portfolio PDF and the Behind the Design carousel. */
:focus-visible { outline-color: var(--ink); }
.progress { background: var(--ink); }
::selection { background: var(--select); }
.label, .facts dt, .crumbs, .project-meta .idx, .work-row .idx, .work-row .tag, .notes-list .meta, .article-meta, .time-left {
  font-family: var(--mono); font-weight: 400; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.crumbs { margin-bottom: 32px; }
.section-head .label b { color: var(--ink); font-weight: 400; }
.brand-name { font-family: var(--sans); font-weight: 500; font-size: 1.0625rem; letter-spacing: -0.01em; }
.brand-role { font-family: var(--serif); font-size: 1.0625rem; color: var(--ink-3); }
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--paper); }
.shot, .figure img, .case-gallery img, .scroll-frame, .preview, .carousel img { border-radius: 0; }
.shot { border: 0; }

/* Cover panel: a black block with white type, like the portfolio and carousel covers */
.hero { background: #000; color: #fff; padding: clamp(36px, 5vw, 64px) 0; min-height: min(80vh, 760px); display: flex; }
.hero .hero-grid { width: 100%; align-content: space-between; min-height: inherit; }
.hero .eyebrow { margin-bottom: 0; }
.hero .label { color: rgba(255, 255, 255, 0.55); }
.hero h1 { color: #fff; font-size: clamp(2.25rem, 5.2vw, 5rem); max-width: 22ch; align-self: end; }
.hero .lede { color: rgba(255, 255, 255, 0.68); }
.hero .btn { background: #fff; color: #000; border-color: #fff; }
.hero .btn:hover { background: transparent; color: #fff; }
.hero .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.hero .btn.ghost:hover { border-color: #fff; }
.hero-foot { margin-top: clamp(28px, 4vw, 48px); }

/* Case studies: numbered text rows and edge-to-edge images */
main { counter-reset: ct; }
.case-text { counter-increment: ct; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 2fr); }
.case-text::before { content: counter(ct, decimal-leading-zero); font-family: var(--serif); font-size: 1.15rem; line-height: 1.4; }
.case-text .h3 { font-size: clamp(1.4rem, 2vw, 1.75rem); }
.case-text p { font-size: 1rem; }
.case-gallery.wrap { max-width: none; padding-inline: 0; gap: 6px; }
.case-gallery .figure-pair { gap: 6px; }
.article-head .display { font-size: clamp(2rem, 4.4vw, 3.75rem); max-width: 22ch; line-height: 1.04; }
@media (max-width: 760px) {
  .case-text { grid-template-columns: 40px minmax(0, 1fr); }
  .case-text > div { grid-column: 1 / -1; }
}

/* Behind the design: a swipeable carousel, like the LinkedIn post */
.carousel__track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__slide { flex: 0 0 min(88vw, 540px); scroll-snap-align: start; margin: 0; }
.carousel__slide img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--paper-2); }
.carousel__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.carousel__bar .btns { display: flex; gap: 8px; }
.carousel__count { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--ink-3); }
.transcript { margin-top: 56px; border-top: 1px solid var(--rule); }
.transcript summary { cursor: pointer; padding: 20px 0; font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.transcript ol { list-style: none; margin: 0; padding: 0 0 24px; display: grid; gap: 28px; }
.transcript h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 1.5rem; }
.transcript p { margin: 0; max-width: 56ch; color: var(--ink-2); }
