/* ==========================================================================
   আমার ৬৪ — BASE   (hand H1 · design-system core, file 2 of 2)
   Reset + element defaults + accessibility primitives. Consumes tokens.css.
   No component classes live here — .card/.btn/.chip/… belong to
   layout.css / components.css / mobile.css.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light;
  scroll-behavior: smooth;
}
html.night { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-body);
  color: var(--c-text);
  background-color: var(--c-canvas);
  /* the khata paper: pulp grain + a faint ruled line, pure gradients */
  background-image:
    radial-gradient(circle at 18% 12%, rgba(0, 0, 0, .020) 0 1.2px, transparent 1.3px),
    radial-gradient(circle at 63% 41%, rgba(0, 0, 0, .016) 0 1.1px, transparent 1.2px),
    radial-gradient(circle at 86% 78%, rgba(0, 0, 0, .014) 0 1px, transparent 1.1px),
    repeating-linear-gradient(0deg, transparent 0 33px, var(--rule-soft) 33px 34px);
  background-size: 41px 41px, 57px 57px, 73px 73px, 100% 34px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ------------------------------------------------------------- typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--fw-label);
  line-height: 1.25;
  text-wrap: balance;
  color: var(--c-text);
}
/* the page's single display line (one per page). The masthead brand must not
   ride a bare <h1> — style .brand explicitly in layout.css. */
h1 { font-family: var(--font-disp); font-size: var(--t-hero); line-height: var(--lh-hero); font-weight: var(--fw-display); letter-spacing: -.01em; }
h2 { font-family: var(--font-disp); font-size: var(--t-h2); line-height: var(--lh-h2); }
h3 { font-family: var(--font-disp); font-size: var(--t-h3); line-height: var(--lh-h3); }
h4 { font-size: var(--t-lead); line-height: var(--lh-lead); }
h5 { font-size: var(--t-label); line-height: var(--lh-label); }
h6 { font-size: var(--t-micro); line-height: var(--lh-micro); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

small { font-size: var(--t-micro); line-height: var(--lh-micro); }
strong, b { font-weight: var(--fw-label); }

/* links are indigo — never red (§3) */
a {
  color: var(--indigo);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.25em; }
li { margin: 0; }

hr { height: 0; margin: var(--sp-5) 0; border: 0; border-top: 1px solid var(--c-rule); }

code, kbd, samp, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}

/* ------------------------------------------------------------------ media */
img, svg, video, canvas { max-width: 100%; }
img, video, canvas { display: block; height: auto; }
svg { vertical-align: middle; }

/* ----------------------------------------------------------------- forms */
button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button { cursor: pointer; }
textarea { resize: vertical; }
::placeholder { color: var(--ink-soft); opacity: 1; }

/* ------------------------------------------------------------- focus ring
   §3: indigo, 3px, offset 2px — on EVERY interactive element, always visible. */
:focus-visible { outline: var(--focus-w) solid var(--c-focus); outline-offset: var(--focus-off); }
:focus:not(:focus-visible) { outline: none; }

::selection { background: color-mix(in srgb, var(--indigo) 22%, transparent); }

/* --------------------------------------------------- a11y primitives */
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip, .skip-link {
  position: absolute;
  left: var(--sp-2); top: var(--sp-2);
  z-index: 100;
  transform: translateY(-200%);
  background: var(--ink);
  color: var(--paper);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  font-weight: var(--fw-label);
  text-decoration: none;
}
.skip:focus, .skip-link:focus { transform: translateY(0); }

/* ------------------------------------------------------------------ motion
   §11: all motion is off under reduced motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------------ print */
@media print {
  body { background: #fff; background-image: none; color: #000; }
}
