/* ============================================================
   WalQuran Academy — black (#0a0a0a) + beige (#F5F5DC)
   Mobile-first. Contrast of beige on this black is ~17.7:1.
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --fg: #f5f5dc;
  --fg-muted: #d4d4b8;
  --border: #3a3a30;
  --focus: #f5f5dc;
  --header-h: 4.6rem;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 0.5rem;
  --max: 68rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--fg);
}

h1 {
  font-size: clamp(1.85rem, 5vw, 3.15rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 1rem;
  color: var(--fg-muted);
}

a {
  color: var(--fg);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* Beige outline on black — required focus style */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 1000;
  padding: 0.5rem 0.85rem;
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ---------- Header / sticky nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
}

.logo-img {
  display: block;
  height: 2.35rem;
  width: auto;
  max-width: min(58vw, 17.5rem);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--fg);
  position: relative;
}

.menu-toggle-bars::before,
.menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle-bars::before {
  top: -6px;
}

.menu-toggle-bars::after {
  top: 6px;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.primary-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem 1.25rem;
}

.primary-nav.is-open {
  display: block;
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav a {
  display: block;
  padding: 0.65rem 0.35rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.primary-nav a:hover,
.primary-nav a[aria-current="true"] {
  background: var(--bg-elevated);
}

@media (min-width: 72rem) {
  .logo-img {
    height: 2.6rem;
    max-width: 19rem;
  }

  .menu-toggle {
    display: none;
  }

  .primary-nav {
    display: block;
    position: static;
    background: transparent;
    border: 0;
    padding: 0;
  }

  .primary-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.1rem 0.15rem;
  }

  .primary-nav a {
    border: 0;
    padding: 0.4rem 0.5rem;
    border-radius: 0.35rem;
    font-size: 0.95rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-items: start;
  padding: 2.5rem 1rem 3.5rem;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 44rem);
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--fg);
  margin-bottom: 0.75rem;
}

.lead {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.scholarships {
  margin-top: 2rem;
  padding: 1.2rem 1.15rem 1.3rem;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(20, 20, 20, 0.82);
}

.scholarships h2 {
  font-size: 1.25rem;
  margin-bottom: 0.85rem;
}

.scholarship-types {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.scholarship-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
}

.scholarship-card p {
  margin: 0;
  font-size: 0.98rem;
}

.process-title {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.05rem;
}

.scholarship-process {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--fg-muted);
}

.scholarship-process span {
  color: var(--fg);
}

.scholarship-actions {
  justify-content: flex-start;
}

@media (min-width: 40rem) {
  .scholarship-types {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--fg);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}

.btn-primary:hover {
  background: #ebebd0;
}

.btn-secondary {
  background: transparent;
  color: var(--fg);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
}

/* CSS-only Arabic calligraphy-style ornament (no images) */
.hero-deco {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.calligraphy-ring {
  width: min(78vw, 28rem);
  height: min(78vw, 28rem);
  border-radius: 50%;
  border: 1px solid rgba(245, 245, 220, 0.18);
  box-shadow:
    0 0 0 12px rgba(245, 245, 220, 0.04),
    inset 0 0 0 18px rgba(245, 245, 220, 0.04);
  display: grid;
  place-items: center;
  background:
    repeating-conic-gradient(
      from 0deg,
      transparent 0 8deg,
      rgba(245, 245, 220, 0.06) 8deg 9deg
    );
}

.calligraphy-word {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 16vw, 7.5rem);
  opacity: 0.09;
  line-height: 1;
}

.star-ornament {
  position: absolute;
  width: 4.5rem;
  height: 4.5rem;
  top: 12%;
  right: 8%;
  background: radial-gradient(circle, rgba(245, 245, 220, 0.2) 18%, transparent 19%);
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  background-color: rgba(245, 245, 220, 0.12);
}

@media (min-width: 48rem) {
  .hero-copy {
    text-align: left;
    margin-inline: auto;
    margin-left: max(1rem, calc((100% - var(--max)) / 2));
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .calligraphy-ring {
    margin-left: 28%;
  }
}

/* ---------- Shared sections ---------- */
.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.section-intro {
  max-width: 40rem;
  margin-bottom: 2rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  gap: 1rem;
}

.about-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.about-note {
  margin-top: 1.5rem;
  font-style: italic;
}

@media (min-width: 48rem) {
  .about-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Courses ---------- */
.course-grid {
  display: grid;
  gap: 1rem;
}

.course-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: border-color 0.2s ease;
}

.course-card:hover,
.course-card:focus-within {
  border-color: var(--fg);
}

.text-link {
  font-weight: 600;
}

@media (min-width: 40rem) {
  .course-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .course-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- How it works ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  text-align: center;
}

.step-icon {
  display: inline-block;
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

@media (min-width: 48rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Testimonials carousel ---------- */
.carousel {
  max-width: 40rem;
}

.quote {
  margin: 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  min-height: 12rem;
}

.quote p {
  font-size: 1.08rem;
  color: var(--fg);
}

.quote footer {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.quote cite {
  font-style: normal;
  font-weight: 600;
  color: var(--fg);
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.carousel-btn {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  border-radius: var(--radius);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.carousel-btn:hover {
  background: var(--bg-elevated);
}

.carousel-dots {
  display: flex;
  gap: 0.4rem;
}

.dot {
  width: 0.7rem;
  height: 0.7rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--fg);
  background: transparent;
  cursor: pointer;
}

.dot[aria-selected="true"] {
  background: var(--fg);
}

/* ---------- Contact ---------- */
.contact-layout {
  display: grid;
  gap: 2rem;
}

.contact-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-links li {
  margin-bottom: 0.5rem;
}

.trial-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg);
  font: inherit;
}

.field input::placeholder {
  color: #9a9a80;
}

.form-note {
  min-height: 1.4em;
  margin: 0;
  font-size: 0.95rem;
}

@media (min-width: 48rem) {
  .contact-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
}

.footer-grid {
  display: grid;
  gap: 1rem;
}

.footer-brand {
  margin: 0;
}

.footer-logo {
  display: block;
  height: 2.1rem;
  width: auto;
  max-width: 16rem;
}

.footer-links,
.footer-social {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.copyright {
  margin: 0;
  font-size: 0.95rem;
}

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }

  .copyright {
    grid-column: 1 / -1;
  }
}

/* Legal satellite pages */
.legal-page {
  padding: 3rem 0 4rem;
  min-height: 70vh;
}

.legal-page p,
.legal-page li {
  color: var(--fg-muted);
  max-width: 42rem;
}

.legal-nav {
  display: block !important;
  position: static !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

.legal-nav ul {
  display: flex;
  gap: 0.75rem;
}

.legal-nav a {
  border: 0;
  padding: 0.4rem 0.55rem;
}
