/* RUH Café brand page, the packaging first: the name rising from the coffee's steam (scroll to breathe it in), the
   seal with the café's
   moments circling it (drag to turn them),
   the bakery boxes opening out of each other through the RUH mark, the three cups, to go, and a walk into
   the café itself. Cocoa, cream and milk; Cormorant Garamond with Jost. */
:root {
  --night: #23140E;
  --ink: #3B2219;
  --cocoa: #683D2D;
  --cream: #E7D8C3;
  --milk: #F4ECE0;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --body: 'Jost', system-ui, sans-serif;
  --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(--milk); color: var(--ink); font: 300 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, video { 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-family: var(--serif); font-weight: 500; font-size: clamp(46px, 7vw, 120px); line-height: .95; letter-spacing: -.015em; }
em { font-style: italic; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* small capitals after a short rule that breathes */
.hint { display: inline-flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 500; line-height: 1; letter-spacing: .24em; text-transform: uppercase; }
.hint i { width: 26px; height: 1px; background: currentColor; transform-origin: 0 50%; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scaleX(.4); } }

/* headings rise a line at a time */
.rise .ln { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.rise .ln > span { display: block; transform: translateY(120%); transition: transform 1.1s var(--ease); }
.rise .ln:nth-child(2) > span { transition-delay: .1s; }
.rise.in .ln > span { transform: none; }

/* bar, and the mark turning in the corner */
.bar { position: fixed; inset: 0 0 auto; z-index: 30; display: flex; padding: 14px var(--gut); pointer-events: none; }
.bar > * { pointer-events: auto; }
.spin-mark { position: fixed; z-index: 31; top: 14px; right: var(--gut); width: 38px; mix-blend-mode: difference; rotate: var(--spin, 0deg); pointer-events: none; }

/* 1. Aroma: the café photo in the dark, lit only round the cup (--sx, --sy, --srx, --sry; --dk is how dark the rest is,
   and --edge keeps the dark over the space above the photo while it rises into place). The steam is drawn on the canvas
   and gathers into the name, which then settles crisp (--solid); scrolling turns the name back to steam (--ev, --gone)
   as the café comes into the light. The script sets the name's size and place (--lw, --lx, --ly) and moves the photo. */
.hero { position: relative; height: 270vh; background: var(--night); }
.hero-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--night); }
.hero-photo { position: absolute; left: 0; top: 0; width: 1672px; height: 940px; max-width: none; transform-origin: 0 0; will-change: transform; pointer-events: none; }
.hero-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(var(--night) var(--edge, 0px), rgb(35 20 14 / 0) calc(var(--edge, 0px) + 160px)),
    radial-gradient(var(--srx, 30vw) var(--sry, 26vw) at var(--sx, 50%) var(--sy, 85%), rgb(35 20 14 / 0), rgb(35 20 14 / calc(var(--dk, 1) * .6)) 40%, rgb(35 20 14 / calc(var(--dk, 1) * .97)) 78%); }
/* the crisp name condenses out of a blur, and blurs away again as it turns back to steam */
.hero-logo { position: absolute; inset: 0; pointer-events: none; opacity: calc(var(--solid, 1) * (1 - var(--gone, 0)));
  filter: blur(calc((1 - var(--solid, 1) + var(--gone, 0)) * 16px)); }
.hero-logo::before { content: ''; position: absolute; inset: 0; background: var(--milk);
  -webkit-mask: url(img/wordmark-mask.png) no-repeat; mask: url(img/wordmark-mask.png) no-repeat;
  -webkit-mask-size: var(--lw, 56vw) auto; mask-size: var(--lw, 56vw) auto;
  -webkit-mask-position: var(--lx, 22vw) var(--ly, 12vh); mask-position: var(--lx, 22vw) var(--ly, 12vh); }
.hero-steam { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: blur(1.5px); }
.hero-line { position: absolute; left: 0; right: 0; top: var(--ty, 60%); text-align: center; font-family: var(--serif); font-size: clamp(22px, 2.4vw, 40px); line-height: 1.05;
  color: var(--cream); opacity: calc(var(--said, 1) - var(--ev, 0) * 5); translate: 0 calc((1 - var(--said, 1)) * 12px); pointer-events: none; }
.hero-hint { position: absolute; left: var(--gut); bottom: clamp(20px, 4vh, 40px); color: var(--cream); opacity: calc(var(--said, 1) - var(--ev, 0) * 6); }

/* 2. Ruh means soul: the seal at the centre and the café's moments circling it on a faint track; the script places each
   moment and sizes it (--sz), dims the ones at the back (--dim), and sizes the track (--rx, --ry) */
.soul { position: relative; height: 280vh; background: var(--night); color: var(--cream); }
.soul-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  background: radial-gradient(60% 55% at 50% 56%, rgba(104, 61, 45, .55), transparent 70%); }
.soul-stage.held { cursor: grabbing; }
.soul h2 { position: absolute; z-index: 40; left: var(--gut); top: clamp(84px, 12vh, 130px); color: var(--cream); pointer-events: none; }
.soul h2 em { color: #D7AE8E; }
.soul-seal { position: absolute; z-index: 10; left: 50%; top: 56%; width: min(36vh, 44vw); translate: -50% -50%; pointer-events: none; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .4)); }
.orbit { position: absolute; left: 50%; top: 56%; width: 0; height: 0; }
.orbit::before { content: ''; position: absolute; left: 0; top: 0; width: calc(var(--rx, 0px) * 2); height: calc(var(--ry, 0px) * 2); translate: -50% -50%;
  border: 1px solid rgba(231, 216, 195, .18); border-radius: 50%; pointer-events: none; }
.moon { position: absolute; left: 0; top: 0; width: var(--sz, 180px); height: var(--sz, 180px); margin: calc(var(--sz, 180px) / -2) 0 0 calc(var(--sz, 180px) / -2);
  border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 4px var(--cream), 0 18px 40px rgba(0, 0, 0, .45); will-change: transform; }
.moon img { width: 100%; height: 100%; object-fit: cover; filter: brightness(var(--dim, 1)); transition: scale .6s var(--spring); pointer-events: none; -webkit-user-drag: none; }
.moon:hover img { scale: 1.1; }
.soul-hint { position: absolute; z-index: 40; right: var(--gut); bottom: clamp(20px, 4vh, 40px); }

/* 3. The bakery: each box opens out of the one before through the RUH mark, which grows to fill the screen */
.bake-title { padding: clamp(40px, 8vh, 100px) var(--gut) clamp(40px, 7vh, 80px); color: var(--cocoa); }
.bake-run { position: relative; height: 420vh; }
.bake-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--night); }
.slide { position: absolute; inset: 0; }
.slide img { width: 100%; height: 100%; object-fit: cover; scale: calc(1.18 - var(--r, 1) * .18); }
.slide + .slide { -webkit-mask: url(img/mark-cocoa.png) center / var(--m, 0px) var(--m, 0px) no-repeat, radial-gradient(circle, #000 var(--c, 0px), transparent calc(var(--c, 0px) + 1px)) center / 100% 100% no-repeat;
  mask: url(img/mark-cocoa.png) center / var(--m, 0px) var(--m, 0px) no-repeat, radial-gradient(circle, #000 var(--c, 0px), transparent calc(var(--c, 0px) + 1px)) center / 100% 100% no-repeat; }
.slide figcaption, .half figcaption {
  position: absolute; left: var(--gut); bottom: clamp(20px, 4vh, 40px); display: inline-flex; align-items: center; gap: 12px; padding: 10px 18px; border-radius: 999px;
  background: var(--milk); color: var(--ink); font-size: 11px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; line-height: 1; }
.slide figcaption { opacity: var(--cap, 0); translate: 0 calc((1 - var(--cap, 0)) * 12px); }
.slide figcaption b { font-weight: 500; color: var(--cocoa); }

/* 4. The cups, stood on a sheet of butter paper */
.cups { display: grid; justify-items: center; gap: clamp(40px, 8vh, 90px); padding: clamp(90px, 14vh, 160px) var(--gut); text-align: center; color: var(--cocoa);
  background: var(--milk) url(img/butter-paper.jpg) center / cover no-repeat; }
.cup-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 3vw, 56px); width: min(100%, 1100px); align-items: end; }
.cup { display: grid; justify-items: center; gap: 18px; width: 100%; }
.cup img { width: 100%; filter: drop-shadow(0 34px 26px rgba(59, 34, 25, .22)); transition: transform .7s var(--spring), opacity .4s; animation: bob 5s ease-in-out infinite alternate; }
.cup-row li:nth-child(2) .cup img { animation-delay: -1.7s; }
.cup-row li:nth-child(3) .cup img { animation-delay: -3.4s; }
@keyframes bob { from { translate: 0 -1.2%; } to { translate: 0 1.2%; } }
.cup span { font-size: 12px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; opacity: 0; translate: 0 10px; transition: opacity .4s, translate .5s var(--ease); }
.cup:hover img, .cup:focus-visible img, .cup.on img { transform: translateY(-9%) rotate(-4deg) scale(1.03); }
.cup:hover span, .cup:focus-visible span, .cup.on span { opacity: 1; translate: 0 0; }
.cup-row:hover .cup:not(:hover) img { opacity: .55; }

/* 5. To go: the half you point at opens wider */
.togo { display: flex; height: 100vh; height: 100svh; background: var(--night); }
.half { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; transition: flex-grow .9s var(--ease); }
.togo:hover .half:hover, .half.on { flex-grow: 1.8; }
.half img { width: 100%; height: 100%; object-fit: cover; transition: scale 1.2s var(--ease); }
.half:hover img { scale: 1.04; }

/* 6. Come in: a walk from the front into the café. The front zooms on its door (--z, about --ox, --oy); the café
   opens out of the doorway in an arch and the seat out of the chairs in another (clip-paths set by the script), each
   coming forward as it opens (--zi, --zs); the whole view drifts with the pointer (--lx, --ly). On a phone each photo
   is framed on what matters in it (--fx). */
.walk { position: relative; height: 480vh; background: var(--night); }
.walk-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.walk-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(26, 14, 8, .62), rgba(26, 14, 8, 0) 46%); }
.walk-look { position: absolute; inset: 0; scale: 1.05; translate: var(--lx, 0px) var(--ly, 0px); }
.walk-look img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.walk-front { object-position: var(--fxf, 50%) 50%; transform-origin: var(--ox, 67%) var(--oy, 84%); scale: var(--z, 1); }
/* the room round each opening arch dims, to show the way */
.walk-dim { position: absolute; inset: 0; background: rgb(20 10 4 / .9); opacity: var(--dim1, 0); pointer-events: none; }
.walk-dim.two { opacity: var(--dim2, 0); }
.walk-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.walk-line path { fill: none; stroke: var(--cream); stroke-width: 2; opacity: var(--lo, 0); filter: drop-shadow(0 0 10px rgba(255, 236, 214, .7)); }
.walk-in, .walk-seat { position: absolute; inset: 0; opacity: 0; clip-path: inset(50%); }
.walk-in img { object-position: var(--fxi, 50%) 50%; transform-origin: 44% 50%; scale: var(--zi, 1.3); }
.walk-seat img { object-position: var(--fxs, 50%) 50%; transform-origin: 55% 60%; scale: var(--zs, 1.25); }
.walk-title, .walk-cap { position: absolute; z-index: 1; left: var(--gut); bottom: clamp(36px, 9vh, 100px); color: var(--cream); text-shadow: 0 2px 30px rgba(20, 10, 4, .45); }
.walk-title { opacity: var(--tt, 1); }
.walk-cap { left: auto; right: var(--gut); text-align: right; font-family: var(--serif); font-weight: 500; font-size: clamp(46px, 7vw, 120px); line-height: .95; opacity: var(--cap, 0); translate: 0 calc((1 - var(--cap, 0)) * 24px); }

/* The end */
.end { display: grid; justify-items: center; gap: 26px; padding: clamp(90px, 14vh, 160px) var(--gut) clamp(48px, 8vh, 80px); background: var(--night); color: var(--cream); text-align: center; }
.end-mark { width: 96px; animation: turn 26s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.end-line { font-family: var(--serif); font-size: clamp(26px, 2.6vw, 40px); line-height: 1.1; }
.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(--ink);
  text-decoration: none; font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; transition: background-color .3s, color .3s; }
.pill span { transition: translate .3s var(--spring); }
.pill:hover span { translate: 4px 0; }
.pill:hover { background: transparent; color: var(--cream); }
.pill.ghost { background: transparent; color: var(--cream); }
.pill.ghost:hover { background: var(--cream); color: var(--ink); }

@media (max-width: 860px) {
  .soul-seal { width: min(30vh, 46vw); }
  .togo { flex-direction: column; height: auto; }
  .half { flex: none; height: 82svh; }
  .cup span { opacity: 1; translate: 0 0; font-size: 10px; letter-spacing: .18em; }
}
@media (prefers-reduced-motion: reduce) {
  .hint i, .cup img, .end-mark { 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; } }
