/* ==========================================================================
   STAY FREE ENTERPRISE — base layer
   Minimal reset + typography defaults + section-shell rhythm (ivory/sand
   alternation per plan §4). No build step: this file is hand-authored,
   loaded directly by index.html.
   ========================================================================== */

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, picture, svg { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; }

html {
  color-scheme: light;
  scroll-behavior: auto; /* Lenis owns smoothing when tier allows */
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--sf-bg-primary);
  color: var(--sf-text-primary);
  font-family: var(--sf-font-body);
  font-size: var(--sf-text-base);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- typography defaults ---- */
h1, h2, h3, h4 {
  font-family: var(--sf-font-display);
  font-weight: 480;
  color: var(--sf-text-primary);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-variation-settings: 'opsz' var(--sf-fraunces-opsz-hero), 'SOFT' var(--sf-fraunces-soft-hero), 'WONK' 0;
}

h1 { font-size: clamp(var(--sf-text-3xl), 6vw, var(--sf-text-5xl)); }
h2 { font-size: clamp(var(--sf-text-2xl), 4.2vw, var(--sf-text-4xl)); }
h3 { font-size: var(--sf-text-xl); }
h4 { font-size: var(--sf-text-lg); }

p  { max-width: var(--sf-max-prose); color: var(--sf-text-secondary); }

.sf-eyebrow {
  display: inline-block;
  font-family: var(--sf-font-body);
  font-size: var(--sf-text-sm);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sf-teal);
  margin-bottom: var(--sf-space-2);
}

.sf-script {
  /* the ONE sitewide script use — footer wordmark flourish only. */
  font-family: var(--sf-font-script);
  font-weight: 400;
  color: var(--sf-gold);
}

/* ---- CTA button (WCAG-locked: champagne gold on midnight emerald) ---- */
.sf-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sf-space-2);
  padding: var(--sf-space-3) var(--sf-space-5);
  background: var(--sf-cta-bg);
  color: var(--sf-cta-text);
  font-family: var(--sf-font-body);
  font-weight: 700;
  font-size: var(--sf-text-base);
  border-radius: var(--sf-radius-sm);
  box-shadow: var(--sf-shadow-soft);
  transition: background-color var(--sf-dur-fast) var(--sf-ease-out),
              transform var(--sf-dur-fast) var(--sf-ease-out),
              box-shadow var(--sf-dur-fast) var(--sf-ease-out);
}
.sf-cta:hover, .sf-cta:focus-visible {
  background: var(--sf-cta-bg-hover);
  color: var(--sf-cta-text-hover, var(--sf-cta-text));
  transform: translateY(-2px);
  box-shadow: var(--sf-shadow-lift);
}
.sf-cta:focus-visible { outline: 2px solid var(--sf-teal); outline-offset: 3px; }

/* on dark surfaces the midnight fill needs a champagne ring to stay
   visible (inset shadow, not border: geometry stays identical) */
.sf-section--dark .sf-cta,
.sf-footer .sf-cta {
  box-shadow: inset 0 0 0 1.5px var(--sf-gold), var(--sf-shadow-soft);
}
.sf-section--dark .sf-cta:hover, .sf-section--dark .sf-cta:focus-visible,
.sf-footer .sf-cta:hover, .sf-footer .sf-cta:focus-visible {
  box-shadow: inset 0 0 0 1.5px var(--sf-gold), var(--sf-shadow-lift);
}
.sf-section--dark .sf-cta:focus-visible,
.sf-footer .sf-cta:focus-visible { outline-color: var(--sf-gold); }

/* ---- section shells: ivory / sand alternation ---- */
.sf-section {
  position: relative;
  padding-block: var(--sf-space-8);
  background: var(--sf-bg-primary);
}
.sf-section--alt { background: var(--sf-bg-alt); }
.sf-section--dark {
  background: var(--sf-bg-dark);
  color: var(--sf-text-on-dark);
}
.sf-section--dark h1, .sf-section--dark h2, .sf-section--dark h3, .sf-section--dark h4,
.sf-section--dark p { color: var(--sf-text-on-dark); }

.sf-container {
  max-width: var(--sf-max-content);
  margin-inline: auto;
  padding-inline: var(--sf-space-4);
}

/* ---- nav skeleton ---- */
.sf-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sf-space-3) var(--sf-space-4);
  background: rgba(250, 247, 242, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(14, 74, 60, 0.12);
}
.sf-nav__mark { font-family: var(--sf-font-display); font-size: var(--sf-text-md); font-weight: 560; }
.sf-nav__links { display: flex; gap: var(--sf-space-5); align-items: center; }
.sf-nav__group { display: flex; flex-direction: column; font-size: var(--sf-text-sm); }
.sf-nav__group-label { color: var(--sf-teal); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 0.68rem; }

/* ---- footer skeleton ---- */
.sf-footer {
  background: var(--sf-teal);
  color: var(--sf-ivory);
  padding-block: var(--sf-space-8) var(--sf-space-6);
}
.sf-footer a { color: var(--sf-ivory); opacity: .85; }
.sf-footer a:hover { opacity: 1; }
.sf-footer__flourish { font-size: var(--sf-text-2xl); }
.sf-footer__compliance { font-size: var(--sf-text-xs); opacity: .7; max-width: 60ch; }

/* ---- reduced-motion global posture ----
   sf-gl.js adds .sf-reduced to <html> and never mounts a WebGL context
   when the media query matches; this covers CSS-only motion too. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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