/* ============================================================
   BagaTur base — reset + body + element defaults
   ============================================================ */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
}

body {
  color: var(--ink-sepia);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  /* Body base color only — parchment image moves to per-section so it stretches
     to each section's actual dimensions (no tile, no visible edges). */
  background-color: var(--parchment);
}

/* Body-level vignette — single fixed radial darkening at viewport corners,
   replaces the vignette that was previously baked into parchment-texture.jpg.
   Keeping it on the BODY (not on sections) means scroll feels like holding a
   single sheet of paper in front of the viewer, not many separate sheets. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(63, 46, 30, 0.20) 100%
  );
  mix-blend-mode: multiply;
}

/* Very fine SVG grain on top of the real texture — adds high-freq tactility
   that the JPEG can't store. Lower opacity (0.04) since the real texture already
   carries most of the biology. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch' seed='7'/><feColorMatrix values='0 0 0 0 0.247  0 0 0 0 0.181  0 0 0 0 0.118  0 0 0 0.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* Lift content above the noise layer */
main,
header,
footer { position: relative; z-index: 1; }

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

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

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

a {
  color: var(--ember);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-decisive);
}

a:hover,
a:focus-visible {
  color: var(--ink-sepia);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Typography defaults ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-display);
  color: var(--ink-sepia);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--fs-h3); letter-spacing: var(--tracking-snug); line-height: var(--lh-tight); }
h4 { font-size: var(--fs-body); font-family: var(--font-body); font-weight: 700; }

p {
  max-width: 65ch;
}

em {
  font-style: italic;
  color: var(--ember);
}

strong {
  font-weight: 700;
  color: var(--ink-sepia);
}

::selection {
  background: var(--ember);
  color: var(--bone);
}

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--container-max);
  padding-inline: var(--container-pad);
  margin-inline: auto;
  width: 100%;
}

.container--wide {
  max-width: 90rem;
}

.section {
  padding-block: clamp(var(--space-8), 10vw, var(--space-10));
}

.section--tight {
  padding-block: var(--space-7);
}

/* Base section — every section gets its own parchment image stretched 100%/100%
   to its actual dimensions. No tile, no seams between sections. */
.section {
  background-image: url("../brand_assets/parchment-texture.jpg");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center center;
  background-color: var(--parchment);
  position: relative;
  isolation: isolate;
}

/* Default neutral section — just stretched parchment, no extra tint */
.section--ink {
  /* legacy class kept for HTML compatibility; renders as pure parchment now */
}

/* Warm parchment panel — adds a warm tint layer over the stretched parchment */
.section--iron {
  background-image:
    linear-gradient(rgba(232, 219, 192, 0.40), rgba(232, 219, 192, 0.40)),
    url("../brand_assets/parchment-texture.jpg");
  background-size: auto, 100% 100%;
}

/* Faint period-pattern overlay — IYI / Bulgarian rosette silhouette.
   Opacity 0.035 = barely-there texture. Only on .section--iron blocks. */
.section--iron::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280' viewBox='0 0 280 280'><g fill='none' stroke='%233f2e1e' stroke-width='1.2' opacity='0.5'><circle cx='140' cy='140' r='52'/><circle cx='140' cy='140' r='28'/><path d='M140 88 L140 192 M88 140 L192 140 M104 104 L176 176 M176 104 L104 176'/></g></svg>");
  background-size: 320px 320px;
  background-repeat: repeat;
  opacity: 0.035;
}

/* Lighter cream — light tint over stretched parchment */
.section--bone {
  background-image:
    linear-gradient(rgba(251, 245, 229, 0.35), rgba(251, 245, 229, 0.35)),
    url("../brand_assets/parchment-texture.jpg");
  background-size: auto, 100% 100%;
}

/* Deep sepia panel — rare, for high-contrast CTA blocks */
.section--deep {
  background: var(--iron-deep);
  color: var(--bone);
}
.section--deep h1,
.section--deep h2,
.section--deep h3 {
  color: var(--parchment);
}
.section--deep .eyebrow {
  color: var(--sand);
}

/* ---------- Eyebrow (small uppercase label) ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ember);
  display: inline-block;
  margin-bottom: var(--space-4);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--ember);
  vertical-align: middle;
  margin-right: var(--space-3);
  transform: translateY(-2px);
}

/* ---------- Pull-quote (centered display, large) ---------- */
.pullquote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.75rem, 1rem + 3vw, 3.25rem);
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
  color: var(--ink-sepia);
  max-width: 32ch;
  text-wrap: balance;
}

.pullquote-attr {
  display: block;
  margin-top: var(--space-5);
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--fs-meta);
  color: var(--steel);
  letter-spacing: 0.02em;
}

/* ---------- Hairline divider ---------- */
.hairline {
  border: 0;
  height: 1px;
  background: var(--hairline);
  margin-block: var(--space-7);
}

/* ---------- Skip-link (a11y) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blood-iron);
  color: var(--bone);
  padding: var(--space-3) var(--space-5);
  z-index: 100;
}
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}

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

/* ---------- Tabular numerals for stats ---------- */
.num,
.stat-value,
time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
