/* Ayat Academy — Design System */
:root {
  --bg: #F5F0E6;
  --bg-alt: #EDE4D3;
  --bg-card: #FBF7EF;
  --ink: #1A1A18;
  --ink-soft: #4A4742;
  --ink-mute: #8A857C;
  --line: #D9CEB8;
  --line-soft: #E8DFC9;

  --primary: #0B3B2E;
  --primary-soft: #1A5644;
  --primary-ink: #F5F0E6;

  --accent: #C9A961;
  --accent-deep: #A88840;
  --accent-soft: #E8D5A3;

  --danger: #8B3A2F;

  --serif: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --arabic: 'Amiri Quran', 'Amiri', 'Scheherazade New', serif;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  --shadow-sm: 0 1px 2px rgba(26,26,24,0.04), 0 1px 3px rgba(26,26,24,0.06);
  --shadow: 0 4px 16px rgba(26,26,24,0.06), 0 1px 3px rgba(26,26,24,0.04);
  --shadow-lg: 0 24px 48px -16px rgba(11,59,46,0.18), 0 8px 16px rgba(26,26,24,0.06);

  --max: 1200px;
  --density: 1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h4 { font-size: 1.25rem; }

p { text-wrap: pretty; color: var(--ink-soft); }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 58ch; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
}

.section {
  padding: calc(72px * var(--density)) 0;
}
.section-sm { padding: calc(48px * var(--density)) 0; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--primary);
  opacity: 0.5;
}

.arabic {
  font-family: var(--arabic);
  direction: rtl;
  line-height: 1.8;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
}
.btn-primary:hover {
  background: var(--primary-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.btn-accent {
  background: var(--accent);
  color: var(--primary);
}
.btn-accent:hover {
  background: var(--accent-deep);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}
.btn svg { width: 14px; height: 14px; }

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 240, 230, 0.85);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.scrolled { border-color: var(--line-soft); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--primary);
}
.brand-mark {
  width: 56px;
  height: 56px;
  background: var(--ink);
  -webkit-mask: url(/assets/logo-mark.png) center / contain no-repeat;
          mask: url(/assets/logo-mark.png) center / contain no-repeat;
}
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-links a {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  transition: all 0.2s;
  font-weight: 450;
}
.nav-links a:hover { color: var(--primary); background: var(--bg-alt); }
.nav-links a.active { background: var(--primary); color: var(--primary-ink); font-weight: 500; }
.nav-links a.active:hover { background: var(--primary-soft); color: var(--primary-ink); }
.nav-cta { margin-left: 12px; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 18px; height: 18px; }

/* Mobile nav — hidden by default on all viewports */
.mobile-nav { display: none; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-cta { display: none; }
  .mobile-nav {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 100;
    transform: translateY(-100%);
    transition: transform 0.35s cubic-bezier(.7,0,.3,1), visibility 0s linear 0.35s;
    display: flex;
    flex-direction: column;
    padding: 24px;
    visibility: hidden;
    pointer-events: none;
  }
  .mobile-nav.open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.35s cubic-bezier(.7,0,.3,1), visibility 0s linear 0s;
  }
  .mobile-nav-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
  }
  .mobile-nav a:not(.btn) {
    padding: 20px 0;
    border-bottom: 1px solid var(--line-soft);
    font-family: var(--serif);
    font-size: 1.75rem;
    color: var(--primary);
  }
  .mobile-nav .btn { margin-top: 32px; align-self: flex-start; }
}

/* Footer */
.site-footer {
  background: var(--primary);
  color: var(--primary-ink);
  padding: 80px 0 40px;
  margin-top: 80px;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'><g fill='none' stroke='%23C9A961' stroke-width='0.5' opacity='0.25'><path d='M60 0l15 45L120 60 75 75 60 120 45 75 0 60l45-15z'/></g></svg>");
  background-size: 180px;
  opacity: 0.4;
  pointer-events: none;
}
.site-footer > * { position: relative; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand { color: var(--accent); font-family: var(--serif); font-size: 1.75rem; margin-bottom: 16px; }
.footer-tag { color: rgba(245,240,230,0.7); font-size: 0.95rem; max-width: 36ch; }
.footer h5 {
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 20px;
  font-weight: 500;
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer a { color: rgba(245,240,230,0.8); font-size: 0.95rem; transition: color 0.2s; }
.footer a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(201,169,97,0.2);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(245,240,230,0.5);
  font-size: 0.85rem;
}
@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand-col { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* Shared components */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.25s ease;
}
.card:hover {
  border-color: var(--line);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.divider {
  height: 1px;
  background: var(--line-soft);
  margin: 48px 0;
}

.ornament {
  display: block;
  margin: 0 auto;
  color: var(--accent);
  opacity: 0.7;
}

/* Utility */
.text-center { text-align: center; }
.serif { font-family: var(--serif); }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.muted { color: var(--ink-mute); }

/* Page header hero (non-home) */
.page-hero {
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  overflow: hidden;
}
.page-hero h1 { font-size: clamp(2.5rem, 5vw, 3.75rem); margin-top: 12px; }
.page-hero .lead { margin-top: 20px; max-width: 62ch; }
.page-hero-pattern {
  position: absolute;
  right: -60px;
  top: -40px;
  width: 420px;
  height: 420px;
  opacity: 0.18;
  color: var(--accent);
  pointer-events: none;
}
@media (max-width: 900px) {
  .page-hero-pattern { width: 280px; height: 280px; right: -80px; opacity: 0.14; }
}

/* Tweaks panel */
.tweaks-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  width: 280px;
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h6 {
  font-family: var(--sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  margin-bottom: 16px;
}
.tweak-row { margin-bottom: 18px; }
.tweak-row label { display: block; font-size: 0.85rem; margin-bottom: 8px; color: var(--ink-soft); font-weight: 500; }
.tweak-swatches { display: flex; gap: 8px; }
.tweak-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--line-soft);
  transition: all 0.15s;
}
.tweak-swatch.active { border-color: var(--ink); transform: scale(1.1); }
.tweak-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 0.85rem;
  transition: all 0.15s;
}
.tweak-toggle.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
