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

[hidden] { display: none !important; }

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

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-m);
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

.surface-light, .surface-dark { background: var(--bg); color: var(--fg); }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
picture { display: contents; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 750;
  font-stretch: var(--wide);
  letter-spacing: var(--track-display);
  line-height: 1.02;
  text-wrap: balance;
}
h1 { font-size: var(--fs-display); font-weight: 800; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-xl); line-height: 1.12; }
h4 { font-size: var(--fs-l); line-height: 1.2; }
html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3, html[lang="fa"] h4 { line-height: 1.3; }

p { margin: 0; max-width: 68ch; }
p + p { margin-block-start: 1em; }

a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

ul, ol { margin: 0; padding: 0; }
dl, dd { margin: 0; }

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

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

::selection { background: var(--brass); color: var(--ink); }

.num, .tabular { font-variant-numeric: tabular-nums; }
bdi.ltr, .ltr { direction: ltr; unicode-bidi: isolate; }

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  inset-block-start: -80px;
  z-index: var(--z-skip);
  background: var(--brass);
  color: var(--ink);
  padding: 12px 18px;
  font-weight: 600;
  text-decoration: none;
  transition: inset-block-start var(--t-fast) var(--ease);
}
.skip-link:focus { inset-block-start: 12px; }

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

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * .6); }

.lede {
  font-size: var(--fs-l);
  line-height: 1.5;
  color: var(--fg-2);
  max-width: 44ch;
}
.muted { color: var(--fg-2); }
.small { font-size: var(--fs-xs); }

.note {
  font-size: var(--fs-xs);
  color: var(--fg-2);
  max-width: 72ch;
}

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