/* GRAILS Wrapped 2026, v2 (2026-12-04): flat colour slides, the GRAILS mascot, brand logos on white plates,
   agent icons and product photos. Each slide names a theme; the frame takes its colours from the slide on screen. */
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("/fonts/poppins-700.woff2") format("woff2"); }

:root {
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: 22px;
  --page: #0c0711;
}
.frame, .frame[data-theme="plum"] { --bg: #1a1022; --fg: #fcf4f9; --muted: #c3b2ce; --accent: #ff4f9d; --on-accent: #230a18; --line: rgba(255, 255, 255, 0.17); --disc: #2b1838; --card: #281736; }
.frame[data-theme="pink"] { --bg: #ff4f9d; --fg: #230a18; --muted: rgba(35, 10, 24, 0.76); --accent: #230a18; --on-accent: #fff5fa; --line: rgba(35, 10, 24, 0.24); --disc: #ff80b8; --card: rgba(255, 255, 255, 0.3); }
.frame[data-theme="cream"] { --bg: #f6eee2; --fg: #1f1127; --muted: #6c5972; --accent: #e0257f; --on-accent: #fff; --line: rgba(31, 17, 39, 0.17); --disc: #eadcc7; --card: #fffaf3; }
.frame[data-theme="wine"] { --bg: #4d1036; --fg: #fff2f8; --muted: #e6bdd2; --accent: #ff86bc; --on-accent: #230a18; --line: rgba(255, 255, 255, 0.2); --disc: #641848; --card: #5d1643; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--page); overflow: hidden; }
body { font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { font-family: inherit; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 8px; }

.stage { position: fixed; inset: 0; display: grid; place-items: center; touch-action: pan-y; }
.frame { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; container-type: inline-size; overflow: hidden; touch-action: pan-y; background: var(--bg); color: var(--fg); user-select: none; -webkit-user-select: none; transition: background-color 0.35s ease, color 0.35s ease; }

/* top: progress + wordmark */
.top { position: relative; z-index: 3; padding: calc(14px + env(safe-area-inset-top)) var(--pad) 0; flex: none; }
.progress { display: flex; gap: 4px; height: 4px; }
.progress i { flex: 1; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress i::after { content: ""; display: block; height: 100%; background: var(--fg); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease); }
.progress i.is-done::after { transform: scaleX(1); }
.top__row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.word { color: var(--accent); font-weight: 700; font-size: 21px; letter-spacing: 0.02em; text-decoration: none; line-height: 1; }
.count { color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.top__end { display: flex; align-items: center; gap: 12px; }
.close { width: 40px; height: 40px; margin: -8px -8px -8px 0; border-radius: 50%; border: 2px solid var(--line); color: var(--fg); display: grid; place-items: center; text-decoration: none; transition: border-color 0.2s; }
.close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
@media (hover: hover) { .close:hover { border-color: var(--fg); } }

/* slides */
.slides { position: relative; flex: 1; min-height: 0; }
.slide { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 18px var(--pad) 0; overflow: hidden auto; touch-action: pan-y; overscroll-behavior: contain; scrollbar-width: none; opacity: 0; visibility: hidden; transition: opacity 0.2s linear, visibility 0s linear 0.2s; }
.slide::-webkit-scrollbar { display: none; }
.slide.is-on { opacity: 1; visibility: visible; transition: opacity 0.25s linear; }
.slide__body { position: relative; z-index: 2; width: 100%; padding: 6px 0 20px; }
.slide--center .slide__body { margin: auto 0; }

.slide__body > * { opacity: 0; transform: translateY(16px); }
.slide.is-on .slide__body > * { opacity: 1; transform: none; transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms + 80ms); }

/* mascot art: a flat disc and the character, bottom right */
.art { position: absolute; right: 0; bottom: 0; width: 100%; height: 46%; pointer-events: none; z-index: 1; overflow: hidden; }
.art .disc { position: absolute; right: -16%; bottom: -34%; width: 82%; aspect-ratio: 1; border-radius: 50%; background: var(--disc); transform: scale(0.8); opacity: 0; transition: background-color 0.35s ease; }
.art img { position: absolute; right: 3%; bottom: -4%; height: 100%; width: auto; max-width: 72%; object-fit: contain; object-position: right bottom; opacity: 0; transform: translateY(46px); }
.slide.is-on .art .disc { transform: none; opacity: 1; transition: transform 0.7s var(--ease) 0.1s, opacity 0.4s linear 0.1s, background-color 0.35s ease; }
.slide.is-on .art img { opacity: 1; transform: none; transition: opacity 0.35s linear 0.2s, transform 0.75s var(--ease) 0.2s; }

.kicker { display: inline-flex; align-items: center; padding: 6px 13px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; margin-bottom: 16px; line-height: 1.3; }
.title { font-size: clamp(32px, 10cqw, 46px); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; }
.lead { color: var(--muted); font-size: 16px; font-weight: 500; margin-top: 12px; max-width: 26ch; }
.fine { color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 14px; }
.head { font-size: clamp(25px, 7.4cqw, 32px); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 4px; }

.year { font-size: min(40cqw, 180px); font-weight: 700; line-height: 0.86; letter-spacing: -0.05em; color: var(--on-accent); margin: 0 0 14px -0.05em; font-variant-numeric: tabular-nums; }

.big { font-weight: 700; line-height: 0.9; letter-spacing: -0.045em; font-size: min(clamp(108px, 44cqw, 196px), calc(138cqw / var(--len, 2))); font-variant-numeric: tabular-nums; margin-left: -0.04em; }
.big--mid { font-size: min(clamp(64px, 22cqw, 100px), calc(138cqw / var(--len, 2))); letter-spacing: -0.035em; line-height: 0.98; margin-left: -0.02em; }
.big--line { overflow-wrap: anywhere; font-size: clamp(40px, 13cqw, 58px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.04; margin-left: 0; }
.big--line a { text-decoration: none; }
.accent { color: var(--accent); }
.unit { font-size: clamp(20px, 6.2cqw, 26px); font-weight: 700; line-height: 1.2; margin-top: 10px; }
.say { font-size: clamp(16px, 4.8cqw, 19px); font-weight: 600; line-height: 1.35; margin-top: 12px; max-width: 22ch; }
.say b { color: var(--accent); }
.note { color: var(--muted); font-size: 13.5px; font-weight: 500; margin-top: 12px; max-width: 30ch; }
.slide--art .say, .slide--art .note, .slide--art .lead { max-width: 20ch; }

/* small facts */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; line-height: 1.3; }
.chip b { font-weight: 700; color: var(--accent); }
.slide--art .chips { max-width: 78%; }
.slide--dense .art { height: 37%; }
.slide--dense .chips { margin-top: 10px; }
.slide--dense .agent { margin-top: 12px; }

/* brand logos on white plates */
.plates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.pl { min-width: 0; }
.pl--hero { grid-column: 1 / -1; }
.plate { position: relative; display: grid; place-items: center; background: #fff; color: #1f1127; border-radius: 18px; aspect-ratio: 16 / 8.2; padding: 16px 20px; overflow: hidden; }
.pl--hero .plate { aspect-ratio: 16 / 7; padding: 20px 46px; border-radius: 22px; }
.plate img { position: absolute; left: 30px; right: 30px; top: 15px; bottom: 15px; width: calc(100% - 60px); height: calc(100% - 30px); object-fit: contain; }
.pl--hero .plate img { left: 52px; right: 52px; top: 22px; bottom: 22px; width: calc(100% - 104px); height: calc(100% - 44px); }
.plate__name { font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; text-align: center; line-height: 1.05; font-size: min(22px, calc(46cqw / var(--len, 6))); overflow-wrap: anywhere; }
.pl--hero .plate__name { font-size: min(44px, calc(104cqw / var(--len, 6))); }
.plate__n { position: absolute; left: 9px; top: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #1f1127; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.pl--hero .plate__n { background: #ff4f9d; color: #230a18; min-width: 28px; height: 28px; font-size: 14px; left: 12px; top: 12px; }
.pl__cap { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl--hero .pl__cap { font-size: clamp(22px, 6.6cqw, 28px); font-weight: 700; color: var(--fg); letter-spacing: -0.01em; margin-top: 8px; }
.plates .plate, .plates .pl__cap { opacity: 0; transform: scale(0.94); }
.slide.is-on .plates .plate, .slide.is-on .plates .pl__cap { opacity: 1; transform: none; transition: opacity 0.4s linear, transform 0.55s var(--ease); transition-delay: calc(var(--p, 0) * 80ms + 220ms); }

/* agents */
.agent { display: inline-flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 18px 10px 10px; border-radius: 20px; background: var(--card); border: 1.5px solid var(--line); max-width: 100%; }
.agent img, .agent .ico { width: 54px; height: 54px; border-radius: 14px; flex: none; }
.ico { display: grid; place-items: center; background: var(--fg); color: var(--bg); font-weight: 700; font-size: 20px; }
.agent .k { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }
.agent .v { display: block; font-size: 23px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.chip img, .chip .ico { width: 24px; height: 24px; border-radius: 7px; font-size: 11px; margin-left: -6px; flex: none; }

/* product photos */
.ph { display: block; position: relative; overflow: hidden; background: #e8dfe9; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph--none::after { content: "GRAILS"; position: absolute; inset: 0; display: grid; place-items: center; color: #b9a7c2; font-weight: 700; font-size: 11px; letter-spacing: 0.08em; }
.ph--none img { display: none; }
.rk { position: absolute; left: 6px; top: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #1f1127; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; line-height: 1; z-index: 1; }
.pieces { display: grid; gap: 8px; margin-top: 12px; }
.piece { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 14px 6px 6px; border-radius: 16px; background: var(--card); border: 1.5px solid var(--line); text-decoration: none; color: inherit; }
.piece .ph { width: 54px; height: 54px; border-radius: 10px; }
.piece .t { font-size: 14.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.piece .p { font-size: 14px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.piece--hero { grid-template-columns: 1fr; gap: 0; padding: 0; overflow: hidden; border-radius: 20px; }
.piece--hero .ph { width: 100%; height: auto; aspect-ratio: 16 / 8.6; border-radius: 0; }
.piece--hero .rk { background: #ff4f9d; color: #230a18; min-width: 28px; height: 28px; font-size: 14px; left: 10px; top: 10px; }
.piece--hero .tx { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 14px 10px; }
.piece--hero .t { font-size: 17px; font-weight: 700; }
.piece--hero .p { font-size: 16px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.tile { display: block; border-radius: 18px; overflow: hidden; background: var(--card); border: 1.5px solid var(--line); text-decoration: none; color: inherit; min-width: 0; }
.tile .ph { aspect-ratio: 1; }
.tile .tx { padding: 10px 12px 12px; }
.tile .tag { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.tile .t { font-size: 14px; font-weight: 600; line-height: 1.25; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .p { display: block; font-size: 15px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.duo--one { grid-template-columns: minmax(0, 0.62fr); }
.pieces > *, .duo > * { opacity: 0; transform: translateY(12px); }
.slide.is-on .pieces > *, .slide.is-on .duo > * { opacity: 1; transform: none; transition: opacity 0.4s linear, transform 0.55s var(--ease); transition-delay: calc(var(--p, 0) * 70ms + 200ms); }
@media (hover: hover) { a.piece:hover, a.tile:hover { border-color: var(--fg); } }

/* share bars with agent icons */
.bars { list-style: none; margin-top: 16px; display: grid; gap: 14px; }
.bars li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; }
.bars img, .bars .ico { width: 40px; height: 40px; border-radius: 11px; font-size: 15px; }
.bars .row { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; font-weight: 700; }
.bars .row span:last-child { font-variant-numeric: tabular-nums; }
.bars .track { height: 10px; border-radius: 10px; background: var(--line); margin-top: 6px; overflow: hidden; }
.bars .fill { height: 100%; border-radius: 10px; background: var(--fg); transform: scaleX(0); transform-origin: left; }
.bars li:first-child .fill { background: var(--accent); }
.slide.is-on .bars .fill { transform: scaleX(var(--w)); transition: transform 0.9s var(--ease) 0.35s; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px; border-radius: 999px; border: 2px solid transparent; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s; }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line); }
@media (hover: hover) { .btn--primary:hover { transform: translateY(-1px); } .btn--ghost:hover, .nav__back:hover { border-color: var(--fg); } .textbtn:hover { color: var(--fg); } }
.btn[disabled] { opacity: 0.6; cursor: default; }

/* share slide */
.slide--share .slide__body { display: flex; flex-direction: column; align-items: center; text-align: center; }
.card { display: block; width: auto; max-width: 100%; height: min(46vh, 430px); aspect-ratio: 9 / 16; border-radius: 20px; background: #ff4f9d; margin-bottom: 16px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); }
.slide--share .title { font-size: clamp(22px, 6.6cqw, 28px); }
.slide--share .actions { margin-top: 14px; justify-content: center; }
.textbtn { background: none; border: 0; color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 0 0; }
.agentline { margin-top: 14px; padding-top: 12px; border-top: 1.5px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 500; width: 100%; }
.agentline a { color: var(--fg); font-weight: 600; text-underline-offset: 3px; }

/* bottom nav */
.nav { position: relative; z-index: 3; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 10px var(--pad) calc(16px + env(safe-area-inset-bottom)); }
.nav__back { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); color: var(--fg); display: grid; place-items: center; cursor: pointer; transition: background-color 0.35s ease, border-color 0.2s; }
.nav__next { min-height: 48px; padding: 0 28px; border-radius: 999px; border: 0; background: var(--fg); color: var(--bg); font-size: 15px; font-weight: 700; cursor: pointer; transition: background-color 0.35s ease, color 0.35s ease; }
.nav button[disabled] { opacity: 0.35; cursor: default; }
.nav svg, .side svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.side, .keys { display: none; }

/* desktop: the story is a phone-shaped card on the dark page */
@media (min-width: 760px) and (min-height: 560px) {
  .stage { grid-template-columns: 1fr auto 1fr; column-gap: 28px; }
  .frame { width: 440px; height: min(860px, 100dvh - 64px); border-radius: 34px; grid-column: 2; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
  .side { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); background: transparent; color: #fcf4f9; cursor: pointer; }
  .side:hover { border-color: #fcf4f9; }
  .side[disabled] { opacity: 0.3; cursor: default; }
  .side--prev { grid-column: 1; justify-self: end; }
  .side--next { grid-column: 3; justify-self: start; }
  .keys { display: block; position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: #8d7b98; font-size: 12px; font-weight: 500; }
  .nav { display: none; }
  .top { padding-top: 22px; }
  :root { --pad: 28px; }
  .card { height: min(50vh, 440px); }
}

/* short screens: smaller numbers, smaller mascot */
@media (max-height: 720px) {
  .art { height: 40%; }
  .slide--dense .art { height: 31%; }
  .pieces > :nth-child(n+5) { display: none; }
  .piece--hero .ph { aspect-ratio: 16 / 6.6; }
  .big:not(.big--mid):not(.big--line) { font-size: min(clamp(84px, 32cqw, 132px), calc(138cqw / var(--len, 2))); }
  .year { font-size: min(30cqw, 124px); }
  .card { height: 38vh; }
}
@media (max-height: 600px) {
  .art { height: 34%; }
  .slide--dense .art { display: none; }
  .card { height: 32vh; }
}

@media (prefers-reduced-motion: reduce) {
  .frame, .slide, .slide.is-on, .progress i::after, .btn, .nav__back, .nav__next { transition: none; }
  .slide__body > *, .slide.is-on .slide__body > *, .plates .plate, .plates .pl__cap, .slide.is-on .plates .plate, .slide.is-on .plates .pl__cap,
  .pieces > *, .duo > *, .slide.is-on .pieces > *, .slide.is-on .duo > *,
  .art .disc, .art img, .slide.is-on .art .disc, .slide.is-on .art img { opacity: 1; transform: none; transition: none; }
  .bars .fill, .slide.is-on .bars .fill { transform: scaleX(var(--w)); transition: none; }
}
