/* ————————————————————————————————————————
   Base — reset, typography, utilities
   ———————————————————————————————————————— */

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
  background: var(--paper);
  overflow-x: clip;
  min-height: 100dvh;
  text-wrap: pretty;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: var(--lh-heading);
  font-weight: 700;
  text-wrap: balance;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: rgba(3, 200, 255, 0.22);
}

/* Layout ------------------------------------------------ */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--tint { background: var(--surface); }
.section--cyan { background: linear-gradient(180deg, #f2fafe, var(--paper)); }
.section--dark { background: var(--navy-deep); }

/* Typography helpers ------------------------------------ */

.h-display {
  font-size: var(--fs-display);
  font-weight: 900;
  line-height: var(--lh-tight);
  letter-spacing: 0;
}

.h1 { font-size: var(--fs-h1); font-weight: 900; line-height: var(--lh-tight); }
.h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.42; }
.h3 { font-size: var(--fs-h3); font-weight: 600; }

.lead {
  font-size: var(--fs-lead);
  line-height: 2;
  color: var(--muted);
}

.small { font-size: var(--fs-small); }
.caption { font-size: var(--fs-caption); color: var(--muted); }
.muted { color: var(--muted); }

.num {
  font-weight: 200;
  color: var(--ink);
  line-height: 1;
  font-feature-settings: "tnum";
}

/* Overline eyebrow — diamond facet motif.
   NOTE: no letter-spacing (breaks connected Persian script). */
.overline {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-overline);
  font-weight: 600;
  color: var(--accent-deep);
  line-height: 1;
}

.overline::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border: 1.5px solid var(--accent-deep);
  transform: rotate(45deg);
  border-radius: 1px;
}

.section--dark .overline { color: var(--accent); }
.section--dark .overline::before { border-color: var(--accent); }

/* Section head — asymmetric editorial header */
.section-head {
  display: grid;
  gap: var(--sp-4);
  max-width: 640px;
  margin-bottom: clamp(var(--sp-6), 6vw, var(--sp-8));
}

.section-head .h2 { max-width: 21ch; }

.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
  margin-bottom: clamp(var(--sp-6), 6vw, var(--sp-8));
}
.section-head-row .section-head { margin-bottom: 0; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.text-link svg { transition: transform var(--t-fast) var(--ease); }
.text-link:hover { color: var(--accent-deep); border-color: currentColor; }
.text-link:hover svg { transform: translateX(-4px); }

/* Utilities ---------------------------------------------- */

.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.wrap { flex-wrap: wrap; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100%;
  inset-inline-start: var(--sp-4);
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus-visible { top: var(--sp-3); }

/* Reveal-on-scroll (JS adds .is-in) */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Staggered reveal for direct children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal-stagger.is-in > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-in > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.is-in > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.is-in > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.is-in > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.is-in > * {
  opacity: 1;
  transform: none;
}

@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;
  }
  .reveal { opacity: 1; transform: none; }
}
