/* ==========================================================================
   SiratSync Base Styles & Typography
   Apple-Level Minimal, Polished Aesthetics
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--ss-header-height) + 20px);
}

body {
  font-family: var(--ss-font-sans);
  background-color: var(--ss-bg);
  background-image:
    radial-gradient(circle at 8% 18%, rgba(var(--ss-gold-rgb), 0.055), transparent 26rem),
    radial-gradient(circle at 90% 48%, rgba(var(--ss-accent-rgb), 0.04), transparent 25rem);
  color: var(--ss-text-primary);
  line-height: 1.65;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color var(--ss-duration-normal) var(--ss-ease-out),
              color var(--ss-duration-normal) var(--ss-ease-out);
}

/* ─── Layout & Container ────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--ss-content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(18px, 4vw, 36px);
  padding-right: clamp(18px, 4vw, 36px);
}

.section {
  position: relative;
  padding: clamp(70px, 9vw, 130px) 0;
}

main {
  position: relative;
  isolation: isolate;
}

main > .container > .section-header:first-child,
main > .container > .faq-filter-pills:first-child {
  position: relative;
}

.section-tight {
  padding: clamp(48px, 6vw, 80px) 0;
}

/* ─── Typography Hierarchy ──────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: var(--ss-text-primary);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin-bottom: 0.6em;
}

h1 {
  font-size: clamp(2.55rem, 5.2vw + 1rem, 4.65rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.85rem, 3.4vw + 0.6rem, 2.75rem);
  letter-spacing: -0.028em;
  line-height: 1.16;
}

h1, h2 {
  text-wrap: balance;
}

h3 {
  font-size: clamp(1.3rem, 1.8vw + 0.5rem, 1.7rem);
  letter-spacing: -0.018em;
}

h4 {
  font-size: 1.15rem;
  letter-spacing: -0.012em;
}

p {
  color: var(--ss-text-secondary);
  font-size: 1.025rem;
  line-height: 1.68;
  margin-bottom: 1.25rem;
}

::selection {
  background: rgba(var(--ss-gold-rgb), 0.28);
  color: var(--ss-text-primary);
}

p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: clamp(1.125rem, 1.5vw + 0.75rem, 1.35rem);
  color: var(--ss-text-secondary);
  line-height: 1.55;
  font-weight: 400;
}

/* Section Header Presentation */
.section-header {
  text-align: center;
  max-width: 740px;
  margin: 0 auto clamp(40px, 6vw, 70px);
}

.section-header > .lead {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.section-header.text-left {
  text-align: left;
  margin-left: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ss-accent);
  margin-bottom: 14px;
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 1.5px;
  background-color: var(--ss-gold);
  border-radius: 2px;
}

.section-header.text-left .eyebrow::before {
  display: none;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  font-size: clamp(1rem, 1.1vw + 0.6rem, 1.18rem);
  color: var(--ss-text-secondary);
  margin-bottom: 0;
}

/* Quranic / Arabic Typography */
.arabic-quote {
  font-family: var(--ss-font-arabic);
  font-size: clamp(1.4rem, 2vw + 0.8rem, 2rem);
  line-height: 2.1;
  color: var(--ss-accent);
  text-align: center;
  direction: rtl;
  margin: 1.5rem 0 0.5rem;
  font-weight: 400;
}

.arabic-reference {
  font-size: 0.88rem;
  color: var(--ss-text-tertiary);
  font-style: normal;
  text-align: center;
  display: block;
}

/* ─── Links & Interactive States ────────────────────────────────── */
a {
  color: var(--ss-accent);
  text-decoration: none;
  transition: color var(--ss-duration-fast) var(--ss-ease-out),
              opacity var(--ss-duration-fast) var(--ss-ease-out);
}

a:hover {
  color: var(--ss-gold);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 600px) {
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .section {
    padding: 72px 0;
  }
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ss-accent);
  outline-offset: 3px;
  border-radius: var(--ss-radius-sm);
}

/* ─── Accessibility & Utilities ─────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-to-content {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--ss-text-primary);
  color: var(--ss-surface-elevated);
  padding: 10px 18px;
  border-radius: var(--ss-radius-sm);
  z-index: 9999;
  font-weight: 500;
  transition: top var(--ss-duration-fast);
}

.skip-to-content:focus {
  top: 20px;
}

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

/* ==========================================================================
   Refinement layer — typography polish, selection, scrollbar, link motion
   ========================================================================== */
body {
  font-feature-settings: "kern", "liga", "calt";
  text-rendering: optimizeLegibility;
}

p, li {
  text-wrap: pretty;
}

h3, h4 {
  text-wrap: balance;
}

/* Calm, branded scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--ss-scrollbar-thumb) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--ss-scrollbar-thumb);
  border-radius: var(--ss-radius-pill);
  border: 2px solid var(--ss-bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(var(--ss-accent-rgb), 0.55); }

/* Eyebrow ornament grows in when its section reveals */
.reveal-on-scroll.is-revealed .eyebrow::before,
.reveal-on-scroll.is-revealed .eyebrow::after {
  animation: ssLineGrow 0.9s var(--ss-ease-spring) 0.25s backwards;
}

/* Inline links inside long-form copy get a drawn underline */
.doc-card a,
.faq-answer-content a,
.footer-brand p a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size var(--ss-duration-normal) var(--ss-ease-out),
              color var(--ss-duration-fast) var(--ss-ease-out);
}

.doc-card a:hover,
.faq-answer-content a:hover,
.footer-brand p a:hover {
  background-size: 100% 1px;
}

/* Softer, more visible keyboard focus */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ss-accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(var(--ss-gold-rgb), 0.18);
}

img {
  transition: opacity var(--ss-duration-slow) var(--ss-ease-out);
}
