/* ZammaApp brand stylesheet.
   Mirrors lib/theme/zamma_tokens.dart. Self-hosted fonts (GDPR-safe). */

@font-face {
  font-family: 'Fredoka';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Fredoka-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Fredoka';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Fredoka-SemiBold.ttf') format('truetype');
}
@font-face {
  font-family: 'Fredoka';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Fredoka-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Nunito';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Nunito-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Nunito';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Nunito-SemiBold.ttf') format('truetype');
}
@font-face {
  font-family: 'Nunito';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Nunito-Bold.ttf') format('truetype');
}

/* Tajawal (OFL) — warm, rounded Arabic + Latin. Used for RTL pages.
   Slightly larger optical size than Cairo and more open counters, so
   body text reads comfortably at the same nominal size as Latin. */
@font-face {
  font-family: 'Tajawal';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Tajawal-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Tajawal';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Tajawal-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Tajawal';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Tajawal-Bold.ttf') format('truetype');
}

:root {
  /* From lib/theme/zamma_tokens.dart */
  --scaffold-bg:    #0F172A;
  --surface-dark:   #143C1E;
  --emerald:        #15803D;
  --emerald-dark:   #166534;
  --gold:           #D97706;
  --gold-muted:     rgba(217, 119, 6, .70);
  --gold-subtle:    rgba(217, 119, 6, .15);
  --mullah-gold:    #FFD700;
  --board-wood:     #2A1A08;
  --board-wood-mid: #3D2A12;
  --board-line:     #A8884E;
  --board-point:    #C4A06A;
  --piece-red:      #C0392B;
  --piece-red-l:    #FF7B7B;
  --piece-blue:     #2980B9;
  --piece-blue-l:   #85C1FF;
  --text:           #ffffff;
  --text-soft:      rgba(255, 255, 255, .70);
  --text-muted:     rgba(255, 255, 255, .38);
  --glass-low:      rgba(20, 60, 30, .20);
  --glass-med:      rgba(20, 60, 30, .30);
  --glass-high:     rgba(20, 60, 30, .40);
}

html, body {
  background: var(--scaffold-bg);
  color: var(--text);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, .heading {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Atmospheric scaffold — a quiet emerald wash and a warm gold halo,
   reminiscent of opening a wooden game box in a warmly lit room. */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(21, 128, 61, .15) 0%, transparent 70%),
    radial-gradient(50% 40% at 90% 100%, rgba(217, 119, 6, .08) 0%, transparent 70%);
}
body > * { position: relative; z-index: 1; }

/* Glass surface — emerald tinted, gold-edged, blurred backdrop. */
.glass {
  background: var(--glass-med);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid var(--gold-subtle);
  box-shadow: 0 4px 12px rgba(0,0,0,.33), 0 20px 40px rgba(0,0,0,.20);
}

/* Gold title gradient: gold → emerald → gold, matching the in-app shader. */
.gold-grad {
  background: linear-gradient(135deg, var(--gold) 0%, var(--emerald) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Emerald gradient — primary CTA. */
.btn-emerald {
  background: linear-gradient(135deg, var(--emerald-dark), var(--emerald));
  color: #fff;
  border-radius: 10px;
  padding: 14px 24px;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 6px 18px rgba(21, 128, 61, .30);
  border: 1px solid rgba(255,255,255,.06);
}
.btn-emerald:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(21, 128, 61, .45); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 14px 24px;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--gold-subtle);
  transition: background .2s ease, border-color .2s ease;
}
.btn-ghost:hover { background: var(--glass-low); border-color: var(--gold-muted); }

/* Apple App Store badge — use the official SVG, just size + hover lift. */
.app-store-badge { display: inline-block; line-height: 0; }
.app-store-badge img {
  height: 52px;
  width: auto;
  display: block;
  transition: transform .2s ease;
}
.app-store-badge:hover img { transform: translateY(-2px); }
.coming-soon-tag {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-subtle);
  border-radius: 999px;
}

/* Board mock — warm wood with gold linework. */
.board-bg {
  background:
    linear-gradient(135deg, var(--board-wood) 0%, var(--board-wood-mid) 50%, var(--board-wood) 100%);
  border: 2px solid var(--gold-subtle);
  box-shadow: 0 14px 40px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.04);
}

.piece { width: 36px; height: 36px; border-radius: 999px; }
.piece-red { background: radial-gradient(circle at 35% 35%, var(--piece-red-l), var(--piece-red)); box-shadow: 0 3px 8px rgba(0,0,0,.5), inset 0 2px 4px rgba(255,255,255,.25); }
.piece-blue { background: radial-gradient(circle at 35% 35%, var(--piece-blue-l), var(--piece-blue)); box-shadow: 0 3px 8px rgba(0,0,0,.5), inset 0 2px 4px rgba(255,255,255,.25); }
.piece-mullah { background: radial-gradient(circle at 35% 35%, #ffe588, var(--mullah-gold)); box-shadow: 0 3px 12px rgba(255,215,0,.60), inset 0 2px 4px rgba(255,255,255,.25); border: 2px solid rgba(255,255,255,.30); }

/* Phone screenshot in landing showcase — rounded device-like corners,
   warm glow underneath, gentle hover lift. The middle one ('hero') sits
   slightly higher than the side two to mimic a fanned-out display rack. */
.phone-shot {
  display: block;
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  border-radius: 36px;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(217, 119, 6, .18),
    0 0 80px rgba(21, 128, 61, .14);
  transition: transform .35s ease, box-shadow .35s ease;
}
.phone-shot--hero { transform: translateY(-12px) scale(1.04); }
.phone-shot:hover { transform: translateY(-6px) scale(1.02); }
.phone-shot--hero:hover { transform: translateY(-18px) scale(1.06); }
@media (max-width: 768px) {
  .phone-shot--hero, .phone-shot--lift { transform: none; }
}

/* Small print + footers. */
.muted { color: var(--text-muted); }
.soft  { color: var(--text-soft); }

/* Hover utility for nav links. */
.nav-link { color: var(--text-soft); transition: color .15s ease; }
.nav-link:hover { color: var(--text); }

/* Language switcher — compact code-style links separated by hair-dividers. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: .12em;
  font-weight: 600;
  color: var(--text-muted);
}
.lang-switch a {
  color: var(--text-muted);
  text-transform: uppercase;
  transition: color .15s ease;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.is-active {
  color: var(--gold);
}
.lang-switch__sep { color: var(--gold-subtle); }

/* RTL refinements (Arabic). Flex/grid auto-flips; we only override where
   typography or fixed direction would look off. Arabic glyphs render
   visually smaller than Latin at the same nominal size, so we bump the
   root font-size — all rem-based sizes (Tailwind's text-* utilities,
   leading-*, etc.) scale together. */
/* RTL refinements (Arabic). Flex/grid auto-flips; we only override where
   typography or fixed direction would look off. Sizes stay at the LTR
   defaults (16px root); Cairo's larger x-height does the heavy lifting. */
html[dir="rtl"] body,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] .heading {
  font-family: 'Tajawal', 'SF Arabic', 'Geeza Pro', 'Damascus', 'Tahoma', sans-serif;
}
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .heading { letter-spacing: 0; }
html[dir="rtl"] .lang-switch { letter-spacing: 0; }
html[dir="rtl"] details > summary::after { float: left; }
html[dir="rtl"] .prose ul { padding-left: 0; padding-right: 1.5rem; }

/* Subtle gold rule under section titles where wanted. */
.gold-rule::after {
  content: '';
  display: block; width: 56px; height: 2px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 2px;
}

/* Prose helpers for policy / FAQ. */
.prose h2 { font-size: 1.5rem; margin: 2rem 0 .5rem; color: var(--text); }
.prose p, .prose li { color: var(--text-soft); line-height: 1.75; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin: .5rem 0 1rem; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }

/* FAQ accordion. */
details {
  border-top: 1px solid var(--gold-subtle);
  font-family: 'Nunito', sans-serif;
}
details > summary {
  cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after {
  content: '+';
  float: right; color: var(--gold); font-weight: 700;
  transition: transform .2s ease;
}
details[open] > summary::after { content: '−'; }
details > div { padding: 0 0 16px; color: var(--text-soft); line-height: 1.75; }
details > div a { color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }
