/* ============================================================
   SEMIX — Site styles
   ============================================================ */

/* --- FONTS: PP Neue Montreal (local files in /fonts) --- */
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-Hairline.woff2') format('woff2');        font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-HairlineItalic.woff2') format('woff2');  font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-Light.woff2') format('woff2');           font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-LightItalic.woff2') format('woff2');     font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-Regular.woff2') format('woff2');         font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-Italic.woff2') format('woff2');          font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-Semibold.woff2') format('woff2');        font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-SemiboldItalic.woff2') format('woff2');  font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-Extrabold.woff2') format('woff2');       font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/PPNeueMontreal-ExtraboldItalic.woff2') format('woff2'); font-weight: 800; font-style: italic; font-display: swap; }

/* WB Sans (Wildberries corporate typeface) — Wildberries case headings only */
@font-face { font-family: 'WB Sans'; src: url('../fonts/WBSans-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

/* --- DESIGN TOKENS --- */
:root {
  /* Font. Available weights: 100, 300, 400, 600, 800 (+ italics) */
  --font-sans: 'PP Neue Montreal', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Type scale */
  --text-xs:   clamp(0.6875rem, 0.65rem + 0.2vw, 0.8125rem);  /* 11→13px */
  --text-sm:   clamp(0.8125rem, 0.75rem + 0.3vw, 0.9375rem);  /* 13→15px */
  --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);   /* 15→17px */
  --text-lg:   clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl:  clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing (4px base) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Layout */
  --header-h: 68px;
  --header-fade: 16px;   /* gradient continues this far below the header bar */

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-full: 9999px;

  /* Motion */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- LIGHT THEME (default) --- */
:root, [data-theme="light"] {
  --color-bg: #F5F4F0;
  --color-surface: #EEEDE8;
  --color-border: #D0CEC8;
  --color-text: #1A1A18;
  --color-text-muted: #6B6A66;
  --color-text-faint: #A8A7A3;
  --color-primary: #1A1A18;
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.05);
  --glass-fill: rgba(255, 255, 255, 0.55);
  --glass-fill-hover: rgba(255, 255, 255, 0.75);
  --glass-edge: rgba(0, 0, 0, 0.08);
  --glass-shine: rgba(255, 255, 255, 0.7);
}

/* --- DARK THEME (pure black / white, as in the Figma layouts) --- */
[data-theme="dark"] {
  --color-bg: #000000;
  --color-surface: #111111;
  --color-border: #2A2A2A;
  --color-text: #FFFFFF;
  --color-text-muted: #808080;   /* = white at 50% on black */
  --color-text-faint: #4D4D4D;
  --color-primary: #FFFFFF;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.4);
  --glass-fill: rgba(30, 30, 30, 0.45);
  --glass-fill-hover: rgba(60, 60, 60, 0.55);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --glass-shine: rgba(255, 255, 255, 0.08);
}

/* No-JS fallback: follow the system setting */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #000000;
    --color-surface: #111111;
    --color-border: #2A2A2A;
    --color-text: #FFFFFF;
    --color-text-muted: #808080;
    --color-text-faint: #4D4D4D;
    --color-primary: #FFFFFF;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.4);
    --glass-fill: rgba(30, 30, 30, 0.45);
    --glass-fill-hover: rgba(60, 60, 60, 0.55);
    --glass-edge: rgba(255, 255, 255, 0.14);
    --glass-shine: rgba(255, 255, 255, 0.08);
  }
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.3s var(--ease-out);
}

/* Soft edge: a plain gradient from the page colour (100%) to transparent (0%),
   extending below the bar so content fades out instead of being cut off. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 calc(-1 * var(--header-fade)) 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--color-bg) 0%, transparent 100%);
}

.site-header--hidden { transform: translateY(calc(-100% - var(--header-fade))); }

.site-logo {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity var(--transition-interactive);
}

.site-logo:hover { opacity: 0.6; }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.site-nav a {
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--color-text);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
}

.theme-toggle:hover { color: var(--color-text); }

/* --- MOBILE MENU --- */
.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

/* Full-screen menu on phones: big bold titles, like the Projects page */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--color-bg);
  flex-direction: column;
  justify-content: center;
  padding: var(--header-h) var(--space-4) calc(var(--space-16) + env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-out), visibility 0s linear 0.3s;
}

.mobile-nav.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s var(--ease-out);
}

.mobile-nav__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.mobile-nav__links a {
  font-size: clamp(2.5rem, 13vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-text);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.6s var(--ease-out);
}

.mobile-nav.open .mobile-nav__links a { opacity: 1; transform: none; }
.mobile-nav.open .mobile-nav__links a:nth-child(2) { transition-delay: 60ms; }
.mobile-nav__links a[aria-current] { color: var(--color-text-muted); }

.mobile-nav__foot {
  position: absolute;
  left: var(--space-4);
  right: var(--space-4);
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.mobile-nav__mail { color: var(--color-text-muted); }
.mobile-nav__foot .theme-toggle { width: 44px; height: 44px; margin-right: -10px; }

.menu-open, .menu-open body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .mobile-nav__links a { transform: none; transition: opacity 0.2s ease; }
}

@media (max-width: 768px) {
  .site-header { padding: 0 var(--space-4); }
  .site-nav { display: none; }
  .menu-toggle { display: flex; }
  .mobile-nav { display: flex; }
}

/* ============================================================
   HOME — gravity gallery
   ============================================================ */

.gravity-scene {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  padding-top: 80px;
  overflow-x: clip;     /* trims sideways only, so enlarged items near the bottom are not cut */
  overflow-y: visible;
}

.gravity-item {
  position: absolute;
  cursor: pointer;
  will-change: transform, opacity;
  transform-origin: center center;
}

/* The focused work after it has grown: still its own layer, but without the transform
   hint, so the browser redraws it at its enlarged size instead of stretching it
   (set by js/gravity.js) */
.gravity-item.gravity-item--sharp { will-change: opacity; }

.gravity-item:hover { z-index: 10; }

.gravity-item img,
.gravity-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.gravity-item-swatch {
  box-shadow: inset 0 0 0 1px oklch(0 0 0 / 0.08);
}

/* Phones: works can be dragged with a finger (js/gravity.js), so a touch on one must not
   scroll, zoom or open the image menu */
@media (max-width: 767.98px) {
  .gravity-item {
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

/* Caption on the focused item: a frosted-glass pill in its bottom-left corner.
   js/gravity.js puts this wrapper at the corner (inset 10px); the pill hangs above that
   point. A case link, custom text, or "Artwork".
   No opacity on this wrapper: it would stop the pill's blur from seeing the image. */
.focus-caption {
  position: absolute;
  z-index: 51;
  display: flex;
  justify-content: flex-start;
  white-space: nowrap;
  pointer-events: none;
  will-change: transform;   /* own layer: moving it never repaints the page */
}

.focus-caption__title {
  position: absolute;
  left: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.45em 0.75em;
  border-radius: 6px;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 0 0 1px var(--glass-edge), inset 0 1px 0 var(--glass-shine);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--color-text);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.45s var(--ease-out), background-color 0.2s ease;
}

.focus-caption.is-visible .focus-caption__title { opacity: 1; transform: none; }
.focus-caption.is-visible a { pointer-events: auto; }

/* No case to open: plain text on the image, no pill, so it doesn't look pressable */
.focus-caption__title--plain {
  /* same gap to the left edge and to the baseline: 16px at the 10px anchor */
  left: 6px;
  bottom: calc(6px - 0.22em);
  padding: 0;
  line-height: 1;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  color: #fff;
  cursor: default;
}
/* black on light images (js/gravity.js measures the corner) */
.focus-caption__title--plain.is-on-light { color: #000; }

/* A case: the pill is the link, with an arrow instead of an underline */
.focus-caption a::after {
  content: "\2192";
  display: inline-block;
  font-weight: 400;
  transition: transform 0.25s var(--ease-out);
}

.focus-caption a:hover { background: var(--glass-fill-hover); }
.focus-caption a:hover::after { transform: translateX(3px); }
.focus-caption a:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }

/* ============================================================
   PROJECTS — centered index
   ============================================================ */

.project-index {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--header-h) var(--space-4);
}

.project-index__list {
  list-style: none;
  text-align: center;
}

.project-index__list li { max-width: none; }

.project-index__link {
  display: inline-block;
  font-size: clamp(1rem, min(3.9vw, 3.75svh), 2.4rem);
  font-weight: 600;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--color-text);
  transition: opacity 0.3s var(--ease-out);
}

/* Hovering one project dims the others */
.project-index__list:has(.project-index__link:hover) .project-index__link:not(:hover) {
  opacity: 0.3;
}

/* Phones: the same size as PROJECTS / INFO in the menu */
@media (max-width: 768px) {
  .project-index__list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
  }

  .project-index__link {
    font-size: clamp(2.5rem, 13vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
  }
}

/* ============================================================
   INFO — split: intro and contact pinned on the left,
   experience and brands scroll on the right
   ============================================================ */

.info {
  --g: var(--space-6);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--g);
  padding-inline: var(--g);
}

.info ol, .info ul { list-style: none; }
.info li { max-width: none; }

.info__left {
  grid-column: 1 / span 6;
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + clamp(32px, 7vh, 96px)) 0 clamp(32px, 6vh, 64px);
}

.info__intro p {
  max-width: 17em;
  font-size: clamp(24px, 2.4vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

.info__intro p + p {
  margin-top: 0.7em;
  max-width: 24em;
  font-size: var(--text-lg);
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--color-text-muted);
}

.info__contact p { max-width: 24em; font-size: var(--text-base); color: var(--color-text-muted); }
.info__contact .info__mail { display: inline-block; margin-top: 10px; font-size: var(--text-xl); }

.info__right {
  grid-column: 8 / -1;
  padding: calc(var(--header-h) + clamp(32px, 7vh, 96px)) 0 clamp(120px, 14vw, 200px);
}

.info__section + .info__section { margin-top: clamp(64px, 9vw, 128px); }

.info__label { margin-bottom: 20px; font-size: var(--text-sm); font-weight: 400; color: var(--color-text-muted); }

.info__job { padding: 18px 0; border-top: 1px solid var(--color-border); }
.info__job:last-child { border-bottom: 1px solid var(--color-border); }
.info__co { font-size: var(--text-xl); line-height: 1.15; letter-spacing: -0.01em; }

.info__meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

.info__meta span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }

.info__brands {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px var(--g);
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
}

/* Links: companies open their sites in a new tab; the email opens the mail app */
.info__co a, .info__mail {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.2s var(--ease-out), text-decoration-thickness 0.2s var(--ease-out);
}

.info__co a { text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.info__co a:hover { text-decoration-color: currentColor; }
.info__mail { color: var(--color-text); overflow-wrap: anywhere; }
.info__mail:hover { text-decoration-thickness: 2px; }
.info a:focus-visible { outline: 2px solid var(--color-text); outline-offset: 3px; }

.nowrap { white-space: nowrap; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .info__left, .info__right { grid-column: 1 / -1; }
  .info__left { position: static; height: auto; gap: 48px; padding-bottom: 0; }
  .info__right { padding-top: 72px; }
}

@media (max-width: 720px) {
  .info { --g: var(--space-4); }
}

/* ============================================================
   CASE STUDY — shared by all project pages
   Desktop sizes are Figma px × --u, so a 1440px Figma frame
   scales as one piece on any desktop width.
   Per block: --mt = gap above it, --w = its width (Figma px).
   Per page:  --pt / --pb = top / bottom padding (Figma px).
   ============================================================ */

.case {
  --u: calc(min(100vw, 1920px) / 1440);
  width: calc(1300 * var(--u));
  margin-inline: auto;
  padding-top: max(calc(var(--pt, 85) * var(--u)), calc(var(--header-h) + var(--space-4)));
  padding-bottom: calc(var(--pb, 120) * var(--u));
}

.case > * { margin-top: calc(var(--mt, 0) * var(--u)); }

/* Logo */
.case-logo {
  color: var(--color-text);
  font-weight: 400;          /* the h1 text is screen-reader only; avoid loading a bold face */
  line-height: 0;
}

.case-logo svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Image / video + caption */
.case-media img,
.case-media video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--color-surface);
}

.case-media figcaption {
  max-width: none;
  font-size: max(11px, calc(15 * var(--u)));
  font-weight: 300;
  line-height: 2;            /* 30px caption box at 15px */
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  text-align: right;
}

/* Centered block of a given width (--w) */
.case-center {
  width: calc(var(--w) * var(--u));
  margin-inline: auto;
}

/* Text block: 871 × 300 box (or --w wide), text centred vertically, as in Figma */
.case-text {
  width: calc(var(--w, 871) * var(--u));
  min-height: calc(300 * var(--u));
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: max(15px, calc(25 * var(--u)));
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: justify;
}

.case-text p {
  max-width: none;
  text-wrap: balance;   /* Figma: balanced wrapping */
}


/* Two images side by side, pinned to the outer edges */
.case-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.case-row > .case-media { width: calc(var(--w) * var(--u)); }

/* 3 × 2 grid */
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: calc(72 * var(--u));
  row-gap: calc(74 * var(--u));
}

/* Credits */
.case-credits {
  width: max(calc(540 * var(--u)), 22em);
  max-width: 100%;
  margin-inline: auto;
  font-size: max(13px, calc(20.793 * var(--u)));
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
}

.case-credits span { display: block; }

/* Other projects, at the end of every case */
.case-projects {
  list-style: none;
  text-align: center;
}

.case-projects li { max-width: none; }

.case-projects a {
  display: inline-block;
  font-size: max(17px, calc(25 * var(--u)));
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--color-text);
  transition: opacity 0.3s var(--ease-out);
}

.case-projects a[aria-current] { color: var(--color-text-muted); }

.case-projects:has(a:hover) a:not(:hover) { opacity: 0.3; }

/* --- Phone: single column --- */
@media (max-width: 720px) {
  .case {
    width: auto;
    padding: calc(var(--header-h) + var(--space-6)) var(--space-4) var(--space-16);
  }

  .case > * { margin-top: max(var(--space-8), calc(var(--mt, 0) * 0.35px)); }
  .case > :first-child { margin-top: 0; }

  .case-center,
  .case-text { width: auto; }



  .case-text {
    min-height: 0;
    font-size: 15px;
    line-height: 1.42;
    text-align: justify;
    hyphens: auto;             /* keeps justified lines even in a narrow column */
  }

  .case-text p { text-wrap: pretty; }

  .case-media figcaption {
    font-size: 11px;
    line-height: 22px;
  }

  .case-row {
    flex-direction: column;
    gap: var(--space-6);
  }

  .case-row > .case-media { width: 100%; }

  .case-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: var(--space-3);
    row-gap: var(--space-4);
  }

  .case-credits {
    width: auto;
    font-size: 13px;
    line-height: 1.35;
  }

  .case-credits span { display: inline; }
}

/* ============================================================
   WILDBERRIES CASE — "Cinema" layout
   Giant chapter titles in WB Sans, two-column text,
   edge-to-edge looping videos, one pull quote.
   ============================================================ */

.wb {
  --u: calc(min(100vw, 1920px) / 1440);   /* shared unit, used by .case-projects */
  --g: clamp(16px, 2.8vw, 40px);           /* side gutter */
  --wb-display: 'WB Sans', var(--font-sans);
  padding: calc(var(--header-h) + var(--space-6)) 0 clamp(96px, 10vw, 160px);
  overflow-x: clip;
}

.wb-logo {
  padding-inline: var(--g);
  color: var(--color-text);
  font-weight: 400;          /* the h1 text is screen-reader only */
  line-height: 0;
}

.wb-logo svg { display: block; width: 100%; height: auto; }

.wb-intro {
  width: min(100% - 2 * var(--g), 52rem);
  margin: clamp(48px, 7vw, 112px) auto 0;
  font-size: clamp(20px, 1.9vw, 28px);
  line-height: 1.3;
  text-align: center;
}

.wb-intro p { max-width: none; text-wrap: balance; }

.wb-chapter { margin-top: clamp(120px, 16vw, 260px); }

.wb-title {
  padding-inline: var(--g);
  font-family: var(--wb-display);
  font-size: clamp(56px, 11.2vw, 200px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.wb-text {
  margin-top: clamp(32px, 4vw, 64px);
  padding-inline: var(--g);
  columns: 2;
  column-gap: clamp(24px, 3vw, 48px);
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.5;
}

.wb-text p { max-width: none; break-inside: avoid-column; }
.wb-text p + p { margin-top: 1em; }

.wb-video { margin-top: clamp(40px, 5vw, 80px); }

.wb-video video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--color-surface);
}

.wb-quote {
  max-width: 15ch;
  margin-top: clamp(96px, 12vw, 200px);
  padding-inline: var(--g);
  font-family: var(--wb-display);
  font-size: clamp(36px, 6.4vw, 112px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.wb-quote p { max-width: none; }

.wb-closing {
  width: min(100% - 2 * var(--g), 64rem);
  margin: clamp(120px, 16vw, 260px) auto 0;
  font-size: clamp(22px, 2.6vw, 40px);
  line-height: 1.2;
  text-align: center;
}

.wb-closing p { max-width: none; text-wrap: balance; }

.wb-projects { margin-top: clamp(96px, 12vw, 200px); }

@media (max-width: 820px) {
  .wb-text {
    columns: 1;
    text-align: justify;       /* phones: spread edge to edge, like the Noodome case */
    hyphens: auto;
  }

  .wb-text p { text-wrap: pretty; }
  .wb-quote { max-width: none; }
}

/* Phones only: calmer type and more room for the videos.
   Chapter titles stay clearly visible but sit below the logo in size,
   text is a little smaller and tighter, and chapters with a phone cut
   of the video show it in 4:5. */
@media (max-width: 720px) {
  .wb-intro {
    margin-top: 40px;
    font-size: 16px;
    line-height: 1.3;
  }

  .wb-chapter { margin-top: 96px; }

  .wb-title {
    font-size: 34px;
    line-height: 0.95;
    letter-spacing: -0.02em;
  }

  .wb-text {
    margin-top: 20px;
    font-size: 15px;
    line-height: 1.42;
  }

  .wb-text p + p { margin-top: 0.75em; }

  .wb-video { margin-top: 28px; }

  .wb-video video[data-poster-mobile] {
    aspect-ratio: 4 / 5;          /* the phone cut, reserved before the video loads */
    object-fit: cover;
  }

  .wb-quote {
    margin-top: 80px;
    font-size: 20px;
    line-height: 1.1;
    letter-spacing: -0.005em;
  }

  .wb-closing {
    margin-top: 96px;
    font-size: 17px;
    line-height: 1.25;
  }

  .wb-projects { margin-top: 80px; }
}
