:root {
  --olive: #4c4d25;
  --olive-deep: #3a3b1b;
  --beige: #dbbe92;
  --cream: #f3e7d3;
  --choc: #3b2416;
  --font: "Archivo", system-ui, sans-serif;
  --bar-h: 72px;
}
html[lang="ar"] { --font: "Tajawal", system-ui, sans-serif; }

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--olive);
  color: var(--beige);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
/* film grain: motion-graphics texture */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .07;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--beige); outline-offset: 3px; }

/* ---------- header ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 40px); pointer-events: none;
}
.bar > * { pointer-events: auto; }
.mark {
  font-family: "Archivo", sans-serif; font-weight: 900; font-size: 15px; line-height: .95; letter-spacing: -.02em; direction: ltr;
  color: var(--beige); background: var(--olive); text-decoration: none;
  padding: 9px 12px; border-radius: 10px; box-shadow: 0 0 0 1.5px rgba(219, 190, 146, .35);
}
.bar-actions { display: flex; gap: 10px; }
.pill {
  height: 44px; min-width: 44px; padding: 0 14px; border: 0; border-radius: 99px;
  background: var(--olive); color: var(--beige); box-shadow: 0 0 0 1.5px rgba(219, 190, 146, .35);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800;
}
.lang { font-family: "Tajawal", "Archivo", sans-serif; font-size: 17px; }
.badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  background: var(--beige); color: var(--olive); font-size: 13px; line-height: 22px; text-align: center;
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  padding: calc(var(--bar-h) + 6vh) clamp(16px, 5vw, 80px) 10vh;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-word {
  font-family: "Archivo", sans-serif; font-weight: 900; letter-spacing: -.045em; line-height: .86;
  font-size: clamp(5.2rem, 19vw, 17rem); position: relative; z-index: 2;
}
html[dir="rtl"] .hero-word { direction: ltr; text-align: right; }
.line { display: block; overflow: hidden; padding-bottom: .04em; }
.line > span { display: block; }
.hero-tag { margin-top: 28px; font-size: clamp(1.1rem, 2vw, 1.5rem); max-width: 24ch; position: relative; z-index: 2; }
.hero-cookie {
  position: absolute; z-index: 1; width: min(44vw, 66vh); aspect-ratio: 1;
  inset-inline-end: -5vw; top: 54%; translate: 0 -50%;
}
.hero-cookie img { width: 100%; filter: drop-shadow(0 40px 50px rgba(0, 0, 0, .45)); animation: spin 40s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.hint { position: absolute; bottom: 28px; inset-inline-start: clamp(16px, 5vw, 80px); display: flex; gap: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; z-index: 2; }
.hint-arrow::after { content: "→"; display: inline-block; animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { translate: 8px 0; } }
@media (max-width: 767px) {
  .hero { justify-content: flex-start; }
  .hero-cookie { width: 92vw; top: auto; bottom: -14vw; translate: 0; inset-inline-end: -22vw; }
  .hint-arrow::after { content: "↓"; animation-name: drop; }
  @keyframes drop { 50% { translate: 0 6px; } }
}

/* ---------- ticker ---------- */
.ticker { background: var(--beige); color: var(--olive); overflow: hidden; white-space: nowrap; padding: 14px 0; position: relative; z-index: 3; }
.ticker-move { display: inline-flex; animation: tick 28s linear infinite; }
.ticker-move span { font-weight: 900; font-size: clamp(1rem, 2.2vw, 1.6rem); text-transform: uppercase; letter-spacing: .02em; padding-inline-end: .5em; }
@keyframes tick { to { translate: -50% 0; } }

/* ---------- cookie panels ---------- */
.panel {
  --bg: var(--olive); --ink: var(--beige);
  position: relative; overflow: hidden; background: var(--bg); color: var(--ink);
  min-height: 100svh; padding: calc(var(--bar-h) + 12px) 20px 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center;
}
html[dir="rtl"] .panel { direction: rtl; }
.bgword {
  position: absolute; inset: auto 0 50%; translate: 0 50%; z-index: 0; white-space: nowrap; pointer-events: none;
  font-family: "Archivo", "Tajawal", sans-serif; font-weight: 900; font-size: 26vw; line-height: 1; letter-spacing: -.05em;
  color: transparent; -webkit-text-stroke: 2px var(--ink); opacity: .14; text-transform: uppercase;
}
html[lang="ar"] .bgword { font-family: "Tajawal", sans-serif; }
.stage-wrap { position: relative; z-index: 1; width: min(94vw, 52svh); aspect-ratio: 1; transition: scale .35s cubic-bezier(.2, .8, .2, 1); }
.stage-wrap:hover { scale: 1.03; }
.stage { position: absolute; inset: 0; border: 0; padding: 0; background: none; border-radius: 50%; }
/* the clip frame; the soft round edge hides any tiny color difference with the panel */
.stage canvas {
  width: 100%; height: 100%; display: block; background-size: cover;
  -webkit-mask-image: radial-gradient(closest-side, #000 84%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 84%, transparent 100%);
}
.sticker {
  position: absolute; z-index: 4; top: 4%; inset-inline-end: 2%; width: 20%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; text-align: center; padding: 8px; pointer-events: none;
  background: var(--ink); color: var(--bg); font-weight: 900; font-size: clamp(10px, 1.1vw, 14px); line-height: 1.05; text-transform: uppercase;
  rotate: 12deg; box-shadow: 0 10px 20px rgba(0, 0, 0, .2);
}
.info { position: relative; z-index: 2; max-width: 440px; }
.num { font-weight: 800; font-size: 13px; letter-spacing: .18em; opacity: .7; }
.name {
  font-weight: 900; line-height: .92; letter-spacing: -.035em; margin: 10px 0 12px;
  font-size: clamp(2.3rem, 10vw, 3.2rem); overflow: hidden; padding-bottom: .06em;
}
html[lang="ar"] .name { letter-spacing: 0; line-height: 1.15; }
.name span { display: block; }
.filling { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.filling::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--fill); box-shadow: 0 0 0 2px var(--ink); }
.desc { margin-top: 10px; line-height: 1.5; opacity: .85; font-size: 15px; }
.buy { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 16px; }
.price { font-weight: 900; font-size: 1.6rem; }
.btn {
  border: 0; border-radius: 99px; padding: 15px 26px; font-weight: 800; font-size: 16px;
  background: var(--ink, var(--olive)); color: var(--bg, var(--beige));
  transition: translate .2s, box-shadow .2s;
}
.btn:hover { translate: 0 -2px; box-shadow: 0 10px 22px rgba(0, 0, 0, .22); }
.btn:active { translate: 0 1px; }
.btn:disabled { opacity: .4; cursor: not-allowed; translate: none; box-shadow: none; }
@media (max-width: 767px) and (max-height: 700px) { .desc { display: none; } }

/* desktop: one long horizontal strip, moved by scroll */
@media (min-width: 768px) {
  .panel {
    flex-direction: row; text-align: start; justify-content: center;
    gap: 6vw; padding: var(--bar-h) 6vw 40px;
  }
  .stage-wrap { width: min(74vh, 46vw); }
  .info { max-width: 34vw; }
  .name { font-size: clamp(3rem, 6.4vw, 6.6rem); }
  .desc { font-size: 17px; max-width: 36ch; }
  .buy { justify-content: flex-start; }
  .bgword { font-size: 22vw; }
}
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .menu { overflow: hidden; }
  .track { display: flex; width: max-content; }
  .panel { width: 100vw; height: 100vh; min-height: 0; flex-shrink: 0; }
}

/* ---------- outro + footer ---------- */
.outro { background: var(--beige); color: var(--olive); text-align: center; padding: 18vh 20px; --ink: var(--olive); --bg: var(--beige); }
.outro h2 { font-weight: 900; font-size: clamp(3rem, 10vw, 8rem); letter-spacing: -.045em; line-height: .9; }
html[lang="ar"] .outro h2 { letter-spacing: 0; line-height: 1.1; }
.outro p { margin: 18px auto 32px; max-width: 36ch; font-size: 18px; line-height: 1.5; }
.outro-row { display: flex; justify-content: center; margin-bottom: 40px; }
.outro-row img { width: clamp(64px, 11vw, 140px); margin-inline: -1.5vw; filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .25)); animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 -14px; rotate: 6deg; } }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px clamp(16px, 4vw, 48px); font-size: 14px; }
.foot .mark { box-shadow: none; padding: 0; background: none; }

/* ---------- basket drawer ---------- */
.drawer {
  --from: 100%;
  margin: 0; margin-inline-start: auto; width: min(420px, 100vw); height: 100dvh; max-height: none; max-width: none;
  border: 0; padding: 0; background: var(--cream); color: var(--olive-deep);
  display: none; flex-direction: column;
}
html[dir="rtl"] .drawer { --from: -100%; }
.drawer[open] { display: flex; animation: slide .4s cubic-bezier(.2, .8, .2, 1); }
.drawer::backdrop { background: rgba(58, 59, 27, .55); backdrop-filter: blur(4px); }
@keyframes slide { from { translate: var(--from) 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 22px 12px; }
.drawer-head h2 { font-weight: 900; font-size: 28px; letter-spacing: -.02em; }
.x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--olive); color: var(--beige); font-size: 24px; line-height: 1; }
.drawer-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.lines { list-style: none; padding: 0 22px; overflow-y: auto; flex: 1; }
.lines li { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid rgba(76, 77, 37, .15); }
.lines img { width: 60px; height: 60px; }
.lines h3 { font-size: 16px; font-weight: 800; }
.lines small { opacity: .7; }
.qty { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.qty button { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--olive); background: none; font-weight: 800; }
.qty output { min-width: 26px; text-align: center; font-weight: 800; }
.line-total { font-weight: 900; }
.empty { padding: 30px 22px; opacity: .75; }
.drawer-foot { padding: 18px 22px 24px; border-top: 2px solid var(--olive); --ink: var(--olive); --bg: var(--cream); }
.total { display: flex; justify-content: space-between; font-size: 18px; margin-bottom: 14px; }
.total strong { font-size: 24px; font-weight: 900; }
.drawer-foot .btn { width: 100%; }
.demo-note { margin-top: 10px; font-size: 13px; text-align: center; opacity: .65; }
.done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; gap: 14px; --ink: var(--olive); --bg: var(--cream); }
.done h2 { font-weight: 900; font-size: 34px; letter-spacing: -.02em; }
.done-cookie { width: 140px; animation: spin 12s linear infinite; }
.order-no strong { font-size: 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
