/* Fricecream brand page: hold to fry the landing (it heats to 180° and crunches), the label running, the story, a
   sticker wall that scatters from the pointer, a flavour wheel you drag round, a pinned dessert-physics run with a
   climbing thermometer, tubs after dark, street photos uncovered by a melting drip, merch, the marks, credits. */
:root {
  --purple: #5E3A74;
  --lilac: #B9A6C8;
  --gold: #D99A38;
  --mint: #0B2B2A;
  --cream: #F4ECE2;
  --ink: #1E1226;
  --display: 'Luckiest Guy', 'Rubik', system-ui, sans-serif;
  --body: 'Rubik', system-ui, sans-serif;
  --gut: max(clamp(16px, 4vw, 56px), (100vw - 1840px) / 2); /* content stops at 1840px on 27" and ultrawide screens */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.2, .9, .3, 1.5);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 17px/1.65 var(--body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, figure, ol { margin: 0; }
h1, h2, .sec { font-family: var(--display); font-weight: 400; line-height: .95; letter-spacing: .01em; text-transform: uppercase; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.wrap { padding-inline: var(--gut); }
.sec { font-size: clamp(44px, 7vw, 112px); color: var(--purple); margin-bottom: clamp(16px, 2.4vw, 30px); }
.kicker { font-weight: 800; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }

/* Bar */
.bar { position: fixed; inset: 0 0 auto; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px var(--gut); color: var(--ink); transition: background-color .3s, box-shadow .3s; }
.bar.solid { background: rgba(244, 236, 226, .94); backdrop-filter: blur(8px); box-shadow: 0 1px 0 rgba(30, 18, 38, .1); }
.bar-back { font-weight: 600; text-decoration: none; font-size: 15px; }
.bar-mark { font-family: var(--display); font-size: 24px; color: var(--purple); text-decoration: none; text-transform: uppercase; }
.bar-nav { justify-self: end; display: flex; gap: 22px; font-size: 15px; }
.bar-nav a { text-decoration: none; }
.bar-nav a:hover { color: var(--purple); }
@media (max-width: 760px) { .bar-nav { display: none; } .bar { grid-template-columns: 1fr auto; } .bar-mark { justify-self: end; } }

/* 1. Landing: --h (0 to 1) is the heat; main.js raises it while the button is held. */
.land { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; display: grid; place-items: center; align-content: center; gap: clamp(14px, 2.5vh, 24px);
  padding: 90px var(--gut) 40px; background: color-mix(in srgb, #C9B9D6, #F0A93C calc(var(--h, 0) * 100%)); transition: background-color .2s; }
.land::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: calc(1 - var(--h, 0));
  background: radial-gradient(circle at 20% 25%, rgba(255, 255, 255, .55), transparent 30%), radial-gradient(circle at 80% 70%, rgba(255, 255, 255, .4), transparent 34%); }
.land-logo { position: relative; z-index: 2; width: min(62vw, 46vh, 440px); user-select: none; filter: drop-shadow(0 20px 30px rgba(60, 20, 0, calc(.15 + var(--h, 0) * .3)));
  transform: translate(var(--sx, 0px), var(--sy, 0px)) rotate(var(--sr, 0deg)) scale(calc(1 + var(--h, 0) * .06)); animation: drop .9s var(--spring) both; }
@keyframes drop { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }
.land.done .land-logo { animation: crunch .5s var(--spring); }
@keyframes crunch { 30% { scale: 1.18 .86; } 60% { scale: .94 1.08; } }
.thermo { position: absolute; z-index: 2; right: clamp(16px, 5vw, 70px); top: 50%; translate: 0 -50%; width: 26px; height: min(46vh, 360px); border-radius: 20px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 3px var(--ink); }
.thermo i { position: absolute; left: 6px; right: 6px; bottom: 6px; border-radius: 14px; height: calc((100% - 12px) * (.08 + var(--h, 0) * .92)); background: linear-gradient(#E8562A, var(--gold)); }
.thermo b, .phys-thermo b { position: absolute; left: 50%; top: -38px; translate: -50% 0; font-family: var(--display); font-weight: 400; font-size: 26px; white-space: nowrap; }
.fry { position: relative; z-index: 3; min-height: 64px; padding: 0 34px; border: 3px solid var(--ink); border-radius: 999px; background: var(--purple); color: #fff; font-family: var(--display); font-size: clamp(22px, 2.4vw, 30px); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
  box-shadow: 0 6px 0 var(--ink); transition: transform .1s, box-shadow .1s, background-color .3s; }
.fry:active, .fry.on { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); background: #E8562A; }
.fry-say { position: relative; z-index: 3; font-weight: 800; font-size: clamp(16px, 1.6vw, 20px); text-align: center; min-height: 1.6em; }
.land.done .fry-say { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 4vw, 54px); color: var(--ink); animation: pop .5s var(--spring); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.bubbles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.bubble { position: absolute; bottom: -30px; width: var(--s); height: var(--s); border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .25); animation: rise var(--t) ease-in forwards; }
@keyframes rise { to { transform: translate(var(--dx), calc(-100vh - 40px)) scale(.4); opacity: 0; } }
.crumb { position: absolute; z-index: 4; width: 14px; height: 14px; border-radius: 40% 60% 50% 45%; background: radial-gradient(circle at 35% 35%, #F7C866, #B8701E 75%); pointer-events: none; animation: fly .9s ease-out forwards; }
@keyframes fly { to { transform: translate(var(--fx), var(--fy)) rotate(var(--fr)); opacity: 0; } }
@media (max-width: 760px) { .thermo { right: 12px; width: 20px; height: 34vh; } .thermo b { font-size: 20px; } }

/* 2. Label run */
.label-run { overflow: hidden; background: var(--purple); }
.label-track { display: flex; width: max-content; animation: run 40s linear infinite; }
.label-track img { height: clamp(110px, 16vw, 220px); width: auto; max-width: none; }
@keyframes run { to { transform: translateX(-33.333%); } }

/* 3. Story */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
/* page gutter on the outer (left) edge only: on ultrawide screens the full gutter on both sides was wider than this half column */
.story-text { padding: clamp(70px, 9vw, 140px) clamp(16px, 4vw, 56px) clamp(70px, 9vw, 140px) var(--gut); display: grid; align-content: center; gap: 20px; }
.story h1 { font-size: clamp(42px, 5vw, 86px); color: var(--purple); }
.story-text p:not(.kicker) { max-width: 46ch; font-size: clamp(16px, 1.25vw, 18px); }
.story-pic { overflow: hidden; min-height: 72vh; }
.story-pic img { width: 100%; height: 100%; object-fit: cover; transform: translateY(var(--py, 0px)) scale(1.12); }
@media (max-width: 860px) { .story { grid-template-columns: minmax(0, 1fr); } .story-pic { min-height: 54vh; order: -1; } }

/* 4. Sticker wall: main.js places the words; each is pushed away from the pointer (--px, --py). */
.wall { position: relative; height: clamp(520px, 80vh, 820px); overflow: hidden; background: #5C3B72; cursor: crosshair; touch-action: pan-y; }
.stickers { position: absolute; inset: -6%; }
.sticker { position: absolute; left: var(--x); top: var(--y); font-family: var(--display); font-size: var(--fs); line-height: 1; color: #7A5893; white-space: nowrap; user-select: none;
  text-shadow: 0 0 0 #452A57, 3px 3px 0 #452A57, -3px 3px 0 #452A57, 3px -3px 0 #452A57, -3px -3px 0 #452A57, 0 7px 0 #3A2349;
  transform: translate(var(--px, 0px), var(--py, 0px)) rotate(calc(var(--r) + var(--pr, 0deg))); will-change: transform; }
.sticker.hot { color: #F3E6FA; }
.wall-say { position: absolute; left: 50%; bottom: 22px; translate: -50% 0; z-index: 2; padding: 10px 20px; border-radius: 999px; background: var(--gold); color: var(--ink); font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; white-space: nowrap; }

/* 5. Flavours: the wheel; main.js places each tub on a circle seen from the front (--x, --s, z-index). */
.flavours { padding: clamp(80px, 10vw, 150px) 0 clamp(60px, 8vw, 110px); background: var(--flav, #7FB0B1); transition: background-color .6s var(--ease); overflow: hidden; }
.flavours .sec { color: var(--ink); }
.fl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px 32px; }
.fl-head p { max-width: 40ch; margin-bottom: clamp(24px, 4vw, 48px); font-weight: 600; }
.wheel { position: relative; height: clamp(320px, 46vw, 560px); cursor: grab; touch-action: pan-y; user-select: none; outline: none; }
.wheel.drag { cursor: grabbing; }
.wheel:focus-visible { outline: 3px solid var(--ink); outline-offset: -12px; }
.tub { position: absolute; left: 50%; top: 50%; width: clamp(150px, 22vw, 300px); pointer-events: none;
  transform: translate(-50%, -50%) translateX(var(--x, 0px)) scale(var(--s, 1)) rotate(var(--t, 0deg)); filter: drop-shadow(0 24px 22px rgba(30, 18, 38, .3)) brightness(var(--b, 1)); }
.wheel-ctrl { display: flex; justify-content: center; align-items: center; gap: 20px; }
.wbtn { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--ink); background: var(--cream); cursor: pointer; font-size: 22px; box-shadow: 0 4px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.wbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.flavour-name { font-family: var(--display); font-size: clamp(28px, 3.6vw, 48px); min-width: 7.5em; text-align: center; text-transform: uppercase; }

/* 6. Dessert physics: pinned; main.js sets --q (0 to 1) and which step is on. */
.physics { position: relative; height: 320vh; background: var(--ink); color: var(--cream); }
.phys-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(20px, 4vw, 60px); padding: 80px var(--gut) 30px; }
.physics .sec { color: var(--gold); }
.steps { list-style: none; padding: 0; display: grid; gap: clamp(10px, 2vh, 20px); }
.steps li { display: grid; gap: 2px; padding-left: 18px; border-left: 4px solid rgba(244, 236, 226, .15); opacity: .35; transform: translateX(-10px); transition: opacity .4s, transform .5s var(--spring), border-color .4s; }
.steps li.on { opacity: 1; transform: none; border-color: var(--gold); }
.steps b { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 2.4vw, 34px); text-transform: uppercase; }
.steps span { color: #D8CBE0; }
.phys-pics { position: relative; height: min(70vh, 620px); }
.pp { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 28px; opacity: 0; transform: scale(1.06) rotate(-2deg); transition: opacity .6s, transform .9s var(--ease); }
.pp.on { opacity: 1; transform: none; }
.phys-thermo { position: absolute; z-index: 2; right: -14px; top: 12%; bottom: 12%; width: 28px; border-radius: 20px; background: var(--cream); box-shadow: inset 0 0 0 3px var(--ink), 0 10px 20px rgba(0, 0, 0, .3); }
.phys-thermo i { position: absolute; left: 6px; right: 6px; bottom: 6px; border-radius: 14px; height: calc((100% - 12px) * (.08 + var(--q, 0) * .92)); background: linear-gradient(#E8562A, var(--gold)); }
.phys-thermo b { color: var(--gold); }
@media (max-width: 860px) {
  .phys-stage { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 18px; padding-top: 74px; }
  .physics .sec { font-size: 40px; margin-bottom: 8px; }
  .steps li { display: none; } .steps li.on { display: grid; }
  .phys-pics { height: 46vh; margin-right: 22px; }
}

/* 7. Dark */
.full { overflow: hidden; }
.full img { width: 100%; transform: translateY(var(--py, 0px)) scale(1.1); }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.duo figure { overflow: hidden; aspect-ratio: 1; }
.duo img { width: 100%; height: 100%; object-fit: cover; transform: translateY(var(--py, 0px)) scale(1.12); }
@media (max-width: 760px) { .duo { grid-template-columns: minmax(0, 1fr); } }

/* 8. Street: each photo has a cover in the page colour with a dripping lower edge; it melts away upward (--d, 0 to 1). */
.street { padding-top: clamp(80px, 10vw, 150px); }
.melt-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: clamp(170px, 19vw, 300px); }
.drip { position: relative; overflow: hidden; }
.drip img { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.1 - var(--d, 0) * .1)); }
.drip::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(100% + 90px); background: var(--cream); pointer-events: none;
  transform: translateY(calc(var(--d, 0) * -100% - var(--d, 0) * 10px));
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 89px) no-repeat, radial-gradient(22px 56px at 50% 0, #000 97%, #0000) bottom left / 80px 90px repeat-x, radial-gradient(14px 34px at 50% 0, #000 97%, #0000) 40px 100% / 80px 90px repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 89px) no-repeat, radial-gradient(22px 56px at 50% 0, #000 97%, #0000) bottom left / 80px 90px repeat-x, radial-gradient(14px 34px at 50% 0, #000 97%, #0000) 40px 100% / 80px 90px repeat-x; }
.d-a { grid-column: span 4; grid-row: span 2; }
.d-b { grid-column: span 2; grid-row: span 2; }
.d-c { grid-column: span 3; grid-row: span 2; }
.d-d { grid-column: span 3; }
.d-e { grid-column: span 3; }
@media (max-width: 760px) { .melt-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 64vw; } .melt-grid figure { grid-column: auto !important; grid-row: auto !important; } }

/* 9. Merch */
/* clipped sideways: the photos spring in a touch past full size, which for a moment made a 360 px phone's page scroll */
.merch { padding-top: clamp(80px, 10vw, 150px); overflow-x: clip; }
.merch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(220px, 26vw, 420px); }
.merch-grid figure { overflow: hidden; }
.merch-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.merch-grid figure:hover img { transform: scale(1.06) rotate(-1deg); }
.m-a { grid-row: span 2; }
.m-b { grid-column: span 2; }
.m-c { grid-column: span 2; }
.m-d { grid-column: 4; grid-row: 1 / span 2; }
.pop { opacity: 0; transform: translateY(40px) scale(.94); transition: opacity .8s ease calc(var(--i) * 90ms), transform .9s var(--spring) calc(var(--i) * 90ms); }
.pop.in { opacity: 1; transform: none; }
@media (max-width: 760px) { .merch-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 80vw; } .merch-grid figure { grid-column: auto !important; grid-row: auto !important; } }

/* 10. Marks */
.marks { padding-top: clamp(80px, 10vw, 150px); }
.band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.band-third { background: var(--bg); display: grid; place-items: center; padding: clamp(50px, 8vw, 120px) 10%; }
.wobble { width: min(80%, 300px); transition: transform .5s var(--spring); }
.wobble.wide { width: min(92%, 420px); }
.band-third:hover .wobble { animation: jelly .7s var(--spring); }
@keyframes jelly { 25% { transform: scale(1.12, .9); } 50% { transform: scale(.94, 1.08); } 75% { transform: scale(1.04, .97); } }
@media (max-width: 760px) { .band { grid-template-columns: minmax(0, 1fr); } }
.colours { display: flex; height: clamp(240px, 40vh, 420px); overflow: hidden; }
.sw { flex: 1; min-width: 0; background: var(--c); color: var(--t); display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(14px, 2vw, 26px);
  transform: translateY(70%); transition: transform 1s var(--spring), flex-grow .6s var(--ease); }
.colours.in .sw { transform: none; }
.sw:nth-child(2) { transition-delay: .08s, 0s; }
.sw:nth-child(3) { transition-delay: .16s, 0s; }
.sw:nth-child(4) { transition-delay: .24s, 0s; }
.sw:hover { flex-grow: 2.2; }
.sw b { font-family: var(--display); font-weight: 400; font-size: clamp(20px, 2vw, 32px); text-transform: uppercase; white-space: nowrap; }
.sw span { font-size: 13px; }
@media (max-width: 760px) { .colours { flex-direction: column; height: auto; } .sw { min-height: 96px; } }

/* 11. Credits */
.credits { background: var(--purple); color: #fff; padding-block: clamp(64px, 8vw, 120px); }
.credits-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; border-bottom: 1px solid rgba(255, 255, 255, .25); padding-bottom: clamp(40px, 6vw, 80px); }
.credits h3 { font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.outro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-top: clamp(40px, 6vw, 80px); }
.outro p { font-family: var(--display); font-size: clamp(36px, 4.8vw, 76px); line-height: .95; text-transform: uppercase; max-width: 14ch; }
.outro-links { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; min-height: 50px; padding: 0 26px; border-radius: 999px; background: var(--gold); color: var(--ink); text-decoration: none; font-weight: 800; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.ghost { background: transparent; color: #fff; border-color: #fff; box-shadow: 0 4px 0 #fff; }
@media (max-width: 760px) { .credits-grid { grid-template-columns: minmax(0, 1fr); } }

/* Motion: headings bounce up word by word; the rest fades up. */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.split .w > span { display: inline-block; transform: translateY(110%) rotate(8deg); transition: transform .8s var(--spring) calc(var(--k) * 70ms); }
.split.in .w > span { transform: none; }
.reveal { opacity: 0; transform: translate(-16px, 34px) rotate(2.5deg); transform-origin: 0 100%; transition: opacity .8s ease, transform .8s cubic-bezier(.65, 0, .35, 1); }
.reveal.in { opacity: 1; transform: none; }

/* Back to Grit Fox: the agency's own chip on every brand page. The fox blinks now and then, and tilts its head and
   glances back when you point at it. */
.bar-back.fox-back {
  justify-self: start; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 15px 0 12px;
  border-radius: 999px; background: #1A1A1A; color: #fff; border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  line-height: 1; text-decoration: none; white-space: nowrap; opacity: 1;
  transition: translate .3s cubic-bezier(.2, 1.4, .4, 1), box-shadow .3s;
}
.bar-back.fox-back:hover { color: #fff; text-decoration: none; opacity: 1; translate: -2px 0; box-shadow: 0 10px 24px rgba(0, 0, 0, .26); }
.bar-back.fox-back:focus-visible { outline: 3px solid #F0AC1D; outline-offset: 3px; }
.fox-back i { font-style: normal; font-weight: 400; font-size: 14px; color: #F0AC1D; transition: translate .3s cubic-bezier(.2, 1.4, .4, 1); }
.fox-back:hover i { translate: -3px 0; }
.fox-back .fx { width: 24px; height: 24px; flex: none; overflow: visible; }
.fox-back .fx-head { transform-box: view-box; transform-origin: 500px 430px; transition: rotate .5s cubic-bezier(.2, 1.6, .4, 1); }
.fox-back:hover .fx-head { rotate: -12deg; }
.fox-back .fx-iris { transition: translate .35s cubic-bezier(.2, .8, .2, 1); }
.fox-back:hover .fx-iris { translate: -24px 6px; }
.fox-back .fx-eye { transform-box: fill-box; transform-origin: center; animation: fxBlink 5.2s ease-in-out infinite; }
.fox-back:active .fx-eye { animation: none; scale: 1 .08; }
@keyframes fxBlink { 0%, 93%, 100% { scale: 1 1; } 96% { scale: 1 .08; } }
/* a wink when pointed at: it stays even with reduced motion, as it is tiny and only follows the pointer */
.fox-back:hover .fx-eye { animation: fxWink .34s ease-in-out; }
@keyframes fxWink { 0%, 100% { scale: 1 1; } 50% { scale: 1 .08; } }
@media (max-width: 760px) { .bar-back.fox-back { gap: 5px; padding: 0 11px 0 10px; } .fox-back span { display: none; } }
@media (prefers-reduced-motion: reduce) { .fox-back .fx-eye { animation: none; } }
