/* ------------------------------------------------------------------
   Palette pulled from the logo: warm paper, ink, logo red, cheek pink
------------------------------------------------------------------- */
:root {
  --paper: #f3efe7;
  --paper-2: #ebe5d9;
  --ink: #1b1917;
  --ink-2: #57524b;
  --ink-3: #8a837a;
  --line: #d9d1c3;
  --red: #a8292b;       /* logo line colour */
  --pink: #ee98d6;      /* logo cheeks */

  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: var(--sans); /* display text uses the same family, set lighter and tighter */
  --jp: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --radius: 4px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141210;
    --paper-2: #1d1a17;
    --ink: #eee8de;
    --ink-2: #b5ada2;
    --ink-3: #7f786f;
    --line: #2f2b27;
    --red: #e0554f;
    --pink: #f0a6db;
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--pink); color: #1b1917; }

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.jp { font-family: var(--jp); font-weight: 500; }

/* ---------------- Nav ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand img {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #fff;
  transition: transform .4s cubic-bezier(.3,1.6,.5,1);
}
.brand:hover img { transform: rotate(-12deg) scale(1.06); }

.nav-links { display: flex; gap: clamp(14px, 3vw, 32px); }
.nav-links a {
  font-size: 0.92rem;
  color: var(--ink-2);
  text-decoration: none;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ---------------- Hero ---------------- */
.hero {
  padding-top: clamp(48px, 10vw, 128px);
  padding-bottom: clamp(48px, 8vw, 96px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.eyebrow {
  margin: 0 0 20px;
  font-size: 0.82rem;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.eyebrow .jp { color: var(--red); }

.hero h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(3rem, 10vw, 8.5rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.jp-name {
  display: inline-block;
  font-size: max(0.32em, 20px);
  color: var(--red);
  letter-spacing: 0.1em;
  vertical-align: top;
  margin-top: 0.3em;
  writing-mode: vertical-rl;
}

.lede {
  margin: clamp(16px, 2.4vw, 28px) 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}

.facts {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pink);
}
.facts li:first-child::before { background: var(--red); }

/* ---------------- Sections ---------------- */
.section { padding-block: clamp(40px, 6vw, 72px); }

.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 16px;
  padding-top: 18px;
  margin-bottom: clamp(24px, 4vw, 40px);
  border-top: 1px solid var(--line);
}
.section-head .num {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--red);
}
.section-head h2 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.045em;
}
.section-head p {
  grid-column: 2;
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* ---------------- Masonry gallery ---------------- */
.masonry {
  columns: 3 300px;
  column-gap: clamp(16px, 2.4vw, 32px);
}

.work {
  break-inside: avoid;
  margin: 0 0 clamp(28px, 4vw, 44px);
}

.media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper-2);
  cursor: zoom-in;
}
.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.media img { height: auto; }
.media:hover img,
.media:hover video { transform: scale(1.025); }

/* small "loop" tag on animations */
.media.is-video::after {
  content: "Loop";
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 8px 3px 20px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
  border-radius: 999px;
  background:
    radial-gradient(circle at 10px 50%, var(--pink) 3px, transparent 3.5px),
    rgba(20, 18, 16, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

figcaption { padding-top: 12px; }
figcaption h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
figcaption p {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--ink-2);
  max-width: 48ch;
}
figcaption .meta {
  margin: 2px 0 6px;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.links { display: flex; gap: 16px; margin-top: 8px !important; }
.links a {
  font-size: 0.82rem;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s, color .2s;
}
.links a:hover { color: var(--red); text-decoration-color: var(--red); }

/* ---------------- Short film band ---------------- */
.film {
  /* fixed night palette, sampled from the film itself, in both themes */
  --night: #0e0f1e;
  --night-2: #181a33;
  --snow: #ece6f0;
  --snow-2: #a9a6c4;
  --glow: #f2899b;
  background:
    radial-gradient(120% 60% at 80% 0%, #2a2d5a 0%, transparent 60%),
    radial-gradient(80% 50% at 0% 100%, #3a1f3a 0%, transparent 60%),
    var(--night);
  color: var(--snow);
  padding-block: clamp(56px, 9vw, 120px);
  margin-block: clamp(8px, 2vw, 24px) clamp(24px, 4vw, 48px);
}

.film-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  align-items: end;
  gap: 16px 48px;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.film-kicker {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--glow);
}
.rec {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 0 0 rgba(242, 137, 155, .6);
  animation: rec 2s ease-out infinite;
}
@keyframes rec {
  0%   { box-shadow: 0 0 0 0 rgba(242, 137, 155, .55); }
  80%, 100% { box-shadow: 0 0 0 10px rgba(242, 137, 155, 0); }
}
.film h2 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}
.film-intro {
  margin: 0;
  color: var(--snow-2);
  font-size: 1rem;
}

.film figure { margin: 0; }
.film-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: var(--night-2);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
}
.film-frame video { width: 100%; height: 100%; object-fit: cover; }

.film figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  font-size: 0.85rem;
}
.film figcaption span:last-child { color: var(--snow-2); }

.film-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2.4vw, 32px);
  margin-top: clamp(24px, 3vw, 40px);
}

.film-toggle {
  position: absolute;
  right: 14px; bottom: 14px;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(14, 15, 30, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: background .2s;
}
.film-toggle:hover { background: rgba(14, 15, 30, .8); }
.i-pause {
  width: 12px; height: 14px;
  border-inline: 4px solid currentColor;
}
.film-toggle.paused .i-pause {
  width: 0; height: 0;
  border-inline: 0;
  border-left: 13px solid currentColor;
  border-block: 8px solid transparent;
  margin-left: 4px;
}

/* ---------------- Commissions ---------------- */
.commissions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 32px);
  align-items: start;
}
.commissions .media { aspect-ratio: 1; }
.commissions .media img { width: 100%; height: 100%; object-fit: cover; }

/* transparent line-art merch sits on a fixed light card in both themes */
.media.paper { background: #faf7f1; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.media.paper img { object-fit: contain; padding: 8%; }

.client-note {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 12px 32px;
  margin-top: clamp(16px, 3vw, 32px);
  padding: clamp(20px, 3vw, 32px);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.client-tag {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}
.client-note h3 {
  margin: 0 0 6px;
  font-weight: 500;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.client-note p:not(.client-tag) {
  margin: 0;
  color: var(--ink-2);
  max-width: 62ch;
}

/* ---------------- About ---------------- */
.about-body { max-width: 760px; margin-left: auto; }
.about-lead {
  margin: 0 0 16px;
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.035em;
}
.about-body > p:not(.about-lead) {
  margin: 0 0 14px;
  font-size: 1.05rem;
  color: var(--ink-2);
  max-width: 58ch;
}
.about-body > p a {
  color: var(--ink);
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}

/* recognition list */
.credits {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.credits li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 4px 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
}
.credits li .k {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  padding-top: 3px;
}

.background {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 0;
}
.background dt { font-weight: 500; font-size: 0.95rem; }
.background dd { margin: 2px 0 0; font-size: 0.85rem; color: var(--ink-3); }

/* ---------------- Contact ---------------- */
.contact {
  padding-block: clamp(56px, 9vw, 120px) clamp(40px, 6vw, 72px);
  text-align: center;
}
.contact-kicker {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 1rem;
}
.contact-mail {
  display: inline-block;
  font-size: clamp(1.5rem, 5.4vw, 4.2rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.05;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--red), var(--red)) left 100% / 0 2px no-repeat;
  transition: background-size .35s ease, color .2s;
  padding-bottom: 4px;
}
.contact-mail:hover { color: var(--red); background-size: 100% 2px; }
.contact .social { justify-content: center; }
.social .count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--pink);
  color: #1b1917;
  font-size: 0.75rem;
  font-weight: 600;
}

/* festival laurel: PNG used as a mask so it takes the text colour in both themes */
.laurel {
  display: block;
  flex: none;
  width: clamp(150px, 17vw, 220px);
  aspect-ratio: 720 / 391;
  background: var(--ink);
  -webkit-mask: url("images/work/laurel-microshorts.png") center / contain no-repeat;
          mask: url("images/work/laurel-microshorts.png") center / contain no-repeat;
  opacity: .85;
  transition: opacity .2s, background-color .2s;
}
.laurel:hover { opacity: 1; background: var(--red); }

.social {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.social svg { width: 16px; height: 16px; }
.social a:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------------- Footer ---------------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 28px 40px;
  margin-top: 24px;
  position: relative;
  font-size: 0.82rem;
  color: var(--ink-3);
}
.footer p { margin: 0; }
.footer::before {
  content: "";
  position: absolute;
  top: 0; left: var(--gutter); right: var(--gutter);
  border-top: 1px solid var(--line);
}

/* ---------------- Lightbox ---------------- */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 56px var(--gutter) 24px;
  border: 0;
  background: rgba(14, 12, 10, 0.94);
  color: #eee8de;
}
.lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  animation: lb-in .25s ease;
}
.lightbox::backdrop { background: transparent; }
.lb-media {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-media.paper img { background: #faf7f1; padding: 4%; }
.lb-media img,
.lb-media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
}
.lb-caption {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.4rem;
}
.lb-close {
  position: absolute;
  top: 12px; right: 16px;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.lb-close:hover { background: rgba(255,255,255,0.1); }

@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- Small screens ---------------- */
@media (max-width: 860px) {
  .film-head { grid-template-columns: 1fr; }
  .commissions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-note { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .brand span { display: none; }
  .nav-links {
    overflow-x: auto;
    scrollbar-width: none;
    gap: 18px;
    mask-image: linear-gradient(to right, #000 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    padding-right: 24px;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; }
}

@media (max-width: 560px) {
  .film-pair { grid-template-columns: 1fr; }
  .commissions { grid-template-columns: 1fr; }
  .credits li { grid-template-columns: 1fr; }
  .background { grid-template-columns: 1fr; gap: 10px; }
  .section-head { grid-template-columns: 1fr; }
  .section-head p { grid-column: 1; }
  .about-body { margin-left: 0; }
}

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