/* ============================================================
   Shabaka site — page layout on top of brand tokens
   ============================================================ */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, rgba(26,22,20,0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(26,22,20,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  min-height: 100vh;
  color: var(--ink);
}

a { color: var(--punch-blue); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

img { max-width: 100%; display: block; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: var(--bw-base) solid var(--ink);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-3) var(--sp-5);
  max-width: 1120px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  color: var(--ink);
}
.brand img { height: 28px; width: auto; }
.brand-mark {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: var(--fs-lg);
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-left: auto;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: var(--fw-semi);
  font-size: var(--fs-sm);
}
.nav a:hover { color: var(--punch-blue); }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: var(--bw-base) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--paper-light);
  color: var(--ink);
  text-decoration: none;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  font-family: var(--font-sans);
}
.lang-toggle:hover { background: var(--lemon); color: var(--ink); }

.nav-toggle {
  display: none;
  background: var(--paper-light);
  border: var(--bw-base) solid var(--ink);
  border-radius: var(--r-md);
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 20px;
  height: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
  content: "";
}
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after  { position: absolute; top: 7px; }

/* ===== Hero ===== */
.hero {
  padding: var(--sp-9) 0 var(--sp-8);
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--sp-7);
  align-items: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: clamp(48px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-5);
}
.hero h1 .accent { color: var(--punch-red); }
.hero .arabic-mark {
  font-family: var(--font-arabic);
  font-weight: 700;
  display: inline-block;
}
.hero p.lede {
  font-size: var(--fs-lg);
  line-height: var(--lh-base);
  max-width: 50ch;
  margin: 0 0 var(--sp-6);
  color: var(--ink-soft);
}
.hero-ctas { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
}
.hero-art .tile-stack {
  position: relative;
  width: 280px;
  height: 280px;
}
.hero-art .tile-stack img {
  position: absolute;
  width: 200px;
  border: var(--bw-bold) solid var(--ink);
  background: var(--paper-light);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}
.hero-art .tile-stack img:nth-child(1) { top: 0;   left: 0;   transform: rotate(-6deg); }
.hero-art .tile-stack img:nth-child(2) { top: 30px; left: 60px; transform: rotate(3deg); background: var(--peach); }
.hero-art .tile-stack img:nth-child(3) { top: 80px; left: 20px; transform: rotate(-2deg); background: var(--sky); }

/* ===== Sections ===== */
.section {
  padding: var(--sp-8) 0;
  border-top: var(--bw-base) dashed var(--ink);
}
.section-eyebrow {
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 var(--sp-3);
}
.section h2 {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 var(--sp-5);
}
.section p { font-size: var(--fs-md); line-height: var(--lh-base); max-width: 65ch; }

/* ===== What-is window card ===== */
.what-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-7);
  align-items: center;
}
.word-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: var(--sp-4);
}
.word-cell {
  aspect-ratio: 5 / 3;
  border: var(--bw-base) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--paper-light);
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.word-cell.peach { background: var(--peach); }
.word-cell.sky   { background: var(--sky); }
.word-cell.mint  { background: var(--mint); }
.word-cell.lemon { background: var(--lemon); }
.word-cell.ink   { background: var(--ink); color: var(--paper); }

/* ===== How to play steps ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}
.step {
  background: var(--paper-light);
  border: var(--bw-bold) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-5);
}
.step .num {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--peach);
  border: var(--bw-bold) solid var(--ink);
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-3);
}
.step:nth-child(2) .num { background: var(--sky); }
.step:nth-child(3) .num { background: var(--mint); }
.step h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-xl); }
.step p { margin: 0; color: var(--ink-soft); }

/* ===== Pricing ===== */
.pricing-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--paper-light);
  border: var(--bw-bold) solid var(--ink);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-7);
  text-align: center;
}
.pricing-amount {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: clamp(56px, 8vw, 96px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.pricing-amount .unit {
  display: inline-block;
  font-size: 0.35em;
  vertical-align: middle;
  margin-left: 6px;
  color: var(--ink-muted);
  letter-spacing: 0;
}
.pricing-sub {
  font-size: var(--fs-md);
  color: var(--ink-soft);
  margin: var(--sp-2) 0 var(--sp-5);
}
.pricing-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-6);
  text-align: left;
  display: inline-block;
}
.pricing-list li {
  padding: 6px 0 6px 28px;
  position: relative;
}
.pricing-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: 800;
  color: var(--punch-red);
}

/* ===== FAQ ===== */
.faq details {
  background: var(--paper-light);
  border: var(--bw-base) solid var(--ink);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer;
  font-weight: var(--fw-bold);
  font-size: var(--fs-md);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-xl);
  line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: var(--sp-3) 0 var(--sp-2); color: var(--ink-soft); }

/* ===== Footer ===== */
.footer {
  border-top: var(--bw-base) solid var(--ink);
  margin-top: var(--sp-8);
  padding: var(--sp-7) 0 var(--sp-6);
  background: var(--paper-deep);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-6);
}
.footer h4 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 var(--sp-3);
  color: var(--ink-muted);
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { margin-bottom: 6px; }
.footer ul a { color: var(--ink); text-decoration: none; font-weight: var(--fw-semi); }
.footer ul a:hover { color: var(--punch-blue); text-decoration: underline; }
.footer-bottom {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1.5px dashed var(--ink);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}

/* ===== Legal pages ===== */
.legal {
  padding: var(--sp-8) 0;
}
.legal-wrap {
  max-width: 760px;
  margin: 0 auto;
  background: var(--paper-light);
  border: var(--bw-bold) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-7);
}
.legal h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  margin: 0 0 var(--sp-3);
  letter-spacing: -0.015em;
}
.legal .updated {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  margin-bottom: var(--sp-6);
}
.legal h2 {
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xl);
  margin: var(--sp-7) 0 var(--sp-3);
}
.legal h3 {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  margin: var(--sp-5) 0 var(--sp-2);
}
.legal p, .legal li {
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--ink-soft);
}
.legal ul, .legal ol { padding-left: 22px; }
.legal li { margin-bottom: var(--sp-2); }
.legal .placeholder {
  background: var(--lemon);
  padding: 1px 6px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9em;
  white-space: nowrap;
}

/* ===== Helpers ===== */
.center { text-align: center; }
.muted { color: var(--ink-muted); }
.pill {
  display: inline-block;
  padding: 4px 10px;
  border: var(--bw-base) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--paper-light);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill.peach { background: var(--peach); }
.pill.sky   { background: var(--sky); }
.pill.mint  { background: var(--mint); }
.pill.lemon { background: var(--lemon); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; min-height: 240px; }
  .what-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: var(--bw-base) solid var(--ink);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-3) var(--sp-5);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: var(--sp-3) 0; border-bottom: 1px dashed var(--ink); }
  .nav a:last-child { border-bottom: none; }
  .topbar-inner { position: relative; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ===== RTL ===== */
[dir="rtl"] body,
[dir="rtl"] {
  font-family: var(--font-arabic);
}
[dir="rtl"] .nav { margin-left: 0; margin-right: auto; }
[dir="rtl"] .pricing-list { text-align: right; }
[dir="rtl"] .pricing-list li { padding: 6px 28px 6px 0; }
[dir="rtl"] .pricing-list li::before { left: auto; right: 0; }
[dir="rtl"] .legal ul, [dir="rtl"] .legal ol { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .hero-art .tile-stack img:nth-child(1) { left: auto; right: 0; transform: rotate(6deg); }
[dir="rtl"] .hero-art .tile-stack img:nth-child(2) { left: auto; right: 60px; transform: rotate(-3deg); }
[dir="rtl"] .hero-art .tile-stack img:nth-child(3) { left: auto; right: 20px; transform: rotate(2deg); }
