:root {
  --paper: #f7f7f4;
  --ink: #0c0c0c;
  --line: rgba(12, 12, 12, 0.22);
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-snap-type: y mandatory; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; width: 100%; height: 100%; object-fit: cover; }

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}

.preview-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: clamp(20px, 3vw, 48px);
  align-items: center;
  height: var(--header-h);
  padding: 0 clamp(18px, 2.8vw, 48px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.preview-brand { font-size: clamp(24px, 2.7vw, 36px); font-weight: 600; letter-spacing: 0; line-height: 1; }
.preview-header nav { display: flex; gap: clamp(18px, 3.6vw, 58px); color: #6b6b6b; font-size: 14px; font-weight: 300; }
.preview-header nav a, .preview-pdf { transition: opacity 160ms ease; }
.preview-header nav a:hover, .preview-pdf:hover { opacity: 0.45; }
.preview-pdf {
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 31px;
  padding: 0 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
}

.opener {
  position: relative;
  height: 100svh;
  min-height: 620px;
  padding-top: var(--header-h);
  overflow: hidden;
  overscroll-behavior-y: contain;
  touch-action: pan-x;
  scroll-snap-align: start;
  background: var(--paper);
  isolation: isolate;
  transform: translate3d(0, 0, 0);
  transition: transform 780ms cubic-bezier(0.76, 0, 0.24, 1);
  will-change: transform;
}
.opener.is-turning { transform: translate3d(0, -100%, 0); }
.masthead {
  position: relative;
  z-index: 10;
  width: 100%;
  height: clamp(124px, 19.5vh, 210px);
  margin: 0;
  padding: 0 clamp(14px, 1.3vw, 24px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  font-size: clamp(68px, 6.8vw, 150px);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.075em;
  white-space: nowrap;
  text-transform: uppercase;
}
.masthead-track {
  display: flex;
  align-items: center;
  gap: 0.18em;
  width: max-content;
  min-width: 100%;
  height: 100%;
}
.masthead i { font-style: normal; font-weight: 400; }

.scene-stage {
  position: relative;
  height: calc(100svh - var(--header-h) - clamp(124px, 19.5vh, 210px) - 74px);
  min-height: 350px;
  overflow: hidden;
}
.scene-artboard { display: none; }
.scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2.2vw, 34px) 0;
  visibility: hidden;
  opacity: 0;
  transform: translate3d(9vw, 0, 0);
  transition: opacity 460ms ease, transform 620ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 620ms;
  pointer-events: none;
}
.scene.is-active {
  visibility: visible;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 0s;
  pointer-events: auto;
}
.scene.is-before { transform: translate3d(-9vw, 0, 0); }
.scene-line {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 30px);
  width: max-content;
  font-size: clamp(66px, 10.2vw, 190px);
  font-weight: 500;
  line-height: 0.84;
  letter-spacing: -0.065em;
  white-space: nowrap;
}
.scene-line--offset-left { transform: translateX(-4.5vw); }
.scene-line--offset-right { transform: translateX(5vw); }
.media-card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(230px, 31vw, 560px);
  height: clamp(260px, 43vh, 500px);
  margin: 0;
  overflow: hidden;
  background: #ddd;
}
.media-card--basis { width: clamp(250px, 36vw, 650px); }
.media-card--rckless { width: clamp(210px, 25vw, 450px); }
.media-card--campaign { width: clamp(220px, 27vw, 500px); }
.media-card--pearlgo { width: clamp(210px, 25vw, 450px); }
.media-card figcaption {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 9px;
  padding: 5px 7px;
  background: rgba(247,247,244,0.88);
  color: var(--ink);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
}
.media-card--simian video { object-position: center 44%; }
.media-card--basis video { object-position: center center; }
.media-card--rckless img { object-position: center 36%; }
.media-card--campaign img { object-position: center 32%; }
.media-card--pearlgo img { object-position: center center; }

.opener-footer {
  position: absolute;
  inset: auto 0 5px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 68px;
  padding: 0 clamp(18px, 2.8vw, 48px);
  border-top: 1px solid var(--line);
  background: var(--paper);
  font-size: 11px;
  letter-spacing: 0.055em;
}
.opener-footer p { margin: 0; }
.scene-name { justify-self: center; font-size: 12px; letter-spacing: 0; text-transform: uppercase; }
.advance-copy { justify-self: end; }
.advance-copy b { display: inline-block; animation: nudge 1.15s ease-in-out infinite; }
.mobile-copy { display: none; }
.scene-progress { position: absolute; z-index: 21; right: 0; bottom: 0; left: 0; height: 5px; background: #deded9; }
.scene-progress span { display: block; width: 20%; height: 100%; background: var(--ink); transform-origin: left; transition: width 440ms cubic-bezier(0.22, 1, 0.36, 1); }

.selected-preview {
  min-height: 100svh;
  padding: calc(var(--header-h) + clamp(34px, 5vw, 80px)) clamp(18px, 3vw, 52px) clamp(48px, 5vw, 86px);
  scroll-snap-align: start;
  background: #101010;
  color: #f4f4ef;
}
.selected-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
  padding-bottom: clamp(30px, 4vw, 62px);
}
.selected-heading p { grid-column: 1 / -1; margin: 0 0 clamp(30px, 7vh, 80px); color: rgba(255,255,255,.5); font-size: 11px; }
.selected-heading h2 { margin: 0; font-size: clamp(54px, 8vw, 144px); font-weight: 500; line-height: .82; letter-spacing: -.065em; }
.selected-heading a { padding-bottom: 4px; border-bottom: 1px solid currentColor; font-size: 12px; }
.selected-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: clamp(10px, 1.4vw, 24px); }
.selected-grid a { display: grid; gap: 10px; min-width: 0; font-size: 11px; }
.selected-grid img { height: clamp(280px, 43vh, 520px); object-position: center 30%; transition: filter 200ms ease, transform 450ms cubic-bezier(.22,1,.36,1); }
.selected-grid a { overflow: hidden; }
.selected-grid a span { position: relative; z-index: 2; }
.selected-grid a:hover img { filter: brightness(.8); transform: scale(1.025); }
.noscript { position: fixed; z-index: 200; right: 20px; bottom: 20px; padding: 10px; background: #fff; }

@keyframes nudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

@media (min-width: 761px) {
  .masthead,
  .opener-footer,
  .scene-progress { display: none; }

  .preview-header { display: grid; }

  .opener {
    min-height: 100svh;
    padding-top: 0;
  }

  .scene-stage {
    position: absolute;
    inset: 0;
    height: auto;
    min-height: 0;
  }

  .scene {
    padding: 0;
    place-items: stretch;
  }

  .scene-line { display: none; }

  .scene-artboard {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: min(100vw, 177.777778svh);
    height: min(56.25vw, 100svh);
    transform: translate(-50%, -50%);
  }

  .scene-artboard::after {
    position: absolute;
    z-index: 20;
  inset: 0 0 auto;
  height: 6.8%;
  background: var(--paper);
  content: "";
  pointer-events: none;
  }

  .desktop-artboard-ui {
    position: absolute;
    z-index: 30;
    top: 50%;
    left: 50%;
    width: min(100vw, 177.777778svh);
    height: min(56.25vw, 100svh);
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  .desktop-hotspot {
    position: absolute;
    top: 0;
    height: 6.666667%;
    pointer-events: auto;
  }

  .desktop-nav-hotspots { display: none; }

  .desktop-hotspot--home { left: 72.8%; width: 4.2%; }
  .desktop-hotspot--work { left: 77.9%; width: 4%; }
  .desktop-hotspot--about { left: 82.8%; width: 4.2%; }
  .desktop-hotspot--contact { left: 87.8%; width: 4.7%; }
  .desktop-hotspot--pdf { left: 93.9%; width: 3.1%; }

  .desktop-hotspot:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: -4px;
  }

  .desktop-scroll-hint {
    position: absolute;
    right: 50%;
    bottom: 0.6%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.22em;
    width: 30%;
    height: 9%;
    margin: 0;
    transform: translateX(50%);
    background: var(--paper);
    font-size: min(1.05vw, 1.866667svh);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.035em;
    white-space: nowrap;
  }

  .scene-layout {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
  }

  .scene-video {
    position: absolute;
    z-index: 2;
    display: block;
    object-fit: contain;
    background: #fff;
  }

  .scene-video--simian {
    top: 25.555556%;
    left: 40.78125%;
    width: 21.979167%;
    height: 49.351852%;
  }

  .scene-video--basis {
    top: 25%;
    left: 7.083333%;
    width: 18.229167%;
    height: 46.296296%;
  }
}

@media (max-width: 760px) {
  :root { --header-h: 62px; }
  .preview-header { grid-template-columns: 1fr auto; padding-inline: 18px; }
  .preview-header nav { display: none; }
  .preview-brand { font-size: 24px; }
  .desktop-artboard-ui { display: none; }
  .masthead {
    height: clamp(96px, 16vh, 140px);
    padding-inline: 10px;
    font-size: clamp(44px, 10.8vw, 62px);
    transform: translateX(-1.2vw);
  }
  .scene-stage { height: calc(100svh - var(--header-h) - clamp(96px, 16vh, 140px) - 70px); min-height: 370px; }
  .scene { padding: 18px 0; }
  .scene-line { gap: 12px; font-size: clamp(50px, 16.5vw, 78px); }
  .scene-line--offset-left { transform: translateX(-15vw); }
  .scene-line--offset-right { transform: translateX(12vw); }
  .media-card,
  .media-card--basis,
  .media-card--rckless,
  .media-card--campaign,
  .media-card--pearlgo {
    width: min(58vw, 260px);
    height: min(48svh, 410px);
  }
  .media-card--basis video { content-visibility: auto; }
  .opener-footer { grid-template-columns: auto 1fr; height: 64px; padding: 0 18px; }
  .scene-name { justify-self: end; text-align: right; }
  .advance-copy { position: absolute; right: 18px; bottom: 47px; }
  .desktop-copy { display: none; }
  .mobile-copy { display: inline; }
  .selected-preview { padding-inline: 18px; }
  .selected-heading { grid-template-columns: 1fr; }
  .selected-heading p { margin-bottom: 30px; }
  .selected-heading h2 { font-size: clamp(54px, 18vw, 76px); }
  .selected-heading a { justify-self: start; margin-top: 10px; }
  .selected-grid { grid-template-columns: 1fr 1fr; }
  .selected-grid a:first-child { grid-column: 1 / -1; }
  .selected-grid img { height: 34svh; min-height: 220px; }
  .selected-grid a:first-child img { height: 42svh; }
}

/* A resized desktop window remains the approved desktop opener. Device type,
   rather than viewport width, owns the mobile/desktop experience split. */
@media (max-width: 760px) {
  html[data-site-device="desktop"] { --header-h: 72px; }

  html[data-site-device="desktop"] .masthead,
  html[data-site-device="desktop"] .opener-footer,
  html[data-site-device="desktop"] .scene-progress {
    display: none;
  }

  html[data-site-device="desktop"] .preview-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: clamp(14px, 2.6vw, 24px);
    min-height: 72px;
    padding: 0 clamp(20px, 3.2vw, 32px);
  }

  html[data-site-device="desktop"] .preview-header nav {
    display: flex;
    gap: clamp(16px, 2.8vw, 28px);
  }

  html[data-site-device="desktop"] .opener {
    min-height: 100svh;
    padding-top: 0;
  }

  html[data-site-device="desktop"] .scene-stage {
    position: absolute;
    inset: 0;
    height: auto;
    min-height: 0;
  }

  html[data-site-device="desktop"] .scene {
    padding: 0;
    place-items: stretch;
  }

  html[data-site-device="desktop"] .scene-line { display: none; }

  html[data-site-device="desktop"] .scene-artboard,
  html[data-site-device="desktop"] .desktop-artboard-ui {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: min(100vw, 177.777778svh);
    height: min(56.25vw, 100svh);
    transform: translate(-50%, -50%);
  }

  html[data-site-device="desktop"] .scene-artboard::after {
    position: absolute;
    z-index: 20;
    inset: 0 0 auto;
    height: 6.8%;
    background: var(--paper);
    content: "";
    pointer-events: none;
  }

  html[data-site-device="desktop"] .desktop-artboard-ui {
    z-index: 30;
    pointer-events: none;
  }

  html[data-site-device="desktop"] .desktop-hotspot {
    position: absolute;
    top: 0;
    height: 6.666667%;
    pointer-events: auto;
  }

  html[data-site-device="desktop"] .desktop-hotspot--home { left: 72.8%; width: 4.2%; }
  html[data-site-device="desktop"] .desktop-hotspot--work { left: 77.9%; width: 4%; }
  html[data-site-device="desktop"] .desktop-hotspot--about { left: 82.8%; width: 4.2%; }
  html[data-site-device="desktop"] .desktop-hotspot--contact { left: 87.8%; width: 4.7%; }
  html[data-site-device="desktop"] .desktop-hotspot--pdf { left: 93.9%; width: 3.1%; }

  html[data-site-device="desktop"] .desktop-nav-hotspots { display: none; }

  html[data-site-device="desktop"] .desktop-scroll-hint {
    position: absolute;
    right: 50%;
    bottom: 0.6%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.22em;
    width: 30%;
    height: 9%;
    margin: 0;
    transform: translateX(50%);
    background: var(--paper);
    font-size: min(1.05vw, 1.866667svh);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.035em;
    white-space: nowrap;
  }

  html[data-site-device="desktop"] .scene-layout {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
  }

  html[data-site-device="desktop"] .scene-video {
    position: absolute;
    z-index: 2;
    display: block;
    object-fit: contain;
    background: #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scene, .scene-progress span, .selected-grid img { transition: none; }
  .advance-copy b { animation: none; }
  .opener { transition-duration: 1ms; }
}

/* Navigation feedback is interaction-led and identical for every action. */
.preview-header nav a,
.preview-pdf {
  display: inline-grid;
  place-items: center;
  min-height: 31px;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  transition: none;
}

.preview-header nav a:hover,
.preview-header nav a:focus-visible,
.preview-header nav a:active,
.preview-pdf:hover,
.preview-pdf:focus-visible,
.preview-pdf:active {
  background: #b8f911;
  color: var(--ink);
  box-shadow: none;
  opacity: 1;
}
