/* ==========================================================================
   GICC — base.css
   Reset, document defaults, typography primitives, layout utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h-sticky) + var(--sp-6));
  -moz-tab-size: 4;
  tab-size: 4;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  font-weight: var(--fw-regular);
  color: var(--fg-default);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  overflow-x: hidden;
}

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

img, video { height: auto; }

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

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

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

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

table { border-collapse: collapse; width: 100%; }

hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: var(--sp-10) 0;
}

:target { scroll-margin-top: calc(var(--header-h-sticky) + var(--sp-8)); }

/* --------------------------------------------------------------------------
   2. Focus — visible, on-brand, never removed
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

:focus:not(:focus-visible) { outline: none; }

::selection {
  background: var(--gold-300);
  color: var(--navy-950);
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--fg-strong);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-4xl); line-height: var(--lh-tight); letter-spacing: var(--ls-tighter); font-weight: var(--fw-extra); }
h2 { font-size: var(--fs-3xl); line-height: var(--lh-tight); letter-spacing: var(--ls-tighter); font-weight: var(--fw-extra); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
h6 { font-size: var(--fs-md); font-weight: var(--fw-semibold); }

p { text-wrap: pretty; }

a {
  color: var(--navy-600);
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
  transition: color var(--dur-fast) var(--ease-out),
              text-decoration-color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--gold-700); text-decoration-color: currentColor; }
.on-dark a { color: var(--gold-300); }
.on-dark a:hover { color: var(--gold-200); }

strong, b { font-weight: var(--fw-semibold); color: var(--fg-strong); }
.on-dark strong, .on-dark b { color: var(--white); }

small { font-size: var(--fs-sm); }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.9em; }

/* Prose block — long-form content (news article, page body from CMS) */
.prose {
  max-width: var(--container-text);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--fg-default);
}
.prose > * + * { margin-top: var(--sp-5); }
.prose h2 { font-size: var(--fs-2xl); margin-top: var(--sp-12); }
.prose h3 { font-size: var(--fs-xl); margin-top: var(--sp-10); }
.prose h4 { font-size: var(--fs-lg); margin-top: var(--sp-8); }
.prose ul, .prose ol { padding-left: var(--sp-6); }
.prose li + li { margin-top: var(--sp-2); }
.prose li::marker { color: var(--gold-600); }
.prose img { border-radius: var(--r-lg); margin-block: var(--sp-8); box-shadow: var(--sh-md); }
.prose blockquote {
  border-left: 3px solid var(--gold-600);
  padding: var(--sp-2) 0 var(--sp-2) var(--sp-6);
  font-size: var(--fs-lg);
  line-height: var(--lh-normal);
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  color: var(--fg-strong);
}
.prose figcaption {
  font-size: var(--fs-sm);
  color: var(--fg-subtle);
  margin-top: calc(var(--sp-6) * -1 + var(--sp-3));
}

/* Type helpers */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--fg-accent);
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  background: currentColor;
  flex: none;
  border-radius: 2px;
}
.eyebrow--plain::before { display: none; }

.lede {
  font-size: var(--fs-lg);
  line-height: var(--lh-normal);
  color: var(--fg-muted);
  font-weight: var(--fw-regular);
  max-width: 62ch;
}

.text-gradient {
  background: linear-gradient(100deg, var(--gold-400) 0%, var(--gold-600) 45%, var(--gold-300) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.u-mute   { color: var(--fg-muted); }
.u-subtle { color: var(--fg-subtle); }
.u-strong { color: var(--fg-strong); }
.u-accent { color: var(--fg-accent); }
.u-center { text-align: center; }
.u-right  { text-align: right; }
.u-nowrap { white-space: nowrap; }
.u-mono   { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.u-tnum   { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--text { max-width: var(--container-text); }
.container--flush { padding-inline: 0; }

.section { padding-block: var(--section-y); position: relative; }
.section--lg { padding-block: var(--section-y-lg); }
.section--sm { padding-block: var(--section-y-sm); }
.section--flush-top { padding-top: 0; }
.section--flush-bottom { padding-bottom: 0; }
.section--subtle  { background: var(--bg-subtle); }
.section--muted   { background: var(--bg-muted); }
.section--inverse { background: var(--bg-inverse); }

/* Section header block — eyebrow + title + lede */
.section-head { max-width: 720px; margin-bottom: var(--sp-12); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head > * + * { margin-top: var(--sp-4); }
.section-head__title { font-size: var(--fs-3xl); }

/* Split header — title left, action right */
.section-head--split {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
}
.section-head--split > div { max-width: 640px; }
.section-head--split > div > * + * { margin-top: var(--sp-4); }

/* Grid */
.grid { display: grid; gap: var(--sp-6); }
.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--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
/* 258px keeps four cards on one row inside a 1240px container (1160 content
   − 72 gap = 1088 ÷ 4 = 272). A larger min silently drops to three and leaves
   an orphan card on its own row. */
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(min(258px, 100%), 1fr)); }
.grid--auto-sm { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.grid--auto-lg { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.grid--gap-lg { gap: var(--sp-10); }
.grid--gap-sm { gap: var(--sp-4); }

.grid--sidebar { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-12); }
.grid--split   { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 5rem); align-items: center; }

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--split { grid-template-columns: minmax(0, 1fr); gap: var(--sp-10); }
}
@media (max-width: 620px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Flex helpers */
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.cluster--between { justify-content: space-between; }
.cluster--center { justify-content: center; }
.cluster--end { justify-content: flex-end; }
.cluster--tight { gap: var(--sp-2); }
.cluster--loose { gap: var(--sp-6); }

.stack > * + * { margin-top: var(--sp-4); }
.stack--sm > * + * { margin-top: var(--sp-2); }
.stack--lg > * + * { margin-top: var(--sp-8); }

/* Spacing utilities (sparingly used — components own their own spacing) */
.mt-0 { margin-top: 0; }  .mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); } .mt-12 { margin-top: var(--sp-12); }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); } .mb-8 { margin-bottom: var(--sp-8); }
.mb-12 { margin-bottom: var(--sp-12); }

/* --------------------------------------------------------------------------
   5. Accessibility helpers
   -------------------------------------------------------------------------- */
.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;
}

.skip-link {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: var(--z-toast);
  transform: translateY(-200%);
  background: var(--gold-600);
  color: var(--navy-950);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* --------------------------------------------------------------------------
   6. Scroll reveal — progressive enhancement.
      Elements only hide once JS confirms IntersectionObserver support
      (js adds .js-reveal-ready to <html>), so no-JS users see everything.
   -------------------------------------------------------------------------- */
.js-reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js-reveal-ready [data-reveal='fade']  { transform: none; }
.js-reveal-ready [data-reveal='left']  { transform: translateX(-28px); }
.js-reveal-ready [data-reveal='right'] { transform: translateX(28px); }
.js-reveal-ready [data-reveal='scale'] { transform: scale(0.94); }

.js-reveal-ready [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal-ready [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   7. Print
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .no-print, .hero__media { display: none !important; }
  body { color: #000; background: #fff; font-size: 11pt; }
  a::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #555; }
  .section { padding-block: 1rem; }
}
