/* site.css: Men El Ghashim landing page. Tokens first; layout uses logical properties so RTL can follow. */

:root {
  --canvas: #0f0c0a; --surface: #1c1612; --ink: #f5ecdc; --ink-soft: #c2b39e;
  --accent: #1fb3a9; --accent-ink: #03110f; --warn: #ff6b4a;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-text: "DM Sans", system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
h1, h2 { font-family: var(--font-display); font-weight: 800; line-height: 0.95; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(3.1rem, 10.5vw, 9rem); max-width: 9ch; }
h2 { font-size: clamp(2.1rem, 5.6vw, 4.6rem); max-width: 13ch; }
p { margin: 0; max-width: 30rem; color: var(--ink-soft); font-size: clamp(1rem, 1.25vw, 1.15rem); }
p b { color: var(--ink); font-weight: 700; }
[data-act] p, [data-act] h1, [data-act] h2 { text-shadow: 0 1px 14px color-mix(in srgb, var(--canvas) 85%, transparent); }
.bubble, .btn, .who { text-shadow: none !important; }
.copy, .beats { display: grid; gap: 1.1rem; justify-items: start; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; min-width: 11.5rem;
  padding: 0 1.5em; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; text-decoration: none; border: 2px solid var(--accent);
  transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
.btn:hover { transform: translateY(-2px); }
.btn-small { min-height: 42px; min-width: 0; font-size: .92rem; }
.btn-ghost { background: transparent; color: var(--ink); border-color: color-mix(in srgb, var(--ink) 45%, transparent); }

nav {
  position: fixed; z-index: 5; inset-block-start: 0; inset-inline: 0; display: flex; justify-content: space-between;
  align-items: center; padding: 14px var(--gutter);
}
.nav-right { display: inline-flex; align-items: center; gap: .6rem; }
.brand b, .btn-small { white-space: nowrap; }
@media (max-width: 720px) { .nav-right { gap: .4rem; } .btn-small { padding: 0 1em; font-size: .88rem; } .sound { width: 38px; height: 38px; } }
.sound { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; cursor: pointer; color: var(--ink);
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 2px solid color-mix(in srgb, var(--ink) 28%, transparent); }
.sound .cross { display: none; }
.sound[aria-pressed="false"] .waves { display: none; }
.sound[aria-pressed="false"] .cross { display: inline; }
.sound[aria-pressed="false"] { color: var(--ink-soft); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--accent); text-decoration: none; }
.brand b { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); letter-spacing: -0.01em; }

/* posters: only seen without WebGL */
.poster { background: radial-gradient(60% 45% at 50% 38%, #6b4a22 0%, #24190f 45%, var(--canvas) 80%); }

/* table: headline bottom left, leaves as the camera starts to move */
[data-act="table"] .frame { align-content: end; justify-items: start; padding-block-end: clamp(28px, 7vh, 80px); }
[data-act="table"] .copy { transform: translate3d(0, calc(var(--p) * -10vh), 0); opacity: calc(1 - var(--p) * 1.5); }
[data-act="table"] p { color: var(--ink); }

/* deal: one caption per friend, bottom left for shoulder shots, bottom right for face shots */
[data-act="deal"] .frame { align-content: end; justify-items: start; padding-block-end: clamp(28px, 8vh, 96px); }
[data-act="deal"][data-beat="3"] .frame, [data-act="deal"][data-beat="4"] .frame { justify-items: end; }
.beats { display: grid; }
.beat { grid-area: 1 / 1; display: grid; gap: .8rem; justify-items: start; align-content: end; opacity: 0; transform: translateY(18px);
  transition: opacity .45s, transform .6s cubic-bezier(.2,.7,.2,1); pointer-events: none; }
[data-beat="0"] .beat:nth-child(1), [data-beat="1"] .beat:nth-child(2), [data-beat="2"] .beat:nth-child(3),
[data-beat="3"] .beat:nth-child(4), [data-beat="4"] .beat:nth-child(5) { opacity: 1; transform: none; }
.who { font-weight: 700; font-size: .9rem; color: var(--accent-ink); background: var(--accent); padding: .25em .8em; border-radius: 999px; }

/* ask: copy top left, speech bubbles pinned to heads by the script */
[data-act="ask"] .frame { align-content: start; justify-items: start; padding-block-start: clamp(84px, 14vh, 150px); }
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute; top: 0; left: 0; margin: 0; max-width: min(15rem, 58vw); padding: .65em 1em;
  border-radius: 18px; font-size: clamp(.92rem, 1.2vw, 1.05rem); line-height: 1.3; font-weight: 500;
  background: var(--ink); color: #1b130c; opacity: 0; transition: opacity .3s; will-change: transform;
}
.bubble.a { background: var(--accent); color: var(--accent-ink); }
.bubble.on { opacity: 1; }

/* vote: question top centre, names along the bottom */
[data-act="vote"] .frame { align-content: space-between; justify-items: center; text-align: center; padding-block: clamp(84px, 13vh, 140px) clamp(24px, 6vh, 64px); }
[data-act="vote"] .copy { justify-items: center; }
[data-act="vote"] .copy { background: color-mix(in srgb, var(--surface) 78%, transparent); padding: 18px 28px 20px; border-radius: 24px; }
[data-act="vote"] .copy::before { display: none; }
[data-act="vote"] h2 { max-width: none; }
.verdict { color: var(--ink); min-height: 3.2em; }
.verdict.wrong b { color: var(--warn); }
.suspects { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.suspects button {
  font: 700 1rem var(--font-text); min-height: 48px; padding: 0 1.2em; border-radius: 999px; cursor: pointer;
  color: var(--ink); background: color-mix(in srgb, var(--surface) 82%, transparent); border: 2px solid color-mix(in srgb, var(--ink) 30%, transparent);
  transition: transform .2s, border-color .2s, opacity .2s;
}
.suspects button:hover { transform: translateY(-2px); border-color: var(--accent); }
.suspects button.cleared { opacity: .4; text-decoration: line-through; }
.suspects button.spy { background: var(--warn); border-color: var(--warn); color: #1c0803; }
html.pick canvas[data-stage] { cursor: pointer; }
html.pick [data-act="vote"] .frame { cursor: pointer; }

/* packs: copy on the right, cards own the left and the air */
[data-act="packs"] .frame { align-content: center; justify-items: end; }
[data-act="packs"] .copy { background: color-mix(in srgb, var(--surface) 90%, transparent); padding: clamp(20px, 3vw, 40px); border-radius: 28px; }
[data-act="packs"] .copy::before { display: none; }
.facts { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .5rem; color: var(--ink-soft); }
.facts b { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); margin-inline-end: .35em; }

/* close: centred at the bottom, the chair above it */
[data-act="close"] .frame { align-content: center; justify-items: start; }
[data-act="close"] h2 { max-width: 8ch; }
.stores { display: flex; flex-wrap: wrap; gap: .7rem; margin-block-start: .4rem; max-width: 26rem; }
/* official store badges, always the same height */
.badge { display: inline-flex; border-radius: 9px; transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.badge:hover { transform: translateY(-2px); }
.badge img { height: 54px; width: auto; }
.stores { align-items: center; }
small { color: var(--ink-soft); opacity: .8; }

canvas[data-stage] { opacity: 0; }
html.world-ready canvas[data-stage] { opacity: 1; }

@media (max-width: 720px) {
  .copy, .beats { gap: .8rem; }
  [data-act="deal"] .frame, [data-act="deal"][data-beat="3"] .frame, [data-act="deal"][data-beat="4"] .frame { justify-items: start; }
  [data-act="packs"] .frame { align-content: end; justify-items: start; padding-block-end: 40px; }
  [data-act="ask"] .frame { padding-block-start: 76px; }
  /* captions sit on a panel on small screens: the brass table is too bright to read over */
  [data-act="deal"] .beats { background: color-mix(in srgb, var(--surface) 86%, transparent); padding: 18px 20px; border-radius: 22px; }
  [data-act="deal"] .beats::before { display: none; }
  [data-act="close"] .frame { align-content: end; padding-block-end: 32px; }
  .stores .btn { min-width: 9.5rem; }
  .brand b { font-size: 1rem; }
}

/* language switch */
.lang { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 .6em; border-radius: 999px; cursor: pointer; color: var(--ink);
  font: 700 .9rem var(--font-text); background: color-mix(in srgb, var(--surface) 80%, transparent); border: 2px solid color-mix(in srgb, var(--ink) 28%, transparent); }
@media (max-width: 720px) { .lang { min-width: 38px; height: 38px; } }

/* Arabic: its own faces, no negative tracking, and more line height, because the script has tall
   ascenders, deep descenders and marks above and below the line */
html[lang="ar"] { --font-display: "Noto Kufi Arabic", system-ui, sans-serif; --font-text: "IBM Plex Sans Arabic", system-ui, sans-serif; }
html[lang="ar"] h1, html[lang="ar"] h2 { letter-spacing: 0; line-height: 1.28; }
html[lang="ar"] h1 { font-size: clamp(2.5rem, 8.4vw, 7rem); max-width: 11ch; }
html[lang="ar"] h2 { font-size: clamp(1.8rem, 4.8vw, 3.8rem); max-width: 15ch; }
html[lang="ar"] p { line-height: 1.8; }
html[lang="ar"] .facts b { font-size: 1.35rem; }

/* the prompt that asks for the tap browsers need before they will play sound */
.sound-hint { position: fixed; z-index: 6; inset-block-start: 74px; inset-inline-end: var(--gutter); cursor: pointer;
  font: 500 .92rem var(--font-text); color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 999px; padding: .55em 1.1em;
  box-shadow: 0 6px 24px rgba(0,0,0,.35); animation: hint-in .5s cubic-bezier(.2,.7,.2,1) both; }
.sound-hint[hidden] { display: none; }
@keyframes hint-in { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .sound-hint { animation: none; } }
