@font-face {
  font-family: "Jost";
  src: url("fonts/jost-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("fonts/jost-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #faf2dc;
  --paper-deep: #f1e4bf;
  --ink: #2b2a28;
  --graphite: #5d5a55;
  --pencil: #8d8778;
  --ease: cubic-bezier(.65, .05, .25, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Jost", Futura, "Avenir Next", "Century Gothic", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.page {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 80px) 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Logo: painted on like a brush stroke ---------- */
.logo {
  display: block;
  width: min(420px, 86%);
  height: auto;
  margin: 0 0 clamp(32px, 6vh, 52px);
}
.logo img { display: block; width: 100%; height: auto; }

/* ---------- Showreel ---------- */
.reel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border-radius: 3px 6px 4px 5px / 5px 3px 6px 4px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(43, 42, 40, .08), 0 18px 40px -22px rgba(43, 42, 40, .55);
}
.reel iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.reel-play {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; padding: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  cursor: pointer;
}
.reel-play .poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.reel-play:hover .poster { transform: scale(1.03); }
.reel-play::after {
  content: "";
  position: absolute; inset: 0;
  background: #786f59;
  opacity: .62;
  transition: opacity .45s var(--ease);
}
.reel-play:hover::after { opacity: .5; }
.reel-play .cta {
  position: absolute; inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.reel-play .disc {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  display: grid; place-items: center;
  box-shadow: 0 8px 24px -10px rgba(43, 42, 40, .6);
  transition: transform .35s var(--ease);
}
.reel-play .disc svg { width: 30px; height: 30px; margin-left: 4px; }
.reel-play:hover .disc { transform: scale(1.08); }
.reel-play .title {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--paper);
  text-shadow: 0 1px 8px rgba(43, 42, 40, .35);
}
.reel-play:focus-visible { outline-offset: 4px; }

.reel-caption {
  width: 100%;
  margin: 10px 0 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: .8125rem;
  color: var(--pencil);
}
.reel-caption a { color: var(--graphite); }
.reel-caption a { text-underline-offset: 3px; }

/* ---------- Links: ink fills in like a brush stroke ---------- */
.links {
  list-style: none;
  width: 100%;
  margin: clamp(32px, 5vh, 44px) 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 12px 20px;
  text-decoration: none;
  color: var(--ink);
  isolation: isolate;
}
/* hand-drawn outline */
.link::before {
  content: "";
  position: absolute; inset: 0;
  border: 1.5px solid var(--ink);
  border-radius: 4px 9px 5px 8px / 8px 4px 9px 5px;
  z-index: -2;
}
/* the ink scribble (built in main.js): one layer of ink behind the text,
   and one on top that shows the text in paper colour exactly where the ink is */
.link .scribble {
  position: absolute;
  inset: -3px -4px;
  width: calc(100% + 8px);
  height: calc(100% + 6px);
  overflow: visible;
  z-index: -1;
  pointer-events: none;
}
.link .scribble.on-top { z-index: 1; }
.link .scribble .stroke {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--len) var(--len);
  stroke-dashoffset: var(--len);
  opacity: 0;
  /* leaving: fade the ink out, then reset the brush silently */
  transition: opacity .25s ease, stroke-dashoffset 0s linear .25s;
}
.link .scribble mask .stroke { stroke: #fff; }
.link:hover .scribble .stroke,
.link:focus-visible .scribble .stroke {
  stroke-dashoffset: 0;
  opacity: 1;
  /* entering: one fast looping scribble from left to right */
  transition: opacity 0s, stroke-dashoffset .75s cubic-bezier(.3, .55, .35, 1);
}
.link:hover .scribble .tail,
.link:focus-visible .scribble .tail {
  transition: opacity 0s, stroke-dashoffset .12s ease-in;
}
.link .scribble .inverse { fill: var(--paper); color: var(--paper); }
.link .scribble .inverse .meta-copy { fill: rgba(250, 242, 220, .78); }
.link:focus-visible { outline-offset: 6px; }

.link svg.icon {
  flex: none;
  width: 22px; height: 22px;
}
.link .label { font-weight: 500; font-size: 1.0625rem; }
.link .meta {
  margin-left: auto;
  font-size: .875rem;
  color: var(--graphite);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Footer ---------- */
.foot {
  margin-top: clamp(48px, 8vh, 72px);
  display: flex;
  gap: 24px;
  font-size: .8125rem;
  color: var(--pencil);
}
.foot a { color: var(--graphite); text-underline-offset: 3px; }

/* ---------- Page-load sequence (one orchestrated moment) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .logo img {
    clip-path: inset(0 100% 0 0);
    animation: paint 1.1s var(--ease) .15s forwards;
  }
  .js .reel,
  .js .reel-caption,
  .js .links li,
  .js .foot {
    opacity: 0;
    transform: translateY(8px);
    animation: settle .7s var(--ease) forwards;
  }
  .js .reel { animation-delay: .9s; }
  .js .reel-caption { animation-delay: 1.05s; }
  .js .links li:nth-child(1) { animation-delay: 1.1s; }
  .js .links li:nth-child(2) { animation-delay: 1.17s; }
  .js .links li:nth-child(3) { animation-delay: 1.24s; }
  .js .links li:nth-child(4) { animation-delay: 1.31s; }
  .js .foot { animation-delay: 1.45s; }
}
@keyframes paint { to { clip-path: inset(0 0 0 0); } }
@keyframes settle { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .link .scribble .stroke, .reel-play .disc, .reel-play .poster, .reel-play::after { transition: none; }
}

@media (max-width: 420px) {
  .reel-play .disc { width: 60px; height: 60px; }
  .reel-play .disc svg { width: 24px; height: 24px; }
  .reel-play .cta { gap: 10px; }
  .link { padding: 12px 16px; gap: 12px; }
  .link .meta { display: none; }
}

/* ---------- Legal pages ---------- */
.legal { max-width: 640px; }
.legal .logo { width: min(240px, 60%); margin-bottom: 40px; }
.legal article { width: 100%; }
.legal h1 { font-size: 1.75rem; font-weight: 500; margin: 0 0 4px; }
.legal .sub { color: var(--graphite); margin: 0 0 32px; font-size: .9375rem; }
.legal h2 { font-size: 1.125rem; font-weight: 500; margin: 32px 0 6px; }
.legal p, .legal address { margin: 0 0 12px; font-style: normal; max-width: 68ch; }
.legal .back { margin-top: 40px; display: inline-block; text-underline-offset: 3px; }
