@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-normal-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-italic-latin.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --page: #110f0c;
  --ink: #efe6d3;
  --ink-muted: #9a9180;
  --rule: #2e2a23;
  --tick: #5c5548;
  --accent: #e5814f;
  --grain-opacity: 0.07;

  --pad: clamp(20px, 4vw, 64px);
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  color-scheme: dark;
}

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

html {
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Film grain over the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

p,
h1,
h2,
figure {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

/* Layout: one column on phones, text left and film right on wider screens */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "mast"
    "film"
    "contact"
    "footer";
  grid-template-rows: auto auto auto 1fr;
  gap: clamp(32px, 6vw, 48px);
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--pad);
}

.masthead { grid-area: mast; }
.film { grid-area: film; }
.contact { grid-area: contact; }
.footer { grid-area: footer; }

@media (min-width: 900px) {
  .page {
    grid-template-columns: minmax(320px, 5fr) 7fr;
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas:
      "mast film"
      ". film"
      "contact film"
      "footer film";
    column-gap: clamp(40px, 5vw, 96px);
    row-gap: 24px;
  }

  /* The film runs to the top, right and bottom edges of the window. */
  .film {
    display: flex;
    flex-direction: column;
    margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) calc(-1 * var(--pad)) 0;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
  }

  .film__stage {
    flex: 1 1 auto;
    min-height: 0;
  }

  .film__caption {
    padding: 0 var(--pad) var(--pad) 0;
  }
}

/* Masthead */
.wordmark {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(3rem, 6.4vw, 6.25rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.status {
  margin-top: clamp(0.75rem, 1.5vw, 1.25rem);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.375rem, 2.2vw, 2rem);
  color: var(--ink-muted);
}

/* The film */
.film__stage {
  position: relative;
  overflow: hidden;
  background: var(--page) url("/plate/side-01.webp") 58% 50% / cover no-repeat;
}

.film__stage.is-live {
  background-image: none;
}

.film__canvas,
.film__inset-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.film__tag {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  pointer-events: none;
}

.film__tag--side {
  left: auto;
  right: 16px;
}

/* The front view sits in the top left corner, which stays empty in every frame. */
.film__inset {
  position: absolute;
  top: 16px;
  left: 16px;
  width: clamp(112px, 24%, 220px);
  aspect-ratio: 520 / 492;
  border: 1px solid rgb(239 230 211 / 0.2);
  background: var(--page);
}

.film__inset[hidden] {
  display: none;
}

.film__inset .film__tag {
  top: calc(100% + 8px);
  left: 0;
}

@media (min-width: 900px) {
  .film__inset {
    top: var(--pad);
    left: 20%;
  }

  .film__tag--side {
    top: var(--pad);
    right: var(--pad);
  }
}

.film__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.film__controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.film__controls[hidden] {
  display: none;
}

.film__count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Frame scrubber: twelve ticks, one per photograph */
.film__scrub {
  -webkit-appearance: none;
  appearance: none;
  width: 179px;
  height: 32px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.film__scrub::-webkit-slider-runnable-track {
  height: 32px;
  background: repeating-linear-gradient(to right, transparent 0 1px, var(--tick) 1px 2px, transparent 2px 16px) 0 50% / 100% 9px no-repeat;
}

.film__scrub::-moz-range-track {
  height: 32px;
  background: repeating-linear-gradient(to right, transparent 0 1px, var(--tick) 1px 2px, transparent 2px 16px) 0 50% / 100% 9px no-repeat;
}

.film__scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 3px;
  height: 17px;
  margin-top: 7.5px;
  border: 0;
  border-radius: 0;
  background: var(--accent);
}

.film__scrub::-moz-range-thumb {
  width: 3px;
  height: 17px;
  border: 0;
  border-radius: 0;
  background: var(--accent);
}

@media (max-width: 899px) {
  /* On phones the film runs to both side edges of the screen. */
  .film {
    margin-inline: calc(-1 * var(--pad));
  }

  .film__stage {
    aspect-ratio: 1 / 1;
  }

  .film__caption {
    padding-inline: var(--pad);
  }
}

@media (hover: hover) and (pointer: fine) {
  .film__stage.is-live {
    cursor: ew-resize;
  }
}

/* Contact */
.label {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.contact__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.625rem;
}

.contact__email {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--ink-muted);
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.contact__email:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.contact__copy {
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 0.8125rem;
  cursor: pointer;
}

.contact__copy:hover {
  border-color: var(--ink);
}

.contact__note {
  min-height: 1.25rem;
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.footer {
  align-self: end;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .contact__email,
  .contact__copy {
    transition: none;
  }
}

@media (forced-colors: active) {
  body::after {
    display: none;
  }

  .film__inset {
    border-color: CanvasText;
  }

  .film__scrub {
    forced-color-adjust: auto;
  }
}

/* Not found page */
.page--simple {
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "mast"
    "."
    "contact";
}

@media (min-width: 900px) {
  .page--simple {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "mast"
      "."
      "contact";
  }
}

.wordmark__link {
  color: inherit;
  text-decoration: none;
}
