/* Site styles. Colours and sizes are set as variables in :root below. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #f5f6f6;
  --sheet: #ffffff;
  --ink: #17191c;
  --pencil: #5c636a;
  --rule: #d8dcdf;
  --rule-strong: #b7bdc2;
  --accent: #2443d6;
  --on-accent: #ffffff;
  --ok: #1d7a46;
  --danger: #b42318;
  --viewer-bg: #141618;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.953rem;
  --step-4: clamp(2.2rem, 5vw, 3.05rem);

  --wrap: 1440px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 60px;
  --radius: 2px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #202326;
    --sheet: #2a2d31;
    --ink: #eceef0;
    --pencil: #a2a9b0;
    --rule: #363b41;
    --rule-strong: #4c535a;
    --accent: #93a6ff;
    --on-accent: #10131a;
    --ok: #6fd39b;
    --danger: #ff8a80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #202326;
  --sheet: #2a2d31;
  --ink: #eceef0;
  --pencil: #a2a9b0;
  --rule: #363b41;
  --rule-strong: #4c535a;
  --accent: #93a6ff;
  --on-accent: #10131a;
  --ok: #6fd39b;
  --danger: #ff8a80;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 8px);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html:has(.viewer[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--font);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.15; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -9999px; top: 0.75rem; z-index: 200; padding: 0.6rem 1rem; background: var(--ink); color: var(--paper); text-decoration: none; }
.skip-link:focus { left: 0.75rem; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 46px; padding: 0.7rem 1.25rem;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--paper);
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.button:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.is-quiet { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.button.is-quiet:hover { border-color: var(--ink); color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.button[disabled] { opacity: 0.6; cursor: progress; }

.link-button {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0; border: 0; background: none; cursor: pointer;
  font-size: var(--step--1); color: inherit;
  text-decoration: underline; text-underline-offset: 0.25em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
.link-button:hover { text-decoration-color: currentColor; }
.link-button svg { width: 16px; height: 16px; }

.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--rule); border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ---------- Landing (front page) ---------- */
.landing {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding: 16px var(--gutter) max(20px, env(safe-area-inset-bottom));
}
.landing-corner { justify-self: end; }
.landing-center {
  align-self: center;
  display: inline-grid;
  justify-items: stretch;
  text-align: center;
  padding-bottom: 4vh;
}
.wordmark {
  font-size: clamp(3.1rem, 15.5vw, 13rem);
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: 0.03em;
  margin-right: -0.03em;           /* balance the tracking after the last letter */
  line-height: 0.9;
}

/* A dimension line under the name, like on a drawing. */
.dimension {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: clamp(1.1rem, 2.4vw, 2rem);
}
.dimension-line {
  position: relative;
  flex: 1 1 0;
  min-width: 1.5rem;
  height: 1px;
  background: var(--ink);
}
.dimension-line::before,
.dimension-line::after { content: ""; position: absolute; background: var(--ink); width: 1px; }
.dimension-line:first-child::before { left: 0; top: -18px; height: 24px; }                 /* extension line */
.dimension-line:first-child::after  { left: 0; top: -7px; height: 14px; transform: rotate(45deg); }  /* tick */
.dimension-line:last-child::before  { right: 0; top: -18px; height: 24px; }
.dimension-line:last-child::after   { right: 0; top: -7px; height: 14px; transform: rotate(45deg); }
.dimension-label {
  font-size: clamp(0.95rem, 1.6vw, 1.125rem);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.availability {
  justify-self: center;
  display: inline-flex; align-items: center; gap: 0.55rem;
  margin-top: 1.75rem;
  font-size: var(--step--1);
  color: var(--pencil);
}
.availability a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.availability a:hover { color: var(--ink); border-color: var(--ink); }
.availability-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent);
}
.availability.is-inline { justify-self: start; align-items: flex-start; margin-top: 1.25rem; color: var(--ink); font-size: var(--step-0); }
.availability.is-inline .availability-dot { margin-top: 0.55em; }

.landing-nav { display: flex; gap: clamp(1.75rem, 6vw, 4rem); }
.landing-nav a { padding: 0.6rem 0.1rem; text-decoration: none; border-bottom: 1px solid transparent; }
.landing-nav a:hover { color: var(--ink); border-color: var(--ink); }

/* Opening moment: the name stretches open, then the dimension line appears. */
@media (prefers-reduced-motion: no-preference) {
  .js .wordmark, .js .dimension, .js .landing .availability, .js .landing-nav { opacity: 0; }
  .js.fonts-ready .wordmark { animation: stretch-open 1.5s cubic-bezier(0.2, 0.65, 0.15, 1) forwards; }
  .js.fonts-ready .dimension { animation: draw 0.7s 0.95s ease-out forwards; }
  .js.fonts-ready .landing .availability,
  .js.fonts-ready .landing-nav { animation: fade 0.6s 1.35s ease-out forwards; }
}
@keyframes stretch-open {
  0%   { opacity: 0; font-stretch: 62%; letter-spacing: 0.32em; }
  25%  { opacity: 1; }
  100% { opacity: 1; font-stretch: 125%; letter-spacing: 0.03em; }
}
@keyframes draw { from { opacity: 0; clip-path: inset(0 50% 0 50%); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes fade { to { opacity: 1; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.js .site-header.is-home {
  position: fixed; left: 0; right: 0;
  transform: translateY(-101%);
  transition: transform 0.25s ease;
}
.js .site-header.is-home.is-visible { transform: none; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: var(--header-h); }
.header-mark { font-weight: 800; font-stretch: 125%; font-size: 1.125rem; letter-spacing: 0.03em; text-decoration: none; }
.header-mark:hover { color: var(--ink); }
.header-nav { display: flex; align-items: center; gap: clamp(0.9rem, 3vw, 2rem); }
.header-nav a { padding: 0.5rem 0; text-decoration: none; color: var(--pencil); font-size: 0.9375rem; }
.header-nav a:hover { color: var(--ink); }
.header-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -1px 0 var(--ink); }

/* ---------- Work ---------- */
.work { padding-block: clamp(3.5rem, 8vw, 6.5rem) 2rem; }
#work { scroll-margin-top: var(--header-h); }
.work-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ink);
}
.work-head h2 { font-size: var(--step-3); font-weight: 800; font-stretch: 125%; letter-spacing: 0.02em; }
.work-count { color: var(--pencil); font-size: var(--step--1); font-variant-numeric: tabular-nums; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem 2rem;
  padding-block: 1.25rem 2.25rem;
  align-items: start;
}
.filter-row { grid-column: 1; display: flex; align-items: baseline; gap: 1rem; min-width: 0; }
.filter-name { flex: 0 0 5rem; font-size: var(--step--1); color: var(--pencil); }
.filter-options { display: flex; flex-wrap: wrap; gap: 0.375rem; min-width: 0; }
.chip {
  display: inline-flex; align-items: baseline; gap: 0.35rem;
  min-height: 36px; padding: 0.4rem 0.75rem;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: transparent; cursor: pointer; white-space: nowrap;
  font-size: 0.9375rem;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip-n { font-size: 0.8125rem; color: var(--pencil); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .chip-n { color: inherit; opacity: 0.7; }
.sort { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 0.6rem; }
.sort label { font-size: var(--step--1); color: var(--pencil); }
.sort select {
  appearance: none; -webkit-appearance: none;
  min-height: 38px; padding: 0.4rem 2.2rem 0.4rem 0.75rem;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.55rem center / 18px;
  cursor: pointer;
}

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 3.2vw, 3rem) clamp(1rem, 2vw, 2rem);
}
.card[hidden] { display: none; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { color: inherit; }
.card-link:focus-visible { outline-offset: 6px; }
.card-media {
  position: relative; display: block;
  aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--rule);
}
.card-media video { width: 100%; height: 100%; object-fit: cover; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.65, 0.15, 1); }
.card-link:hover .card-media img { transform: scale(1.02); }
.card-media.is-sheet { background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule); }
.card-media.is-sheet img { object-fit: contain; padding: 5%; }
.card-link:hover .card-media.is-sheet img { transform: none; }
.card-count {
  position: absolute; left: 0.6rem; bottom: 0.6rem;
  padding: 0.2rem 0.5rem; border-radius: var(--radius);
  background: rgba(20, 22, 24, 0.8); color: #fff;
  font-size: 0.75rem; line-height: 1.4;
}
.card-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; pointer-events: none; }
.card-play svg {
  width: 64px; height: 64px; padding: 18px 16px 18px 20px; border-radius: 50%;
  background: rgba(20, 22, 24, 0.55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.card-text { display: block; padding-top: 0.8rem; }
.card-title { display: block; font-weight: 650; font-size: 1.125rem; line-height: 1.3; }
.card-link:hover .card-title { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.card-meta { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.2rem; font-size: var(--step--1); color: var(--pencil); }
.card-meta span:last-child { flex: none; font-variant-numeric: tabular-nums; }

.empty { padding: 4rem 0; text-align: center; }
.empty p { margin-bottom: 1.25rem; color: var(--pencil); }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(3rem, 7vw, 6rem); border-top: 1px solid var(--rule); }
.footer-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem 2rem; align-items: start;
  padding-block: 2.5rem calc(2rem + env(safe-area-inset-bottom));
}
.footer-name { font-weight: 800; font-stretch: 125%; letter-spacing: 0.02em; }
.footer-id p:last-child { color: var(--pencil); font-size: var(--step--1); }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; justify-content: flex-end; }
.footer-copy { grid-column: 1 / -1; color: var(--pencil); font-size: 0.8125rem; }

/* ---------- About ---------- */
.about, .contact { padding-block: clamp(2.5rem, 6vw, 5rem) 0; }
.page-about h1, .page-contact h1 { font-size: var(--step-4); font-weight: 800; font-stretch: 125%; letter-spacing: 0.01em; line-height: 1.05; }
.about-grid {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.about-photo { position: sticky; top: calc(var(--header-h) + 2rem); }
.about-photo img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--rule); }
.about-main { max-width: 46rem; }
.about-role { margin-top: 0.6rem; font-size: var(--step-1); color: var(--pencil); }
.prose { margin-top: 1.75rem; }
.prose p { max-width: 64ch; font-size: 1.0625rem; line-height: 1.65; }
.prose p + p { margin-top: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.cv-section { margin-top: clamp(2.75rem, 5vw, 3.75rem); }
.cv-section h2 { padding-bottom: 0.75rem; border-bottom: 1px solid var(--ink); font-size: var(--step-2); font-weight: 750; font-stretch: 112%; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr); gap: 1.5rem; padding-block: 1.25rem; border-bottom: 1px solid var(--rule); }
.timeline-period { padding-top: 0.15rem; font-size: var(--step--1); color: var(--pencil); font-variant-numeric: tabular-nums; }
.timeline-body h3 { font-size: 1.0625rem; font-weight: 650; line-height: 1.35; }
.timeline-org { margin-top: 0.15rem; color: var(--pencil); }
.timeline-body p:not(.timeline-org) { margin-top: 0.55rem; max-width: 62ch; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.25rem 0 0; padding: 0; }
.tags li { padding: 0.35rem 0.75rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); font-size: 0.9375rem; }
.languages { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); column-gap: 1.5rem; margin: 0; }
.languages div { padding-block: 0.9rem; border-bottom: 1px solid var(--rule); }
.languages dt { font-weight: 650; }
.languages dd { margin: 0; color: var(--pencil); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.lede { margin-top: 1.1rem; max-width: 36ch; font-size: var(--step-1); line-height: 1.45; }
.contact-list { margin: 2.25rem 0 0; border-top: 1px solid var(--rule); }
.contact-list div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; padding-block: 0.9rem; border-bottom: 1px solid var(--rule); }
.contact-list dt { color: var(--pencil); }
.contact-list dd { margin: 0; overflow-wrap: anywhere; }
.contact-list a { font-weight: 600; }
.copy-button { margin-left: 0.75rem; padding: 0; }

.form { position: relative; padding: clamp(1.25rem, 3vw, 2.25rem); background: var(--sheet); border: 1px solid var(--rule); }
.field + .field { margin-top: 1.25rem; }
.field label { display: block; margin-bottom: 0.4rem; font-weight: 600; font-size: 0.9375rem; }
.field input, .field textarea {
  width: 100%; padding: 0.75rem 0.85rem;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--paper); font-size: 1rem;
}
.field textarea { resize: vertical; min-height: 9rem; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin-top: 0.35rem; color: var(--danger); font-size: var(--step--1); }
.field-error:empty { display: none; }
.field-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.5rem; }
.form-note { color: var(--pencil); font-size: var(--step--1); }
.form-status { margin-bottom: 1.25rem; padding: 0.85rem 1rem; border-left: 3px solid var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.form-status.is-error { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.form-status[hidden] { display: none; }

/* ---------- Project viewer ---------- */
.viewer {
  --accent: #93a6ff;
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--viewer-bg); color: #e8ebee;
}
.viewer::backdrop { background: rgba(10, 11, 12, 0.7); }
.viewer[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "bar info" "stage info" "caption info" "thumbs info";
}
.viewer-bar { grid-area: bar; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.75rem 0.6rem 1.25rem; }
.viewer-counter { font-size: var(--step--1); color: #a9b0b6; font-variant-numeric: tabular-nums; }
.viewer-actions { display: flex; align-items: center; gap: 0.25rem; }
.v-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  height: 40px; padding: 0 0.75rem;
  border: 0; border-radius: var(--radius);
  background: transparent; color: #e8ebee;
  font-size: var(--step--1); text-decoration: none; cursor: pointer;
}
.v-btn:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.v-btn svg { width: 18px; height: 18px; }
.v-btn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.14); }
.v-close { width: 44px; padding: 0; justify-content: center; }
.v-close svg { width: 22px; height: 22px; }

.viewer-stage { grid-area: stage; position: relative; overflow: hidden; touch-action: pan-y pinch-zoom; }
.viewer-media {
  position: absolute; inset: 0; display: grid; place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  padding: 0 4rem;
}
.viewer-media img, .viewer-media video {
  width: auto; height: auto; max-width: 100%; max-height: 100%;
  object-fit: contain; user-select: none; -webkit-user-drag: none;
}
.viewer-media img { cursor: zoom-in; background: #1c1f22; }
.viewer-media video { background: #000; }
.viewer-media .is-loading { opacity: 0.35; }
.viewer.is-zoomed .viewer-stage { overflow: auto; touch-action: auto; }
.viewer.is-zoomed .viewer-media { position: static; display: block; width: max-content; height: auto; padding: 0; }
.viewer.is-zoomed .viewer-media img { max-width: none; max-height: none; cursor: zoom-out; }
.viewer.is-zoomed .v-nav { display: none; }
.v-nav {
  position: absolute; top: 50%; z-index: 2;
  display: grid; place-items: center; width: 46px; height: 46px; margin-top: -23px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.09); color: #fff; cursor: pointer;
}
.v-nav:hover { background: rgba(255, 255, 255, 0.18); }
.v-nav svg { width: 22px; height: 22px; }
.v-prev { left: 0.75rem; }
.v-next { right: 0.75rem; }
.v-nav[hidden] { display: none; }
.viewer-caption { grid-area: caption; min-height: 1.6em; padding: 0.6rem 1.25rem 0; text-align: center; font-size: var(--step--1); color: #c6ccd1; }
.viewer-thumbs {
  grid-area: thumbs; display: flex; gap: 0.5rem; overflow-x: auto;
  justify-content: safe center;
  padding: 0.75rem 1.25rem 1rem; scrollbar-width: thin;
}
.viewer-thumbs[hidden] { display: none; }
.viewer-thumbs button {
  position: relative; flex: none; width: 76px; height: 56px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius); overflow: hidden;
  background: #000; opacity: 0.5; cursor: pointer;
}
.viewer-thumbs button:hover { opacity: 0.85; }
.viewer-thumbs button[aria-current="true"] { opacity: 1; border-color: #fff; }
.viewer-thumbs img, .viewer-thumbs video { width: 100%; height: 100%; object-fit: cover; }
.viewer-thumbs .thumb-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.viewer-thumbs .thumb-play svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6)); }

.viewer-info {
  grid-area: info; display: flex; flex-direction: column;
  padding: 4.25rem 1.75rem 1.5rem; overflow-y: auto;
  background: #1b1d20; border-left: 1px solid #2c3035;
}
.viewer-info h2 { font-size: 1.5rem; font-weight: 750; font-stretch: 112%; line-height: 1.2; color: #fff; }
.viewer-desc { margin-top: 0.8rem; color: #c6ccd1; line-height: 1.6; }
.viewer-desc:empty { display: none; }
/* Info laid out like the title block on a drawing sheet. */
.titleblock { margin: 1.75rem 0 0; border: 1px solid #3b4046; }
.titleblock div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); border-bottom: 1px solid #3b4046; }
.titleblock div:last-child { border-bottom: 0; }
.titleblock dt { padding: 0.55rem 0.75rem; border-right: 1px solid #3b4046; font-size: 0.8125rem; color: #9aa2a9; }
.titleblock dd { margin: 0; padding: 0.55rem 0.75rem; font-size: 0.875rem; color: #eef0f2; }
.viewer-projects { display: flex; justify-content: space-between; gap: 1rem; margin-top: auto; padding-top: 2rem; color: #dfe3e6; }

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .viewer[open] { display: block; overflow-y: auto; }
  .viewer-bar { position: sticky; top: 0; z-index: 3; background: var(--viewer-bg); padding-left: 1rem; }
  .viewer-stage { height: 62vh; height: 62svh; }
  .viewer-media { padding: 0; }
  .v-nav { width: 40px; height: 40px; margin-top: -20px; background: rgba(20, 22, 24, 0.55); }
  .v-prev { left: 0.4rem; }
  .v-next { right: 0.4rem; }
  .viewer-thumbs { justify-content: flex-start; padding-inline: 1rem; }
  .viewer-info { padding: 1.5rem 1rem 2.5rem; border-left: 0; border-top: 1px solid #2c3035; overflow: visible; }
  .v-btn span { display: none; }
  .v-btn { width: 44px; padding: 0; justify-content: center; }

  .about-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .about-photo { position: static; max-width: 300px; }
}
@media (max-width: 719px) {
  .toolbar { grid-template-columns: minmax(0, 1fr); padding-bottom: 1.75rem; }
  .sort { grid-column: 1; grid-row: auto; }
  .filter-row { gap: 0.75rem; }
  .filter-name { flex-basis: 4.5rem; }
  .filter-options {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter);
  }
  .filter-options::-webkit-scrollbar { display: none; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-links { justify-content: flex-start; }
}
@media (max-width: 679px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .header-nav { gap: 0.85rem; }
  .header-nav a { font-size: 0.875rem; }
  .header-mark { font-size: 1rem; }
  .theme-toggle { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media print {
  .site-header, .landing-nav, .landing-corner, .toolbar, .viewer, .theme-toggle { display: none !important; }
  .landing { min-height: auto; padding: 2rem 0; }
}
