/* hop · a clear day in plasticine.
   Every colour here was sampled from hop's Young Animator of the Year entry. */

@font-face {
  font-family: "Fredoka";
  src: url("fredoka.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --navy: #041730;
  --navy-raised: #0a2442;
  --navy-lifted: #113058;
  --sky: #1589b7;
  --sky-deep: #0075b4;
  --teal: #1e8890;
  --teal-deep: #006679;
  --apricot: #da9d52;
  --sun: #fdf6e6;
  --glass: #d8f1ee;
  --glass-edge: #9ed6d4;
  --glass-blush: #f2cdd2;
  --ink: #f4ead8;
  --ink-soft: #a9bccb;
  --glass-fill: linear-gradient(165deg, #fff 8%, var(--glass) 34%, var(--glass-edge) 56%, var(--glass-blush) 78%, var(--sun) 94%);
  --glass-glow: drop-shadow(0 0 14px rgb(158 214 212 / .35));
  --title-size: clamp(2.6rem, 8vw, 4.8rem);
  --title-gap: clamp(20px, 3vw, 32px);

  --gutter: clamp(16px, 4vw, 48px);
  --gap: clamp(12px, 2.2vw, 24px);
  --page: 1180px;
  --squish: cubic-bezier(.2, .9, .3, 1.35);
  --settle: cubic-bezier(.2, .8, .2, 1);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(130% 70% at 50% -12%, rgb(21 137 183 / .5), rgb(0 117 180 / .1) 45%, transparent 70%),
    var(--navy);
  color: var(--ink);
  font: 400 1.0625rem/1.55 "Fredoka", ui-rounded, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film grain: the whole page is shot on something slightly crunchy */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

a { color: inherit; }

:focus-visible { outline: 3px solid var(--glass-edge); outline-offset: 3px; border-radius: 6px; }

img, video { display: block; max-width: 100%; }

/* ---------- clay: the house material ---------- */

.clay {
  background: var(--navy-raised);
  border-radius: 22px 26px 24px 20px / 20px 24px 26px 22px;
  box-shadow:
    inset 2px 3px 0 rgb(255 255 255 / .07),
    inset -3px -4px 0 rgb(0 0 0 / .28),
    0 18px 32px -20px rgb(0 0 0 / .9);
}

/* ---------- masthead ---------- */

.masthead {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) var(--gutter) 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.masthead h1 { margin: 0; font-size: inherit; }

/* the logo is just the page's first title: same glass, same size as "films" */
.wordmark {
  display: block;
  font-size: var(--title-size);
  font-weight: 700;
  line-height: 1.05;
  text-decoration: none;
  filter: var(--glass-glow);
}

/* each letter carries its own glass, because they hop independently */
.letter {
  display: inline-block;
  padding-bottom: .06em;
  background: var(--glass-fill);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform-origin: 50% 100%;
  animation: hop .9s var(--settle) both;
}
.letter:nth-child(2) { animation-delay: .08s; }
.letter:nth-child(3) { animation-delay: .16s; }

.wordmark:hover .letter,
.wordmark:focus-visible .letter { animation: hop-again .9s var(--settle) both; }
.wordmark:hover .letter:nth-child(2), .wordmark:focus-visible .letter:nth-child(2) { animation-delay: .08s; }
.wordmark:hover .letter:nth-child(3), .wordmark:focus-visible .letter:nth-child(3) { animation-delay: .16s; }

/* squash, stretch, hang, land, wobble: the five stages of a good hop */
@keyframes hop {
  0%   { transform: translateY(0) scale(1, 1); }
  18%  { transform: translateY(0) scale(1.18, .8); }
  42%  { transform: translateY(-38%) scale(.88, 1.14); }
  56%  { transform: translateY(-44%) scale(1, 1); }
  74%  { transform: translateY(0) scale(1.2, .78); }
  88%  { transform: translateY(0) scale(.95, 1.05); }
  100% { transform: translateY(0) scale(1, 1); }
}

/* a twin, because CSS only replays an animation when its name changes */
@keyframes hop-again {
  0%   { transform: translateY(0) scale(1, 1); }
  18%  { transform: translateY(0) scale(1.18, .8); }
  42%  { transform: translateY(-38%) scale(.88, 1.14); }
  56%  { transform: translateY(-44%) scale(1, 1); }
  74%  { transform: translateY(0) scale(1.2, .78); }
  88%  { transform: translateY(0) scale(.95, 1.05); }
  100% { transform: translateY(0) scale(1, 1); }
}

.masthead nav { display: flex; gap: clamp(4px, 2vw, 14px); }
.masthead nav a {
  padding: 6px 12px;
  border-radius: 99px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  transition: color .2s, background .2s;
}
.masthead nav a:hover { color: var(--ink); background: rgb(255 255 255 / .06); }

/* ---------- hero ---------- */

/* the logo is a title, so the hero sits under it exactly as films sit under "films" */
.hero {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--title-gap) var(--gutter) 0;
}

.hero-frame {
  position: relative;
  margin: 0;
  aspect-ratio: 1280 / 980;
  overflow: hidden;
  background: #000 url("../media/hero.jpg") center / cover;
  border-radius: 28px 34px 30px 26px / 26px 30px 34px 28px;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / .06),
    0 40px 90px -30px rgb(21 137 183 / .6),
    0 30px 60px -30px rgb(0 0 0 / .9);
}

/* the still underneath is the ident's final frame, so until the video is
   genuinely rolling (or forever, for calm visitors) you see the title card */
.hero-video { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease; }
.hero-video.rolling { opacity: 1; }

.hero-sound {
  position: absolute;
  right: clamp(10px, 2.4vw, 22px);
  bottom: clamp(10px, 2.4vw, 22px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  background: rgb(4 23 48 / .62);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--ink);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: scale .25s var(--squish), background .2s;
}
.hero-sound:hover { scale: 1.05; background: rgb(4 23 48 / .8); }

.play-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sun);
  position: relative;
}
.play-dot::after {
  content: "";
  position: absolute;
  inset: 8px 7px 8px 10px;
  background: var(--sky-deep);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

h2, h3 { font-weight: 700; line-height: 1.05; margin: 0; }

/* full-bleed hills that melt into the navy instead of ending in a seam */
.hills {
  display: block;
  width: 100vw;
  height: clamp(60px, 10vw, 120px);
  margin: clamp(32px, 6vw, 64px) 0 0 calc(50% - 50vw);
}
.hill-far { fill: url(#hill-far); }
.hill-mid { fill: url(#hill-mid); }

/* ---------- sections ---------- */

.section {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(44px, 8vw, 88px) var(--gutter) 0;
}
.hills + .section { padding-top: clamp(8px, 2vw, 24px); }

.section-head { margin-bottom: var(--title-gap); }

.glass {
  display: inline-block;
  font-size: var(--title-size);
  background: var(--glass-fill);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: var(--glass-glow);
  padding-bottom: .06em;
}

.shelf {
  margin: clamp(26px, 4vw, 40px) 0 14px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: .12em;
}
.shelf:first-of-type { margin-top: 0; }

/* ---------- films ---------- */

.films {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--gap);
}
.films.tall { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .films.tall { grid-template-columns: repeat(3, 1fr); } }

.film {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  text-decoration: none;
  transition: translate .35s var(--squish), box-shadow .35s;
}
.film:hover { translate: 0 -5px; }
.film:hover .play { scale: 1.12; }

.still { position: relative; display: block; background: #000; }
.still img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.tall .still img { aspect-ratio: 3 / 4; }

.play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 62px;
  margin: -31px 0 0 -31px;
  border-radius: 50%;
  background: rgb(4 23 48 / .55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1.5px rgb(253 246 230 / .5);
  transition: scale .3s var(--squish);
}
.play::after {
  content: "";
  position: absolute;
  inset: 20px 18px 20px 24px;
  background: var(--sun);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.film-text { display: grid; gap: 4px; padding: 16px 18px 20px; }
.film-title { font-weight: 600; font-size: 1.15rem; line-height: 1.2; }
.film-meta { color: var(--apricot); font-size: .9rem; }

/* the headliner: just the picture, letterboxed wide */
.feature { grid-column: 1 / -1; }
.feature .still img { aspect-ratio: 16 / 9; }

@media (min-width: 820px) {
  .feature .play { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
  .feature .play::after { inset: 27px 24px 27px 33px; }
}

/* ---------- latest: a strip of film ---------- */

.filmstrip {
  --sprocket: rgb(253 246 230 / .14);
  list-style: none;
  margin: 0 calc(-1 * var(--gutter));
  padding: 26px var(--gutter);
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  background:
    radial-gradient(circle at 50% 50%, var(--sprocket) 4px, transparent 4.5px) 0 7px / 22px 14px repeat-x,
    radial-gradient(circle at 50% 50%, var(--sprocket) 4px, transparent 4.5px) 0 calc(100% - 7px) / 22px 14px repeat-x,
    #020d1c;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) transparent;
}

.filmstrip li { flex: none; scroll-snap-align: start; }

.frame {
  position: relative;
  display: block;
  height: clamp(300px, 46vw, 380px);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 10px;
  background: var(--navy-lifted);
  text-decoration: none;
  transition: translate .35s var(--squish);
}
.frame.wide { aspect-ratio: 16 / 10; }
.frame:hover { translate: 0 -4px; }

.frame img { width: 100%; height: 100%; object-fit: cover; }

.frame-text {
  position: absolute;
  inset: auto 0 0;
  padding: 44px 14px 14px;
  background: linear-gradient(transparent, rgb(2 13 28 / .92));
  display: grid;
  gap: 2px;
}
.frame-title { font-weight: 600; line-height: 1.2; }
.frame-meta { font-size: .82rem; color: var(--apricot); }

.elsewhere {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 0;
}
.elsewhere a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* the clay shadow eats the bottom edge, so equal padding looks sunk:
     lift the text 2px to centre it on the visible face */
  padding: 10px 20px 14px;
  font-weight: 600;
  text-decoration: none;
  transition: scale .25s var(--squish), background .2s;
}
.elsewhere a:hover { scale: 1.05; background: var(--navy-lifted); }
.elsewhere span { font-weight: 400; color: var(--ink-soft); font-size: .9rem; }

/* ---------- art ---------- */

.gallery { columns: 3 280px; column-gap: var(--gap); }

.piece {
  display: block;
  width: 100%;
  margin: 0 0 var(--gap);
  padding: 0;
  border: 0;
  background: #000;
  break-inside: avoid;
  overflow: hidden;
  border-radius: 14px;
  cursor: zoom-in;
  box-shadow: 0 18px 40px -18px rgb(0 0 0 / .85);
  transition: translate .35s var(--squish), box-shadow .35s;
}
.piece:hover { translate: 0 -4px; box-shadow: 0 28px 60px -20px rgb(0 0 0 / .95); }
.piece img { width: 100%; height: auto; }

.pixelated { image-rendering: pixelated; }

/* ---------- footer ---------- */

.footer {
  max-width: var(--page);
  margin: clamp(60px, 10vw, 120px) auto 0;
  padding: 0 var(--gutter) calc(40px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}
.footer .elsewhere { justify-content: center; }

.small { margin: 28px 0 0; font-size: .85rem; color: var(--ink-soft); opacity: .7; }

/* ---------- dialogs: theatre + lightbox ---------- */

dialog {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}
dialog::backdrop { background: rgb(2 13 28 / .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
dialog[open] { animation: fade-in .25s ease-out; }

.theatre[open], .stage {
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vw, 56px);
}

.theatre video {
  max-width: 100%;
  max-height: calc(100dvh - 2 * clamp(12px, 4vw, 56px));
  border-radius: 14px;
  background: #000;
  box-shadow: 0 0 120px -20px rgb(21 137 183 / .5), 0 30px 90px rgb(0 0 0 / .7);
  animation: rise .35s var(--settle);
}

.stage { width: 100%; height: 100%; cursor: zoom-out; }
.stage img {
  max-width: 100%;
  max-height: calc(100dvh - 2 * clamp(12px, 4vw, 56px));
  border-radius: 8px;
  box-shadow: 0 30px 90px rgb(0 0 0 / .7);
  cursor: default;
  animation: rise .3s var(--settle);
}
.stage img.pixelated { width: min(100%, calc(100dvh - 2 * clamp(12px, 4vw, 56px))); height: auto; }

.control {
  position: fixed;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / .1);
  color: var(--ink);
  cursor: pointer;
  transition: background .2s, scale .25s var(--squish);
}
.control:hover { background: rgb(255 255 255 / .2); scale: 1.08; }
.control svg { width: 24px; height: 24px; }

.close { top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; }
.prev  { left: 16px;  top: 50%; translate: 0 -50%; }
.next  { right: 16px; top: 50%; translate: 0 -50%; }

@media (max-width: 700px) {
  .prev, .next { top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); translate: none; }
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise    { from { opacity: 0; transform: scale(.97); } }

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  .masthead nav a { padding: 6px 8px; }
  .hero-sound { font-size: .85rem; padding: 8px 12px 8px 9px; gap: 8px; }
  .play-dot { width: 22px; height: 22px; }
  .play-dot::after { inset: 7px 6px 7px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
