/* The website layer over the film (web mode only). Everything is scoped to #site so the
   clicker show is unaffected. Overview = the film itself; other tabs open the sheet. */

#site {
  --ink: #f3ecdc; --dim: rgba(243,236,220,.64); --faint: rgba(243,236,220,.42);
  --line: rgba(243,236,220,.12); --card: rgba(255,255,255,.04);
  --gold: #d9b26a; --gold-hi: #ecc985; --gold-soft: rgba(217,178,106,.38);
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --arabic: "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
  --pad: clamp(16px, 3.4vw, 40px);
  font-family: var(--sans); color: var(--ink); user-select: text; -webkit-user-select: text;
}
#site[hidden] { display: none; }
html[lang="ar"] #site { font-family: var(--arabic); }
#site * { box-sizing: border-box; }
#site a { color: inherit; }
#site img { max-width: 100%; height: auto; display: block; }
#site :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

/* ---------- Top bar ---------- */
#site .top {
  position: fixed; left: 0; right: 0; top: 0; z-index: 24;
  display: flex; align-items: center; gap: 18px;
  padding: calc(12px + env(safe-area-inset-top)) var(--pad) 12px;
  background: linear-gradient(rgba(4,6,10,.82), rgba(4,6,10,0));
  transition: background .3s;
}
/* The blur sits on a layer behind the bar: a backdrop-filter on the bar itself would trap the
   phone tab bar (position: fixed) inside it. */
#site .top::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: rgba(4,6,10,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
body.sheet-open #site .top::before { opacity: 1; }
#site .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 20px/1 var(--sans); letter-spacing: -.02em; }
#site .brand img { width: 30px; height: 30px; border-radius: 8px; }
#site .tabs {
  display: flex; gap: 2px; margin: 0 auto; padding: 4px; border-radius: 999px;
  background: rgba(8,10,14,.55); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#site .tabs a {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  text-decoration: none; color: var(--dim); font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: color .2s, background .2s;
}
#site .tabs a:hover { color: var(--ink); background: rgba(255,255,255,.06); }
#site .tabs a[aria-selected="true"] { color: #120d04; background: var(--gold); }
#site .tabs svg { width: 18px; height: 18px; flex: none; }
#site .actions { display: flex; align-items: center; gap: 8px; }
#site .lang, #site .store {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  font: 500 14.5px/1 var(--sans); color: var(--ink); text-decoration: none; white-space: nowrap;
  background: rgba(8,10,14,.55); border: 1px solid var(--line);
}
#site .lang { font-family: var(--arabic); }
html[lang="ar"] #site .lang { font-family: var(--sans); }
#site .lang:hover { border-color: var(--gold-soft); }
#site .store { background: var(--gold); border-color: var(--gold); color: #120d04; font-weight: 600; }
#site .store:hover { background: var(--gold-hi); }
#site .store svg { width: 18px; height: 18px; fill: currentColor; }

@media (max-width: 1000px) { #site .tabs a { padding: 8px 11px; } }
@media (max-width: 860px) {
  /* Phones: tabs become an icon bar along the bottom, like an app. */
  #site .top { padding-bottom: 18px; }
  #site .tabs {
    position: fixed; left: 50%; transform: translateX(-50%); top: auto; margin: 0;
    bottom: max(12px, env(safe-area-inset-bottom)); width: min(440px, calc(100% - 24px)); justify-content: space-between;
    background: rgba(8,10,14,.82);
  }
  #site .tabs a { flex: 1; flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 10.5px; }
  #site .tabs svg { width: 21px; height: 21px; }
  #site .actions { margin-inline-start: auto; }
  body.web .webui { bottom: calc(86px + env(safe-area-inset-bottom)) !important; }
  body.web .webrot { top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) { #site .store span { display: none; } #site .store { width: 40px; padding: 0; justify-content: center; } }

/* ---------- The sheet (Features, Widgets, Tutorials, Support) ---------- */
#site .sheet {
  position: fixed; inset: 0; z-index: 22; overflow-y: auto; overscroll-behavior: contain;
  background: rgba(4,6,10,.84); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: opacity .45s cubic-bezier(.2,.7,.2,1), transform .45s cubic-bezier(.2,.7,.2,1), visibility 0s .45s;
}
body.sheet-open #site .sheet { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) { #site .sheet { transform: none; transition: opacity .2s, visibility 0s .2s; } }
#site .sheet-in { max-width: 1160px; margin: 0 auto; padding: calc(110px + env(safe-area-inset-top)) var(--pad) 60px; }
@media (max-width: 860px) { #site .sheet-in { padding-top: calc(84px + env(safe-area-inset-top)); padding-bottom: calc(110px + env(safe-area-inset-bottom)); } }

#site .kick { font: 500 12.5px/1 var(--mono); letter-spacing: .28em; text-transform: uppercase; color: var(--gold); margin: 0 0 16px; }
html[lang="ar"] #site .kick { font: 600 15px/1.2 var(--arabic); letter-spacing: 0; }
#site h2 { margin: 0 0 clamp(28px, 5vw, 56px); font-size: clamp(32px, 4.6vw, 60px); line-height: 1.04; letter-spacing: -.035em; font-weight: 600; max-width: 17em; }
#site h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
html[lang="ar"] #site h2, html[lang="ar"] #site h3 { letter-spacing: 0; line-height: 1.3; }
#site .lead { color: var(--dim); font-size: clamp(17px, 1.5vw, 19px); max-width: 38em; margin: -28px 0 40px; }
#site .note { color: var(--faint); font-size: 15px; margin: 28px 0 0; }

/* Features */
#site .feat { display: grid; grid-template-columns: 300px 1fr; gap: clamp(28px, 6vw, 88px); align-items: center; padding: clamp(28px, 4vw, 48px) 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
#site .feat.flip { grid-template-columns: 1fr 300px; }
#site .feat.flip > img { order: 2; }
#site .shot { width: 100%; max-width: 280px; margin: 0 auto; filter: drop-shadow(0 30px 50px rgba(0,0,0,.55)); }
#site .feat h3 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.08; margin-bottom: 20px; }
#site .feat ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 34em; }
#site .feat li { position: relative; padding-inline-start: 22px; color: var(--dim); font-size: 17px; line-height: 1.55; }
#site .feat li::before { content: ""; position: absolute; inset-inline-start: 0; top: .62em; width: 8px; height: 8px; transform: rotate(45deg); border: 1.5px solid var(--gold); }
@media (max-width: 760px) {
  #site .feat, #site .feat.flip { grid-template-columns: 1fr; gap: 22px; }
  #site .feat.flip > img { order: 0; }
  #site .shot { max-width: 220px; }
}

/* Widgets */
#site .wgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 1.6vw, 18px); }
#site .w { width: 100%; border-radius: 22px; box-shadow: 0 24px 50px rgba(0,0,0,.45); aspect-ratio: 1; object-fit: cover; }
#site .w.wide { grid-column: span 2; aspect-ratio: auto; height: 100%; }
#site .w.round { border-radius: 24%; }
#site .shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: clamp(44px, 6vw, 72px); }
#site .shots figure { margin: 0; }
#site .shots .shot { max-width: 100%; }
#site .shots figcaption { margin-top: 14px; color: var(--dim); font-size: 15px; text-align: center; line-height: 1.45; }
#site .steps { list-style: none; padding: 0; margin: clamp(40px, 6vw, 64px) 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
#site .steps li { display: flex; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--dim); line-height: 1.5; }
#site .steps b { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #120d04; font-size: 14px; }
@media (max-width: 900px) { #site .shots { grid-template-columns: 1fr 1fr; } #site .steps { grid-template-columns: 1fr; } }
@media (max-width: 560px) { #site .wgrid { grid-template-columns: 1fr 1fr; } #site .shots { gap: 14px; } #site .shots figcaption { font-size: 13.5px; } }

/* Tutorials */
#site .tuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
#site .tut { text-decoration: none; display: grid; gap: 6px; }
#site .tut b { font-size: 18px; font-weight: 600; }
#site .tut > span:last-child { color: var(--dim); font-size: 15px; }
#site .thumb { position: relative; display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 8px; }
#site .thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
#site .tut:hover .thumb img { transform: scale(1.03); }
#site .play { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; display: grid; place-items: center; background: rgba(217,178,106,.92); color: #120d04; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
#site .play svg { width: 26px; height: 26px; margin-left: 3px; }

/* Support */
#site .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
#site .card { text-decoration: none; display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); transition: border-color .2s, transform .2s; }
#site .card[hidden] { display: none; }
#site .card:hover { border-color: var(--gold-soft); transform: translateY(-2px); }
#site .card h3 { font-size: 20px; margin-bottom: 8px; }
#site .card p { margin: 0 0 18px; color: var(--dim); font-size: 15px; line-height: 1.5; flex: 1; overflow-wrap: anywhere; }
#site .card .go { color: var(--gold); font-weight: 600; font-size: 15px; }

#site .foot { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--faint); font-size: 14px; }
#site .foot a { text-decoration: none; }
#site .foot a:hover { color: var(--ink); }
#site .foot .credit { margin-inline-start: auto; }

/* The film's own bits while the website is on */
body.sheet-open .webrot { display: none !important; }
body.web .webui .n { white-space: nowrap; }
