/* The Kachori Co. brand page: the halwai you tap for a kachori (with the campaign's lines counting up), the story, a
   stack of campaign posters you flick away, a sideways packaging run, two bottles you tap forward, the street, the
   marks and colours, credits. */
:root {
  --pink: #E4176A;
  --yellow: #F8B518;
  --teal: #1E97B1;
  --green: #47AE3F;
  --cream: #F6EACB;
  --red: #C8302C;
  --ink: #111111;
  --display: 'Anton', Impact, sans-serif;
  --body: 'Poppins', 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.45);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 300 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 { margin: 0; }
h1, h2, .sec { font-family: var(--display); font-weight: 400; line-height: .95; letter-spacing: .005em; text-transform: uppercase; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.wrap { padding-inline: var(--gut); }
.sec { font-size: clamp(44px, 7vw, 116px); color: var(--pink); margin-bottom: clamp(16px, 2.4vw, 30px); }
.label { font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--red); }

/* Bar */
.bar { position: fixed; inset: 0 0 auto; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px var(--gut); transition: background-color .3s, box-shadow .3s; }
.bar.solid { background: rgba(246, 234, 203, .94); backdrop-filter: blur(8px); box-shadow: 0 1px 0 rgba(17, 17, 17, .1); }
.bar-back { font-weight: 600; text-decoration: none; font-size: 15px; }
.bar-mark { font-family: var(--display); font-size: 20px; letter-spacing: .02em; text-decoration: none; text-transform: uppercase; color: var(--pink); }
.bar-nav { justify-self: end; display: flex; gap: 22px; font-size: 15px; font-weight: 400; }
.bar-nav a { text-decoration: none; }
.bar-nav a:hover { color: var(--pink); }
@media (max-width: 760px) { .bar-nav { display: none; } .bar { grid-template-columns: 1fr auto; } .bar-mark { justify-self: end; } }

/* 1. Landing */
.land { position: relative; min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; padding: clamp(80px, 12vh, 120px) var(--gut) clamp(24px, 5vh, 50px); overflow: hidden;
  background: radial-gradient(circle at 50% 62%, #FFF6DC 0, var(--cream) 46%, #F2DDA9 100%); }
.land-word { width: min(78vw, 560px); animation: drop .9s var(--spring) both; }
@keyframes drop { from { transform: translateY(-40px) rotate(-6deg); opacity: 0; } }
.halwai { all: unset; cursor: pointer; align-self: center; width: min(46vh, 70vw, 440px); transform-origin: 50% 100%; transform: rotate(var(--lean, 0deg)); transition: transform .3s var(--ease); touch-action: manipulation; }
.halwai img { width: 100%; user-select: none; pointer-events: none; filter: drop-shadow(0 26px 30px rgba(120, 60, 10, .25)); animation: sway 3.4s ease-in-out infinite alternate; }
@keyframes sway { from { rotate: -2deg; } to { rotate: 2deg; translate: 0 -6px; } }
.halwai.bite img { animation: bite .45s var(--spring); }
.halwai { perspective: 900px; }
.halwai.spin img { animation: spin .9s cubic-bezier(.65, 0, .35, 1); }
@keyframes spin { from { transform: rotateY(0deg); } 50% { transform: rotateY(180deg) scale(1.06); } to { transform: rotateY(360deg); } }
@keyframes bite { 30% { scale: 1.08 .9; } 60% { scale: .95 1.06; } 100% { scale: 1; } }
.halwai:focus-visible { outline-offset: 10px; border-radius: 30px; }
/* Short or narrow screens: keep the wordmark, the halwai and his counter all on the first screen. */
@media (max-width: 760px), (max-height: 720px) {
  .land { padding-top: 70px; gap: 6px; }
  .land-word { width: min(56vw, 18vh * 2.05, 420px); }
  .halwai { width: min(64vw, 34vh); }
  .count { min-height: 0; }
}
.count { display: grid; justify-items: center; gap: 4px; text-align: center; min-height: 92px; }
.count-n { font-family: var(--display); font-weight: 400; font-size: clamp(38px, 5vw, 64px); line-height: 1; color: var(--pink); }
.count-n.pop { animation: pop .4s var(--spring); }
@keyframes pop { 40% { transform: scale(1.5) rotate(-6deg); } }
.count-line { font-weight: 600; font-size: clamp(16px, 1.6vw, 22px); text-transform: uppercase; letter-spacing: .04em; }
/* A kachori flies up from his plate on each tap (main.js adds them). */
.crumb { position: absolute; z-index: 3; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #F7C15C, #C9781F 70%); box-shadow: 0 2px 0 rgba(0, 0, 0, .2); pointer-events: none; animation: fly .9s ease-out forwards; }
@keyframes fly { to { transform: translate(var(--fx), var(--fy)) rotate(var(--fr)); opacity: 0; } }

/* 2. Story */
.story { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: stretch; background: #fff; }
/* 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, 84px); color: var(--ink); }
.story-text p:not(.label) { max-width: 46ch; font-size: clamp(16px, 1.25vw, 18px); }
.story-pic { overflow: hidden; min-height: 70vh; }
.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: 52vh; order: -1; } }

/* 3. Campaign: the deck; main.js stacks the cards (--i is a card's place in the stack) and throws the top one. */
.campaign { background: var(--red); color: #fff; padding-block: clamp(90px, 11vw, 160px); overflow: hidden; }
.camp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 100px); align-items: center; }
.campaign .sec { color: #fff; }
.camp-copy p { max-width: 40ch; color: #FFE1D6; }
.camp-ctrl { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.cbtn { width: 52px; height: 52px; border-radius: 50%; border: 2px solid #fff; background: transparent; cursor: pointer; font-size: 20px; transition: background-color .2s, color .2s, transform .2s var(--spring); }
.cbtn:hover { background: #fff; color: var(--red); }
.cbtn:active { transform: scale(.9); }
.camp-n { font-family: var(--display); font-size: 24px; min-width: 56px; text-align: center; }
.deck { position: relative; justify-self: center; width: min(100%, 420px); aspect-ratio: 2 / 3; touch-action: pan-y; outline: none; }
.deck:focus-visible { outline: 3px solid var(--yellow); outline-offset: 10px; border-radius: 8px; }
.card { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; box-shadow: 0 24px 50px rgba(0, 0, 0, .35); user-select: none; cursor: grab; will-change: transform;
  transform: translate(calc(var(--i, 0) * 10px), calc(var(--i, 0) * -10px)) rotate(calc(var(--i, 0) * 3deg - 3deg)); transition: transform .5s var(--spring), opacity .3s; z-index: calc(20 - var(--i, 0)); }
.card.drag { transition: none; cursor: grabbing; }
.card.gone { opacity: 0; }
@media (max-width: 860px) { .camp-grid { grid-template-columns: minmax(0, 1fr); } .deck { width: min(78vw, 360px); } }

/* 4. Packaging: pinned; main.js sizes the section to the track and runs it sideways. */
.packs { position: relative; background: var(--cream); }
.packs-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: clamp(16px, 3vh, 34px); }
.packs-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 8px 30px; }
.packs .sec { margin: 0; }
.packs-head p { max-width: 36ch; }
.packs-track { display: flex; align-items: stretch; width: max-content; height: min(62vh, 560px); will-change: transform; }
.packs-track figure { flex: none; height: 100%; aspect-ratio: 3 / 2; overflow: hidden; }
.packs-track figure.tall { aspect-ratio: 2 / 3; }
.packs-track img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.packs-track figure:hover img { transform: scale(1.05); }

/* 5. Bottles: the section washes to the chosen bottle's colour (--wash). */
.bottles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(30px, 5vw, 90px); align-items: center; padding: clamp(90px, 11vw, 160px) var(--gut); background: var(--bg, var(--ink)); color: #fff; transition: background-color .6s var(--ease); overflow: hidden; }
.bottles h2 { font-size: clamp(46px, 6.4vw, 108px); color: var(--yellow); }
.bottles p { margin-top: 16px; color: #E9E0CC; }
.bottles-row { display: flex; justify-content: center; align-items: end; gap: clamp(10px, 3vw, 40px); }
.bottle { all: unset; cursor: pointer; width: clamp(120px, 15vw, 220px); transform-origin: 50% 100%; transition: transform .5s var(--spring), filter .4s; filter: drop-shadow(0 24px 24px rgba(0, 0, 0, .35)); }
.bottle img { width: 100%; pointer-events: none; user-select: none; }
.bottle:hover { transform: translateY(-8px) rotate(-3deg); }
.bottle[aria-pressed="true"] { transform: translateY(-26px) rotate(-8deg) scale(1.12); filter: drop-shadow(0 40px 30px rgba(0, 0, 0, .45)); }
.bottle:nth-child(2)[aria-pressed="true"] { transform: translateY(-26px) rotate(8deg) scale(1.12); }
.bottles-row:has([aria-pressed="true"]) .bottle[aria-pressed="false"] { transform: scale(.88); filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .3)) saturate(.7); }
@media (max-width: 860px) { .bottles { grid-template-columns: minmax(0, 1fr); } }

/* 6. Street */
.full { overflow: hidden; }
.full img { width: 100%; transform: translateY(var(--py, 0px)) scale(1.1); }
.full.wipe { clip-path: inset(0 calc((1 - var(--w, 0)) * 100%) 0 0); }
.street-copy { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px 32px; padding-block: clamp(60px, 8vw, 120px); }
.street-copy p { max-width: 40ch; }

/* 7. Marks */
.band { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.band-half { background: var(--bg); display: grid; place-items: center; padding: clamp(60px, 9vw, 130px) 10%; }
.band-half img { width: min(84%, 460px); transition: transform .5s var(--spring); }
.band-half:hover img { transform: rotate(-4deg) scale(1.05); }
/* The wordmark reversed: its shape as a mask, filled white. */
.rev { display: block; width: min(84%, 460px); aspect-ratio: 2200 / 1073; background: #fff; -webkit-mask: url(img/wordmark.png) center / contain no-repeat; mask: url(img/wordmark.png) center / contain no-repeat; transition: transform .5s var(--spring); }
.band-half:hover .rev { transform: rotate(-4deg) scale(1.05); }
@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(--ease), 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:nth-child(5) { transition-delay: .32s, 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; } }

/* 8. Credits */
.credits { background: var(--ink); color: var(--cream); 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(246, 234, 203, .25); padding-bottom: clamp(40px, 6vw, 80px); }
.credits h3 { font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--yellow); 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: 15ch; color: var(--yellow); }
.outro-links { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; border-radius: 999px; background: var(--pink); color: #fff; text-decoration: none; font-weight: 600; border: 2px solid var(--pink); transition: background-color .25s, color .25s; }
.btn:hover { background: transparent; color: var(--pink); }
.btn.ghost { background: transparent; color: var(--cream); border-color: var(--cream); }
.btn.ghost:hover { background: var(--cream); color: var(--ink); }
@media (max-width: 760px) { .credits-grid { grid-template-columns: minmax(0, 1fr); } }

/* Motion: headings rise word by word; the rest fades up. */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split .w > span { display: inline-block; transform: translateY(110%) rotate(4deg); transition: transform .9s var(--spring) calc(var(--k) * 60ms); }
.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; } }
