:root {
  color-scheme: dark;
  --paper: #000;
  --ink: #f5f3ee;
  --muted: #b7b4ad;
  --accent: #e0d4bf;
  --rule: #2e2c29;
  --panel: #151515;
  --layout-gap: 16px;
  --card-label-size: 13px;
  --preview-ratio: 4 / 3;
  --site-texture: url("charcoal.webp");
  font-family: system-ui, "PingFang SC", "Microsoft YaHei UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #000b 0, #000d 370px, #000 720px), var(--site-texture) center top / 100% auto no-repeat, #000;
}
h1, h2, h3, p, figure { margin: 0; }
img { display: block; width: 100%; height: auto; background: var(--panel); }
a { color: inherit; text-decoration: none; }
a, button, input { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 44px, 1216px); margin-inline: auto; }
.entry-page { min-height: 100svh; background: #000; }
.entry { min-height: 100svh; display: grid; place-items: center; }
.entry-link { position: relative; display: grid; place-items: center; border-radius: 50%; }
.entry-link .mark { width: 114px; height: 114px; }
.entry-label { position: absolute; top: 100%; inset-inline: 0; display: grid; place-content: center; min-height: 52px; color: var(--muted); font-size: 13px; letter-spacing: .055em; text-align: center; }
.entry-link:is(:hover, :focus-visible) .entry-label { color: var(--accent); }
.entry-filing { position: absolute; inset-inline: 0; bottom: max(12px, env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: 12px; }
.entry-filing a { display: grid; align-items: center; min-height: 44px; width: max-content; margin-inline: auto; text-decoration: underline; text-underline-offset: 3px; }
.icon { display: block; flex: 0 0 auto; width: 20px; height: 20px; }
.mast { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--rule); background: #0a0a0a; }
.mast-inner { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: inline-flex; gap: 5px; align-items: center; min-height: 44px; font-size: clamp(10px, 3vw, 15px); font-weight: 620; letter-spacing: -.025em; white-space: nowrap; }
.mark { flex: 0 0 auto; width: 28px; height: 28px; background: transparent; }
.mast nav { display: flex; gap: 4px; }
.mast nav a { display: grid; min-height: 44px; min-width: 44px; place-content: center; text-align: center; color: var(--muted); font-size: 13px; }
.mast nav a:hover, .back:hover { color: var(--ink); }

.intro { padding-block: 23px 13px; }
.intro h1 { font-size: clamp(33px, 9vw, 72px); line-height: 1; font-weight: 620; letter-spacing: -.065em; text-wrap: balance; }
.home-grid > a, .about, .case-video { scroll-margin-top: 68px; }
.about { margin-top: 34px; border-top: 1px solid var(--rule); }
.about h2 { padding-block: 12px; font-size: clamp(19px, 3.4vw, 24px); font-weight: 580; letter-spacing: -.025em; }
.about p, .case-summary { max-width: 42ch; color: var(--muted); font-size: 15px; line-height: 1.6; }

.footer { display: grid; gap: 12px; padding-block: 18px 24px; margin-top: 38px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.footer-row > span { flex-shrink: 0; }
.footer-contact { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 .5ch; text-align: right; }
.footer-contact:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer .filing-number { text-align: center; font-size: 11px; }

.case-intro { padding-block: 9px 19px; }
.back { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; color: var(--muted); font-size: 13px; }
.back .icon { width: 16px; height: 16px; }
.case-intro h1 { margin-top: 9px; font-size: clamp(29px, 7vw, 54px); line-height: 1.06; font-weight: 630; letter-spacing: -.045em; text-wrap: balance; }
.case-location { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.case-location span { padding-inline: 3px; color: var(--accent); }

.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--layout-gap); align-items: start; }
.work-card { display: block; min-width: 0; }
.work-cover { width: 100%; aspect-ratio: var(--preview-ratio); overflow: hidden; background: var(--panel); border-radius: 3px; }
.work-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.caption { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; padding-block: 8px 2px; min-height: calc(4.3em + 13px); font-size: var(--card-label-size); }
.caption > div { min-width: 0; }
.caption h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: inherit; font-weight: 570; line-height: 1.35; }
.card-location { display: block; margin-top: 3px; font-size: max(11px, .85em); line-height: 1.35; color: var(--muted); }
.home-grid .caption { min-height: 0; }
.home-grid .caption h2 { display: block; }
.caption .icon { width: 14px; height: 14px; margin-top: calc((1.5em - 14px) / 2); color: var(--accent); }
.work-card:hover .caption h2 { text-decoration: underline; text-underline-offset: 4px; }
.work-card:active .caption { color: var(--accent); }
.case { width: min(100%, 98svh, 980px); margin-inline: auto; }
.photo, .film-frame {
  display: block;
  width: 100%;
  aspect-ratio: var(--preview-ratio);
  overflow: hidden;
  border-radius: 3px;
  background: #1b1b1b;
}
.case-shot img { width: 100%; height: 100%; object-fit: cover; background: transparent; }
.case-shot-lead { margin-bottom: 17px; }
.case-summary { margin-bottom: 21px; }
.case-gallery { display: grid; gap: var(--layout-gap); }

.lightbox { inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; padding: 0; color: var(--ink); background: #000; }
.lightbox-inner { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; height: 100%; max-width: 1300px; margin-inline: auto; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
.lightbox form { display: flex; }
.lightbox button { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: inherit; background: #171717; border: 1px solid #514d48; border-radius: 99px; min-width: 44px; min-height: 44px; font: inherit; font-size: 13px; cursor: pointer; }
.lightbox button.close { padding-inline: 13px; }
.lightbox button:disabled { opacity: .35; cursor: default; }
.lightbox-image { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: transparent; }
.lightbox-caption { text-align: center; font-size: 13px; }
.lightbox-nav { display: flex; justify-content: center; gap: 18px; }
body.gallery-open { overflow: hidden; }

.case-actions { display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid var(--rule); margin-top: 14px; }
.case-actions .back { margin: 6px 0 0; }
.case-video { margin-bottom: 18px; }
.film-frame { position: relative; }
.film-frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.film-play { position: absolute; inset: 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 3px; background: #141414; color: #fff; cursor: pointer; }
.film-play img, .film-play::before { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; }
.film-play img { object-fit: cover; }
.film-play::before { content: ''; z-index: 1; background: #0006; }
.film-play-icon { position: relative; z-index: 2; display: grid; place-items: center; width: clamp(52px, 10vw, 78px); aspect-ratio: 1; border: 1px solid #fffd; border-radius: 50%; background: #16161580; }
.film-play-icon::after { content: ''; width: 0; height: 0; margin-left: 4px; border-block: 8px solid transparent; border-left: 13px solid #fff; }
.film-play:is(:hover, :focus-visible) .film-play-icon { background: #f5f3ee; }
.film-play:is(:hover, :focus-visible) .film-play-icon::after { border-left-color: #151515; }
.film-status { position: absolute; z-index: 2; inset-inline: 0; bottom: 10px; font: 12px system-ui, sans-serif; }
.tour-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 65px; margin-top: 18px; padding: 11px 15px; border: 1px solid #514d48; border-radius: 3px; background: var(--panel); font-weight: 580; }
.tour-entry .icon { color: var(--accent); }
.tour-entry:hover { border-color: var(--accent); }

@media (min-width: 850px) {
  :root { --layout-gap: 22px; --card-label-size: 15px; }
  .wrap { width: min(100% - 96px, 1216px); }
  .mast-inner { min-height: 68px; }
  .mast nav { gap: 17px; }
  .intro { padding-block: 37px 23px; }
  .intro h1 { font-size: clamp(39px, 4.7vw, 64px); }
  .home-grid > a, .about, .case-video { scroll-margin-top: 84px; }
  .work-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .case-intro { padding-block: 13px 24px; }
  .case-summary { margin-block: 22px 30px; }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .work-cover img { transition: transform .28s ease; }
  .work-card:hover img { transform: scale(1.025); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  main { animation: page-in .28s ease-out both; }
  .entry { animation: none; }
  .entry-link .mark { animation: entry-breathe 3.6s ease-in-out infinite; }
  .entry-link:is(:focus-visible, :active) .mark { animation: none; }
  .lightbox[open] .lightbox-inner { animation: page-in .18s ease-out both; }
  ::view-transition-old(root) { animation: page-out .18s ease-in both; }
  ::view-transition-new(root) { animation: page-in .28s ease-out both; }
  .entry-link .mark, body:has(.home-grid) .brand .mark { view-transition-name: evan-mark; }
  ::view-transition-group(evan-mark) { animation-duration: .3s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
}

@view-transition { navigation: auto; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

@keyframes entry-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: .82; }
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes page-out {
  to { opacity: 0; }
}
