/**
 * global.css
 * ─────────────────────────────────────────────────────────────────
 * CSS reset, base typography, utility classes, and layout helpers.
 *
 * DEPENDENCY: must be loaded AFTER variables.css
 * ─────────────────────────────────────────────────────────────────
 */

/* ── Reset ─────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-page-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-base);
}

ul,
ol {
  list-style: none;
}

/* ── Typography ─────────────────────────────────────────────────── */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h4 { font-size: 1rem; }

p {
  font-family: var(--font-body);
  line-height: 1.75;
  color: var(--color-text-muted);
}

/* ── Layout ─────────────────────────────────────────────────────── */

/**
 * .container
 * Centered content wrapper with max-width and horizontal padding.
 * Use this on every section's inner wrapper.
 */
.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding-x);
  padding-right: var(--container-padding-x);
}

/**
 * .section-pad
 * Adds standard vertical padding to page sections.
 */
.section-pad {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

/* ── Buttons ─────────────────────────────────────────────────────── */

/**
 * .btn
 * Base button styles. Combine with modifier classes:
 *   .btn-primary   — cyan bg, dark text
 *   .btn-dark      — dark navy bg, white text
 *   .btn-outline   — white border, white text (for dark bg sections)
 *   .btn-ghost     — transparent, white border with arrow icon
 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-button);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 28px;
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base);
}

.btn-primary {
  background-color: var(--color-cyan);
  color: var(--color-navy);
  border-color: var(--color-cyan);
}

.btn-primary:hover {
  background-color: #29aff2;
  border-color: #29aff2;
}

.btn-dark {
  background-color: var(--color-navy);
  color: var(--color-white);
  border-color: var(--color-navy);
}

.btn-dark:hover {
  background-color: #0d0d2a;
  border-color: #0d0d2a;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

.btn-outline:hover {
  background-color: var(--color-white);
  color: var(--color-navy);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
  gap: 12px;
}

.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-ghost .btn-arrow {
  font-size: 1rem;
}

/* ── Utility ─────────────────────────────────────────────────────── */

.text-center   { text-align: center; }
.text-white    { color: var(--color-white); }
.text-accent   { color: var(--color-accent); }
.text-cyan     { color: var(--color-cyan); }
.text-navy     { color: var(--color-navy); }
.text-uppercase { text-transform: uppercase; }
.text-sm       { font-size: 0.8125rem; }
.fw-700        { font-weight: 700; }

.bg-navy       { background-color: var(--color-navy); }
.bg-page       { background-color: var(--color-page-bg); }
.bg-light-card { background-color: var(--color-light-card); }
.bg-cream      { background-color: var(--color-cream); }

.rounded-md    { border-radius: var(--radius-md); }
.rounded-lg    { border-radius: var(--radius-lg); }
.rounded-xl    { border-radius: var(--radius-xl); }

.shadow-card   { box-shadow: var(--shadow-card); }

/* ── Label (small uppercase section label above headings) ─────── */
.section-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
}

/* ── Skip link (accessibility) ───────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--color-cyan);
  color: var(--color-navy);
  padding: 8px 16px;
  z-index: 9999;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: top 0.2s;
}

.skip-link:focus {
  top: 8px;
}

/* ── Visually hidden (accessibility) ────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Responsive helpers ──────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --section-padding-y: 48px;
  }
}
