/* global.css — Typography, base elements, utilities */

/* ── BASE ─────────────────────────────────────────────────── */
html { font-size: 16px; }

body {
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--clr-text-body);
  background: var(--clr-white);
}

/* ── HEADINGS ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--clr-text-dark);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

h1 { font-size: var(--text-6xl); font-weight: var(--fw-black); }
h2 { font-size: var(--text-4xl); font-weight: var(--fw-black); }
h3 { font-size: var(--text-xl);  font-weight: var(--fw-bold);  line-height: var(--lh-snug); }
h4 { font-size: var(--text-lg);  font-weight: var(--fw-bold);  line-height: var(--lh-snug); }
h5 { font-size: var(--text-md);  font-weight: var(--fw-semibold); }
h6 { font-size: var(--text-sm);  font-weight: var(--fw-semibold); }

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

a { text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--clr-gold); }

strong { font-weight: var(--fw-bold); }

/* ── SKIP LINK ────────────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: var(--z-skip);
  padding: var(--sp-3) var(--sp-6);
  background: var(--clr-gold);
  color: var(--clr-midnight);
  font-weight: var(--fw-black);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--ease-fast);
}
.skip-link:focus { transform: translateY(0); }

/* ── EMERGENCY BAR ────────────────────────────────────────── */
.emergency-bar {
  background: var(--clr-midnight);
  border-bottom: 1px solid var(--clr-gold-line);
  padding: var(--sp-2) 0;
  font-size: var(--text-sm);
}
.emergency-bar__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.emergency-bar__text {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--clr-text-white-80);
  flex: 1;
}
.emergency-bar__phone {
  color: var(--clr-gold-bright);
  font-weight: var(--fw-black);
  font-size: var(--text-md);
  text-decoration: none;
  letter-spacing: var(--ls-wide);
  transition: color var(--ease-fast);
}
.emergency-bar__phone:hover { color: var(--clr-white); }
.emergency-bar__badges {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-2xs);
  font-weight: var(--fw-black);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}
.badge--light {
  background: rgba(255,255,255,0.12);
  color: var(--clr-text-white-80);
  border: 1px solid rgba(255,255,255,0.15);
}
.badge--gold {
  background: var(--clr-gold-glow);
  color: var(--clr-gold-bright);
  border: 1px solid var(--clr-gold-line);
}
/* ── EYEBROW ──────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-xs);
  font-weight: var(--fw-black);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--clr-gold);
  margin-bottom: var(--sp-4);
}
.eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--clr-gold);
  flex-shrink: 0;
}
.eyebrow.eyebrow--dark { color: var(--clr-navy); }
.eyebrow.eyebrow--dark::before { background: var(--clr-navy); }

/* ── TEXT HIGHLIGHT ───────────────────────────────────────── */
.text-highlight {
  position: relative;
  color: var(--clr-gold-bright);
  display: inline-block;
}
.text-highlight::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 3px;
  background: linear-gradient(90deg, var(--clr-gold), var(--clr-gold-bright));
  border-radius: var(--radius-full);
  animation: draw-underline 0.8s cubic-bezier(0.4,0,0.2,1) 0.4s forwards;
}
@keyframes draw-underline { to { width: 100%; } }

.text-gold  { color: #8B6914; }

/* ── HERO TEXT COLOUR ─────────────────────────────────────── */
/* Override default dark heading colour inside dark hero backgrounds */
.hero h1, .hero h2, .hero h3, .hero h4,
.hero .hero__headline * {
  color: var(--clr-text-white);
}

/* ── SECTION PATTERNS ─────────────────────────────────────── */
.section { padding: var(--sp-20) 0; }
.section--dark {
  background: var(--clr-navy);
  color: var(--clr-text-white);
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 { color: var(--clr-text-white); }

.section--light { background: var(--clr-surface-1); }
.section--white { background: var(--clr-white); }

/* ── NOISE TEXTURE ────────────────────────────────────────── */
.section--textured {
  background-color: var(--clr-midnight);
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-blend-mode: overlay;
}

/* ── DIAGONAL DIVIDERS ────────────────────────────────────── */
.section--diagonal-bottom {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 60px), 0 100%);
  padding-bottom: calc(var(--sp-20) + 60px);
}
.section--diagonal-top {
  margin-top: -60px;
  padding-top: calc(var(--sp-20) + 60px);
  position: relative;
  z-index: var(--z-base);
}

/* ── STAGGER ANIMATION ────────────────────────────────────── */
/* Only hide items when JS has confirmed it's running (prevents invisible content on slow/no-JS) */
.js-loaded .stagger-item {
  opacity: 0;
  visibility: hidden;
  transform: translateY(32px);
  transition: opacity var(--ease-slow), transform var(--ease-slow);
}
.stagger-item.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

/* ── COUNTER SHIMMER ──────────────────────────────────────── */
.counter-shimmer { position: relative; overflow: hidden; }
.counter-shimmer.is-counting::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(240,192,64,0.30) 50%, transparent 100%);
  animation: shimmer-pass 0.8s ease-out forwards;
}
@keyframes shimmer-pass { to { left: 150%; } }

/* ── UTILITY ──────────────────────────────────────────────── */
.w-full { width: 100%; }
