/* Ketchup Studio — styles
   Palette pulled from the logo itself: the magenta-to-plum of the script,
   the near-black of "STUDIO", and the Bauhaus yellow from the concepts. */

@font-face {
  font-family: "Anybody";
  src: url("../fonts/anybody.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 50% 150%; font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900; font-display: swap;
}

:root {
  --paper: #ffffff;          /* matches the concept artwork, so tiles bleed into the page */
  --ink: #1c0a16;            /* the aubergine-black of "STUDIO" */
  --ink-soft: #5b4a55;
  --rule: #ece6ea;
  --magenta: #e0115f;        /* the ketchup */
  --plum: #4e1a6b;
  --yolk: #f5b800;
  --screen: #000000;

  --display: "Anybody", "Arial Narrow", sans-serif;
  --text: "Schibsted Grotesk", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
p { margin: 0; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; }

.skip {
  position: absolute; left: var(--gutter); top: -60px;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 50;
}
.skip:focus { top: 12px; }

/* ── Header ───────────────────────────────────────────── */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 14px var(--gutter);
}
.mark img { height: 52px; width: auto; }
.top nav { display: flex; gap: clamp(1rem, 2.4vw, 2.25rem); flex-wrap: wrap; justify-content: flex-end; }
.top nav a {
  font: 600 .95rem/1 var(--text);
  text-decoration: none;
  padding: .4rem 0;
  border-bottom: 2px solid transparent;
}
.top nav a:hover { border-color: var(--magenta); }

/* ── Stage: screen + title card ───────────────────────── */
.stage { padding: 0 var(--gutter); }

.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: calc(100svh - 150px);
  width: 100%;
  margin-inline: auto;
  background: var(--screen);
  overflow: hidden;
  cursor: pointer;
}
.screen video, .screen iframe, .screen-film {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border: 0;
}
.screen.is-film { cursor: auto; }

/* Small pause/play control, bottom-left of the reel */
.cursor {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .8rem .45rem .6rem;
  border: 0; border-radius: 99px;
  background: rgba(28, 10, 22, .72); color: #fff;
  font: 600 .8rem/1 var(--text);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s;
}
.cursor:hover { background: var(--magenta); }
.cursor .ico { width: 10px; height: 10px; display: inline-block; flex: none; }
.cursor[data-state="playing"] .ico { border-left: 3px solid currentColor; border-right: 3px solid currentColor; width: 10px; }
.cursor[data-state="paused"] .ico { width: 0; height: 0; border-style: solid; border-width: 5.5px 0 5.5px 9px; border-color: transparent transparent transparent currentColor; }
.screen.is-film .cursor { display: none; }

/* Title slate shown when a film has no link yet */
.slate {
  height: 100%;
  display: grid; place-content: center; text-align: center; gap: .6rem;
  color: #fff; padding: 2rem;
}
.slate .s-client {
  font: 850 clamp(2.5rem, 8vw, 7rem)/.9 var(--display);
  font-variation-settings: "wdth" 70;
  letter-spacing: -.01em;
}
.slate .s-sub { font: 500 1rem/1.4 var(--text); opacity: .8; }

.nowplaying {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .7rem 0 0;
  font-size: .9rem; color: var(--ink-soft);
}
.np-k { color: var(--magenta); font-weight: 700; margin-right: .4rem; }
#nowTitle { color: var(--ink); font-weight: 600; }
.back {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}

.title-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--measure));
  align-items: end;
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 4rem);
  padding: clamp(2rem, 5vw, 4.5rem) 0 clamp(3rem, 7vw, 6rem);
}
.title-card h1 {
  font-family: var(--display);
  font-weight: 880;
  font-size: clamp(2rem, 8.4vw, 10rem);
  grid-column: 1 / -1;
  white-space: nowrap;
  line-height: .86;
  letter-spacing: -.015em;
}
.title-card h1 span { display: block; }
.title-card .l1 { font-variation-settings: "wdth" 62; }
.title-card .l2 { font-variation-settings: "wdth" 62; }
.lead {
  grid-column: 1; align-self: start;
  max-width: 30ch;
  font: 500 clamp(1.4rem, 2.3vw, 2rem)/1.3 var(--text);
  letter-spacing: -.01em;
  text-wrap: pretty;
}
.intro { grid-column: 2; align-self: start; max-width: var(--measure); display: grid; gap: 1.1rem; justify-items: start; }
.intro p { font-size: 1.0625rem; }
.shapes { list-style: none; margin: 0; padding: 0; display: grid; width: 100%; }
.shapes li { padding: .7rem 0; border-top: 1px solid var(--rule); }
.shapes li:last-child { border-bottom: 1px solid var(--rule); }
.shapes strong {
  font: 850 1.35rem/1 var(--display);
  font-variation-settings: "wdth" 72;
  color: var(--magenta);
  margin-right: .3rem;
}
.intro .btn { margin-top: .4rem; }

/* one orchestrated page-load moment: the headline rises out of the screen's edge */
@media (prefers-reduced-motion: no-preference) {
  .title-card h1 span { animation: rise .9s cubic-bezier(.2,.8,.2,1) both; }
  .title-card h1 .l2 { animation-delay: .12s; }
  @keyframes rise { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }
}

.btn {
  display: inline-block;
  background: var(--magenta); color: #fff;
  font: 700 1rem/1 var(--text);
  padding: 1rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
}
.btn:hover { background: var(--plum); }
.btn-ink { background: var(--ink); }
.btn-ink:hover { background: var(--paper); color: var(--ink); }

/* ── Section heads ────────────────────────────────────── */
.section-head, .concepts-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: .5rem 2rem;
  padding: 0 var(--gutter) 1.5rem;
}
.section-head h2, .concepts-head h2, .about h2 {
  font: 850 clamp(2rem, 4.4vw, 3.6rem)/.95 var(--display);
  font-variation-settings: "wdth" 80;
  letter-spacing: -.01em;
}
.section-head p { color: var(--ink-soft); }

.filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.filters button {
  border: 1.5px solid var(--ink); background: none; border-radius: 99px;
  padding: .4rem .85rem; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ── Films: a literal strip of film ───────────────────── */
.films { padding-bottom: clamp(4rem, 9vw, 8rem); }
.strip {
  --hole: 14px;
  background: var(--screen);
  position: relative;
  padding: 34px 0;
}
/* sprocket holes, top and bottom */
.strip::before, .strip::after {
  content: ""; position: absolute; left: 0; right: 0; height: 12px;
  background: repeating-linear-gradient(90deg, transparent 0 10px, var(--paper) 10px 26px, transparent 26px 36px);
  border-radius: 2px;
}
.strip::before { top: 11px; }
.strip::after { bottom: 11px; }

.frames {
  list-style: none; margin: 0; padding: 0 var(--gutter);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(240px, 30vw, 420px);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}
.frames li { scroll-snap-align: start; }
.frame {
  display: block; width: 100%; padding: 0; border: 0; cursor: pointer; text-align: left;
  background: none; color: #fff;
}
.frame-pic {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid; align-content: end;
  padding: 14px 16px;
  background: var(--tile, var(--plum));
  overflow: hidden;
}
.frame-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame-pic .f-client {
  position: relative;
  font: 850 clamp(1.6rem, 2.6vw, 2.4rem)/.92 var(--display);
  font-variation-settings: "wdth" 68;
  letter-spacing: -.005em;
}
.frame-pic:has(img) .f-client { text-shadow: 0 1px 14px rgba(0,0,0,.45); }
.frame-meta { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 2px 0; font-size: .85rem; color: #bdb3b9; }
.frame[aria-current="true"] .frame-pic { outline: 3px solid var(--yolk); outline-offset: -3px; }
.frame[aria-current="true"] .frame-meta span:last-child { color: var(--yolk); }
.frame:hover .frame-pic { filter: brightness(1.08); }

/* ── Concepts wall ────────────────────────────────────── */
.concepts { padding-bottom: clamp(4rem, 9vw, 8rem); }
.concepts-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; padding-bottom: 2.5rem; }
.concepts-head p { max-width: var(--measure); justify-self: end; color: var(--ink-soft); }

.wall {
  list-style: none; margin: 0; padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(8px, 1.6vw, 24px) clamp(8px, 1.6vw, 24px);
}
.wall li:first-child { grid-column: span 2; grid-row: span 2; }
.wall button {
  display: grid; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  grid-template-rows: 1fr auto; text-align: left;
}
.wall .pic { aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper); }
.wall li:first-child .pic { aspect-ratio: auto; height: 100%; }
.wall img { width: 100%; height: 100%; object-fit: contain; }
.wall .full img { object-fit: cover; }
.wall .cap { padding: .35rem 0 0; font-size: .9rem; color: var(--ink-soft); }
.wall button:hover .cap { color: var(--magenta); }

/* ── Manifesto ────────────────────────────────────────── */
.manifesto {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(3rem, 7vw, 6rem) var(--gutter) clamp(6rem, 12vw, 10rem);
  border-top: 1px solid var(--rule);
}
.tenet h2 {
  font: 850 clamp(2rem, 4vw, 3.4rem)/.95 var(--display);
  font-variation-settings: "wdth" 72;
  margin-bottom: 1.2rem;
}
.tenet:nth-child(2) h2 { color: var(--magenta); }
.tenet p { max-width: var(--measure); font-size: 1.125rem; }

/* ── Brief: the only loud colour field on the page ────── */
.brief {
  position: relative;
  background: var(--magenta);
  color: #fff;
  padding: 0 var(--gutter) clamp(4rem, 8vw, 7rem);
  isolation: isolate;
}
.drip {
  position: absolute; left: 0; top: calc(100% - 1px);
  width: 100%; height: clamp(50px, 7vw, 110px);
  fill: var(--magenta);
  z-index: 2;
}
/* film grain, only here */
.brief::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
.brief-inner { padding-top: clamp(4rem, 9vw, 8rem); max-width: 1400px; }
.brief h2 {
  font: 880 clamp(2.8rem, 7.4vw, 7.6rem)/.88 var(--display);
  font-variation-settings: "wdth" 64;
  letter-spacing: -.015em;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
.steps {
  list-style: none; margin: 0 0 clamp(2.5rem, 5vw, 4rem); padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem);
  counter-reset: step;
}
.steps li { counter-increment: step; border-top: 2px solid rgba(255,255,255,.55); padding-top: 1rem; }
.steps li::before {
  content: counter(step);
  display: block;
  font: 880 clamp(3rem, 5vw, 4.5rem)/1 var(--display);
  font-variation-settings: "wdth" 60;
  margin-bottom: .6rem;
}
.steps h3 { font: 700 1.25rem/1.2 var(--text); margin-bottom: .45rem; }
.steps p { max-width: 26rem; }
.brief-cta { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: center; }
.brief-cta p { opacity: .92; }

/* ── About ────────────────────────────────────────────── */
.about {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem;
  padding: clamp(7rem, 13vw, 11rem) var(--gutter) clamp(4rem, 8vw, 7rem);
}
.about h2 { align-self: start; position: sticky; top: 1.5rem; }
.about-copy { display: grid; gap: 1rem; max-width: var(--measure); }
.about-copy p { font-size: 1.0625rem; }
.about-copy .about-open {
  font: 850 clamp(1.6rem, 2.6vw, 2.2rem)/1.05 var(--display);
  font-variation-settings: "wdth" 72;
  margin-bottom: .4rem;
}
.about-copy .signoff { color: var(--ink-soft); font-style: italic; }
.about blockquote {
  margin: 1.2rem 0 0; padding: 1.2rem 0 0;
  border-top: 2px solid var(--magenta);
}
.about blockquote p {
  font: 850 clamp(1.5rem, 2.4vw, 2rem)/1.1 var(--display);
  font-variation-settings: "wdth" 66;
  color: var(--plum);
}

/* ── Footer ───────────────────────────────────────────── */
.foot {
  background: var(--ink); color: var(--paper);
  padding: clamp(3rem, 6vw, 5rem) var(--gutter) 2rem;
}
.foot-line {
  font: 880 clamp(2rem, 6vw, 5.5rem)/.9 var(--display);
  font-variation-settings: "wdth" 62;
  margin-bottom: 3rem;
  max-width: 14ch;
}
.foot-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem 2.5rem; font-size: .95rem; color: #cbbfc6; }
.foot-meta a { color: var(--paper); }

/* ── Lightbox ─────────────────────────────────────────── */
.lightbox {
  width: min(1200px, 94vw); max-height: 94vh; padding: 0; border: 0; background: var(--paper);
}
.lightbox::backdrop { background: rgba(28,10,22,.86); }
.lightbox figure { margin: 0; }
.lightbox img { width: 100%; max-height: 78vh; object-fit: contain; background: var(--paper); }
.lightbox figcaption { padding: .9rem 1.2rem 0; font: 850 1.6rem/1 var(--display); font-variation-settings: "wdth" 75; }
.lb-controls { display: flex; gap: .5rem; padding: 1rem 1.2rem 1.2rem; }
.lb-controls button {
  border: 1.5px solid var(--ink); background: none; border-radius: 99px; padding: .5rem 1rem; font-weight: 600; cursor: pointer;
}
.lb-controls #lbClose { margin-left: auto; background: var(--ink); color: var(--paper); }

/* ── Small screens ────────────────────────────────────── */
@media (max-width: 860px) {
  .top { flex-wrap: wrap; }
  .mark img { height: 40px; }
  .top nav { gap: 1rem; }
  .title-card, .concepts-head, .manifesto, .about { grid-template-columns: 1fr; }
  .intro, .lead { grid-column: 1; }
  .concepts-head p { justify-self: start; }
  .section-head { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .wall { grid-template-columns: 1fr 1fr; }
  .wall li:first-child { grid-row: auto; }
  .wall li:first-child .pic { aspect-ratio: 16 / 9; height: auto; }
  .frames { grid-auto-columns: 78vw; }
  .screen { max-height: none; }
}
@media (max-width: 520px) {
  .top nav a { font-size: .9rem; }
  .nowplaying { flex-direction: column; gap: .3rem; }
}

/* Films play inside their own frame; the playing one widens to two frames */
.frames li.is-playing { grid-column: span 2; }
.frame-player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.frame-player iframe, .frame-player .slate { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.frame-player .slate .s-client { font-size: clamp(2rem, 5vw, 4.5rem); }
.f-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  border: 0; border-radius: 99px; padding: .4rem .8rem;
  background: rgba(28,10,22,.72); color: #fff; font: 600 .8rem/1 var(--text); cursor: pointer;
}
.f-close:hover { background: var(--magenta); }
.f-play {
  position: absolute; top: 14px; right: 14px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.92);
}
.f-play::after {
  content: ""; position: absolute; left: 15px; top: 12px;
  border-style: solid; border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent var(--ink);
}
@media (max-width: 860px) { .frames li.is-playing { grid-column: auto; } }
