/* Components and layout. All values come from tokens.css. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0)/var(--leading) var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, picture { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.22em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-variation-settings: var(--soft); font-weight: 400; line-height: var(--leading-tight); letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.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; }
.skip-link {
  position: absolute; left: var(--gutter); top: -5rem; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 0.65rem 1.1rem;
  border-radius: var(--radius-pill); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 0.75rem; color: var(--on-accent); }

.kicker {
  display: inline-block; margin: 0;
  font: 600 var(--step--1)/1.3 var(--font-sans);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--sage);
}
.section { padding-block: var(--space-2xl); }
.section-head { max-width: 44rem; margin-bottom: var(--gap); }
.section-head h2 { font-size: var(--step-3); margin-top: var(--space-xs); }
.section-head p { color: var(--muted); margin: var(--space-m) 0 0; }
.divider { border: 0; height: 1px; background: var(--line); margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0 1.35rem; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--on-accent); border: 2px solid var(--accent);
  font: 600 var(--step--1)/1.2 var(--font-sans); text-decoration: none; text-align: center;
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast);
}
.btn:hover { color: var(--on-accent); filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); filter: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-s); }

/* ---------- Header ---------- */
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-s) var(--space-m); padding-block: var(--space-l); }
.brand { font: 600 1.25rem/1 var(--font-serif); font-variation-settings: var(--soft); text-decoration: none; padding-block: 0.5rem; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: var(--space-2xs); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem;
  border-radius: var(--radius-pill); font-weight: 500; font-size: var(--step--1); text-decoration: none;
}
.site-nav a:hover { background: var(--surface); color: var(--ink); }
.site-nav a[aria-current] { background: var(--ink); color: var(--bg); }

/* ---------- Home: hero ---------- */
.hero { display: grid; gap: var(--gap); align-items: center; padding-block: var(--space-xl) var(--space-2xl); }
@media (min-width: 56rem) { .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.hero h1 { font-size: var(--step-4); line-height: 0.98; letter-spacing: -0.02em; margin: var(--space-s) 0 var(--space-l); font-variation-settings: var(--soft), "opsz" 144; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { font-size: var(--step-1); line-height: 1.55; margin: 0 0 var(--space-xl); max-width: 32ch; }
.portrait { position: relative; margin: 0; justify-self: center; width: min(100%, 26rem); isolation: isolate; }
.portrait::before { content: ""; position: absolute; inset: 8% -8% -4% 10%; z-index: -1; background: var(--blob); border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%; }
.portrait::after { content: ""; position: absolute; z-index: -1; width: 38%; aspect-ratio: 1; left: -6%; bottom: 6%; background: var(--blob-2); border-radius: 50%; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: var(--radius-pill) var(--radius-pill) var(--radius-l) var(--radius-l); }
.portrait figcaption { margin-top: var(--space-s); text-align: center; font-size: var(--step--1); color: var(--muted); }
@media (max-width: 55.99rem) { .portrait::before { inset: 8% -4% -4% 6%; } .portrait::after { left: -2%; } }

/* ---------- Home: story (About) ---------- */
.story { display: grid; gap: var(--space-l) var(--space-2xl); align-items: start; }
@media (min-width: 56rem) { .story { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } .story-head { position: sticky; top: var(--space-l); } }
.story-head h2 { font-size: var(--step-3); margin-top: var(--space-xs); }
.story-body { max-width: var(--measure); }
.story-body p { margin: 0 0 1.25em; }
.story-body p:first-child { font: 400 var(--step-1)/1.5 var(--font-serif); font-variation-settings: var(--soft); letter-spacing: -0.005em; }
.story-body p:last-child { margin-bottom: 0; color: var(--muted); }

/* ---------- Home: Case studies teaser ("vault"): fanned, pre-blurred cards ---------- */
.vault { display: grid; gap: var(--gap); align-items: center; background: var(--surface); border-radius: var(--radius-l); padding: clamp(1.5rem, 1rem + 3vw, 3rem); overflow: hidden; }
@media (min-width: 56rem) { .vault { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.vault-copy h2 { font-size: var(--step-3); margin: var(--space-xs) 0 var(--space-m); }
.vault-copy p { margin: 0 0 var(--space-l); max-width: 44ch; }
.vault-copy .kicker { margin: 0; }
.stack { position: relative; height: clamp(15rem, 40vw, 25rem); }
.stack figure { position: absolute; margin: 0; width: 60%; aspect-ratio: 10 / 7; border-radius: var(--radius-m); overflow: hidden; border: 1px solid rgb(255 255 255 / 0.35); box-shadow: 0 28px 44px -24px rgb(0 0 0 / 0.55); }
.stack img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stack .f1 { left: 0; top: 18%; transform: rotate(-7deg); }
.stack .f2 { left: 13%; top: 8%; transform: rotate(-3deg); }
.stack .f3 { left: 26%; top: 14%; transform: rotate(2deg); }
.stack .f4 { left: 39%; top: 2%; transform: rotate(6deg); }
.stack .f4::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgb(0 0 0 / 0.28)); }
.stack .lock { position: absolute; z-index: 2; left: 50%; top: 50%; translate: -50% -50%; display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; padding: 0.45rem 0.85rem; border-radius: var(--radius-pill); background: rgb(255 255 255 / 0.88); color: #2D231E; font: 600 var(--step--1)/1 var(--font-sans); }
.stack figcaption { position: absolute; z-index: 2; left: 0.75rem; bottom: 0.75rem; padding: 0.35rem 0.7rem; border-radius: var(--radius-pill); background: rgb(255 255 255 / 0.88); color: #2D231E; font: 500 var(--step--1)/1.2 var(--font-sans); }

/* ---------- Testimonials ---------- */
.quotes { display: grid; gap: var(--gap); }
@media (min-width: 56rem) { .quotes { grid-template-columns: 1fr 1fr; align-items: start; } }
.quote { margin: 0; background: var(--surface); border-radius: var(--radius-l) var(--radius-l) var(--radius-l) var(--radius-s); padding: clamp(1.4rem, 1rem + 1.5vw, 2.4rem); }
.quote blockquote { margin: 0; font: 400 var(--step-0)/1.65 var(--font-serif); font-variation-settings: var(--soft); }
.quote blockquote p { margin: 0; }
.quote figcaption { margin-top: var(--space-l); font-size: var(--step--1); color: var(--muted); }
.quote figcaption strong { display: block; color: var(--ink); font-size: var(--step-0); }
.quote-by { display: flex; align-items: center; gap: var(--space-m); }
.quote-by .who { display: block; min-width: 0; }
.avatar { flex: none; width: 3.5rem; height: 3.5rem; border-radius: 50%; object-fit: cover; background: var(--raised); }
.avatar-initials { display: inline-grid; place-items: center; color: var(--ink); font: 500 1.1rem/1 var(--font-serif); font-variation-settings: var(--soft); letter-spacing: 0.02em; border: 1px solid var(--line-strong); }
.profile-link { display: block; width: fit-content; margin-top: var(--space-2xs); padding-block: 0.2rem; color: var(--ink); }

/* ---------- Contact panel (home) and contact page ---------- */
.contact-panel { background: var(--inverse-bg); color: var(--inverse-ink); border-radius: var(--radius-l); padding: clamp(1.75rem, 1rem + 3vw, 3.5rem); display: grid; gap: var(--space-l); }
.contact-panel .kicker { color: inherit; }
.contact-panel h2 { font-size: var(--step-3); }
.contact-panel .btn-ghost { color: var(--inverse-ink); border-color: currentColor; }
.contact-panel .btn-ghost:hover { color: var(--inverse-ink); }
.contact-panel a:not(.btn):hover { color: inherit; }

.page-head { padding-block: var(--space-xl) var(--space-l); }
.page-head h1 { font-size: var(--step-4); line-height: 1; margin-top: var(--space-s); }
.page-head .lede { font-size: var(--step-1); line-height: 1.55; color: var(--muted); max-width: 44ch; margin: var(--space-l) 0 0; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-m); }
.contact-list li { border-top: 1px solid var(--line); padding-top: var(--space-m); }
.contact-list .label { display: block; font-size: var(--step--1); color: var(--muted); }
.contact-list a { overflow-wrap: anywhere; font: 400 var(--step-2)/1.25 var(--font-serif); font-variation-settings: var(--soft); }

/* ---------- Work index ---------- */
.work-grid { display: grid; gap: var(--gap); list-style: none; margin: 0; padding: 0; }
@media (min-width: 48rem) { .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.work-card a {
  display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 0.75rem;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur-fast);
}
.work-card a:hover { border-color: var(--accent); color: inherit; }
.work-card .media { border-radius: calc(var(--radius-l) - 0.75rem); overflow: hidden; aspect-ratio: 10 / 7; background: var(--surface); }
.work-card .media img { width: 100%; height: 100%; object-fit: cover; }
.work-card .body { padding: var(--space-m) var(--space-s) var(--space-s); display: grid; gap: var(--space-xs); }
.work-card .meta { display: flex; align-items: center; gap: 0.6rem; font-size: var(--step--1); color: var(--muted); }
.work-card .num { display: inline-grid; place-items: center; min-width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 0.75rem; }
.work-card h2 { font-size: var(--step-2); font-weight: 500; }
.work-card a:hover h2 { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.work-card .summary { margin: 0; color: var(--muted); font-size: var(--step--1); }
.notice { display: flex; gap: var(--space-s); align-items: flex-start; background: var(--surface); border-radius: var(--radius-m); padding: var(--space-m) var(--space-l); color: var(--ink); font-size: var(--step--1); max-width: 46rem; }
.notice svg { flex: none; margin-top: 0.2rem; color: var(--sage); }

/* ---------- Case study ---------- */
.cs-head { padding-block: var(--space-xl) var(--space-l); display: grid; gap: var(--space-m); }
.cs-head .back { font-size: var(--step--1); color: var(--muted); }
.cs-head h1 { font-size: var(--step-4); line-height: 1; max-width: 18ch; }
.cs-head .summary { font-size: var(--step-1); line-height: 1.55; margin: 0; max-width: 46ch; }
.cs-cover { margin: 0; border-radius: var(--radius-l); overflow: hidden; background: var(--surface); }
.cs-cover img { width: 100%; }
/* At a glance: a row of key facts, then details (left) and outcomes (right) */
.glance { display: grid; gap: var(--space-l); padding-block: var(--space-2xl) 0; }
.glance > h2 { font-size: var(--step-2); }
.glance-label, .glance-meta dt {
  margin: 0 0 var(--space-xs);
  font: 600 var(--step--1)/1.3 var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.glance-meta {
  display: grid; gap: var(--space-m) var(--gap); margin: 0; padding-block: var(--space-m);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  border-block: 1px solid var(--line);
}
.glance-meta dd { margin: 0; font-weight: 500; line-height: 1.4; }
.glance-body { display: grid; gap: var(--gap); align-items: start; }
@media (min-width: 56rem) { .glance-body { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.glance-details { display: grid; gap: var(--space-xl); }
.glance-details p { margin: 0; max-width: 60ch; }
.team { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-s) var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.team li { line-height: 1.4; }
.team .who { display: block; font-weight: 500; }
.team .what { display: block; font-size: var(--step--1); color: var(--muted); }
.outcomes { background: var(--surface); border-radius: var(--radius-m); padding: clamp(1.25rem, 1rem + 1vw, 1.75rem); }
.outcomes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-s); }
.outcomes li { display: grid; grid-template-columns: 0.5rem 1fr; gap: var(--space-s); font-weight: 500; line-height: 1.5; }
.outcomes li::before { content: ""; width: 0.5rem; height: 0.5rem; margin-top: 0.55em; border-radius: 50%; background: var(--accent); }

/* Long-form case study body (rendered from Markdown) */
.prose { padding-block: var(--space-2xl); }
.prose > * { max-width: var(--measure); margin-inline: auto; }
.prose > .cs-figure, .prose > .gallery, .prose > .stats { max-width: 60rem; }
.prose p, .prose ul, .prose ol { margin-block: 0 1.1em; }
.prose li { margin-bottom: 0.4em; }
.prose h2 { font-size: var(--step-3); margin-block: var(--space-xs) var(--space-l); }
.prose h3 { font-size: var(--step-2); margin-block: var(--space-xl) var(--space-m); }
.prose h4 { font-size: var(--step-1); margin-block: var(--space-l) var(--space-s); }
.prose h2 + h3 { margin-top: 0; font-size: var(--step-1); color: var(--muted); font-weight: 400; }
/* Sentence-length headings read as lead text, not headlines (class added in eleventy.config.js) */
.prose :is(h2, h3, h4).is-long { font-size: var(--step-1); line-height: 1.4; font-weight: 400; letter-spacing: -0.005em; text-wrap: pretty; }
.prose h2.is-long { margin-block: var(--space-xs) var(--space-m); }
.prose .eyebrow { margin-top: var(--space-2xl); margin-bottom: 0; font: 600 var(--step--1)/1.3 var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--sage); }
.prose blockquote { margin-block: var(--space-xl); padding: var(--space-l) var(--space-xl); background: var(--surface); border-radius: var(--radius-m) var(--radius-m) var(--radius-m) var(--radius-s); }
.prose blockquote p { font: 400 var(--step-1)/1.45 var(--font-serif); font-variation-settings: var(--soft); }
.prose blockquote p:last-child { margin: 0; font: 400 var(--step--1)/1.4 var(--font-sans); color: var(--muted); }
.cs-figure { margin: var(--space-xl) auto; }
.cs-figure img { margin-inline: auto; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--raised); }
.cs-figure figcaption { margin-top: var(--space-s); font-size: var(--step--1); color: var(--muted); text-align: center; }
/* Click-to-enlarge (assets/js/lightbox.js wraps each case-study image in .zoom) */
.zoom { position: relative; display: block; width: fit-content; max-width: 100%; margin-inline: auto; padding: 0; border: 0; background: none; border-radius: var(--radius-s); cursor: zoom-in; color: inherit; font: inherit; }
.zoom::after { content: ""; position: absolute; right: 0.6rem; bottom: 0.6rem; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: rgb(28 23 20 / 0.82) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E") center / 1.1rem no-repeat; opacity: 0; pointer-events: none; }
.zoom:hover::after, .zoom:focus-visible::after { opacity: 1; }
@media (hover: none) { .zoom::after { opacity: 0.9; } }
.zoom img { max-width: 100%; height: auto; }

.lightbox { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(20 15 12 / 0.96); color: #F4EADF; overflow: hidden; }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lightbox::backdrop { background: rgb(0 0 0 / 0.7); }
html:has(.lightbox[open]) { overflow: hidden; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-m); padding: var(--space-s) var(--gutter); font-size: var(--step--1); }
.lb-actions { display: inline-flex; gap: var(--space-xs); }
.lb-btn { min-height: 2.75rem; padding: 0 1.1rem; border-radius: var(--radius-pill); border: 1.5px solid #8C7A6D; background: transparent; color: #F4EADF; font: 600 var(--step--1)/1 var(--font-sans); cursor: pointer; }
.lb-btn:hover { background: #F4EADF; color: #1C1714; }
.lb-stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-xs); min-height: 0; padding-inline: var(--space-xs); }
.lb-nav { width: 3rem; height: 3rem; border-radius: 50%; border: 1.5px solid #8C7A6D; background: transparent; color: #F4EADF; font-size: 1.75rem; line-height: 1; cursor: pointer; }
.lb-nav:hover { background: #F4EADF; color: #1C1714; }
.lb-view { display: grid; place-items: center; height: 100%; min-height: 0; overflow: auto; }
.lb-view picture { display: block; }
.lb-view img { display: block; max-width: 100%; max-height: calc(100dvh - 9.5rem); width: auto; height: auto; border-radius: var(--radius-s); background: #fff; }
.lb-actual .lb-view { place-items: start center; }
.lb-actual .lb-view img { max-width: none; max-height: none; }
.lb-caption { margin: 0; padding: var(--space-s) var(--gutter) var(--space-m); text-align: center; font-size: var(--step--1); color: #D9CBBB; }
@media (max-width: 40rem) { .lb-nav { width: 2.5rem; height: 2.5rem; } .lb-stage { padding-inline: 0.25rem; } }
@media (forced-colors: active) { .lightbox { border: 1px solid CanvasText; } }

.gallery { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); align-items: start; margin-block: var(--space-xl); }
.gallery .cs-figure { margin: 0; }
.stats { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin-block: var(--space-xl); }
.stats br { display: none; }
.stats p { margin: 0; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: var(--space-l); color: var(--muted); }
.stats strong { display: block; color: var(--ink); font: 500 var(--step-1)/1.25 var(--font-serif); font-variation-settings: var(--soft); margin-bottom: var(--space-xs); }

.cs-pager { display: grid; gap: var(--space-m); padding-block: var(--space-xl) var(--space-2xl); }
@media (min-width: 48rem) { .cs-pager { grid-template-columns: 1fr 1fr; } }
.cs-pager a { display: grid; gap: var(--space-2xs); padding: var(--space-l); border: 1px solid var(--line); border-radius: var(--radius-m); text-decoration: none; background: var(--raised); }
.cs-pager a:hover { border-color: var(--accent); color: inherit; }
.cs-pager .dir { font-size: var(--step--1); color: var(--muted); }
.cs-pager .t { font: 500 var(--step-1)/1.25 var(--font-serif); font-variation-settings: var(--soft); }
.cs-pager .next { text-align: right; }
@media (min-width: 48rem) { .cs-pager .next { grid-column: 2; } }

/* ---------- Footer & theme switch ---------- */
.site-footer { padding-block: var(--space-xl); font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-m) var(--space-xl); }
.site-footer ul { display: flex; flex-wrap: wrap; gap: var(--space-m); list-style: none; margin: 0; padding: 0; }
.site-footer a { display: inline-block; padding-block: 0.4rem; }
.theme-switch { display: inline-flex; align-items: center; gap: var(--space-s); border: 0; margin: 0; padding: 0; min-width: 0; }
.theme-switch legend { float: left; padding: 0; margin-right: var(--space-s); font-size: var(--step--1); color: var(--muted); }
.theme-switch .seg { display: inline-flex; padding: 3px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line-strong); }
.theme-switch label { position: relative; }
.theme-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.theme-switch span { display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 0.9rem; border-radius: var(--radius-pill); font-weight: 500; color: var(--muted); }
.theme-switch input:checked + span { background: var(--ink); color: var(--bg); }
.theme-switch input:hover:not(:checked) + span { color: var(--ink); }
.theme-switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- 404 ---------- */
.not-found { padding-block: var(--space-3xl); }

/* ---------- Motion: only for people who haven't asked to reduce it ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  /* Colors ease between light and dark (and on hover). :where() keeps specificity at zero,
     so any component's own transition list still wins. */
  :where(body, body *) { transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; }

  /* Links: underline thickens and drops slightly on hover */
  a { transition: color var(--dur-fast), text-decoration-thickness var(--dur-fast), text-underline-offset var(--dur-fast); }
  a:hover { text-decoration-thickness: 3px; text-underline-offset: 0.3em; }

  /* Buttons: lift on hover, press on click */
  .btn { transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast), filter var(--dur-fast), background-color 0.3s, color 0.3s, border-color 0.3s; }
  .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -10px rgb(0 0 0 / 0.45); }
  .btn:active { transform: translateY(0); box-shadow: none; }

  /* Cards: lift, and the cover image zooms slightly inside its frame */
  .work-card a:hover, .cs-pager a:hover { transform: translateY(-3px); }
  .work-card .media img { transition: transform 0.6s var(--ease-out); }
  .work-card a:hover .media img, .work-card a:focus-visible .media img { transform: scale(1.04); }

  /* Case studies fan opens slightly on hover or focus */
  .stack figure { transition: translate 0.5s var(--ease-out); }
  .vault:is(:hover, :focus-within) .f1 { translate: -14px 6px; }
  .vault:is(:hover, :focus-within) .f2 { translate: -6px 2px; }
  .vault:is(:hover, :focus-within) .f3 { translate: 6px 2px; }
  .vault:is(:hover, :focus-within) .f4 { translate: 16px -4px; }

  /* Hero: staggered rise-in; the portrait's color shapes settle into place */
  .reveal { animation: rise 700ms var(--ease-out) both; }
  .reveal-2 { animation-delay: 120ms; }
  .reveal-3 { animation-delay: 240ms; }
  .portrait::before, .portrait::after { animation: settle 1000ms var(--ease-out) 200ms both; }
  .portrait::after { animation-delay: 380ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes settle { from { opacity: 0; transform: scale(0.88); } to { opacity: 1; transform: none; } }

  /* Scroll reveal (see assets/js/motion.js; keep the selector lists in sync) */
  .reveal-on:not(.reveal-all) :is(.story-head, .story-body, .vault, .quote, .contact-panel, .section-head, .work-card, .glance, .cs-figure, .prose > h2, .prose blockquote, .stats p, .cs-pager):not(.is-in) {
    opacity: 0; transform: translateY(18px);
  }
  .reveal-on :is(.story-head, .story-body, .vault, .quote, .contact-panel, .section-head, .work-card, .glance, .cs-figure, .prose > h2, .prose blockquote, .stats p, .cs-pager) {
    transition: opacity 0.7s var(--ease-out) var(--d, 0ms), transform 0.7s var(--ease-out) var(--d, 0ms);
  }

  .lightbox[open] { animation: lb-in 0.25s var(--ease-out); }
  @keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

  /* Case studies: a thin reading-progress line grows as you scroll (browsers with scroll-driven animations) */
  @supports (animation-timeline: scroll()) {
    .read-progress { animation: read-grow linear both; animation-timeline: scroll(root); }
    @keyframes read-grow { to { transform: scaleX(1); } }
  }
}
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; z-index: 50; pointer-events: none; }
@media print { .read-progress { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Forced colors (Windows High Contrast) ---------- */
@media (forced-colors: active) {
  .btn, .theme-switch .seg, .work-card a, .quote, .stack figure { border: 1px solid CanvasText; }
  .theme-switch input:checked + span { outline: 2px solid Highlight; }
}
