/* ---------- Tokens ---------- */
:root {
  --color-text: #ffffff;
  --color-bg: #000000;

  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text-display-size: 18px;
  --text-display-line: 48px;

  --space-edge-x: 48px;  /* side padding of the nav bar */
  --space-edge-y: 24px;  /* top/bottom padding of the nav bar */
  --space-nav-gap: 64px; /* gap between "work" and "contact" */

  /* Work page */
  --color-paper: #ffffff;
  --color-ink: #000000;
  --color-muted: #c4c4c4;

  --font-mono: "Fragment Mono", ui-monospace, Menlo, monospace;
  --text-title-size: clamp(36px, 3.73vw, 60px);
  --text-title-line: 0.933; /* 56px at 60px */
  --text-mono-size: clamp(14px, 1.5vw, 24px);
  --text-mono-line: 1.667;  /* 40px at 24px */
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Landing ---------- */
.landing {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* accounts for mobile browser toolbars */
  overflow: hidden;
}

.reel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.landing__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-edge-y) var(--space-edge-x);
}

.display {
  font-weight: 700;
  font-size: var(--text-display-size);
  line-height: var(--text-display-line);
  white-space: nowrap;
}

.landing__nav {
  display: flex;
  gap: var(--space-nav-gap);
}

.landing a {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.landing a:hover,
.landing a:focus-visible {
  opacity: 1;
}

.landing a:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
}

/* ---------- Work ---------- */
/* Horizontal spacing is in % of the 1609px-wide Figma frame so the layout scales with it. */
body.page-work {
  background: var(--color-paper);
  color: var(--color-ink);
}

.work {
  max-width: 1609px;
  margin: 0 auto;
  padding-bottom: clamp(80px, 12vw, 200px);
}

.work__title {
  margin: 0;
  font-weight: 700;
  font-size: var(--text-title-size);
  line-height: var(--text-title-line);
  color: var(--color-muted);
}

.work__title--right {
  padding: 24px;
  text-align: right;
}

.work__title--indent {
  padding-left: 13.4%;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-mono-size);
  line-height: var(--text-mono-line);
}

.stills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 3.9%;
  row-gap: clamp(24px, 3.9vw, 63px);
  margin-top: clamp(80px, 19.6vw, 316px);
  padding: 0 8.2% 0 2.1%;
}

.stills img {
  display: block;
  width: 100%;
  aspect-ratio: 439 / 291;
  object-fit: cover;
}

.credits {
  margin: clamp(64px, 10.4vw, 168px) 0 0;
  padding: 0 0 0 3%;
  list-style: none;
}

.work__commercials {
  margin-top: clamp(96px, 18vw, 290px);
}

.spot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: clamp(96px, 19.3vw, 310px) 0 0;
  padding: 0 3% 0 1.5%;
}

.work__title + .spot {
  margin-top: clamp(64px, 16.7vw, 268px);
}

.clip {
  display: block;
  width: 60.8%;
  flex: none;
  aspect-ratio: 935 / 620;
  object-fit: cover;
  background: #111;
}

.spot__caption {
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .stills {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 20px;
    column-gap: 16px;
  }

  .credits {
    padding: 0 20px;
  }

  .work__title--indent {
    padding-left: 20px;
  }

  .spot {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0 20px;
  }

  .clip {
    width: 100%;
  }

  .spot__caption {
    white-space: normal;
  }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 520px) {
  :root {
    --space-edge-x: 20px;
    --space-nav-gap: 24px;
  }
}
