/* ============================================================
   Filippo Di Lorenzo — Portfolio
   Editorial minimal. Warm paper, warm ink. Helvetica, regular.
   ============================================================ */

:root {
  /* warm-tinted neutrals (OKLCH, never pure black/white) */
  --bg:        oklch(0.984 0.0035 83);
  --bg-2:      oklch(0.928 0.005 83);
  --ink:       oklch(0.205 0.006 70);
  --ink-soft:  oklch(0.435 0.006 72);
  --muted:     oklch(0.640 0.005 75);
  --line:      oklch(0.875 0.004 80);
  --paper-85:  oklch(0.984 0.0035 83 / 0.9);
  --disney-deep: oklch(0.205 0.058 264);

  --maxw: 1500px;
  --gutter: clamp(20px, 5vw, 80px);

  --font: "Helvetica Neue", "Helvetica", "Arial", system-ui, sans-serif;
  --script: "Snell Roundhand", "Apple Chancery", "Segoe Script", "Brush Script MT", cursive;

  /* fluid type scale */
  --fs-mega:  clamp(2.4rem, 7.4vw, 6rem);
  --fs-h1:    clamp(2rem, 5.4vw, 4.4rem);
  --fs-h2:    clamp(1.55rem, 3.2vw, 2.7rem);
  --fs-lead:  clamp(1.05rem, 1.6vw, 1.45rem);
  --fs-body:  clamp(1rem, 1.2vw, 1.15rem);
  --fs-small: 0.82rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);   /* ease-out-quint-ish */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--bg); }

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

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--gutter);
  color: var(--ink);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease), padding .4s var(--ease);
}
.nav.solid {
  background: var(--paper-85);
  border-bottom-color: var(--line);
  padding-block: 14px;
}
.nav__brand { font-size: 0.98rem; letter-spacing: 0; font-weight: 500; }
.nav__links { display: flex; gap: 30px; font-size: 0.95rem; }
.nav__links a { position: relative; padding-bottom: 3px; color: var(--ink-soft); transition: color .3s var(--ease); }
.nav__links a:hover { color: var(--ink); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Intro ---------- */
.intro { padding-top: clamp(128px, 24vh, 260px); padding-bottom: clamp(56px, 12vh, 140px); }
.intro__headline {
  font-size: var(--fs-mega); font-weight: 400; line-height: 1.12;
  letter-spacing: -0.025em; max-width: none;
}
.intro__headline .hl-line { display: block; }
.intro__row { display: grid; grid-template-columns: 1fr; gap: 26px; margin-top: clamp(42px, 9vh, 96px); }
.intro__bio { max-width: 46ch; font-size: var(--fs-lead); line-height: 1.45; color: var(--ink-soft); font-weight: 400; }
@media (min-width: 880px) {
  .intro__row { grid-template-columns: 53% minmax(0, 1fr); align-items: end; }
  .intro__bio { grid-column: 2; justify-self: start; max-width: 42ch; }
}

.section-label {
  font-size: var(--fs-small); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}

/* ---------- Calligraphy word swap ----------
   PNGs share one geometry: x-height = 1/5.9057 of box height, baseline at 68.28% from top.
   Two independent knobs:
     --ink-xh   : handwriting size (its x-height, in em of the type).
     --ink-base : baseline nudge — moves the hand onto the text baseline.
   The 1.873 factor (= (1 - 0.6828) * 5.9057) cancels the height change,
   so resizing with --ink-xh keeps the baseline fixed (no re-centering needed). */
.intro__headline { --ink-xh: 0.30em; --ink-base: 0.23em; }
/* per-word size override (1 = default). Thinker reads large by hand, so trim it. */
.ink-word { position: relative; display: inline-block; --ink-scale: 1; }
.ink-word--sm { --ink-scale: 0.8; }
/* start-align: pin the hand's left edge to the typeset word's left (for line-end words) */
.ink-word--start { --ink-left: 0; --ink-tx: 0px; }
.ink-word__t { display: inline-block; transition: opacity .4s var(--ease); }
.ink-word__s {
  position: absolute; left: var(--ink-left, 50%); bottom: 0;
  transform: translate(calc(var(--ink-tx, -50%) + var(--ink-x, 0px)), calc(1.873 * var(--ink-xh) * var(--ink-scale) - var(--ink-base)));
  opacity: 0; transition: opacity .4s var(--ease);
  pointer-events: none; white-space: nowrap; line-height: 1;
}
.ink-word__s img { height: calc(var(--ink-xh) * var(--ink-scale) * 5.9057); width: auto; max-width: none; display: block; }
.ink-word__s .fb { font-family: var(--script); font-weight: 400; font-style: normal; letter-spacing: 0; font-size: 0.9em; }
.ink-word:hover .ink-word__t { opacity: 0; }
.ink-word:hover .ink-word__s { opacity: 1; }

/* ---------- Projects index ---------- */
.index { padding-block: clamp(54px, 10vh, 120px); border-top: 1px solid var(--line); }
.index__title {
  font-size: var(--fs-h2); font-weight: 400; letter-spacing: -0.025em; line-height: 1;
  margin-bottom: clamp(34px, 6vh, 66px);
}
.index__cols { display: grid; grid-template-columns: 1fr; gap: clamp(30px, 4vw, 44px); }
@media (min-width: 1100px) { .index__cols { grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 2.6vw, 44px); align-items: start; } }
.index__cat {
  font-size: var(--fs-small); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; margin-bottom: clamp(16px, 2.4vh, 24px);
}
.index__list { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.index__item {
  font-size: clamp(0.9rem, 1.05vw, 1.12rem); font-weight: 400; letter-spacing: -0.014em;
  line-height: 1.3; color: var(--ink); white-space: nowrap;
}
a.index__item {
  text-decoration: underline; text-decoration-color: var(--line);
  text-decoration-thickness: 1px; text-underline-offset: 5px;
  transition: text-decoration-color .35s var(--ease), color .3s var(--ease);
}
a.index__item:hover { text-decoration-color: var(--ink); }
span.index__item { color: var(--ink-soft); }

/* ---------- Work grid ---------- */
.work { padding-block: clamp(48px, 9vh, 110px); }
.work__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: clamp(28px, 4vh, 52px); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(22px, 2.4vw, 40px) clamp(16px, 1.8vw, 30px); }
@media (max-width: 680px) { .grid { grid-template-columns: 1fr; } }

.card { display: block; }
.card__media { position: relative; overflow: hidden; background: var(--bg-2); aspect-ratio: 16 / 10; }
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s var(--ease), filter .6s var(--ease);
  filter: grayscale(6%);
}
.card:hover .card__media img { transform: scale(1.045); filter: grayscale(0%); }
.card__tag {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--paper-85); color: var(--ink-soft); padding: 6px 11px; border-radius: 100px;
}
.card__meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: 15px; gap: 16px; }
.card__title { font-size: clamp(1.1rem, 1.7vw, 1.5rem); font-weight: 400; letter-spacing: -0.015em; }
.card__sub { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.card--soon { cursor: default; }
.card--soon .card__media img { filter: grayscale(72%); opacity: .82; }

/* ---------- Case study ---------- */
.case-head { padding-top: clamp(132px, 21vh, 220px); padding-bottom: clamp(28px, 5vh, 56px); }
.case-head__brand { font-size: var(--fs-lead); color: var(--ink-soft); margin-bottom: 8px; }
.case-head__title { font-size: var(--fs-mega); font-weight: 400; line-height: 0.98; letter-spacing: -0.025em; }
.case-meta {
  display: grid; grid-template-columns: 1fr; gap: 22px;
  border-top: 1px solid var(--line); padding-top: 30px; margin-top: clamp(34px, 6vh, 70px);
}
.case-meta dl { display: flex; flex-direction: column; gap: 4px; }
.case-meta dt { font-size: var(--fs-small); letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.case-meta dd { font-size: 1.02rem; }
.case-meta__desc { color: var(--ink-soft); line-height: 1.5; max-width: 52ch; }
@media (min-width: 880px) {
  .case-meta { grid-template-columns: repeat(4, 1fr); align-items: start; gap: 32px; }
  .case-meta__desc { grid-column: 3 / 5; }
}

.bleed { margin-inline: calc(var(--gutter) * -1); }

/* Video poster / player */
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: oklch(0.16 0.006 70); cursor: pointer; }
.player img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), opacity .5s; }
.player:hover img { transform: scale(1.03); opacity: .9; }
.player__play {
  position: absolute; inset: 0; margin: auto; width: 84px; height: 84px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--bg); transition: transform .4s var(--ease);
}
.player:hover .player__play { transform: scale(1.08); }
.player__play svg { width: 25px; height: 25px; margin-left: 4px; fill: var(--ink); }
.player__label {
  position: absolute; left: 22px; bottom: 20px; color: var(--bg); z-index: 2;
  font-size: 0.78rem; letter-spacing: 0.13em; text-transform: uppercase;
  text-shadow: 0 1px 10px oklch(0 0 0 / 0.4);
}
/* Self-hosted inline video: fills the frame, overlay clears on play */
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: oklch(0.16 0.006 70); z-index: 3; }
.player.is-playing { cursor: default; }
.player.is-playing .player__play, .player.is-playing .player__label, .player.is-playing > img { opacity: 0; pointer-events: none; }

.section { padding-block: clamp(54px, 10vh, 130px); }
.split { display: grid; grid-template-columns: 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1.1fr 1fr; } }
.split__media img { width: 100%; }
.h2 { font-size: var(--fs-h2); font-weight: 400; letter-spacing: -0.02em; line-height: 1.04; margin-bottom: 22px; }
.prose { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-soft); max-width: 48ch; }
.prose em { font-style: italic; color: var(--ink); }

/* stills grid */
.stills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 760px) { .stills { grid-template-columns: repeat(4, 1fr); } }
.stills img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-2); }

/* pull quote */
.quote { text-align: center; padding-block: clamp(50px, 9vh, 120px); }
.quote p { font-size: clamp(1.5rem, 3.1vw, 2.6rem); font-weight: 400; line-height: 1.18; letter-spacing: -0.018em; max-width: 24ch; margin-inline: auto; }
.quote cite { display: block; margin-top: 26px; font-style: normal; font-size: 0.95rem; color: var(--muted); letter-spacing: 0.03em; }

/* comments */
.comments { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(14px, 2vw, 28px); }
@media (max-width: 680px) { .comments { grid-template-columns: 1fr; } }
.comments img { width: 100%; border: 1px solid var(--line); }

/* credits */
.credits { border-top: 1px solid var(--line); padding-top: clamp(34px, 5vh, 60px); }
.credits__grid { display: grid; grid-template-columns: 1fr; gap: 16px 32px; margin-top: 30px; }
@media (min-width: 620px) { .credits__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .credits__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 620px) {
  .credits__grid--team {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-flow: column;
    grid-template-rows: repeat(3, auto);
  }
}
.credit { display: flex; flex-direction: column; gap: 3px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.credit dt { font-size: var(--fs-small); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.credit dd { font-size: 1.02rem; }

/* next / back */
.next { padding-block: clamp(54px, 9vh, 120px); }
.next a { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.next__title { font-size: var(--fs-h1); font-weight: 400; letter-spacing: -0.02em; line-height: 1; transition: transform .5s var(--ease); }
.next a:hover .next__title { transform: translateX(14px); }
.next__arrow { font-size: clamp(2rem, 5vw, 4rem); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: clamp(40px, 7vh, 80px); }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 26px; align-items: flex-end; }
.footer__big { font-size: var(--fs-h2); font-weight: 400; letter-spacing: -0.02em; }
.footer__links { display: flex; gap: 22px; font-size: 0.95rem; }
.footer__links a { border-bottom: 1px solid transparent; transition: border-color .3s; padding-bottom: 1px; }
.footer__links a:hover { border-color: var(--ink); }
.footer__fine { color: var(--muted); font-size: var(--fs-small); margin-top: 32px; }

/* ---------- Award line (logo + text at half size) ---------- */
.award { text-align: center; padding-block: clamp(56px, 11vh, 130px); }
.award__stack { display: inline-flex; flex-direction: column; align-items: center; gap: clamp(12px, 2vh, 18px); }
.award__logo { height: clamp(17px, 2.3vw, 29px); width: auto; display: block; }
.award__rule { width: clamp(70px, 11vw, 140px); height: 1px; background: var(--line); }
.award__text { font-size: clamp(0.66rem, 1.3vw, 1.05rem); font-weight: 400; letter-spacing: -0.012em; color: var(--ink); }

/* ---------- Speeches (thinker cards) ---------- */
/* content-sized columns: media are sized explicitly (~30% larger), the small
   saying sits between them and the group stays centred. */
.speeches {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: center; gap: clamp(28px, 3.6vw, 64px);
  align-items: center; margin-inline: auto;
}
.speech { margin: 0; width: clamp(300px, 33vw, 500px); }
@media (max-width: 820px) {
  .speeches { grid-template-columns: 1fr; justify-items: center; gap: clamp(30px, 5vh, 52px); max-width: 560px; }
  .speech { width: 100%; max-width: 460px; }
}
@media (min-width: 821px) {
  .speeches .speech:first-of-type { transform: translateY(-40px); }
  .speeches .speech:last-of-type { transform: translateY(40px); }
}
/* Interstitial quote between the two voices — ~40% smaller than the display size. */
.saying--mid { font-size: clamp(0.9rem, 1.86vw, 1.56rem); line-height: 1.4; letter-spacing: -0.012em; max-width: none; padding-inline: clamp(10px, 2vw, 32px); }
.saying--mid .saying__line { white-space: nowrap; }
.speech__media {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  background: oklch(0.16 0.006 70);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px -18px oklch(0.205 0.006 70 / 0.5);
}
.speech__media video, .speech__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.speech__tag { position: absolute; top: 14px; left: 14px; z-index: 2; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; background: var(--paper-85); color: var(--ink-soft); padding: 5px 10px; border-radius: 100px; }
.speech__meta { display: flex; justify-content: center; align-items: baseline; margin-top: 16px; gap: 10px; }
.speech__name { font-size: 1.05rem; }
.speech__role { color: var(--muted); font-size: 0.85rem; letter-spacing: 0.04em; }

/* ---------- Zoom hover (elegant, light) ---------- */
.zoom { position: relative; overflow: hidden; background: oklch(0.16 0.006 70); }
.zoom img { display: block; width: 100%; transition: transform 0.95s var(--ease), filter 0.7s var(--ease); filter: grayscale(10%); }
.zoom:hover img { transform: scale(1.045); filter: grayscale(0%); }
.zoom::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.6s var(--ease); background: linear-gradient(to top, oklch(0.12 0.006 70 / 0.34), transparent 46%); }
.zoom:hover::after { opacity: 1; }
.zoom__cap { position: absolute; left: 18px; bottom: 15px; z-index: 2; color: var(--bg); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0; transform: translateY(9px); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease); }
.zoom:hover .zoom__cap { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .zoom img { transition: none; } .zoom:hover img { transform: none; }
  .zoom::after, .zoom__cap { transition: none; }
}

/* simple 2-up grid */
.duo { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(12px, 2vw, 26px); }
@media (max-width: 640px) { .duo { grid-template-columns: 1fr; } }

/* big paired quote */
.bigquote { font-size: clamp(1.7rem, 3.6vw, 3rem); font-weight: 400; line-height: 1.12; letter-spacing: -0.022em; }
.bigquote cite { display: block; margin-top: 22px; font-style: normal; font-size: 0.95rem; letter-spacing: 0.03em; color: var(--muted); }

/* ---------- Formats trio ---------- */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 26px); }
@media (max-width: 760px) { .trio { grid-template-columns: 1fr; } }
.trio figure { margin: 0; }
.trio__media { background: var(--bg-2); overflow: hidden; }
.trio__media img { width: 100%; display: block; }
.trio figcaption { margin-top: 12px; font-size: var(--fs-small); letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }

/* ---------- Cover (logo key-visual at the very top) ---------- */
.cover { padding-top: clamp(60px, 7.5vh, 92px); }
.cover img { width: 100%; max-height: 88vh; object-fit: cover; display: block; }
.case-head--after { padding-top: clamp(36px, 6vh, 76px); }

/* ---------- Native video block ---------- */
.vid { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; background: oklch(0.14 0.006 70); }
.vid video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Disney — social pills (full-bleed deep blue, crafted grid) ---------- */
.social {
  position: relative;
  background:
    radial-gradient(125% 85% at 50% 6%, oklch(0.31 0.085 268 / 0.6), transparent 58%),
    var(--disney-deep);
  color: oklch(0.95 0.012 260);
  padding-block: clamp(72px, 14vh, 184px);
  overflow: hidden;
}
.social .section-label { color: oklch(0.75 0.07 262); }

/* three up, two down — smaller tiles, centred last row, slightly tilted */
.pills {
  display: flex; flex-wrap: wrap;
  justify-content: center; align-items: flex-start;
  gap: clamp(32px, 4.5vw, 74px) clamp(20px, 3vw, 54px);
  margin-top: clamp(40px, 7vh, 78px);
}
.pill { margin: 0; flex: 0 0 auto; width: clamp(180px, 21vw, 300px); }
@media (max-width: 820px) { .pill { width: min(44vw, 300px); } }
@media (max-width: 600px) { .pills { gap: 30px 0; } .pill { width: min(84vw, 360px); } }
.pill__media {
  position: relative; aspect-ratio: 9 / 16; overflow: hidden;
  border-radius: 14px; background: oklch(0.17 0.05 264);
  transform: rotate(var(--tilt, 0deg));
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.06) inset,
    0 16px 28px -18px oklch(0.09 0.05 264 / 0.9),
    0 44px 72px -40px oklch(0.04 0.035 264 / 0.95);
  transition: transform .7s var(--ease), box-shadow .7s var(--ease);
}
.pill:nth-child(6n+1) { --tilt: -2.4deg; }
.pill:nth-child(6n+2) { --tilt: 1.5deg; }
.pill:nth-child(6n+3) { --tilt: -1.3deg; }
.pill:nth-child(6n+4) { --tilt: 2deg; }
.pill:nth-child(6n+5) { --tilt: -1.8deg; }
.pill:nth-child(6n+6) { --tilt: 1.2deg; }
.pill__media video, .pill__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (hover: hover) {
  .pill:hover .pill__media {
    transform: rotate(0deg) translateY(-6px) scale(1.012);
    box-shadow:
      0 1px 0 oklch(1 0 0 / 0.09) inset,
      0 26px 40px -20px oklch(0.09 0.05 264 / 0.95),
      0 64px 96px -46px oklch(0.03 0.03 264 / 1);
  }
}
/* straighten while the clip is actually playing, so native controls sit level */
.pill__media.is-live { transform: rotate(0deg); }
@media (prefers-reduced-motion: reduce) { .pill__media { transition: none; } }

/* ---------- IHA source-tree diagram ---------- */
.iha-wrap { width: 100%; }
@media (max-width: 760px) { .iha-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; } .iha { min-width: 720px; } }
.iha { width: 100%; height: auto; display: block; font-family: var(--font); }
.iha .n rect { fill: var(--ink); }
.iha .n text { fill: var(--bg); letter-spacing: 0.06em; font-weight: 500; }
.iha .n--thinker rect { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.iha .n--thinker text { fill: var(--ink); letter-spacing: 0.05em; }
.iha .e { stroke: var(--ink); fill: none; }
.iha .e--main { stroke-width: 1.6; }
.iha .e--thin { stroke-width: 0.7; opacity: 0.45; }
.iha .d { fill: var(--ink); }

.iha .n { opacity: 0; transition: opacity .6s var(--ease); }
.iha .e { transition: stroke-dashoffset .85s var(--ease); }
.iha .d { opacity: 0; transition: opacity .7s var(--ease); }
.iha.is-on .n { opacity: 1; }
.iha.is-on .e { stroke-dashoffset: 0 !important; }
.iha.is-on .d { opacity: 1; }
/* ---------- Word rain — a horizontal "matrix" of topic words ----------
   The voices dissolve into thousands of generated drafts: lanes of
   topic-grouped words streaming sideways, faster up front, fading at the edges. */
.iha-field { opacity: 0; transition: opacity 1.1s var(--ease); transition-delay: var(--field-delay, 3s); }
.iha.is-on .iha-field { opacity: 1; }
.iha .w { fill: var(--ink); font-family: var(--font); letter-spacing: 0.01em; opacity: var(--o, 0.5); }
.iha .lane-stream { transform: translateX(var(--from, 0)); will-change: transform; }
.iha.is-on .lane-stream { animation: iha-rain var(--dur, 10s) linear var(--adelay, 0s) infinite; }
.iha.is-on .w--glint { animation: iha-glint var(--gdur, 4s) ease-in-out var(--gdelay, 0s) infinite; }
@keyframes iha-rain { from { transform: translateX(var(--from, 0)); } to { transform: translateX(0); } }
@keyframes iha-glint { 0%, 88% { opacity: var(--o, 0.5); } 93% { opacity: 0.98; } 100% { opacity: var(--o, 0.5); } }

@media (prefers-reduced-motion: reduce) {
  .iha .n, .iha .d { opacity: 1; transition: none; }
  .iha-field { opacity: 1; transition: none; }
  .iha .lane-stream { transform: translateX(calc(var(--from, 0) / 2)); animation: none; }
  .iha .w--glint { animation: none; }
  .iha .e { stroke-dashoffset: 0 !important; transition: none; }
}

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; background: oklch(0.12 0.004 70 / 0.95); padding: clamp(16px, 5vw, 64px); place-items: center; }
.lightbox.open { display: grid; animation: fade .4s var(--ease); }
.lightbox__frame { position: relative; width: min(100%, 1400px); aspect-ratio: 16/9; }
.lightbox__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lightbox__close { position: absolute; top: -42px; right: 0; color: var(--bg); background: none; border: 0; font-size: 1.6rem; cursor: pointer; line-height: 1; padding: 6px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- The engine — note under the diagram ---------- */
.engine-note {
  margin-top: clamp(40px, 6vh, 76px);
  display: grid; grid-template-columns: 1fr; gap: clamp(18px, 3vw, 44px);
}
@media (min-width: 900px) {
  .engine-note { grid-template-columns: 1.05fr 1fr; align-items: start; column-gap: clamp(44px, 6vw, 96px); }
}
.engine-note__lead {
  font-size: var(--fs-h2); font-weight: 400; line-height: 1.08;
  letter-spacing: -0.02em; color: var(--ink); text-wrap: balance;
}
.engine-note__sub {
  font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-soft);
  max-width: 44ch; align-self: end;
}

/* ---------- Concept board ---------- */
.board { margin: 0; }
.board img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line);
}

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ink-word__t, .ink-word__s { transition: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 520px) {
  .nav { padding: 15px var(--gutter); }
  .nav__links { gap: 20px; }
}

/* ============================================================
   Eveleth Dot — display face for the "engine" module
   ============================================================ */
@font-face {
  font-family: "Eveleth Dot";
  src: url("../assets/fonts/eveleth-dot.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- Mangiare page: top-aligned split + more air ---------- */
.split--top { align-items: start; }
.pg-mangiare .section { padding-block: clamp(64px, 12vh, 152px); }
.pg-mangiare .quote { padding-block: clamp(64px, 11vh, 140px); }

/* ---------- Old-saying typewriter ---------- */
.saying {
  position: relative;
  text-align: center;
  font-family: var(--font);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: -0.018em;
  font-size: clamp(1.5rem, 3.1vw, 2.6rem);
  max-width: 26ch;
  margin-inline: auto;
}
.saying__line { display: block; }
.saying .ch { opacity: 0; }
.saying .ch.on { opacity: 1; }
.saying__caret {
  position: absolute; left: 0; top: 0;
  width: 0.6em; height: 0.6em;
  background: var(--ink);
  transform: translate(0, 0);
  animation: saying-blink 1.05s steps(1) infinite;
}
@keyframes saying-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .saying .ch { opacity: 1; }
  .saying__caret { display: none; }
}

/* ---------- The engine — cycling copy (full-bleed cream) ---------- */
.engine {
  --engine-bg: #efe4d0;
  --engine-ink: #ac152d;
  background: var(--engine-bg);
  color: var(--engine-ink);
  padding-block: clamp(120px, 22vh, 280px);
  overflow: hidden;
}
.engine__line {
  display: flex; justify-content: center; align-items: baseline;
  gap: 0.4em;
  font-family: "Eveleth Dot", "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.012em;
  line-height: 1; color: var(--engine-ink);
  font-size: clamp(1.4rem, 4.4vw, 3.4rem);   /* JS refines to fit one line */
}
.engine__win {
  position: relative; overflow: hidden; height: 1.24em;
}
.engine__reel--l .engine__win { text-align: right; }
.engine__reel--r .engine__win { text-align: left; }
.engine__sizer { visibility: hidden; white-space: nowrap; display: block; }
.engine__item {
  position: absolute; top: 0; white-space: nowrap; will-change: transform, opacity;
  transition: transform 0.72s var(--ease), opacity 0.5s var(--ease);
}
.engine__reel--l .engine__item { right: 0; }
.engine__reel--r .engine__item { left: 0; }
.ev-u { position: relative; }
.ev-u::after {
  content: ""; position: absolute; left: 50%; top: -0.04em;
  width: 0.2em; height: 0.07em; background: currentColor; border-radius: 1px;
  transform: translateX(-52%) rotate(22deg);
}
@media (prefers-reduced-motion: reduce) {
  .engine__item { transition: opacity 0.3s linear; }
}

/* ============================================================
   Birra Moretti — Come piace a noi
   ============================================================ */

/* ---------- Frames grid (click to enlarge) ---------- */
.frames { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(10px, 1.4vw, 18px); }
@media (min-width: 760px) { .frames { grid-template-columns: repeat(4, 1fr); } }
.frame {
  display: block; padding: 0; border: 0; margin: 0; cursor: zoom-in;
  position: relative; overflow: hidden; background: var(--bg-2);
  aspect-ratio: 16 / 9; width: 100%;
}
.frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.9s var(--ease), filter 0.6s var(--ease);
  filter: grayscale(8%);
}
.frame:hover img, .frame:focus-visible img { transform: scale(1.05); filter: grayscale(0%); }
.frame:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Image lightbox ---------- */
.imgbox {
  position: fixed; inset: 0; z-index: 120; display: none;
  background: oklch(0.12 0.004 70 / 0.94);
  padding: clamp(16px, 5vw, 64px); place-items: center;
}
.imgbox.open { display: grid; animation: imgbox-fade 0.35s var(--ease); }
.imgbox__img {
  max-width: min(100%, 1500px); max-height: 86vh; width: auto; height: auto;
  display: block; box-shadow: 0 30px 80px -30px oklch(0 0 0 / 0.7);
  animation: imgbox-pop 0.42s var(--ease);
}
.imgbox__close {
  position: absolute; top: clamp(14px, 3vw, 30px); right: clamp(16px, 3.5vw, 38px);
  width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  color: #fff; font-size: 1.9rem; line-height: 1; opacity: 0.9;
  display: grid; place-items: center;
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease);
}
.imgbox__close:hover { opacity: 1; transform: scale(1.12); }
@keyframes imgbox-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes imgbox-pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }

/* ---------- Social-proof collage ---------- */
.proof-wrap { padding-block: clamp(44px, 9vh, 120px); }
.proof { position: relative; max-width: 1280px; margin-inline: auto; }
.proof__card { margin: 0; }
.proof__card img {
  display: block; width: 100%; background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 20px 44px -28px oklch(0.205 0.006 70 / 0.55);
}
.proof__quote { text-align: center; }
.proof__quote p {
  font-size: clamp(1.35rem, 2.3vw, 2.05rem); font-weight: 400;
  line-height: 1.22; letter-spacing: -0.018em; text-wrap: balance;
}
.proof__quote cite {
  display: block; margin-top: 20px; font-style: normal;
  font-size: 0.9rem; color: var(--muted); letter-spacing: 0.02em;
}

/* entrance */
.proof__card { opacity: 0; transform: translateY(36px) rotate(0) scale(0.96); transition: opacity 0.85s var(--ease), transform 0.6s var(--ease), box-shadow 0.45s var(--ease); }
.proof__card.is-in { opacity: 1; transform: rotate(var(--r, 0deg)); }
.proof__quote { opacity: 0; transition: opacity 1s var(--ease) 0.1s; }
.proof__quote.is-in { opacity: 1; }
.proof__quote > * { transform: translateY(22px); transition: transform 1s var(--ease) 0.1s; }
.proof__quote.is-in > * { transform: none; }

/* hover: lift the comment screenshot +30% so it's readable */
@media (hover: hover) {
  .proof__card { cursor: zoom-in; }
  .proof__card.is-in:hover { transform: rotate(0deg) scale(1.3); z-index: 20; }
  .proof__card.is-in:hover img { box-shadow: 0 30px 60px -22px oklch(0.205 0.006 70 / 0.62); }
}

@media (min-width: 980px) {
  .proof { height: 940px; }
  .proof__card { position: absolute; }
  .proof__card--a     { top: 2%;  left: 1%;  width: 25%; }
  .proof__card--b     { top: 0;   right: 1%; width: 27%; }
  .proof__card--chart { top: 62%; left: 43%; width: 16.5%; }
  .proof__card--c     { top: 52%; left: 3%;  width: 22%; }
  .proof__card--d     { top: 57%; right: 2%; width: 25%; }
  .proof__quote { position: absolute; top: 32%; left: 50%; transform: translateX(-50%); width: min(800px, 62%); }
  .proof__quote > * { transition-delay: 0.1s; }
}
@media (max-width: 979px) {
  .proof { display: flex; flex-direction: column; align-items: center; gap: clamp(22px, 4vh, 34px); }
  .proof__quote { order: -1; max-width: 60ch; margin-bottom: 6px; }
  .proof__card { width: 100%; max-width: 420px; }
  .proof__card.is-in { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .proof__card { opacity: 1; transform: rotate(var(--r, 0deg)); transition: none; }
  .proof__quote { opacity: 1; transition: none; }
  .proof__quote > * { transform: none; transition: none; }
  .imgbox.open, .imgbox__img { animation: none; }
}

/* ---------- Credits — three explicit columns ---------- */
.credits__cols { display: grid; grid-template-columns: 1fr; gap: 16px 32px; margin-top: 30px; }
@media (min-width: 680px) { .credits__cols { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.credits__col { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Roomier intro — guided-scroll breathing room ---------- */
.pg-bm .case-head--after { padding-top: clamp(76px, 14vh, 180px); }
.pg-bm .case-head { padding-bottom: clamp(76px, 13vh, 164px); }
.pg-bm .intro-film { padding-bottom: clamp(24px, 5vh, 64px); }

/* ============================================================
   Disney+ — L'incanto del talento (page-specific air + radio)
   ============================================================ */
.pg-disney .case-head--after { padding-top: clamp(70px, 13vh, 168px); }
.pg-disney .case-head { padding-bottom: clamp(60px, 11vh, 140px); }
.pg-disney .section { padding-block: clamp(64px, 12vh, 150px); }

/* Radio player — one round button, visible track, playhead, time */
.radio { text-align: center; }
.radio__player {
  display: flex; align-items: center; gap: clamp(16px, 2vw, 22px);
  width: min(100%, 520px);
  margin: clamp(30px, 4.5vh, 52px) auto 0;
  padding: clamp(20px, 2.6vw, 30px) clamp(22px, 3vw, 36px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow:
    0 22px 46px -26px oklch(0.205 0.006 70 / 0.30),
    0 5px 14px -8px oklch(0.205 0.006 70 / 0.16);
  transform: rotate(-1.4deg);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
@media (hover: hover) {
  .radio__player:hover {
    transform: rotate(0deg) translateY(-3px);
    box-shadow:
      0 30px 58px -26px oklch(0.205 0.006 70 / 0.34),
      0 7px 18px -9px oklch(0.205 0.006 70 / 0.18);
  }
}
.radio__btn {
  flex: none; width: 54px; height: 54px;
  border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: var(--ink); position: relative;
  transition: transform .4s var(--ease);
}
.radio__btn:hover { transform: scale(1.06); }
.radio__btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.radio__btn svg {
  position: absolute; inset: 0; margin: auto;
  width: 20px; height: 20px; fill: var(--bg);
}
.radio__btn .radio__ico-play { transform: translateX(1.5px); }
.radio__btn .radio__ico-pause { display: none; }
.radio__player.is-playing .radio__btn .radio__ico-play { display: none; }
.radio__player.is-playing .radio__btn .radio__ico-pause { display: block; }
.radio__bar {
  position: relative; flex: 1 1 auto; height: 4px; border-radius: 4px;
  background: var(--line); cursor: pointer;
}
.radio__bar::before { content: ""; position: absolute; inset: -16px 0; }
.radio__fill {
  position: absolute; left: 0; top: 0; height: 100%; width: 0%;
  background: var(--ink); border-radius: 4px; transition: width .12s linear;
}
.radio__fill::after {
  content: ""; position: absolute; right: -6px; top: 50%;
  width: 12px; height: 12px; border-radius: 50%; background: var(--ink);
  transform: translateY(-50%);
}
.radio__time {
  flex: none; font-variant-numeric: tabular-nums; font-size: 0.9rem;
  color: var(--ink-soft); letter-spacing: 0.02em; min-width: 3.4ch; text-align: right;
}
@media (prefers-reduced-motion: reduce) {
  .radio__btn, .radio__fill, .radio__player { transition: none; }
  .radio__player { transform: rotate(-1.4deg); }
}

/* ============================================================
   Prada Reporter — page air + the "Reality / Truth" beat
   ============================================================ */

/* roomier intro, same guided-scroll breathing as the other pages */
.pg-prada .case-head--after { padding-top: clamp(72px, 13vh, 174px); }
.pg-prada .case-head { padding-bottom: clamp(56px, 10vh, 132px); }
.pg-prada .section { padding-block: clamp(60px, 11vh, 144px); }
.pg-prada .intro-film { padding-bottom: clamp(20px, 4vh, 56px); }

/* film caption: small label under the player heading */
.film-cap { color: var(--ink-soft); }

/* ---------- Veritas — a single dark cinematic beat for the quote ----------
   Isolated, centred, deep room. The light is borrowed from the film's blue
   projections; the two key words drift apart in a chromatic-aberration shimmer,
   as if reality and truth could never quite be held in the same frame. */
.veritas {
  position: relative; overflow: hidden; text-align: center;
  background: var(--bg);
  color: var(--ink);
}
.veritas .wrap { position: relative; z-index: 1; }
.veritas__quote {
  position: relative;
  font-size: clamp(2rem, 5.6vw, 4.4rem);
  font-weight: 400; line-height: 1.12; letter-spacing: -0.022em;
  max-width: 17ch; margin-inline: auto; text-wrap: balance;
}
.veritas__cite {
  display: block; margin-top: clamp(34px, 7vh, 64px);
  font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); font-style: normal;
}

/* ---------- Chromatic-aberration glitch on a single word ----------
   Two tinted ghosts (cyan + red) sit behind the crisp word and breathe a
   couple of pixels apart, screen-blending onto the dark room so they glow.
   --mx / --my (set by the pointer) shift the split; hovering a word pulls it
   further apart, then it settles. Amplitude scales with --gl-amp. */
.gl { position: relative; --gl-amp: 1; --mx: 0; --my: 0; }
.gl--inline { display: inline-block; }
.gl__t { position: relative; z-index: 1; }
.gl::before, .gl::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0; width: 100%; z-index: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.gl::before {
  color: oklch(0.72 0.15 215);
  animation: gl-cyan 2.4s var(--ease) infinite, gl-flicker 1.7s steps(1) infinite;
}
.gl::after {
  color: oklch(0.60 0.23 27);
  animation: gl-red 2.9s var(--ease) infinite, gl-flicker 2.1s steps(1) infinite -0.6s;
}
.gl:hover { --gl-amp: 2.4; }

@keyframes gl-cyan {
  0%, 100% { transform: translate(calc(var(--mx) * -9px + var(--gl-amp) * -2px), calc(var(--my) * -3px)); }
  20%      { transform: translate(calc(var(--mx) * -9px + var(--gl-amp) * -4px), calc(var(--my) * -3px + 2px)); }
  40%      { transform: translate(calc(var(--mx) * -9px + var(--gl-amp) * -2.5px), calc(var(--my) * -3px - 1px)); }
  55%      { transform: translate(calc(var(--mx) * -9px + var(--gl-amp) * -5.5px), 1px); }
  58%      { transform: translate(calc(var(--mx) * -9px + var(--gl-amp) * 2.5px), -2px); }
  76%      { transform: translate(calc(var(--mx) * -9px + var(--gl-amp) * -3px), calc(var(--my) * -3px + 1px)); }
  90%      { transform: translate(calc(var(--mx) * -9px + var(--gl-amp) * -2px), calc(var(--my) * -3px)); }
  93%      { transform: translate(calc(var(--mx) * -9px + var(--gl-amp) * -7.5px), -2px); }
  96%      { transform: translate(calc(var(--mx) * -9px + var(--gl-amp) * 3.5px), 2px); }
}
@keyframes gl-red {
  0%, 100% { transform: translate(calc(var(--mx) * 9px + var(--gl-amp) * 2px), calc(var(--my) * 3px)); }
  20%      { transform: translate(calc(var(--mx) * 9px + var(--gl-amp) * 4px), calc(var(--my) * 3px - 2px)); }
  40%      { transform: translate(calc(var(--mx) * 9px + var(--gl-amp) * 2.5px), calc(var(--my) * 3px + 1px)); }
  55%      { transform: translate(calc(var(--mx) * 9px + var(--gl-amp) * 5.5px), -1px); }
  58%      { transform: translate(calc(var(--mx) * 9px + var(--gl-amp) * -2.5px), 2px); }
  76%      { transform: translate(calc(var(--mx) * 9px + var(--gl-amp) * 3px), calc(var(--my) * 3px - 1px)); }
  90%      { transform: translate(calc(var(--mx) * 9px + var(--gl-amp) * 2px), calc(var(--my) * 3px)); }
  93%      { transform: translate(calc(var(--mx) * 9px + var(--gl-amp) * 7.5px), 2px); }
  96%      { transform: translate(calc(var(--mx) * 9px + var(--gl-amp) * -3.5px), -2px); }
}
@keyframes gl-flicker {
  0%, 100% { opacity: 0.92; }
  45% { opacity: 0.66; }
  50% { opacity: 1; }
  55% { opacity: 0.78; }
}

@media (prefers-reduced-motion: reduce) {
  .gl::before { transform: translate(-2px, 0); animation: none; }
  .gl::after  { transform: translate(2px, 0);  animation: none; }
  .gl:hover { --gl-amp: 1; }
}

/* ---------- Guided scroll: one scene per viewport ---------- */
html:has(.pg-prada) { scroll-snap-type: y proximity; scroll-padding-top: 0; }
.pg-prada main > section { scroll-snap-align: start; }
.pg-prada .scene {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-block: clamp(104px, 16vh, 220px);
}
.pg-prada .split { gap: clamp(34px, 6vw, 96px); }
.pg-prada .duo { gap: clamp(16px, 2.4vw, 34px); margin-top: clamp(30px, 6vh, 70px); }
.pg-prada .h2 { margin-bottom: clamp(20px, 3vh, 30px); }
@media (max-width: 820px) {
  html:has(.pg-prada) { scroll-snap-type: none; }
  .pg-prada .scene { min-height: auto; display: block; padding-block: clamp(70px, 12vh, 132px); }
}
