/* SEVN Café & Bakehaus brand page: seven sections, each one piece of packaging and one thing to do with it. The face of
   the pack (lines that part round the pointer), the croissant pouch (turn it over), a day at the table (drag the sun),
   the bakery boxes (a run along the counter), the seven seals (spin them), the cups (wave over the steam), the café
   (through the arch, then day to night: flip the switch). Cream and espresso, set in the brand's Conso. */
@font-face { font-family: 'Conso'; src: url(fonts/Conso-Light.ttf) format('truetype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Conso'; src: url(fonts/Conso-Regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Conso'; src: url(fonts/Conso-Medium.ttf) format('truetype'); font-weight: 500; font-display: swap; }
:root {
  --cream: #F2EEE5; /* the page, and the backdrop baked into every studio shot, so they melt into it */
  --brown: #31261C; /* the wordmark */
  --gut: max(clamp(16px, 4vw, 56px), (100vw - 1840px) / 2);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.2, 1.5, .4, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--cream); color: var(--brown); font: 400 17px/1.5 'Conso', 'Helvetica Neue', Arial, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
h2 { font-weight: 300; font-size: clamp(40px, 6.2vw, 108px); line-height: .98; letter-spacing: -.015em; }

/* Small capitals with a little wave in front, which flows */
.hint { display: inline-flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 500; line-height: 1; letter-spacing: .22em; text-transform: uppercase; }
.wv { width: 28px; height: 8px; flex: none; overflow: visible; }
.wv path { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-dasharray: 3 2.2; animation: wv 1.4s linear infinite; }
@keyframes wv { to { stroke-dashoffset: -10.4; } }

/* Headings rise line by line */
.rise .ln { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.rise .ln > span { display: block; transform: translateY(120%); transition: transform 1s var(--ease); }
.rise .ln:nth-child(2) > span { transition-delay: .08s; }
.rise .ln:nth-child(3) > span { transition-delay: .16s; }
.rise.in .ln > span { transform: none; }

/* Bar and the section count */
.bar { position: fixed; inset: 0 0 auto; z-index: 30; display: flex; padding: 14px var(--gut); pointer-events: none; }
.bar > * { pointer-events: auto; }
.count { position: fixed; z-index: 31; top: 26px; right: var(--gut); display: flex; gap: .55em; align-items: center; color: #fff; mix-blend-mode: difference;
  font-size: 12px; font-weight: 500; line-height: 1; letter-spacing: .2em; pointer-events: none; }
.count-win { display: block; height: 1.4em; overflow: hidden; }
.count-roll { display: block; transform: translateY(calc(var(--n, 0) * -1.4em)); transition: transform .7s var(--spring); }
.count-roll span { display: block; height: 1.4em; line-height: 1.4em; }

/* Pinned sections: each is taller than the screen, and its stage holds still while you scroll through it; the
   scroll drives what happens on the stage */
.pin { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 520px; overflow: hidden; }

/* 01. The face of the pack: scrolling lifts the name away and spreads the lines (--fp, 0 to 1) */
.face { height: 175vh; }
.face-logo { position: absolute; left: 50%; top: 38%; width: min(80vw, 1120px); translate: -50% calc(-50% - var(--fp, 0) * 26vh); scale: calc(1 - var(--fp, 0) * .3);
  opacity: calc(1 - var(--fp, 0) * 1.1); animation: print 1.3s .15s var(--ease) both; }
@keyframes print { from { clip-path: inset(0 0 100% 0); translate: -50% -40%; } to { clip-path: inset(0 0 -10% 0); } }
.waves { position: absolute; left: 0; width: 100%; overflow: visible; }
.waves path { fill: none; stroke: currentColor; stroke-width: 1.15; vector-effect: non-scaling-stroke; }
.face-waves { top: 56%; height: clamp(110px, 21vh, 230px); translate: 0 calc(var(--fp, 0) * -18vh); animation: draw 1.8s .5s cubic-bezier(.6, 0, .2, 1) both; }
@keyframes draw { from { clip-path: inset(-50% 100% -50% 0); } to { clip-path: inset(-50% 0 -50% 0); } }
.face-note, .face-cue { position: absolute; bottom: clamp(22px, 4vh, 40px); font-size: 11px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; animation: fade 1s 1.4s both;
  opacity: calc(1 - var(--fp, 0) * 3); }
.face-note { left: var(--gut); }
.face-cue { right: var(--gut); }
@keyframes fade { from { opacity: 0; } }

/* The photo scenes (02, 03, 04, 06): the café's own sunlit shots, full bleed, with the heading in cream over a soft
   shade at the top left and a small cream hint at the bottom right */
.scene { background: var(--brown); color: var(--cream); }
.scene::before, .counter-stage::before { content: ""; position: absolute; z-index: 2; inset: 0 auto auto 0; width: min(78vw, 980px); height: 62%; pointer-events: none;
  background: radial-gradient(120% 100% at 0 0, rgba(35, 24, 15, .62), rgba(35, 24, 15, .25) 45%, transparent 72%); }
.scene h2, .counter h2 { position: absolute; z-index: 3; left: var(--gut); top: clamp(84px, 13vh, 130px); font-size: clamp(34px, 4.2vw, 72px); color: var(--cream);
  text-shadow: 0 2px 30px rgba(35, 24, 15, .35); pointer-events: none; }
.scene-hint { position: absolute; z-index: 3; right: var(--gut); bottom: clamp(20px, 4.5vh, 44px); padding: 11px 16px; border-radius: 999px; background: var(--cream); color: var(--brown);
  opacity: calc(1 - var(--done, 0)); transition: opacity .4s; }
.scene-hint .wv { width: 22px; }

/* 02. The pouch: front and back are the same shot, the pouch turned, so the scroll crossfades between them (--t) with
   a slight squeeze (--sq), as a turning pouch narrows; the camera eases in a touch as it turns */
.pouch { height: 230vh; }
.turn { position: absolute; inset: 0; scale: calc(1.06 - var(--t, 0) * .06); }
.turn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; transform-origin: 50% 62%; -webkit-user-drag: none;
  transform: scaleX(var(--sq, 1)); }
.turn-back { opacity: var(--t, 0); }

/* 03. A day at SEVN: the scroll (or the sun, dragged round its arc) sets the hour, 7:00 to 21:00 (--t). The room is
   laid out at the photo's own shape and covers the stage, so the light drawn on it (in the photo's units) stays put on
   any screen: a cool morning (--cool), a pool of sun crossing the floor (--px, --py, --pool), the golden hour (--warm)
   and the night (--dark), when the lamps glow and the pointer carries a warm light (--hx, --hy, --hin). */
.day { height: 320vh; }
.day-room { position: absolute; left: 50%; top: 50%; width: max(100%, 100vh * 16 / 9); width: max(100%, 100svh * 16 / 9); aspect-ratio: 16 / 9; translate: -50% -50%; }
.day-room > * { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.day-img { object-fit: cover; scale: calc(1.06 - var(--t, 0) * .06);
  filter: brightness(calc(1.03 - var(--dark, 0) * .4)) saturate(calc(1 + var(--warm, 0) * .22 - var(--dark, 0) * .25)); }
.day-cool { background: #D6E4FF; mix-blend-mode: soft-light; opacity: calc(var(--cool, 0) * .5); }
.day-warm { background: linear-gradient(200deg, #FFB45E, #FF8B3D 60%, #E8743B); mix-blend-mode: soft-light; opacity: calc(var(--warm, 0) * .72); }
.day-pool { background: radial-gradient(ellipse 24% 18% at var(--px, 80%) var(--py, 74%), rgba(255, 238, 205, .6), transparent 70%); mix-blend-mode: screen; opacity: var(--pool, 0); }
.day-night { background: linear-gradient(180deg, #0B1330, #241A33 70%, #2B1C22); mix-blend-mode: multiply; opacity: calc(var(--dark, 0) * .78); }
.day-lamps { mix-blend-mode: screen; opacity: var(--dark, 0);
  background: radial-gradient(ellipse 30% 7% at 14% 27%, rgba(255, 190, 120, .6), transparent 70%), radial-gradient(ellipse 16% 9% at 6% 37%, rgba(255, 196, 130, .45), transparent 70%),
    radial-gradient(ellipse 13% 11% at 61% 59%, rgba(255, 196, 120, .55), transparent 70%), radial-gradient(ellipse 22% 8% at 67% 34%, rgba(255, 190, 120, .35), transparent 70%); }
.day-hand { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: calc(var(--dark, 0) * var(--hin, 0)); transition: opacity .4s;
  background: radial-gradient(circle 17vmax at var(--hx, -50%) var(--hy, -50%), rgba(255, 200, 140, .5), transparent 70%); }
.day-stage::after { content: ""; position: absolute; z-index: 2; inset: auto 0 0; height: 48%; pointer-events: none; background: linear-gradient(to top, rgba(28, 20, 13, .6), transparent); }

/* The sun dial: drag the sun round its arc (or tap the arc); the part of the day gone by is drawn in, and the hour and
   its moment read out under it. At night the sun is a moon. */
.dial { position: absolute; z-index: 3; left: 50%; bottom: clamp(16px, 3.5vh, 36px); width: min(460px, 88vw); aspect-ratio: 400 / 210; translate: -50% 0;
  color: var(--cream); touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.dial.dragging { cursor: grabbing; }
.dial-arc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial-track, .dial-done { fill: none; stroke: currentColor; vector-effect: non-scaling-stroke; }
.dial-track { stroke-width: 1.1; stroke-dasharray: 2 7; opacity: .7; }
.dial-done { stroke-width: 1.8; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--t, 0) * 100); }
.dial-tick { stroke: currentColor; stroke-width: 1.2; opacity: .75; vector-effect: non-scaling-stroke; }
.dial-sun { position: absolute; left: 5%; top: 95.24%; width: 46px; height: 46px; margin: -23px 0 0 -23px; overflow: hidden; border-radius: 50%; cursor: grab;
  background: radial-gradient(circle, #FFE9B5, #F7BA5C 60%, #E8903A); box-shadow: 0 0 0 6px rgba(255, 226, 172, .22), 0 0 34px 8px rgba(255, 190, 110, .55);
  transition: background-color .5s, box-shadow .5s, scale .3s var(--spring); }
.dial-sun:hover, .dial.dragging .dial-sun { scale: 1.12; }
.dial-sun:focus-visible { outline: 2px solid var(--cream); outline-offset: 8px; }
.dial-sun::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #2A2232; translate: 34% -22%; opacity: 0; transition: opacity .5s; }
.dial.night .dial-sun { background: var(--cream); box-shadow: 0 0 0 6px rgba(242, 238, 229, .14), 0 0 28px 6px rgba(242, 238, 229, .3); }
.dial.night .dial-sun::after { opacity: 1; }
.dial-read { position: absolute; left: 50%; bottom: 2%; translate: -50% 0; display: grid; justify-items: center; gap: 6px; text-align: center; pointer-events: none; }
.dial-time { font-size: clamp(30px, 3.2vw, 48px); font-weight: 300; line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.dial-moment, .dial-hint { font-size: 11px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; white-space: nowrap; }
.dial-moment.swap { animation: moment .55s var(--spring); }
@keyframes moment { from { translate: 0 8px; opacity: 0; } }
.dial-hint { opacity: .7; transition: opacity .4s; }
.dial.used .dial-hint { opacity: 0; }

/* 04. The counter: a sideways run of scenes while the section holds still; each photo drifts inside its frame */
.counter { position: relative; height: 400vh; }
.counter-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--brown); }
.counter-track { display: flex; height: 100%; width: max-content; will-change: transform; }
.treat { position: relative; flex: none; width: 100vw; height: 100%; overflow: hidden; }
.treat img { position: absolute; top: 0; left: -10%; width: 120%; height: 100%; max-width: none; object-fit: cover; translate: var(--px, 0px) 0; }
.treat figcaption { position: absolute; left: var(--gut); bottom: clamp(20px, 4.5vh, 44px); padding: 11px 18px; border-radius: 999px; background: var(--cream); color: var(--brown);
  font-size: 11px; font-weight: 500; line-height: 1; letter-spacing: .22em; text-transform: uppercase; white-space: nowrap; }

/* 05. The seals: the ring turns as you scroll, each seal coming round to the front in turn */
.seals { height: 360vh; background: var(--brown); color: var(--cream); }
.seals-stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: clamp(12px, 2.5vh, 28px); padding: clamp(90px, 13vh, 140px) var(--gut) clamp(32px, 6vh, 70px); }
.seals .sub { font-size: .42em; line-height: 1.3; margin-top: .5em; opacity: .7; }
.ring { position: relative; }
.seal { position: absolute; left: 50%; top: 52%; width: clamp(120px, 15vw, 230px); margin-left: calc(clamp(120px, 15vw, 230px) / -2); translate: 0 -50%; will-change: transform, opacity; }
.seal img { width: 100%; -webkit-user-drag: none; }
.seals-hint { justify-self: center; }
.ring-name { min-width: 15ch; text-align: right; }
.ring-at { font-weight: 500; letter-spacing: .1em; margin-left: 6px; padding-left: 14px; border-left: 1px solid currentColor; }

/* 06. The cups: the photo covers the stage at its own shape, so the steam (drawn in the photo's units) sits on the
   cups; the scroll leans in towards them (--pz) */
.pour { height: 210vh; }
.cups { position: absolute; left: 50%; top: 50%; width: max(100%, 177.7vh); width: max(100%, 177.7svh); aspect-ratio: 1672 / 941; translate: -50% -50%;
  transform-origin: 62% 42%; scale: calc(1 + var(--pz, 0) * .16); }
.cups img { width: 100%; height: 100%; }
.steam { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; filter: drop-shadow(0 0 2px rgba(49, 38, 28, .45)); }
.steam path { fill: none; stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.pour-seal { position: absolute; z-index: 3; right: var(--gut); top: clamp(80px, 12vh, 120px); width: clamp(70px, 6.5vw, 104px); rotate: var(--sr, 0deg); pointer-events: none;
  filter: drop-shadow(0 2px 12px rgba(35, 24, 15, .35)); }

/* 07. The café: through the arch by day, then night falls on the front. The front is the day render; dusk darkens it (--dusk), then the night render shows through the light of the name (--sign, which
   flickers on, --flick), the café inside (--inside) and the garden (--garden), and at last all of it (--night). */
.door { position: relative; height: 600vh; }
.door-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.door-photo { position: absolute; inset: 0; will-change: clip-path; }
/* on a phone the script makes this as wide as the front and moves it along (--fx) */
.door-pan { position: absolute; inset: 0; will-change: transform; }
.door-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.door-day { will-change: transform; filter: brightness(calc(1 - var(--dusk, 0) * .55)) saturate(calc(1 - var(--dusk, 0) * .45)); }
.door-dusk { position: absolute; inset: 0; opacity: var(--dusk, 0); background: linear-gradient(rgb(10 18 48 / .78), rgb(14 18 36 / .52) 45%, rgb(12 12 20 / .46)); }
.door-photo .glow { -webkit-mask: center / cover no-repeat; mask: center / cover no-repeat; }
.glow-sign { opacity: calc(var(--sign, 0) * var(--flick, 1)); -webkit-mask-image: url(img/night-sign.png); mask-image: url(img/night-sign.png); }
.glow-inside { opacity: var(--inside, 0); -webkit-mask-image: url(img/night-inside.png); mask-image: url(img/night-inside.png); }
.glow-garden { opacity: var(--garden, 0); -webkit-mask-image: url(img/night-garden.png); mask-image: url(img/night-garden.png); }
.door-night { opacity: var(--night, 0); }
.door-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.door-ring path { fill: none; stroke: none; }
.door-ring text { fill: var(--brown); font-size: 12px; font-weight: 500; letter-spacing: .32em; }
/* the switch, once the arch has opened: the sun slides across and turns into the moon (--n) */
.door-switch { position: absolute; z-index: 3; right: var(--gut); bottom: clamp(22px, 5vh, 48px); display: inline-flex; align-items: center; gap: 12px; padding: 8px 16px;
  border-radius: 999px; background: var(--cream); color: var(--brown); font-size: 11px; font-weight: 500; line-height: 1; letter-spacing: .22em; text-transform: uppercase;
  opacity: var(--show, 0); translate: 0 calc((1 - var(--show, 0)) * 14px); }
.door-switch i { position: relative; width: 52px; height: 28px; border-radius: 999px; background: color-mix(in srgb, #1B2240 calc(var(--n, 0) * 100%), #E8D3A6); }
.door-switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; translate: calc(var(--n, 0) * 24px) 0;
  background: color-mix(in srgb, #F2EEE5 calc(var(--n, 0) * 100%), #F4B23C);
  box-shadow: inset calc(var(--n, 0) * -7px) calc(var(--n, 0) * -3px) 0 0 color-mix(in srgb, #1B2240 calc(var(--n, 0) * 100%), #E8D3A6); }
.door-switch:hover i::after { scale: 1.08; }

/* The end */
.end { position: relative; display: grid; justify-items: center; gap: 28px; padding: clamp(110px, 18vh, 200px) var(--gut) clamp(48px, 8vh, 80px); background: var(--brown); color: var(--cream); text-align: center; overflow: hidden; }
.end-waves { top: 0; height: clamp(70px, 12vh, 120px); opacity: .5; }
.end-logo { width: min(76vw, 560px); }
.end-line { font-size: clamp(16px, 1.4vw, 19px); }
.end-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 26px; border-radius: 999px; border: 1px solid var(--cream); background: var(--cream); color: var(--brown);
  text-decoration: none; font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; transition: background-color .3s, color .3s; }
.pill span { transition: translate .3s var(--spring); }
.pill:hover span { translate: 4px 0; }
.pill.ghost { background: transparent; color: var(--cream); }
.pill:hover { background: transparent; color: var(--cream); }
.pill.ghost:hover { background: var(--cream); color: var(--brown); }

@media (max-width: 600px) {
  .face-logo { width: 86vw; top: 40%; }
  .face-waves { top: 55%; height: 110px; }
  .seal { width: 150px; margin-left: -75px; }
  /* on a phone the photos are cut to the middle: keep both standing cups in view */
  .cups { translate: -61% -50%; }
  /* the heading runs the width of a phone, so the cups' seal steps down below it */
  .pour-seal { top: calc(clamp(84px, 13vh, 130px) + 96px); }
  .scene-hint { right: 50%; translate: 50% 0; white-space: nowrap; }
  /* the day: keep the set table in the middle of the screen */
  .day-room { translate: -58% -50%; }
}
@media (prefers-reduced-motion: reduce) {
  .pour-seal, .wv path, .dial-moment.swap { animation: none; }
  .rise .ln > span { transition: 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; } }
