/* ==========================================================================
   Base: fonts, reset, typography rules (Typography chapter pp.43–45),
   logical-property layout primitives (RTL-ready), accessibility.
   ========================================================================== */

@font-face { font-family: "Readex Pro"; src: url("../fonts/ReadexPro-200.woff2") format("woff2"); font-weight: 200; font-display: swap; }
@font-face { font-family: "Readex Pro"; src: url("../fonts/ReadexPro-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Readex Pro"; src: url("../fonts/ReadexPro-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Readex Pro"; src: url("../fonts/ReadexPro-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Readex Pro"; src: url("../fonts/ReadexPro-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "A Jannat LT"; src: url("../fonts/AJannatLT-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "A Jannat LT"; src: url("../fonts/AJannatLT-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
/* metric-matched fallback keeps layout steady while Readex Pro swaps in */
@font-face { font-family: "Readex Pro Fallback"; src: local("Arial"); size-adjust: 104%; ascent-override: 96%; descent-override: 24%; }

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-block-start: calc(var(--header-h) + 16px);
}

body {
  min-block-size: 100svh;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  text-align: start;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img,
svg,
video,
canvas { display: block; max-inline-size: 100%; }
img { block-size: auto; }

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

button { cursor: pointer; background: none; border: 0; padding: 0; }

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

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

/* — Typography rules: start-aligned, few weights, balanced rag, no orphans — */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

p, li, figcaption, blockquote { text-wrap: pretty; }

.display { font-size: var(--step-6); line-height: var(--lh-tight); font-weight: var(--fw-regular); }
.h1 { font-size: var(--step-5); line-height: var(--lh-tight); }
.h2 { font-size: var(--step-4); line-height: 1.08; }
.h3 { font-size: var(--step-2); line-height: var(--lh-snug); }
.lead { font-size: var(--step-1); color: var(--ink-2); max-inline-size: 58ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent);
}

/* gradient-filled text (Charts System p.65 "Single Value") */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* — Layout primitives (logical properties only) — */
.container {
  inline-size: 100%;
  max-inline-size: calc(var(--page-max) + var(--page-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.section { padding-block: var(--space-3xl); position: relative; }
/* motion offsets (scatter, parallax) must never create sideways scroll; clip per section
   because body-level overflow is propagated to the viewport */
main > section { overflow-x: clip; }

.stack > * + * { margin-block-start: var(--stack-gap, var(--space-s)); }

.visually-hidden {
  position: absolute !important;
  inline-size: 1px; block-size: 1px;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}

/* direction-aware icons (arrows etc.) flip in RTL */
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* — Accessibility — */
.skip-link {
  position: fixed;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--accent-strong);
  color: var(--on-accent);
  font-family: var(--font-display);
  transform: translateY(-160%);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

/* an outline (not a box-shadow): no component shadow can erase it, and forced-colors keeps it */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

::selection { background: color-mix(in srgb, var(--bora-core-purple) 28%, transparent); }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
