/* Tungsten Royce — page CSS on top of the kit (system.css). Tokens: the palette dealt from the logo red. */
:root {
  --p-bg: #f4f0e9; --p-surface: #e9e2d7; --p-ink: #1e1a16; --p-muted: #6b6259;
  --p-accent: #942824; --p-accent-ink: #f4f0e9; --p-action: #942824; --p-action-ink: #f4f0e9;
  --p-inv-bg: #1e1a16; --p-inv-surface: #2a2622; --p-inv-ink: #f4f0e9; --p-inv-muted: #9b9791;
  --p-inv-accent: #f4f0e9; --p-inv-accent-ink: #1e1a16; --p-inv-action: #f4f0e9; --p-inv-action-ink: #1e1a16;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-text: "Instrument Sans", system-ui, sans-serif;
  --display-weight: 400; --display-tracking: -0.012em; --display-tracking-xl: -0.016em; --ly-scale: 1.12;
  /* motion (Emil's curves) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

/* ---------- dark grade: the same palette turned over ---------- */
html[data-theme="dark"] {
  --p-bg: #17140f; --p-surface: #221d17; --p-ink: #f1ebe2; --p-muted: #a39b91;
  --p-accent: #c4463f; --p-accent-ink: #f4f0e9; --p-action: #a8322d; --p-action-ink: #f4f0e9;
  --p-inv-bg: #f4f0e9; --p-inv-surface: #e9e2d7; --p-inv-ink: #1e1a16; --p-inv-muted: #6b6259;
  --p-inv-accent: #942824; --p-inv-accent-ink: #f4f0e9; --p-inv-action: #942824; --p-inv-action-ink: #f4f0e9;
  color-scheme: dark;
}
html[data-theme="dark"] .form input, html[data-theme="dark"] .form select, html[data-theme="dark"] .form textarea { background: #1e1914; color: var(--ink); }
html[data-theme="dark"] .hero--film2 > .hero__media::after { background: linear-gradient(to top, rgb(16 13 11 / .88), rgb(16 13 11 / .5) 45%, transparent); }
html[data-theme="dark"] ::selection { background: #f1ebe2; color: #17140f; }
html[data-theme="dark"] .nav__menu, html[data-theme="dark"] .nav.is-scrolled { background: var(--bg); }
html { transition: background-color 260ms var(--ease-out), color 260ms var(--ease-out); }
.theme { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out); }
.theme:hover { background: var(--surface); } .theme:active { transform: scale(.94); }
.theme svg { width: 18px; height: 18px; } .theme .sun { display: none; } html[data-theme="dark"] .theme .sun { display: block; } html[data-theme="dark"] .theme .moon { display: none; }
.nav--over:not(.is-scrolled) .theme { color: #fff; border-color: rgb(255 255 255 / .4); }

/* ---------- page transitions (MPA view transitions) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 180ms var(--ease-out) both vt-out; }
::view-transition-new(root) { animation: 260ms var(--ease-out) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
::view-transition-group(hero) { animation-duration: 420ms; animation-timing-function: var(--ease-in-out); }
.nav { view-transition-name: nav; }

/* sections grow with their content (the kit pins them to whole screens) */
main > :is(section, .section), footer.closing { height: auto !important; min-height: 0 !important; }
main > :is(section, .section) > :is(.wrap, .container), footer.closing > .wrap { height: auto !important; }
main > section.hero { min-height: 0 !important; }
main > section.hero--split { min-height: min(88svh, 820px) !important; }
.hero--split .hero-visual { min-height: 420px; }
@media (min-width: 1024px) { .hero--split .hero-visual { min-height: 600px; } }

/* ---------- nav ---------- */
.nav__logo img { height: 28px; width: auto; display: block; }
.nav__logo { gap: 12px; font-family: var(--font-display); font-size: 22px; letter-spacing: .08em; text-transform: uppercase; }
.nav { transition: box-shadow 220ms var(--ease-out), background-color 220ms var(--ease-out); }
.nav.is-scrolled { box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgb(30 26 22 / .35); }
.nav--over { background: transparent; border-bottom-color: transparent; }
.nav--over:not(.is-scrolled) { --ink: #fff; --line: rgb(255 255 255 / .35); color: #fff; }
.nav--over:not(.is-scrolled) .nav__link, .nav--over:not(.is-scrolled) .nav__logo { color: #fff; }
.nav--over:not(.is-scrolled) .nav__toggle { color: #fff; }
.nav--over.is-scrolled { background: var(--bg); }

/* ---------- film hero ---------- */
.hero--film2 { position: relative; color: #fff; background: #1b1b1b; min-height: 100svh; display: flex; align-items: flex-end; margin-top: calc(-1 * var(--nav)); padding-top: var(--nav); overflow: clip; }
.hero--film2 > .hero__media { position: absolute; inset: 0; z-index: 0; }
.hero--film2 > .hero__media > video, .hero--film2 > .hero__media > img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; display: block; }
.hero--film2 > .hero__media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 58%; background: linear-gradient(to top, rgb(16 13 11 / .78), rgb(16 13 11 / .42) 45%, transparent); pointer-events: none; }
.hero--film2 > .wrap { position: relative; z-index: 1; padding-bottom: clamp(32px, 6vh, 72px); }
.hero--film2 { min-height: 100svh !important; }
.hero--film2 h1 { font-size: clamp(44px, 5.6vw, 84px); max-width: 12ch; line-height: 1.0; letter-spacing: var(--display-tracking-xl); margin: 0 0 var(--s-5); }
.hero--film2 .hero__lead { max-width: 52ch; font-size: var(--t-lead); line-height: 1.5; color: #fff; margin: 0 0 var(--s-6); }
.hero--film2 .btn--secondary { background: rgb(255 255 255 / .12); color: #fff; border-color: rgb(255 255 255 / .35); backdrop-filter: blur(6px); }
.hero--film2 .btn--secondary:hover { background: rgb(255 255 255 / .2); }
.hero__facts2 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); margin: var(--s-8) 0 0; padding-top: var(--s-5); border-top: 1px solid rgb(255 255 255 / .3); }
.hero__facts2 div { display: grid; gap: 2px; }
.hero__facts2 dt { font-size: var(--t-label); font-weight: 500; color: rgb(255 255 255 / .72); }
.hero__facts2 dd { margin: 0; font-size: var(--t-body); font-weight: 500; }
.hero__sound { position: absolute; right: var(--gut); bottom: clamp(32px, 6vh, 72px); z-index: 2; }
/* one-shot entrance: lead rises most, support less, decoration fades (choreograph) */
.hero--film2 .h-in { opacity: 0; transform: translateY(var(--rise, 16px)); animation: h-in 700ms var(--ease-out) var(--d, 0ms) both; }
@keyframes h-in { to { opacity: 1; transform: none; } }
@media (max-width: 1023px) { .hero__facts2 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 639px) {
  .hero--film2 { min-height: 100svh; }
  .hero--film2 > .hero__media > video, .hero--film2 > .hero__media > img { object-position: 72% 50%; }
  .hero--film2 h1 { font-size: var(--ly-h1-side, 40px); }
  .hero__facts2 { gap: var(--s-4); }
  .hero__sound { display: none; }
}

/* ---------- scroll reveal (marketing surface; one entrance per container; non-uniform stagger) ---------- */
[data-reveal] > * { opacity: 0; transform: translateY(14px); }
[data-reveal].is-in > * { opacity: 1; transform: none; transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
[data-reveal].is-in > :nth-child(2) { transition-delay: 70ms; }
[data-reveal].is-in > :nth-child(3) { transition-delay: 130ms; }
[data-reveal].is-in > :nth-child(4) { transition-delay: 180ms; }
[data-reveal].is-in > :nth-child(n+5) { transition-delay: 220ms; }
[data-reveal="fade"] > * { transform: none; }
.no-js [data-reveal] > * { opacity: 1; transform: none; }

/* ---------- photo wall (projects, galleries) ---------- */
.wall { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-flow: dense; gap: 2px; align-items: stretch; }
.wall > a, .wall > figure { position: relative; display: block; margin: 0; overflow: hidden; grid-column: span 4; aspect-ratio: 4 / 3; background: var(--surface); }
.wall > .is-wide { grid-column: span 8; grid-row: span 2; aspect-ratio: auto; }
.wall > .is-tall { grid-row: span 2; aspect-ratio: auto; }
.wall img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 700ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .wall > a:hover img { transform: scale(1.03); } }
.wall .wall__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s-4) var(--s-5); display: flex; justify-content: space-between; gap: var(--s-4); color: #fff; font-size: var(--t-small); font-weight: 500; background: linear-gradient(to top, rgb(16 13 11 / .7), transparent); opacity: 0; transform: translateY(6px); transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out); }
.wall > a:hover .wall__cap, .wall > a:focus-visible .wall__cap { opacity: 1; transform: none; }
@media (hover: none) { .wall .wall__cap { opacity: 1; transform: none; } }
@media (max-width: 1023px) { .wall > a, .wall > figure { grid-column: span 6; } .wall > .is-wide { grid-column: span 12; grid-row: auto; aspect-ratio: 16 / 9; } }
@media (max-width: 639px) { .wall > a, .wall > figure, .wall > .is-wide { grid-column: span 12; grid-row: auto; aspect-ratio: 4 / 3; } .wall > .is-tall { grid-row: auto; aspect-ratio: 4 / 3; } }

.wall--2 > a, .wall--2 > figure { grid-column: span 6; }
.wall--2 > .is-wide { grid-column: span 12; grid-row: auto; aspect-ratio: 16 / 9; }
@media (max-width: 639px) { .wall--2 > a, .wall--2 > .is-wide { grid-column: span 12; aspect-ratio: 4 / 3; } }

/* ---------- dark band: the shop ---------- */
.band { background: var(--p-inv-bg); color: var(--p-inv-ink); --ink: var(--p-inv-ink); --muted: var(--p-inv-muted); --line: rgb(244 240 233 / .18); --surface: var(--p-inv-surface); }
.band .muted { color: var(--p-inv-muted); }
.band .btn--secondary { color: var(--p-inv-ink); border-color: rgb(244 240 233 / .4); background: transparent; }
.band .btn--secondary:hover { background: rgb(244 240 233 / .08); }
.band__film { position: relative; aspect-ratio: 16 / 7; overflow: hidden; border-radius: var(--r-lg); background: #000; }
.band__film video, .band__film img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-6); margin: 0; padding: 0; list-style: none; }
.stats li { display: grid; gap: var(--s-2); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.stats .t-stat { font-size: clamp(32px, 3vw, 44px); line-height: 1; }
.stats span { font-size: var(--t-body); color: var(--ink); }
@media (max-width: 639px) { .stats { grid-template-columns: repeat(2, 1fr); gap: var(--s-5); } }

/* ---------- 3D loops ---------- */
.loop3d { margin: 0; display: grid; gap: var(--s-3); }
.loop3d video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #1b1b1b; }
.loop3d figcaption { display: flex; justify-content: space-between; gap: var(--s-4); font-size: var(--t-small); font-weight: 500; }
.loop3d--wide video { aspect-ratio: 21 / 9; }
@media (max-width: 1023px) { .loop3d.span-6 { grid-column: span 12; } }

/* ---------- woods ---------- */
.woods { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-7); }
.woods h3 { font-family: var(--font-text); font-weight: 500; font-size: var(--t-card); margin: 0 0 var(--s-4); }
.woods ul { margin: 0; padding: 0; list-style: none; display: grid; }
.woods li { padding: var(--s-3) 0; border-top: 1px solid var(--line); font-size: var(--t-body); display: flex; justify-content: space-between; gap: var(--s-4); }
.woods li:last-child { border-bottom: 1px solid var(--line); }
.woods li small { color: var(--muted); font-size: var(--t-small); }
@media (max-width: 639px) { .woods { grid-template-columns: 1fr; gap: var(--s-6); } }

/* ---------- process rows ---------- */
.steps { counter-reset: step; margin: 0; padding: 0; list-style: none; display: grid; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 72px 1fr 2fr; gap: var(--s-6); padding: var(--s-5) 0; border-top: 1px solid var(--line); align-items: baseline; }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-display); font-size: var(--t-h3); color: var(--muted); }
.steps h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: var(--t-h3); }
.steps p { margin: 0; font-size: var(--t-body); line-height: 1.55; max-width: 52ch; }
@media (max-width: 639px) { .steps li { grid-template-columns: 48px 1fr; } .steps p { grid-column: 2; } }

/* ---------- project page ---------- */
.phero { position: relative; margin-top: calc(-1 * var(--nav)); padding-top: var(--nav); background: #1b1b1b; color: #fff; }
.phero__img { width: 100%; height: min(78svh, 760px); object-fit: cover; display: block; view-transition-name: hero; }
.phero__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--s-4) var(--s-6); padding: var(--s-6) 0 0; }
.phero__bar h1 { margin: 0; font-size: var(--t-h2); line-height: 1.05; }
.phero__bar .t-label { color: var(--muted); }
.pmeta { display: flex; gap: var(--s-6); flex-wrap: wrap; margin: 0; }
.pmeta div { display: grid; gap: 2px; } .pmeta dt { font-size: var(--t-label); color: var(--muted); font-weight: 500; } .pmeta dd { margin: 0; font-size: var(--t-body); font-weight: 500; }
.pnav { display: flex; justify-content: space-between; gap: var(--s-5); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.pnav a { font-size: var(--t-body); }

/* ---------- filters (projects) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { font: 500 var(--t-small)/1 var(--font-text); padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:hover:not([aria-pressed="true"]) { background: var(--surface); }
.wall > a.is-out { display: none; }
.wall > a { transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); }
.wall.is-swapping > a { opacity: 0; transform: scale(.985); transition-duration: 160ms; }

/* ---------- lightbox ---------- */
.lb { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100svh; color: #fff; }
.lb::backdrop { background: rgb(16 13 11 / .92); }
.lb[open] { display: grid; place-items: center; }
.lb img { max-width: min(96vw, 1600px); max-height: 86svh; object-fit: contain; display: block; border-radius: 4px; }
.lb[open] img { animation: lb-in 220ms var(--ease-out) both; }
@keyframes lb-in { from { opacity: 0; transform: scale(.97); } }
.lb__x, .lb__p, .lb__n { position: fixed; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .35); background: rgb(255 255 255 / .08); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background-color 160ms var(--ease-out); }
.lb__x { top: 20px; right: 20px; transform: none; } .lb__p { left: 20px; } .lb__n { right: 20px; }
.lb__x:hover, .lb__p:hover, .lb__n:hover { background: rgb(255 255 255 / .18); }
.lb__count { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: var(--t-small); color: rgb(255 255 255 / .75); }

/* ---------- quote form ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5) var(--s-5); }
.form .full { grid-column: 1 / -1; }
.form label { display: grid; gap: var(--s-2); font-size: var(--t-small); font-weight: 500; color: var(--ink); }
.form input, .form select, .form textarea { font: 400 var(--t-body)/1.4 var(--font-text); color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 12px 14px; width: 100%; transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
.form input:focus, .form select:focus, .form textarea:focus { outline: 0; border-color: var(--action); box-shadow: 0 0 0 3px rgb(148 40 36 / .18); }
.form textarea { min-height: 140px; resize: vertical; }
.form .btn { justify-self: start; }
.form__ok { display: none; padding: var(--s-6); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.form.is-sent { display: none; } .form.is-sent + .form__ok { display: block; }
.contact { display: grid; gap: var(--s-3); }
.contact a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.contact a:hover { text-decoration-color: currentColor; }
@media (max-width: 639px) { .form { grid-template-columns: 1fr; } }

/* square, quiet buttons */
.btn { border-radius: 0 !important; letter-spacing: .01em; }
.btn--xl { border-radius: 0 !important; }
.chip { border-radius: 0; }
.theme { border-radius: 0; }
.form input, .form select, .form textarea { border-radius: 0; }

/* ---------- browser surfaces carry the palette ---------- */
::selection { background: #942824; color: #f4f0e9; }
:root { accent-color: #942824; scrollbar-color: #9b9791 transparent; }
:focus-visible { outline: 2px solid #942824; outline-offset: 3px; border-radius: 2px; }
a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.stats .t-stat, .pmeta dd, .hero__facts2 dd { font-variant-numeric: tabular-nums; }

/* ---------- misc ---------- */
.split-photo { width: 100%; height: 100%; min-height: 360px; object-fit: cover; display: block; border-radius: var(--r-lg); }
.lede-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); align-items: start; }
@media (max-width: 1023px) { .lede-row { grid-template-columns: 1fr; } }
.tiles3 .tile__media { aspect-ratio: 4 / 3; }
.tile__media img { transition: transform 700ms var(--ease-out); }
.footer__lede a { color: inherit; }
.skip { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); }
.skip:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip-path: none; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 99; }

@media (prefers-reduced-motion: reduce) {
  .hero--film2 .h-in { animation: h-fade 300ms ease both; transform: none; }
  @keyframes h-fade { to { opacity: 1; } }
  [data-reveal] > * { transform: none; }
  [data-reveal].is-in > * { transition: opacity 300ms ease; transition-delay: 0ms !important; }
  .wall img, .tile__media img { transition: none; }
  ::view-transition-old(root), ::view-transition-new(root), ::view-transition-group(hero) { animation-duration: 1ms; }
}
