/* Parametric architecture: the Parametric family (night and paper bands, Jost and Manrope,
   violet) laid out on a drawing's coordination grid. */
@font-face { font-family: "Jost"; font-weight: 300 500; font-display: swap; src: url("assets/fonts/jost-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Jost"; font-weight: 300 500; font-display: swap; src: url("assets/fonts/jost-latin.woff2") format("woff2"); 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: "Manrope"; font-weight: 400 700; font-display: swap; src: url("assets/fonts/manrope-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 400 700; font-display: swap; src: url("assets/fonts/manrope-latin.woff2") format("woff2"); 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; }

:root, .band-night {
  color-scheme: dark;
  --bg: #090c15;
  --surface: #10151f;
  --ink: #eef0f5;
  --ink-2: #c3c8d4;
  --muted: #98a0b3;
  --line: #222a3b;
  --line-strong: #3a4358;
  --accent: #8e93ff;
  --action-bg: #eef0f5;
  --action-ink: #0a0e18;
  --wipe: #8e93ff;
  --field: #090c15;
  --grid: #eef0f50f;
}
.band-paper {
  color-scheme: light;
  --bg: #f3f4f8;
  --surface: #ffffff;
  --ink: #0a0e18;
  --ink-2: #2c3242;
  --muted: #5a6173;
  --line: #dde0e9;
  --line-strong: #b4bac8;
  --accent: #4a4fd6;
  --action-bg: #0a0e18;
  --action-ink: #f3f4f8;
  --wipe: #4a4fd6;
  --field: #ffffff;
  --grid: #0a0e180f;
}
:root {
  --action: var(--action-bg);
  --card: var(--surface);
  --error: #ffb6a1;
  --display: "Jost", Futura, "Century Gothic", sans-serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --header: 72px;
}
.band-night, .band-paper { background: var(--bg); color: var(--ink); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header); }
html { scrollbar-color: #3a4358 #090c15; }
textarea { scrollbar-color: var(--line-strong) var(--field); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
body:has(dialog[open]) { overflow: hidden; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 300; text-transform: uppercase; letter-spacing: .01em; line-height: .95; text-wrap: balance; }
h2 { font-size: clamp(2.5rem, 6vw, 5.5rem); }
h3 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; }
img { display: block; width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .24em; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
input, select, textarea { caret-color: var(--accent); }
.shell { width: min(100% - clamp(2rem, 9vw, 10rem), 1320px); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 20; transform: translateY(-150%); background: var(--ink); color: var(--bg); padding: 8px 12px; }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------------------------------------------------------------- header */
.site-header { position: fixed; inset: 0 0 auto; z-index: 10; background: #090c15; border-bottom: 1px solid var(--line); }
.header { min-height: var(--header); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; min-height: 44px; width: clamp(122px, 12vw, 160px); }
.brand img { height: auto; }
.navigation { display: flex; gap: clamp(1rem, 2.6vw, 2.5rem); }
.navigation a, .quiet { color: var(--ink-2); text-decoration: none; font-size: .92rem; font-weight: 500; }
.navigation a:hover, .quiet:hover { color: var(--ink); }
.quiet { border: 0; background: transparent; padding: 6px 0; }
.navigation a, .header-action, .case-all { position: relative; display: inline-flex; align-items: center; min-height: 44px; }
.navigation a::after, .case-all::after {
  content: ""; position: absolute; inset: auto 0 6px; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right center; transition: transform 400ms var(--draw-ease);
}
.navigation a:focus-visible::after, .case-all:focus-visible::after { transform: scaleX(1); transform-origin: left center; }
@media (hover: hover) and (pointer: fine) {
  .navigation a:hover::after, .case-all:hover::after { transform: scaleX(1); transform-origin: left center; }
}
.mobile-contact { display: none; }
.header-end { justify-self: end; display: flex; align-items: center; gap: 22px; }
.header-phone { font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.header-phone:hover { color: var(--accent); }
.header-action {
  justify-self: end; min-height: 40px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--ink); font-size: .86rem; font-weight: 600; text-decoration: none; transition: border-color 300ms, background-color 300ms;
}
.header-action:hover { border-color: var(--ink); }
.site-header::after {
  content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
}
@supports (animation-timeline: scroll()) {
  .site-header::after { animation: read-progress linear both; animation-timeline: scroll(root); }
  @keyframes read-progress { to { transform: scaleX(1); } }
}

/* ---------------------------------------------------------------- buttons and links */
.button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 26px; border: 1px solid transparent; border-radius: 999px;
  font: 600 .95rem/1 var(--body); text-align: center; text-decoration: none; white-space: nowrap;
  transition: background-color 300ms, color 300ms, border-color 300ms;
}
.button .arrow { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; transition: translate 400ms var(--settle); }
.button:hover .arrow { translate: 3px 0; }
.primary { background: var(--action-bg); color: var(--action-ink); isolation: isolate; overflow: clip; }
.primary:disabled { opacity: .6; cursor: default; }
.outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.outline:hover { border-color: var(--ink); }
.text-action { --m-rest: var(--accent); display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .29em; }
.text-action:hover { color: var(--accent); }

/* ---------------------------------------------------------------- hero */
.hero-home {
  position: relative; isolation: isolate; min-height: 100svh; display: grid; align-items: end;
  padding-block: calc(var(--header) + 140px) clamp(36px, 7vh, 72px);
}
.hero-backdrop { position: absolute; inset: 0; overflow: hidden; z-index: -2; }
.hero-backdrop img { position: absolute; inset: 0; height: 100%; object-fit: cover; object-position: 60% 48%; }
.hero-backdrop::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(180deg, #090c15 0%, #090c1500 26%),
    linear-gradient(0deg, #090c15f5 0%, #090c15c0 30%, #090c1500 64%),
    linear-gradient(90deg, #090c15d9 0%, #090c1566 46%, #090c1500 72%);
}
.axes {
  position: absolute; inset: var(--header) 0 0; margin-inline: auto; z-index: -1; pointer-events: none;
  display: grid; grid-template-columns: repeat(4, 1fr) 0;
}
.axes span { position: relative; }
.axes span::after { content: ""; position: absolute; top: 64px; bottom: 0; left: 0; width: 1px; background: #eef0f51f; transform-origin: top; }
.axes span::before {
  content: attr(data-axis); position: absolute; top: 28px; left: 0; translate: -50% 0;
  width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 50%;
  color: var(--accent); font: 600 .72rem/1 var(--body);
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: end; gap: 40px; }
.hero-copy { max-width: 52rem; }
.hero-home h1 { font-size: clamp(2.6rem, 6.4vw, 6rem); }
.hero-copy p { margin-block: 28px 32px; max-width: 40ch; color: var(--ink-2); font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-plate { position: relative; width: min(340px, 100%); padding: 18px 20px 20px; background: #090c15c7; border: 1px solid #eef0f524; }
.hero-project { display: grid; gap: 6px; text-decoration: none; }
.hero-project-title { font: 400 1.5rem/1.15 var(--display); letter-spacing: .02em; }
.hero-project-meta { color: var(--accent); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.hero-project:hover .hero-project-title { color: var(--accent); }
.hero-controls { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.round { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid #eef0f54d; border-radius: 50%; background: transparent; transition: border-color 300ms, background-color 300ms; }
.round svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.round:hover { border-color: var(--ink); background: #eef0f514; }
.hero-count { font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.hero-timer { position: absolute; inset: auto -1px -1px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left center; }
/* 7800ms is the rotation delay in site.js */
.hero-plate.is-timing .hero-timer { animation: hero-timer 7800ms linear forwards; }
@keyframes hero-timer { to { transform: none; } }
.hero-strip { position: absolute; inset: 0; height: 100%; object-fit: cover; object-position: 60% 48%; z-index: 1; }

/* ---------------------------------------------------------------- marquee */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding-block: 22px; }
.marquee-track { display: flex; width: max-content; }
.marquee-set { display: flex; align-items: center; flex: none; }
.marquee span { font: 300 clamp(28px, 4vw, 54px)/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.marquee .ol { color: transparent; -webkit-text-stroke: 1.2px var(--ink); }
.marquee .star { width: 18px; height: 18px; margin-inline: clamp(20px, 3vw, 40px); fill: var(--accent); flex: none; }

/* ---------------------------------------------------------------- sections */
.section { position: relative; isolation: isolate; padding-block: clamp(80px, 10vw, 150px); scroll-margin-top: var(--header); }
/* the hero's five column axes continue down every band, bounding four bays */
.section::before, .closing::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  width: min(100% - clamp(2rem, 9vw, 10rem), 1320px); margin-inline: auto;
  background: linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 25% 100% repeat-x,
              linear-gradient(var(--grid), var(--grid)) right top / 1px 100% no-repeat;
}
.closing { position: relative; isolation: isolate; }
/* text sits on the sheet's ground, so the axes pass behind it rather than through it */
.section-head h2, .contact h2, .contact-copy > p { width: fit-content; background-color: var(--bg); }
.project-label, .contact-line, .flow-step h3, .flow-step p { background-color: var(--bg); }
.section-head { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head h2 { grid-column: 1 / 4; padding-right: 24px; }
.section-head p { grid-column: 4 / 5; color: var(--muted); }
/* a row axis: its lettered bubble on axis 1 and the line it rules across the sheet */
[data-row] { position: relative; }
[data-row]::before {
  content: attr(data-row); position: absolute; top: -52px; left: 0; translate: -50% 0;
  width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 50%;
  background: var(--bg); color: var(--accent); font: 600 .72rem/1 var(--body);
}
[data-row]::after { content: ""; position: absolute; top: -38px; left: 14px; right: 0; height: 1px; background: var(--grid); }
.contact-copy[data-row]::after { right: -100%; }

.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.service-cell, .service-image { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.service-cell { display: flex; flex-direction: column; gap: 14px; min-height: 300px; padding: clamp(24px, 2.6vw, 40px); transition: background-color 400ms var(--settle); }
.service-cell:hover { background: var(--surface); }
.service-top { display: grid; gap: 8px; }
.service-code { color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.service-cell h3 { font-size: clamp(1.4rem, 1.9vw, 1.85rem); line-height: 1.1; }
.service-cell p { color: var(--muted); max-width: 36ch; }
.service-cell .text-action { margin-top: auto; }
.service-image { grid-column: span 1; position: relative; min-height: 300px; overflow: clip; background: var(--surface); }
.service-image img { position: absolute; inset: 0; height: 100%; object-fit: cover; }

.project-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(56px, 7vw, 110px) 0; align-items: start; }
.project-entry { padding-right: 24px; }
.project-entry:nth-child(1) { grid-column: 1 / 3; }
.project-entry:nth-child(2) { grid-column: 4 / 5; margin-top: clamp(64px, 9vw, 160px); }
.project-entry:nth-child(3) { grid-column: 2 / 4; }
.project-entry:nth-child(4) { grid-column: 1 / 3; margin-top: clamp(48px, 6vw, 96px); }
.project-entry:nth-child(5) { grid-column: 3 / 5; }
.project-link { display: block; color: var(--ink); text-decoration: none; }
.project-media { display: block; overflow: clip; background: var(--surface); }
.project-link img { height: auto; aspect-ratio: 1.5; object-fit: cover; }
.project-entry:nth-child(2) .project-link img { aspect-ratio: .9; }
.project-entry:nth-child(5) .project-link img { aspect-ratio: 1.7; }
.project-label { display: grid; gap: 6px; padding-block: 16px 14px; border-bottom: 1px solid var(--line); }
.project-label > span { color: var(--muted); font-size: .9rem; }
.project-label > strong { font: 400 clamp(1.5rem, 2.4vw, 2.25rem)/1.1 var(--display); letter-spacing: .01em; }
.project-link:hover .project-label > strong, .project-link:focus-visible .project-label > strong { color: var(--accent); }

.flow { counter-reset: step; list-style: none; margin: 0; padding: 52px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 0; border-top: 1px solid var(--line-strong); --rv-line: var(--line-strong); }
.flow-step { position: relative; counter-increment: step; padding-right: 24px; }
.flow-dot { position: absolute; top: -66px; left: 0; translate: -50% 0; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 50%; background: var(--bg); color: var(--accent); font: 600 .72rem/1 var(--body); }
.flow-dot::before { content: counter(step); }
.flow-step h3 { font-size: clamp(1.3rem, 1.8vw, 1.6rem); line-height: 1.15; margin-bottom: 10px; }
.flow-step p { color: var(--muted); }
.process-image { margin-top: clamp(56px, 7vw, 100px); aspect-ratio: 21 / 8; }
.process-image img { height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- contact and footer */
.contact { padding-top: clamp(80px, 10vw, 150px); }
.contact-layout { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; align-items: start; margin-top: 52px; scroll-margin-top: calc(var(--header) + 24px); }
.contact-copy { grid-column: 1 / 3; padding-right: clamp(24px, 4vw, 64px); }
.brief-pane { grid-column: 3 / 5; }
.contact h2 { font-size: clamp(2.6rem, 6.4vw, 6rem); }
.contact-copy > p { margin-block: 28px 36px; max-width: 40ch; color: var(--ink-2); }
.contact-lines { border-top: 1px solid var(--line); }
.contact-line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-block: 18px; border-bottom: 1px solid var(--line); font: 300 clamp(1.5rem, 2.4vw, 2.25rem)/1.15 var(--display); text-decoration: none; transition: color 300ms; }
.contact-line span { color: var(--accent); font: 600 .85rem/1 var(--body); }
.contact-line:hover { color: var(--accent); }
.brief-pane { background: var(--surface); border: 1px solid var(--line); padding: clamp(24px, 3vw, 40px); }
.brief-form, .brief-result { display: grid; gap: 16px; }
.brief-form > .button, .brief-result > .text-action { justify-self: start; }
.brief-result h3 { font: 300 2.25rem/1.05 var(--display); text-transform: uppercase; }
.brief-result > p { color: var(--ink-2); }
.brief-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#copy-status:empty { display: none; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .9rem; font-weight: 600; }
.field label span { color: var(--muted); font-weight: 400; margin-left: 4px; }
input, textarea, select { width: 100%; min-width: 0; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--field); }
select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%238e93ff' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea { resize: vertical; }
.picker { position: relative; }
.picker-button {
  width: 100%; min-height: 48px; padding: 11px 40px 11px 14px; border: 1px solid var(--line-strong); border-radius: 0;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%238e93ff' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  text-align: left; transition: border-color 300ms;
}
.picker-button.is-empty { color: var(--muted); }
.picker-button:hover, .picker-button[aria-expanded="true"] { border-color: var(--accent); }
.picker-list {
  position: absolute; z-index: 6; inset: calc(100% + 6px) 0 auto; margin: 0; padding: 6px 0; list-style: none;
  max-height: min(360px, 60vh); overflow: auto; overscroll-behavior: contain;
  background: #141a27; border: 1px solid var(--line-strong); box-shadow: 0 24px 48px -16px #000000b3;
  scrollbar-color: var(--line-strong) #141a27;
}
.picker.is-up .picker-list { inset: auto 0 calc(100% + 6px); }
.picker-list:focus { outline: none; }
.picker-list ul { margin: 0; padding: 0; list-style: none; }
.picker-list > li + li { border-top: 1px solid var(--line); }
.picker-group { display: block; padding: 12px 16px 6px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.picker-list [role="option"] {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 10px 16px;
  cursor: pointer; transition: background-color 150ms, color 150ms;
}
.picker-list [role="option"].is-active { background: #eef0f512; }
.picker-list [role="option"][aria-selected="true"] { color: var(--accent); }
.picker-list [role="option"][aria-selected="true"]::after {
  content: ""; width: 16px; height: 16px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.5 3 3 7-7' fill='none' stroke='%238e93ff' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat center;
}
.picker-list:focus-visible [role="option"].is-active { box-shadow: inset 2px 0 0 var(--accent); }
.field-meta { display: flex; justify-content: space-between; gap: 12px; }
.field-hint, .field-error, .task-count { font-size: .85rem; }
.field-hint, .task-count { color: var(--muted); }
.task-count { flex: none; font-variant-numeric: tabular-nums; }
.field-error { color: var(--error); }
[aria-invalid="true"] { border-color: var(--error); }
.footer { min-height: 96px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; padding-block: 20px; }
.footer p, .footer .text-action { color: var(--muted); font-size: .88rem; }
.closing .footer { margin-top: clamp(80px, 10vw, 140px); border-top: 1px solid var(--line); }
.footer .brand { width: clamp(148px, 16vw, 190px); }

/* ---------------------------------------------------------------- project pages */
.case-header { grid-template-columns: 1fr auto 1fr; border-bottom: 1px solid var(--line); }
.case-intro { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); align-items: end; gap: clamp(22px, 5vw, 65px); padding-block: clamp(56px, 9vw, 112px) 36px; }
.case-intro h1 { font-size: clamp(2.75rem, 7vw, 6rem); overflow-wrap: break-word; }
.case-intro p { color: var(--ink-2); max-width: 48ch; margin-top: 20px; }
.case-facts { margin: 0; border-top: 1px solid var(--line); }
.case-facts div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.case-facts dt { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.case-facts dd { margin: 4px 0 0; }
.case-gallery { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.gallery-image { display: grid; position: relative; overflow: hidden; text-decoration: none; isolation: isolate; }
.gallery-media { display: block; min-width: 0; }
.case-gallery .gallery-image { grid-column: span 2; }
.case-gallery:has(.gallery-image:nth-child(5)) .gallery-image { grid-column: span 3; }
.case-gallery .gallery-image:first-child { grid-column: 1 / -1; }
.case-gallery .gallery-image img { height: auto; aspect-ratio: 1.43; object-fit: cover; }
.case-gallery .gallery-image:first-child img { aspect-ratio: 1.9; }
.case-gallery .gallery-image[data-gallery] { cursor: zoom-in; }
.case-links { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin: 28px 0 clamp(48px, 8vw, 84px); }
.case-page .footer { border-top: 1px solid var(--line); }
dialog { width: min(1000px, 95vw); padding: 0; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
dialog::backdrop { background: #04060bdc; }
.dialog-bar { padding: 7px 14px; display: flex; gap: 15px; justify-content: space-between; align-items: center; }
.dialog-bar p { font-size: .88rem; }
#photo-full { height: min(68vh, 680px); object-fit: contain; }
.viewer-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .9rem; padding: 6px 14px; color: var(--ink-2); }
.viewer-controls button, .dialog-bar button { min-height: 44px; padding-inline: 5px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .header-phone { display: none; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-image { grid-column: span 1; }
}
@media (max-width: 900px) {
  .header { gap: 15px; }
  .hero-inner { grid-template-columns: 1fr; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .contact-layout, .section-head { grid-template-columns: 1fr; gap: 16px 0; }
  .section-head h2, .section-head p, .contact-copy, .brief-pane { grid-column: 1 / -1; padding-right: 0; }
  .contact-layout { gap: 48px; }
  .contact-copy[data-row]::after { right: 0; }
  .project-list { grid-template-columns: 1fr; }
  .project-entry:nth-child(n) { grid-column: auto; margin-top: 0; padding-right: 0; }
  .project-entry:nth-child(n) .project-link img { aspect-ratio: 1.45; }
}
@media (max-width: 680px) {
  :root { --header: 61px; }
  .header { position: relative; grid-template-columns: 1fr auto; min-height: var(--header); gap: 10px; }
  .menu-toggle { justify-self: end; min-height: 44px; }
  .navigation { grid-row: 2; grid-column: 1 / -1; display: grid; gap: 0; padding-bottom: 11px; }
  .navigation a { border-top: 1px solid var(--line); }
  .navigation .mobile-contact { display: inline-flex; color: var(--accent); }
  .header-end { display: none; }
  .hero-home { padding-block: calc(var(--header) + 96px) 32px; }
  .hero-backdrop img { object-position: 57% 40%; }
  .hero-backdrop::after { background: linear-gradient(180deg, #090c15 0%, #090c1500 24%), linear-gradient(0deg, #090c15 4%, #090c15ee 34%, #090c15aa 56%, #090c1526 82%); }
  .axes span::before { top: 18px; width: 24px; height: 24px; }
  .axes span::after { top: 48px; -webkit-mask-image: linear-gradient(#000 0, #000 22vh, transparent 34vh); mask-image: linear-gradient(#000 0, #000 22vh, transparent 34vh); }
  .section::before, .closing::before { display: none; }
  [data-row]::before { left: 0; translate: 0 0; }
  [data-row]::after { left: 36px; }
  .hero-actions .button { width: 100%; }
  .hero-plate { width: 100%; }
  .service-grid { grid-template-columns: 1fr; }
  .service-cell { min-height: 0; }
  .service-image { aspect-ratio: 1.4; min-height: 0; }
  .flow { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line-strong); padding: 0 0 0 28px; gap: 36px; }
  .flow-step { padding-right: 0; }
  .flow-dot { top: -4px; left: -28px; }
  .process-image { aspect-ratio: 1.4; }
  .pair { grid-template-columns: 1fr; }
  .brief-form > .button, .brief-result .button { width: 100%; }
  .brief-result .brief-actions { display: grid; }
  .case-header .case-all { justify-self: end; }
  .case-header .header-action { display: none; }
  .case-intro { grid-template-columns: 1fr; padding-top: 38px; }
  .case-gallery .gallery-image { grid-column: span 3; }
  .case-gallery .gallery-image:first-child img { aspect-ratio: 1.47; }
}
@media (max-width: 420px) {
  .case-gallery .gallery-image, .case-gallery:has(.gallery-image:nth-child(5)) .gallery-image { grid-column: 1 / -1; }
  .case-gallery .gallery-image img { aspect-ratio: 1.56; }
}

/* ---------------------------------------------------------------- motion
   Slow and architectural: long settles on one calm curve, axes and hairlines ruled like a drawing,
   photographs opening and settling from a slight zoom, the project picture carried into its page. */
html[data-motion] {
  --settle: cubic-bezier(.22, .61, .36, 1);
  --draw-ease: cubic-bezier(.7, 0, .3, 1);
  --m-image: 1600ms;
  --m-image-out: 900ms;
}
[data-rv] { --rv-delay: 0ms; }
@keyframes parametric-control-enter { from { opacity: 0; translate: 0 6px; } }
@keyframes parametric-dialog-enter { from { opacity: 0; } }
@keyframes axis-draw { from { transform: scaleY(0); } }
@keyframes axis-bubble { from { opacity: 0; scale: .4; } }
@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
}
@media (prefers-reduced-motion: no-preference) {
  #photo-dialog[open], #photo-dialog[open]::backdrop { animation: parametric-dialog-enter 200ms var(--m-ease) both; }
  .brief-result:not([hidden]) { animation: parametric-control-enter 300ms var(--settle) both; }
  .picker-list:not([hidden]) { animation: parametric-control-enter 200ms var(--settle) both; }

  /* the drawing's axes are ruled down the hero once on load, bubbles first */
  .axes span::before { animation: axis-bubble 700ms var(--settle) calc(300ms + var(--n, 0) * 120ms) both; }
  .axes span::after { animation: axis-draw 1800ms var(--draw-ease) calc(500ms + var(--n, 0) * 120ms) both; }
  .axes span:nth-child(2) { --n: 1; }
  .axes span:nth-child(3) { --n: 2; }
  .axes span:nth-child(4) { --n: 3; }
  .axes span:nth-child(5) { --n: 4; }

  .marquee-track { animation: marquee 48s linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }

  /* photographs: the picture is clipped, not its frame (IntersectionObserver sees a clipped target
     as hidden); it opens upward out of the dusk and settles from 1.08 */
  [data-rv="media"].is-pending > img { clip-path: inset(0 0 100% 0); filter: brightness(.55); scale: 1.08; }
  /* doubled attribute outranks motion.css's image transition; the hover zoom is kept in the list */
  [data-rv="media"][data-rv="media"].is-revealed > img {
    clip-path: inset(0); filter: none; scale: 1;
    transition: clip-path 1200ms var(--settle) var(--rv-delay), filter 1400ms var(--settle) var(--rv-delay),
                scale 1800ms cubic-bezier(.16, 1, .3, 1) var(--rv-delay), transform var(--m-image-out) var(--m-ease);
  }

  /* headings: each line rises out of its own mask */
  .rm { display: inline-block; overflow: clip; vertical-align: top; padding-block: .1em; margin-block: -.1em; }
  .rm__in { display: inline-block; }
  [data-rv="text"].is-pending .rm__in { translate: 0 115%; }
  [data-rv="text"].is-revealed .rm__in { translate: 0 0; transition: translate 1400ms var(--settle) calc(var(--rv-delay) + var(--ln, 0) * 160ms); }

  /* text and blocks settle up */
  [data-rv="up"].is-pending { opacity: 0; translate: 0 40px; }
  [data-rv="up"].is-revealed { opacity: 1; translate: 0 0; transition: opacity 1400ms var(--settle) var(--rv-delay), translate 1400ms var(--settle) var(--rv-delay); }

  /* hairlines: the border is redrawn as a line ruled from the left */
  :is([data-rv="top"], [data-rv="bottom"], [data-rv="left"]):is(.is-pending, .is-revealed) {
    background-image: linear-gradient(var(--rv-line, var(--line)), var(--rv-line, var(--line))); background-repeat: no-repeat; background-origin: border-box;
  }
  [data-rv="top"]:is(.is-pending, .is-revealed) { border-top-color: transparent; background-position: left top; background-size: 0% 1px; }
  [data-rv="bottom"]:is(.is-pending, .is-revealed) { border-bottom-color: transparent; background-position: left bottom; background-size: 0% 1px; }
  [data-rv="left"]:is(.is-pending, .is-revealed) { border-left-color: transparent; background-position: left top; background-size: 1px 0%; }
  :is([data-rv="top"], [data-rv="bottom"]).is-revealed { background-size: 100% 1px; transition: background-size 1800ms var(--draw-ease) var(--rv-delay); }
  [data-rv="left"].is-revealed { background-size: 1px 100%; transition: background-size 1800ms var(--draw-ease) var(--rv-delay); }
  /* the process: the rule is drawn, then each station is set on it */
  .flow.is-pending .flow-dot { scale: 0; }
  .flow.is-revealed .flow-dot { scale: 1; transition: scale 500ms var(--settle) calc(var(--rv-delay) + 700ms + var(--i) * 350ms); }

  /* the primary action fills from the left in the accent */
  .primary::before {
    content: ""; position: absolute; inset: 0; z-index: -1; background: var(--wipe);
    transform: scaleX(0); transform-origin: right center; transition: transform 500ms var(--draw-ease);
  }
  @media (hover: hover) and (pointer: fine) {
    html[data-motion] .primary:not(:disabled):hover { background: var(--action-bg); color: var(--action-ink); }
    .primary:not(:disabled):hover::before { transform: scaleX(1); transform-origin: left center; }
    /* the portfolio: the project under the pointer stays lit, the rest step back */
    html[data-motion] .project-list .project-entry.card { transition: opacity 500ms var(--settle), transform var(--m-out) var(--m-ease), box-shadow var(--m-out) var(--m-ease); }
    .project-list:has(.project-link:hover) .project-entry:not(:has(.project-link:hover)) { opacity: .4; }
  }

  @view-transition { navigation: auto; }
  ::view-transition-group(*) { animation-duration: 720ms; animation-timing-function: cubic-bezier(.65, 0, .25, 1); }
  ::view-transition-old(*), ::view-transition-new(*) { height: 100%; object-fit: cover; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 500ms; }
}
@media (max-width: 680px) and (prefers-reduced-motion: no-preference) {
  .header:has(.menu-toggle[aria-expanded="true"]) .navigation { animation: parametric-control-enter 200ms var(--m-ease) both; }
}
