/* Shared styles for every page: tokens, page frame, header, footer, focus, images.
   Page-specific layout lives in each page's own <style> block. */

:root {
  --ink: #1c1b1a;
  --body: #3a3835;
  --body-2: #4a4744;
  --muted: #75726e;
  --hairline: #dcd9d4;
  --grid-line: #e2dfda;
  --ground: #f3f2f2;
  --panel: #fbfbfa;
  --panel-2: #f7f6f5;
  --img-bg: #ececea;
  --cobalt-50: #e5e9fb;
  --cobalt-200: #a9b6ee;
  --cobalt: #1b3ac4;
  --cobalt-700: #122a8f;
  --cobalt-900: #0b1a5c;
  --cobalt-hover: #4561dc;
  --cursor-tag: #ffd23f;
  --pad-x: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Archivo, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cobalt-700); text-decoration: none; }
a:hover { color: var(--cobalt); text-decoration: underline; }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* Visible focus on every interactive element — never the browser default. */
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 16px;
  font: 600 13px/1 Archivo, sans-serif; letter-spacing: .06em; text-transform: uppercase;
}
.skip-link:focus { top: 16px; color: #fff; text-decoration: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Page frame. Decorative bleed (grid backdrops, glows) never causes a horizontal page scroll. */
.wrap {
  max-width: 1280px; margin: 0 auto; min-height: 100vh; background: #fff;
  border-left: 1px solid var(--hairline); border-right: 1px solid var(--hairline);
  overflow-x: clip;
}

/* Wide screens. Laptop 15" (1281–1679px): the page stretches to full width on white, no grey side
   margins or side borders. Desktop (>= 1680px) keeps the 1280px page on grey; <= 1280px is unchanged.
   `html body` beats the pages' own body / .wrap rules. */
@media (min-width: 1281px) and (max-width: 1679px) {
  html body { background: #fff; }
  html body .wrap { max-width: none; border-left: 0; border-right: 0; }
}

/* Header */
.hd {
  position: sticky; top: 0; z-index: 5; background: #fff;
  display: flex; align-items: center; flex-wrap: wrap; gap: 40px;
  padding: 22px var(--pad-x);
  border-bottom: 2px solid var(--ink);
}
.hd-logo {
  font: 700 20px/1 Archivo, sans-serif; letter-spacing: -.02em;
  white-space: nowrap; color: var(--ink);
}
.hd-logo:hover { color: var(--ink); text-decoration: none; }
.hd-nav { display: flex; gap: 28px; margin-left: auto; font: 500 15px/1 Archivo, sans-serif; }
.hd-nav a, .cs-main a, .cs-back { position: relative; color: var(--body-2); }
/* 44px hit area without changing the layout */
.hd-nav a::before, .cs-main a::before, .cs-back::before, .btn-cv::before { content: ""; position: absolute; inset: -14px -8px; }
.hd-nav a[aria-current], .cs-main a[aria-current] { color: var(--ink); font-weight: 700; }
.btn-cv {
  position: relative;
  border: 2px solid var(--ink); color: var(--ink); background: transparent;
  font: 600 12px/1 Archivo, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  padding: 9px 14px; white-space: nowrap; transition: background .2s, color .2s;
}
.btn-cv:hover { background: var(--ink); color: #fff; text-decoration: none; }

/* Case-study header: bar + section anchor nav */
.cs-hd { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 2px solid var(--ink); }
.cs-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 24px;
  padding: 22px var(--pad-x); border-bottom: 1px solid var(--hairline);
}
.cs-back { font: 500 14px/1 Archivo, sans-serif; white-space: nowrap; }
.cs-back-c { display: none; }
.cs-main { display: flex; gap: 20px; margin-left: auto; font: 500 14px/1 Archivo, sans-serif; }
.cs-nav { scrollbar-width: thin; }

/* Footer */
.ft {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px;
  padding: 20px var(--pad-x); border-top: 2px solid var(--ink);
}
.ft-home { padding-top: 24px; padding-bottom: 24px; }
.ft-copy { font: 400 13px/1.4 Archivo, sans-serif; color: var(--muted); white-space: nowrap; }
.ft-nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font: 500 14px/1.4 Archivo, sans-serif; }
.ft-nav a { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.ft-nav a:hover { color: var(--cobalt-700); text-decoration: underline; }

/* build.py adds each image's width/height (its own shape, reserved before load). Keep the height
   automatic unless a rule sets one; :where() has no specificity, so any page rule still wins. */
:where(img[width][height]) { height: auto; }

/* Images that replaced the design tool's image slots: fill their sized wrapper. */
.slot { display: block; width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.slot-empty { background: var(--img-bg); }

/* Design-system primary button (e.g. PlayRent "View full guidelines"): the Modernist base hovers to its
   red accent; on this site it hovers to the lighter cobalt, text stays white. */
.btn-primary:hover, .btn-primary:focus-visible { background: var(--cobalt-hover); color: #fff; text-decoration: none; }
.btn-primary:active { background: var(--cobalt-700); color: #fff; }

/* Site video controls (video-controls.js). Nothing tints the footage: a compact bar at the bottom,
   shown while paused and on hover / focus / tap while playing. */
.vc { position: relative; display: block; width: 100%; }
/* The wrapper always fills its frame. Page rules that run "div:has(> video)" edge to edge mean the
   frame around the video, not this wrapper (it would be widened twice). */
html body .wrap div.vc.vc { width: 100% !important; max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
.vc > video { cursor: pointer; }
.vc-btn {
  appearance: none; -webkit-appearance: none; border: 0; margin: 0; padding: 0; border-radius: 0;
  background: transparent; color: #fff; cursor: pointer; flex: none;
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.vc-btn svg { width: 20px; height: 20px; display: block; }
.vc-bar {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  display: flex; align-items: center; padding: 0 2px;
  background: rgba(28, 27, 26, .9); color: #fff;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.vc.is-paused .vc-bar, .vc.is-active .vc-bar, .vc:focus-within .vc-bar { opacity: 1; pointer-events: auto; }
.vc-time {
  font: 600 12px/1 Archivo, sans-serif; font-variant-numeric: tabular-nums;
  white-space: nowrap; padding: 0 6px 0 4px;
}
.vc-narrow .vc-time { display: none; }
.vc-seek {
  flex: 1; min-width: 32px; height: 44px; margin: 0 6px;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
.vc-seek::-webkit-slider-runnable-track {
  height: 4px; background: linear-gradient(to right, #fff var(--p, 0%), rgba(255, 255, 255, .35) var(--p, 0%));
}
.vc-seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; background: #fff; border: 0; border-radius: 0;
}
.vc-seek::-moz-range-track { height: 4px; background: rgba(255, 255, 255, .35); }
.vc-seek::-moz-range-progress { height: 4px; background: #fff; }
.vc-seek::-moz-range-thumb { width: 12px; height: 12px; background: #fff; border: 0; border-radius: 0; }
.vc-bar .vc-btn:focus-visible, .vc-seek:focus-visible { outline: 2px solid var(--cobalt-200); outline-offset: -2px; }
.vc:fullscreen { background: #000; display: flex; align-items: center; }
.vc:fullscreen > video { width: 100%; height: 100%; object-fit: contain; }
.vc:-webkit-full-screen { background: #000; display: flex; align-items: center; width: 100%; height: 100%; }
.vc:-webkit-full-screen > video { width: 100%; height: 100%; object-fit: contain; }

/* CV dialog (cv-viewer.js): max 1200px wide, full screen on phones. */
.cvv {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(11, 26, 92, .72);
}
.cvv-panel {
  width: 100%; max-width: 1200px; height: 100%; display: flex; flex-direction: column;
  background: #fff; border: 2px solid var(--ink);
}
.cvv-bar { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 20px; border-bottom: 2px solid var(--ink); }
.cvv-title { margin-right: auto; font: 700 17px/1 Archivo, sans-serif; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.cvv-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; box-sizing: border-box; cursor: pointer;
  font: 600 12px/1 Archivo, sans-serif; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
}
.cvv-dl { background: var(--cobalt); color: #fff; border: 0; }
.cvv-dl:hover { background: var(--cobalt-700); color: #fff; text-decoration: none; }
.cvv-close { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.cvv-close:hover { background: var(--ink); color: #fff; }
.cvv-pages {
  flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; background: var(--ground);
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.cvv-pages canvas { flex: none; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.cvv-pages iframe { flex: 1; width: 100%; border: 0; }
.cvv-msg { font: 500 14px/1.4 Archivo, sans-serif; color: var(--body-2); padding: 24px; }
html.cvv-open { overflow: hidden; }
@media (max-width: 767px) {
  .cvv { padding: 0; }
  .cvv-panel { max-width: none; border: 0; }
  .cvv-bar { padding: 8px 8px 8px 16px; }
  .cvv-title { font-size: 15px; }
  .cvv-name, .cvv-dl { display: none; }
  .cvv-pages { padding: 8px; }
}

/* CV dialog (cv-viewer.js): max 1200px wide, full screen on phones. */
.cvv {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(11, 26, 92, .72);
}
.cvv-panel {
  width: 100%; max-width: 1200px; height: 100%; display: flex; flex-direction: column;
  background: #fff; border: 2px solid var(--ink);
}
.cvv-bar { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 20px; border-bottom: 2px solid var(--ink); }
.cvv-title { margin-right: auto; font: 700 17px/1 Archivo, sans-serif; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.cvv-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; box-sizing: border-box; cursor: pointer;
  font: 600 12px/1 Archivo, sans-serif; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
}
.cvv-dl { background: var(--cobalt); color: #fff; border: 0; }
.cvv-dl:hover { background: var(--cobalt-700); color: #fff; text-decoration: none; }
.cvv-close { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.cvv-close:hover { background: var(--ink); color: #fff; }
.cvv-pages {
  flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; background: var(--ground);
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.cvv-pages canvas { flex: none; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.cvv-pages iframe { flex: 1; width: 100%; border: 0; }
.cvv-msg { font: 500 14px/1.4 Archivo, sans-serif; color: var(--body-2); padding: 24px; }
html.cvv-open { overflow: hidden; }
@media (max-width: 767px) {
  .cvv { padding: 0; }
  .cvv-panel { max-width: none; border: 0; }
  .cvv-bar { padding: 8px 8px 8px 16px; }
  .cvv-title { font-size: 15px; }
  .cvv-name, .cvv-dl { display: none; }
  .cvv-pages { padding: 8px; }
}

/* Scroll reveal (triggered once by site.js) */
[data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1);
}
[data-reveal].is-in { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  :root { --pad-x: 24px; }
  .hd { padding: 16px 24px; gap: 16px; }
  .cs-bar { padding: 16px 24px; gap: 16px; }
  .cs-nav { padding-left: 24px !important; padding-right: 24px !important; }
  .ft { padding: 20px 24px; }
}
@media (max-width: 560px) {
  .hd-nav, .cs-main { display: none; }
  .hd .btn-cv, .cs-bar .btn-cv { margin-left: auto; }
}
/* Phone header (< 768px): name + 44px menu button; nav, back link, CV and section tabs move
   out (the menu holds the links; no CV on phones). Desktop never shows .m-btn / .m-menu. */
.m-btn, .m-menu { display: none; }
.m-menu a {
  height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  border-bottom: 1px solid var(--hairline); font: 600 20px/1 Archivo, sans-serif; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none;
}
.m-menu a:last-child { border-bottom: 0; }
.m-menu a:hover { color: var(--ink); text-decoration: none; }
.m-menu a:active { background: var(--cobalt-50); }
.m-menu a span { font-size: 16px; }
.m-menu a[aria-current] { font-weight: 800; box-shadow: inset 3px 0 0 var(--ink); }
@media (max-width: 767px) {
  html, body { overflow-x: clip; overscroll-behavior-x: none; }
  .hd {
    height: 56px; padding: 0 6px 0 20px; flex-wrap: nowrap; gap: 12px;
  }
  .cs-bar { height: 56px; padding: 0 6px 0 20px; flex-wrap: nowrap; gap: 12px; border-bottom: 0; }
  .hd-logo { font-size: 17px; min-height: 44px; display: inline-flex; align-items: center; }
  .hd-nav, .cs-main, .cs-nav, .btn-cv, .cv-link { display: none !important; }
  /* Back = chevron at the far left, before the name, with a thin divider; no word. */
  .cs-back {
    order: -1; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    flex: none; margin-left: -12px; border-right: 1px solid var(--hairline); color: var(--ink);
  }
  .cs-back::before { content: none; }
  .cs-back-t, .cs-back-a { display: none; }
  .cs-back-c { display: block; }
  .m-btn {
    display: flex; margin-left: auto; width: 44px; height: 44px; flex: none; align-items: center; justify-content: center;
    background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink);
  }
  .m-btn .m-ic-close, .m-btn[aria-expanded="true"] .m-ic-open { display: none; }
  .m-btn[aria-expanded="true"] .m-ic-close { display: block; }
  /* Fixed to the screen (not hung under the header), so it shows wherever the page is scrolled.
     site.js sets --m-top to the header's bottom edge when the menu opens. */
  .m-menu:not([hidden]) {
    position: fixed; left: 0; right: 0; top: var(--m-top, 56px); bottom: 0; z-index: 50;
    overflow-y: auto; overscroll-behavior: contain;
    display: flex; flex-direction: column; background: #fff; border-top: 2px solid var(--ink);
  }
  /* Lock the page behind the open menu on <html> only: hiding body overflow too resets the scroll
     position to the top. */
  html.m-open { overflow: hidden; }
  .ft { padding: 16px 20px; }
  .ft-copy, .ft-nav a { font-size: 12px; }
  section[id] { scroll-margin-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  /* Safety net for inline/page animations without their own fallback: jump straight to the
     final state. Page rules that set animation:none keep priority (higher specificity). */
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    /* No transitions at all (not a tiny one): scripts that measure right after a style change
       (hero fitting) must read the new value. */
    transition: none !important;
  }
}

/* "↑ Back to Top" at the end of case studies and the Illustration page */
.btt { display: flex; justify-content: center; padding: 40px 20px 48px; }
.btt a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 600 15px/1 Archivo, system-ui, sans-serif; letter-spacing: .01em; color: #122a8f; text-decoration: underline; text-decoration-color: #a9b6ee; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.btt a:hover { color: #1b3ac4; text-decoration-color: #1b3ac4; }
