/*
 * Bretzel — lab-hero-x.css (draft)
 * Shared by the three lab heroes: the 4K grid-paper sheet, the objects on
 * it (print, tape, stickers), marker lettering written on stroke by stroke,
 * tape buttons and hand-made buttons.
 */
:root {
  --ink: #151515;
  --orange: #FF8738;               /* the logo's orange: the brand's one orange */
  --hero: 'Archivo Black', system-ui, sans-serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --pad: clamp(20px, 4.2vw, 64px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--sans); color: var(--ink); background: #EFEBE3; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ════════════════════════════════════════
   THE SHEET — grid paper photographed from above, one fold
════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #EFEBE3 url('/assets/lab/img/lab/paper-2k.jpg') center / cover no-repeat;
}

@media (min-width: 1700px), (min-resolution: 2dppx) and (min-width: 1000px) {
  .hero { background-image: url('/assets/lab/img/lab/paper-4k.jpg'); }
}

/* one light over everything, and the grain of a photograph */
.hero::before,
.hero::after { content: ''; position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.hero::before { background: radial-gradient(ellipse 80% 70% at 40% 35%, rgba(255, 250, 240, 0.10), rgba(40, 30, 20, 0.14) 100%); mix-blend-mode: multiply; }
.hero::after { background: url('/assets/lab/img/lab/grain.png'); background-size: 256px; opacity: 0.2; mix-blend-mode: overlay; }

/* ── the nav, printed on the sheet ── */
.nav {
  position: relative;
  z-index: 7;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px var(--pad);
}

.nav__links { display: flex; gap: 28px; font: 600 12px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.nav__links a { position: relative; }
.nav__links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 2px; background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease; }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__logo img { height: clamp(34px, 2.8vw, 42px); width: auto; filter: brightness(0); opacity: 0.92; mix-blend-mode: multiply; }
.nav__right { justify-self: end; display: flex; align-items: center; gap: 24px; font: 600 12px var(--sans); letter-spacing: 0.12em; }
.nav .btn-tape img { height: 38px; }
.nav .btn-hand img { height: 52px; }

/* ── a worksheet header (option B) ── */
.sheet-head {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  gap: 10px 24px;
  margin: clamp(4px, 1.5vh, 18px) var(--pad) 0;
  padding: 10px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font: 600 11px var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  mix-blend-mode: multiply;
}

.sheet-head b { margin-right: 8px; font-weight: 600; opacity: 0.5; }

/* ════════════════════════════════════════
   THE COPY — the line in marker, the subtitle, the buttons
════════════════════════════════════════ */
.copy { position: relative; z-index: 4; padding: clamp(20px, 5.5vh, 80px) var(--pad) 0; }
.headline { position: relative; max-width: 100%; }

/* lettering: a marker raster, revealed through its own stroke paths */
.hand { position: absolute; overflow: visible; mix-blend-mode: multiply; }
.hand path { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
.js .hand { visibility: hidden; }
.is-ready .hand { visibility: visible; }

.sub {
  max-width: 36ch;
  margin-top: clamp(18px, 3.4vh, 40px);
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.55;
  mix-blend-mode: multiply;
}

.sub strong { font-weight: 600; }

.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: clamp(18px, 3.4vh, 34px); }

/* buttons made of masking tape, labelled with a Sharpie */
.btn-tape {
  display: block;
  rotate: var(--r, 0deg);
  filter: drop-shadow(0 1px 1px rgba(30, 24, 18, 0.22)) drop-shadow(0 5px 8px rgba(30, 24, 18, 0.10));
  transition: translate 0.25s ease, rotate 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.btn-tape img { height: clamp(46px, 6vh, 66px); width: auto; }
.btn-tape:hover { translate: 0 -3px; rotate: calc(var(--r, 0deg) * -0.5); filter: drop-shadow(0 2px 2px rgba(30, 24, 18, 0.2)) drop-shadow(0 12px 16px rgba(30, 24, 18, 0.14)); }
.btn-tape:active { translate: 0 1px; filter: drop-shadow(0 1px 1px rgba(30, 24, 18, 0.25)); }

/* buttons made by hand: coloured in with a marker */
.btn-hand { display: block; }
.btn-hand img { height: clamp(56px, 7.6vh, 86px); width: auto; mix-blend-mode: multiply; transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.btn-hand:hover img { transform: rotate(-1.5deg) scale(1.04); }
.btn-hand:active img { transform: scale(0.98); }

.btn-tape:focus-visible,
.btn-hand:focus-visible { outline: 2px dashed var(--ink); outline-offset: 6px; border-radius: 6px; }

/* ════════════════════════════════════════
   THE OBJECTS — placed on a 16:9 "photo" that covers the hero
════════════════════════════════════════ */
.scene {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: max(100vw, 177.78svh);
  aspect-ratio: 16 / 9;
  translate: -50% -50%;
  pointer-events: none;
}

.obj {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: auto;
  rotate: var(--r, 0deg);
  filter: drop-shadow(0 1px 1px rgba(30, 24, 18, 0.34)) drop-shadow(0 10px 16px rgba(30, 24, 18, 0.18));
}

.obj.tape { z-index: 2; filter: drop-shadow(0 1px 1px rgba(30, 24, 18, 0.14)); }

/* ── entrances: things are put down on the sheet ── */
.drop  { transition: opacity 0.4s ease, translate 0.6s cubic-bezier(0.22, 1, 0.36, 1), scale 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.slap  { transition: opacity 0.18s ease, scale 0.36s cubic-bezier(0.3, 1.5, 0.5, 1), translate 0.36s cubic-bezier(0.3, 1.5, 0.5, 1); }
.fade  { transition: opacity 0.8s ease, translate 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.wipe  { transition: clip-path 0.75s cubic-bezier(0.6, 0, 0.3, 1); }
.tape  { transition: opacity 0.25s ease, scale 0.3s ease; }

.js .drop:not(.is-in) { opacity: 0; translate: 0 -16px; scale: 1.05; }
.js .slap:not(.is-in) { opacity: 0; scale: 1.14; translate: 0 -6px; }
.js .fade:not(.is-in) { opacity: 0; translate: 0 10px; }
.js .wipe:not(.is-in) { clip-path: inset(0 100% 0 0); }
.js .tape:not(.is-in) { opacity: 0; scale: 1.08; }

/* Bretzi's chat (bretzi.js): Bretzi on the sheet opens it, so the widget's own round button
   waits until that sticker has scrolled away */
html .bz { --bz-orange: #FF8738; }
.bz .bz-launch { transition: transform 0.2s ease, opacity 0.35s ease, scale 0.35s ease, visibility 0s linear 0s; }
.bz-on-sheet .bz:not(.is-open) .bz-launch { opacity: 0; scale: 0.6; pointer-events: none; visibility: hidden;
  transition: transform 0.2s ease, opacity 0.35s ease, scale 0.35s ease, visibility 0s linear 0.35s; }   /* hidden, so Tab skips it */

/* the hand-written bits come in two letters (NuestraLetra, Santi's); the page shows one */
.letter-sl .lt-nl, .letter-nl .lt-sl { display: none !important; }

/* ════════════════════════════════════════
   DRAFT ONLY — switch between the options, replay
════════════════════════════════════════ */
.switch {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(17, 17, 17, 0.92);
  font: 600 12px var(--sans);
  color: #fff;
}

.switch span { padding: 0 8px; color: rgba(255, 255, 255, 0.55); }
.switch a, .switch button { padding: 7px 12px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 99px; font: inherit; color: rgba(255, 255, 255, 0.85); background: none; cursor: pointer; }
.switch a[aria-current="page"] { background: var(--orange); border-color: var(--orange); color: #111; }

/* ════════════════════════════════════════
   SMALL SCREENS + MOTION
════════════════════════════════════════ */
@media (max-width: 900px) {
  .nav { grid-template-columns: auto 1fr; padding-top: 16px; }
  .nav__links, .nav__lang { display: none; }
  .nav__logo { grid-column: 1; }
  .sheet-head { grid-template-columns: auto auto; }
  .sheet-head span:nth-child(n+3) { display: none; }
  .scene { left: 0; top: 0; width: 100vw; height: 100%; aspect-ratio: auto; translate: 0 0; }
  .switch { left: 8px; right: 8px; bottom: 8px; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .drop, .slap, .fade, .wipe, .tape, .btn-tape, .btn-hand img { transition: none !important; }
}

/* nav words grow with the screen on large monitors (12px up to 1366px wide, then up to 16px at 1900px+) */
@media (min-width: 1367px) {
  .nav__links, .nav__right { font-size: clamp(12px, 0.84vw, 16px); }
  .nav__links { gap: clamp(28px, 2vw, 40px); }
}
