/* Brand controls */
:root {
  color-scheme: dark;
  --bg: #09090c;
  --panel: #131218;
  --ink: #f1eff6;
  --muted: #b1adb9;
  --line: #2c2933;
  --accent: #cbbdff;
  --gutter: clamp(18px, 4vw, 72px);
  --max-width: 1760px;
  --site-header-height: 70px;
  --sans: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--site-header-height); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
body:has(dialog[open]) { overflow: hidden; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:not(:disabled) { cursor: pointer; }
img { display: block; max-width: 100%; }
figure, h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent); color: #181121; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
main:focus, h1:focus { outline: none; }
.shell { width: min(100% - 2 * var(--gutter), var(--max-width)); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: 11px; line-height: 1.45; letter-spacing: .08em; }
.accent, .eyebrow { color: var(--accent); }
.skip { position: fixed; top: 12px; left: 12px; transform: translateY(-180%); padding: 8px 12px; z-index: 8; background: var(--bg); }
.skip:focus { transform: translateY(0); }
#work, #services, #contact { scroll-margin-top: 28px; }

/* Understated, spread navigation */
.site-head {
  position: fixed;
  inset: 0 0 auto;
  z-index: 5;
  background: #09090cf5;
  transition: background-color .18s ease-out;
}
.site-head[data-over-hero] { background: transparent; }
.header-inner { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; min-height: var(--site-header-height); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; width: fit-content; gap: 11px; }
.brand-mark { width: 29px; flex: 0 0 29px; color: var(--accent); }
.brand strong { display: block; font-size: 17px; font-weight: 750; line-height: 1.18; letter-spacing: .08em; }
.brand small { display: block; margin-top: 4px; font: 9px/1.15 var(--mono); letter-spacing: .055em; color: var(--muted); }
.site-nav { display: flex; align-items: center; justify-content: center; gap: clamp(26px, 5.5vw, 98px); }
.site-nav a, .nav-contact { display: inline-flex; align-items: center; min-height: 42px; font-size: 13px; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--accent); }
.nav-contact { justify-self: end; gap: 14px; border: 1px solid #4b4755; padding: 0 14px; border-radius: 2px; min-height: 36px; }
.nav-contact:hover { border-color: var(--accent); color: var(--accent); }

.site-head[data-over-hero] .header-inner { grid-template-columns: minmax(0,1fr) auto auto; gap: clamp(15px, 3vw, 42px); border-color: transparent; }
.site-head[data-over-hero] .brand { min-height: 42px; }
.site-head[data-over-hero] .brand-mark { width: 22px; flex-basis: 22px; }
.site-head[data-over-hero] .brand > span { display: none; }
.site-head[data-over-hero] .site-nav { gap: clamp(10px, 2.2vw, 30px); }
.site-head[data-over-hero] :is(.site-nav a, .nav-contact) { min-height: 42px; font-size: 11px; text-shadow: 0 1px 6px #09070c; }
.site-head[data-over-hero] .nav-contact { padding: 0; border-color: transparent; gap: 5px; }

/* Only the home hero crops its media. */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #100e16;
}
.hero-visual, .hero-stage, .hero-video-layer, .hero-glow, .hero-visual::after { position: absolute; inset: 0; }
.hero-visual::after {
  content: "";
  pointer-events: none;
  background:
    linear-gradient(180deg, #09090c91, transparent 26%),
    linear-gradient(0deg, #09090cbd, #09090c72 21%, transparent 51%);
}
.hero-stage { transition: transform .18s cubic-bezier(.2,.68,.3,1); }
@media (any-hover: hover) and (any-pointer: fine) {
  .hero-stage { inset: -8px; }
}
.hero-visual[data-tracking="true"] .hero-stage { transform: translate(var(--hero-shift-x), var(--hero-shift-y)); }
.hero-stage img, .hero-stage video {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #100e16;
}
.hero-video-layer { opacity: 0; pointer-events: none; transition: opacity .18s ease-out; }
.hero-video-layer.is-visible { opacity: 1; }
.hero-stage video { opacity: 0; }
.hero-glow {
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at var(--hero-glow-x, 50%) var(--hero-glow-y, 50%), #cbbdff, transparent 49%);
  mix-blend-mode: screen;
  transition: opacity .18s ease-out;
}
.hero-visual[data-tracking="true"] .hero-glow { opacity: .1; }
.hero-utility {
  position: absolute;
  inset: calc(var(--site-header-height) + 10px) var(--gutter) auto auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-motion-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #e5d9ff63;
  border-radius: 50%;
  color: var(--ink);
  background: #09090c66;
  transition: color .16s, border-color .16s;
}
.hero-motion-toggle:hover { color: var(--accent); border-color: var(--accent); }
.hero-motion-pause, .hero-motion-toggle[data-playing="true"] .hero-motion-play { display: none; }
.hero-motion-toggle[data-playing="true"] .hero-motion-pause { display: initial; }
.hero-stamp { color: #f1eff6c4; text-shadow: 0 1px 6px #09070c; }
.hero-reel {
  position: absolute;
  inset: 48% auto auto 50%;
  translate: -50% -50%;
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: .08em;
  text-shadow: 0 1px 8px #09070c;
}
.hero-reel-icon {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  padding-inline-start: 2px;
  border: 1px solid #f1eff6c7;
  border-radius: 50%;
  background: #09090c80;
  transition: background-color .17s ease-out, transform .17s ease-out;
}
.hero-reel:is(:hover, :focus-visible) .hero-reel-icon { background: #09090cbf; transform: scale(1.04); }
.hero-overlay {
  position: absolute;
  inset: auto var(--gutter) 32px;
  inset: auto var(--gutter) max(clamp(32px, 6svh, 72px), env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 26px;
  pointer-events: none;
}
.hero-signature { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px clamp(12px, 2.5vw, 40px); min-width: 0; }
.hero-signature h1 {
  font-size: clamp(94px, 15vw, 252px);
  font-weight: 690;
  line-height: .94;
  letter-spacing: -.07em;
  overflow-wrap: anywhere;
  text-shadow: 0 .03em .2em #08070b58;
}
.hero-signature p { padding-bottom: .75em; font-size: clamp(12px, 1.05vw, 16px); color: #f1eff6df; text-shadow: 0 1px 6px #09070c; }
.hero-projects { flex: 0 0 auto; pointer-events: auto; }
.hero-project-picker { display: flex; align-items: center; gap: 7px; touch-action: manipulation; }
.hero-select { display: grid; justify-items: end; gap: 2px; }
.hero-project-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: var(--ink);
  opacity: .66;
  font-size: 13px;
  text-shadow: 0 1px 6px #09070c;
  transition: opacity .16s ease-out;
}
.hero-project-link[aria-current="true"] { opacity: .86; }
.hero-project-link:is(:hover, :focus-visible) { opacity: 1; }
.hero-project-link span { color: var(--accent); font-size: 11px; }
.hero-project-skip, .hero-swipe-hint { display: none; }
.load-error { padding: calc(var(--site-header-height) + 26px) 0 26px; color: var(--accent); }
.admin-links { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }

/* Selected work */
.content-section { padding-top: clamp(59px, 7.4vw, 123px); }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 28px; }
.section-header h2, .contact h2 { font-size: clamp(34px, 4.5vw, 69px); font-weight: 690; letter-spacing: -.055em; line-height: 1.14; margin-top: 9px; }
.section-header > p { color: var(--muted); max-width: 420px; text-wrap: pretty; padding-bottom: 4px; }
.work-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 14px 0 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filter { border: 1px solid var(--line); background: transparent; border-radius: 2px; padding: 6px 12px; min-height: 36px; color: var(--muted); font-size: 13px; }
.filter:hover { color: var(--ink); border-color: #76707e; }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.work-count { color: var(--muted); white-space: nowrap; }
.work-grid { border-top: 1px solid var(--line); }
.work-card { min-width: 0; border-bottom: 1px solid var(--line); }
.card-link { display: grid; grid-template-columns: minmax(27px,.13fr) minmax(0,1fr) minmax(0,1.37fr) auto; align-items: center; gap: clamp(10px,2.2vw,38px); padding-block: clamp(16px,2.45vw,35px); }
.card-image { position: relative; aspect-ratio: 3 / 1; background: #100e16; border: 1px solid #2a2531; min-width: 0; }
.card-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: filter .22s; }
.card-link:hover img { filter: brightness(1.13); }
.card-index { align-self: start; margin-top: 7px; color: var(--accent); }
.card-caption h3 { font-size: clamp(24px, 3.4vw, 50px); letter-spacing: -.06em; font-weight: 650; line-height: 1.12; }
.card-caption .mono { color: var(--accent); margin-bottom: 7px; }
.card-description { font-size: 14px; color: var(--muted); margin-top: 7px; text-wrap: pretty; }
.card-arrow { display: grid; place-items: center; border: 1px solid #504a5b; border-radius: 50%; width: 40px; aspect-ratio: 1; font-size: 17px; line-height: 1; transition: color .22s, background-color .22s; }
.card-link:hover .card-arrow { color: #14101b; background: var(--accent); border-color: var(--accent); }

/* Services and enquiries */
.services-list { list-style: none; margin: 0; padding: 0; }
.services-list li { display: grid; grid-template-columns: minmax(32px,.15fr) minmax(148px,.85fr) minmax(0,1fr); gap: 16px; align-items: baseline; padding: clamp(17px, 2.2vw, 31px) 0; border-top: 1px solid var(--line); }
.services-list li:last-child { border-bottom: 1px solid var(--line); }
.services-list .service-index { color: var(--accent); }
.services-list h3 { font-size: clamp(18px, 2.1vw, 27px); font-weight: 650; line-height: 1.2; }
.services-list h3 small { display: block; color: var(--muted); margin-top: 7px; font-weight: 400; }
.services-list li > p { color: var(--muted); }
.contact { margin-top: clamp(64px, 9vw, 146px); }
.contact-inner { border-top: 1px solid #766b94; background: radial-gradient(ellipse 75% 185% at 89% 119%, transparent 24%, #40235f76 42%, #542c7d4f 54%, transparent 76%), #110f15; padding: clamp(24px, 4.2vw, 68px); display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; }
.contact p:not(.eyebrow) { margin-top: 15px; color: var(--muted); white-space: pre-line; }
.contact-actions { display: grid; justify-items: end; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 17px; border: 1px solid transparent; border-radius: 2px; min-height: 44px; padding: 8px 16px; font-size: 14px; font-weight: 650; white-space: nowrap; }
.button-primary { background: var(--accent); color: #161121; }
.button-primary:hover { background: #e0d6ff; }
.button-secondary { background: transparent; color: var(--ink); border-color: #555062; }
.button-secondary:hover { border-color: var(--accent); }
.contact-email { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.footer { display: flex; justify-content: space-between; gap: 16px; align-items: center; border-top: 1px solid var(--line); margin-top: 26px; padding-block: 18px 24px; color: var(--muted); font-size: 12px; }
.footer a { white-space: nowrap; }
.footer a:hover { color: var(--accent); }

/* Case detail. No fixed aspect ratio or cover cropping for project media. */
.case-view { padding-top: calc(var(--site-header-height) + clamp(22px, 4vw, 55px)); }
.case-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.back-link { font-size: 13px; color: var(--ink); padding-block: 5px; }
.back-link:hover, .case-next:hover { color: var(--accent); }
.case-heading { display: grid; grid-template-columns: minmax(0,1fr) minmax(215px,.62fr); align-items: end; gap: 24px; padding: clamp(25px, 3.7vw, 57px) 0 clamp(20px, 3vw, 40px); }
.case-heading .mono { color: var(--accent); }
.case-heading h1 { font-size: clamp(44px, 6vw, 95px); font-weight: 700; line-height: 1.07; letter-spacing: -.065em; margin-top: 5px; }
.case-heading > p { font-size: clamp(16px, 1.7vw, 24px); color: var(--muted); padding-bottom: 5px; }
.full-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.full-media video { display: block; width: 100%; height: auto; max-height: 76vh; object-fit: contain; background: #050505; }
.case-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; border-block: 1px solid var(--line); padding-block: 2px; }
.case-tab { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding-inline: clamp(10px,1.8vw,23px); border: 0; border-bottom: 1px solid transparent; background: transparent; font-size: 13px; color: var(--muted); }
.case-tab:hover { color: var(--ink); }
.case-tab[aria-pressed="true"] { border-bottom-color: var(--accent); background: #cbbdff14; color: var(--ink); }
.case-tab .mono { color: var(--accent); }
.media-pane { margin-top: 11px; }
.case-facts { margin: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px 30px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.case-facts dt { font-size: 12px; color: var(--accent); margin-bottom: 5px; }
.case-facts dd { margin: 0; }
.case-story { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 38px; margin-block: clamp(28px, 5vw, 74px); }
.case-story h2, .case-media-title { font-size: clamp(20px, 2.6vw, 34px); font-weight: 640; line-height: 1.22; }
.case-story p { color: var(--muted); max-width: 42em; margin-top: 9px; }
.figure-button { position: relative; display: block; width: 100%; max-height: 74vh; padding: 0; border: 0; background: #0c0c0e; }
.figure-button:not(:disabled) { cursor: zoom-in; }
.full-media figcaption { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.full-media figcaption strong { color: var(--ink); }
.full-media figcaption a, .dialog-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.figure-meta { display: flex; gap: 12px; align-items: baseline; }
.zoom-hint { color: var(--accent); white-space: nowrap; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.case-next { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 38px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.case-next .mono { color: var(--accent); }

/* Native dialogs retain keyboard focus, Esc and mobile scrolling. */
dialog { padding: 0; color: var(--ink); background: var(--panel); border: 1px solid #514962; max-height: 94dvh; }
dialog::backdrop { background: #08070ce8; }
.media-dialog { width: min(94vw, 1700px); max-width: none; }
.dialog-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 13px; border-bottom: 1px solid var(--line); }
.dialog-bar h2 { font-size: 15px; font-weight: 650; }
.dialog-actions { display: flex; gap: 6px; }
.subtle-button { border: 1px solid transparent; background: transparent; padding: 5px 8px; min-height: 38px; font-size: 13px; }
.subtle-button:hover, .subtle-button[aria-pressed="true"] { border-color: #5c5369; color: var(--accent); }
.media-body { max-height: min(78dvh, 960px); overflow: auto; background: #050505; }
.media-body img { max-width: 100%; height: auto; margin-inline: auto; }
.media-body[data-zoomed="true"] img { max-width: none; margin-inline: 0; }
.media-body video { display: block; width: 100%; max-height: 76dvh; object-fit: contain; }
.dialog-note { color: var(--muted); font-size: 12px; padding: 8px 13px; }
.brief-dialog { width: min(92vw, 580px); }
.brief-form { padding: 17px; display: grid; gap: 14px; }
.brief-form label { display: block; font-size: 14px; font-weight: 550; }
.brief-form label small { color: var(--muted); font-weight: 400; }
.brief-form input, .brief-form select, .brief-form textarea { display: block; margin-top: 5px; width: 100%; min-height: 41px; border-radius: 2px; border: 1px solid #55505f; background: var(--bg); color: var(--ink); padding: 7px 9px; }
.brief-form textarea { resize: vertical; }
.brief-form input::placeholder, .brief-form textarea::placeholder { color: #a4a0ab; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brief-hint, .brief-status { color: var(--muted); font-size: 12px; }
.brief-status { color: var(--accent); }
.brief-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.noscript { color: var(--muted); padding-block: 25px; }

@media (max-width: 980px) {
  :root { --site-header-height: 65px; }
  .card-link { grid-template-columns: 24px minmax(0,.91fr) minmax(0,1.24fr) auto; }
  .card-description { font-size: 13px; }
}
@media (max-width: 690px) {
  :root { --site-header-height: 68px; }
  .header-inner { grid-template-columns: 1fr auto auto; gap: clamp(9px,3vw,22px); }
  .brand { gap: 6px; }
  .brand-mark { width: 23px; flex-basis: 23px; }
  .brand strong { font-size: 15px; }
  .brand small { font-size: 8px; }
  .site-nav { gap: 12px; }
  .site-nav a, .nav-contact { font-size: 12px; }
  .nav-contact { gap: 4px; padding-inline: 8px; min-height: 34px; }
  .section-header { align-items: flex-start; flex-direction: column; gap: 7px; margin-bottom: 16px; }
  .section-header > p { font-size: 14px; }
  .card-link { grid-template-columns: 23px minmax(0,1fr) auto; gap: 9px; }
  .card-image { grid-row: 1; grid-column: 1 / -1; }
  .card-index, .card-caption, .card-arrow { grid-row: 2; }
  .card-index { margin-top: 3px; }
  .card-caption .mono { font-size: 10px; margin-bottom: 4px; }
  .card-description { margin-top: 5px; }
  .card-arrow { width: 35px; }
  .work-toolbar { align-items: flex-start; }
  .work-count { padding-top: 7px; }
  .filter { font-size: 12px; padding-inline: 7px; min-height: 34px; }
  .services-list li { grid-template-columns: 26px minmax(0, 1fr); gap: 5px 9px; }
  .services-list li > p { grid-column: 2; font-size: 14px; }
  .contact-inner { flex-direction: column; align-items: flex-start; }
  .contact-actions { justify-items: start; }
  .footer { flex-wrap: wrap; gap: 7px 14px; }
  .case-heading { grid-template-columns: 1fr; gap: 8px; }
  .case-facts { grid-template-columns: 1fr; gap: 12px; }
  .case-story { grid-template-columns: 1fr; gap: 21px; }
  .case-switch { gap: 0; }
  .case-tab { gap: 4px; padding-inline: 8px; min-height: 38px; font-size: 12px; }
}
@media (max-width: 380px) {
  .brand small { display: none; }
  .work-toolbar { gap: 8px; }
  .work-count { font-size: 10px; }
  .form-pair { grid-template-columns: 1fr; }
}
@media (max-width: 690px), (hover: none) and (pointer: coarse) {
  .hero-overlay { flex-direction: column-reverse; align-items: flex-start; gap: 15px; }
  .hero-signature { align-items: baseline; }
  .hero-signature h1 { font-size: clamp(68px, 22vw, 130px); }
  .hero-signature p { padding-bottom: 0; font-size: 12px; }
  .hero-reel-icon { width: 60px; height: 60px; }
  .hero-select { justify-items: start; }
  .hero-project-link { min-height: 40px; }
  .hero-project-link:not([aria-current="true"]) { display: none; }
  .hero-project-skip {
    display: grid;
    place-items: center;
    min-width: 35px;
    min-height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f1eff6cb;
    font-size: 21px;
  }
  .hero-swipe-hint { display: block; padding-inline-start: 42px; color: #f1eff6aa; font-size: 10px; }
}
@media (max-height: 520px) {
  .hero-overlay { bottom: max(20px, env(safe-area-inset-bottom)); }
  .hero-signature h1 { font-size: clamp(55px, 18svh, 110px); }
  .hero-reel { inset-block-start: 46%; }
  .hero-reel-icon { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
