/* ==========================================================================
   NIFIAN — Reset, elements, layout primitives, utilities
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 110px; /* clears the sticky header on anchor jumps */
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--font-display); font-weight: 600; }
h1 { font-size: var(--fs-h1);  line-height: var(--lh-tight); letter-spacing: var(--ls-display); }
h2 { font-size: var(--fs-h2);  line-height: var(--lh-head);  letter-spacing: var(--ls-head); }
h3 { font-size: var(--fs-h3);  line-height: 1.22; letter-spacing: -0.01em; }
h4 { font-size: var(--fs-h4);  line-height: 1.3; font-weight: 600; }

p { margin: 0 0 1.15em; max-width: 68ch; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

img, svg, video { max-width: 100%; height: auto; display: block; }
img { background: var(--bone-deep); }

ul, ol { margin: 0 0 1.15em; padding-left: 1.25rem; }
li { margin-bottom: 0.4em; }
li:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; }
em, i { font-style: italic; }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-7) 0; }

button { font: inherit; color: inherit; cursor: pointer; }

::selection { background: var(--gold); color: var(--green-950); }

/* ---- Focus ------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-dark :focus-visible { outline-color: var(--gold-bright); }

/* ---- Skip link --------------------------------------------------------- */
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px;
  z-index: var(--z-modal);
  background: var(--green-900); color: var(--white);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 600;
  text-decoration: none;
  transition: top var(--dur) var(--ease-out);
}
.skip-link:focus { top: var(--sp-4); }

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); position: relative; }
.section--sm { padding-block: var(--section-y-sm); }
.section--tight-top { padding-top: var(--section-y-sm); }

/* Surface variants */
.section--alt  { background: var(--surface-alt); }
.section--dark { background: var(--surface-dark); color: var(--on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--white); }
.section--dark p { color: var(--on-dark-muted); }
.section--dark .eyebrow { color: var(--gold); }

/* Grid helpers */
.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.grid--split-wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.flow-reverse { direction: rtl; }
.flow-reverse > * { direction: ltr; }

/* ==========================================================================
   Typography components
   ========================================================================== */

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--gold-ink);
  margin: 0 0 var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: currentColor;
  flex: none;
  opacity: 0.6;
}
.section--dark .eyebrow::before { opacity: 0.8; }

.display { font-size: var(--fs-display); line-height: var(--lh-tight); letter-spacing: var(--ls-display); font-weight: 600; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 60ch;
}
.section--dark .lead { color: var(--on-dark-muted); }

.section-head { max-width: 720px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head--wide { max-width: 900px; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head--center .lead { margin-inline: auto; }
.section-head p { margin-top: var(--sp-4); }

.measure { max-width: 68ch; }
.measure-narrow { max-width: 58ch; }

.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }

/* Pull quote */
.pullquote {
  border-left: 3px solid var(--gold);
  padding: var(--sp-2) 0 var(--sp-2) var(--sp-6);
  margin: var(--sp-7) 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1.35;
  letter-spacing: -0.012em;
  font-weight: 500;
}
.pullquote cite {
  display: block;
  margin-top: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.section--dark .pullquote cite { color: var(--on-dark-muted); }

/* Answer block — the AEO / quotable paragraph */
.answer-block {
  background: var(--bone);
  border-left: 3px solid var(--gold-ink);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--sp-5) var(--sp-6);
  font-size: var(--fs-lead);
  line-height: 1.5;
  margin-bottom: var(--sp-6);
  max-width: 72ch;
}
.section--dark .answer-block {
  background: var(--green-800);
  border-left-color: var(--gold);
  color: var(--on-dark);
}

/* Key-points box */
.keypoints {
  background: var(--bone);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin: var(--sp-7) 0;
}
.keypoints h4 {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: var(--sp-4);
}
.keypoints ul { list-style: none; padding: 0; margin: 0; }
.keypoints li {
  position: relative;
  padding-left: var(--sp-6);
  margin-bottom: var(--sp-3);
  font-size: var(--fs-sm);
}
.keypoints li::before {
  content: "";
  position: absolute; left: 0; top: 0.55em;
  width: 12px; height: 2px;
  background: var(--gold-ink);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

/* A class like .field { display:flex } outbids the UA sheet's [hidden]{display:none},
   which left conditionally-hidden form fields visible. This settles it. */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  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;
}

.no-scroll { overflow: hidden; }

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.mb-0 { margin-bottom: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--split, .grid--split-wide { grid-template-columns: minmax(0, 1fr); }
  .flow-reverse { direction: ltr; }
}

@media (max-width: 860px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .pullquote { padding-left: var(--sp-5); }
  .answer-block { padding: var(--sp-5); }
}
