/* ==========================================================================
   base.css — design tokens, reset, typography
   Iowa Falls Towing & Recovery
   Palette: obsidian night / brushed steel / amber beacon
   ========================================================================== */

:root {
  /* --- Surfaces (deepest → raised) --- */
  --ink:         #14181F;
  --ink-2:       #1A1F27;
  --surface:     #222831;
  --surface-2:   #2C333E;
  --surface-3:   #39414E;

  /* --- Light surfaces (used by the conversion band so the form reads bright) --- */
  --paper:       #F4F6F9;
  --paper-2:     #FFFFFF;
  --paper-ink:   #0F172A;
  --paper-muted: #475569;
  --paper-line:  #D8DEE7;

  /* --- Line & metal --- */
  --steel:       #5A6675;
  --line:        rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);

  /* --- Accents --- */
  --beacon:      #FFB020;
  --beacon-2:    #FFD066;
  --beacon-deep: #8A5A00;
  --ember:       #E4572E;
  --signal:      #3DDC84;

  /* --- Text --- */
  --snow:        #F5F7FA;
  --chrome:      #BFC8D4;
  --chrome-dim:  #93A0B0;

  /* --- Glass --- */
  --glass:        rgba(255, 255, 255, 0.055);
  --glass-2:      rgba(255, 255, 255, 0.09);
  --glass-stroke: rgba(255, 255, 255, 0.12);
  --glass-blur:   blur(18px) saturate(140%);

  /* --- Signature gradients --- */
  --grad-beacon: linear-gradient(135deg, var(--beacon) 0%, var(--ember) 100%);
  --grad-text:   linear-gradient(100deg, var(--beacon-2) 0%, var(--beacon) 45%, var(--ember) 100%);
  --grad-steel:  linear-gradient(160deg, var(--surface-2) 0%, var(--ink-2) 100%);

  /* --- Multi-layer shadows (never a single layer) --- */
  --sh-1: 0 1px 2px rgba(0,0,0,.40), 0 2px 6px rgba(0,0,0,.24);
  --sh-2: 0 1px 2px rgba(0,0,0,.40), 0 8px 24px rgba(0,0,0,.35), 0 16px 40px rgba(0,0,0,.22);
  --sh-3: 0 1px 2px rgba(0,0,0,.45), 0 8px 24px rgba(0,0,0,.38), 0 24px 64px rgba(0,0,0,.34);
  --sh-4: 0 2px 4px rgba(0,0,0,.50), 0 16px 40px rgba(0,0,0,.42), 0 40px 96px rgba(0,0,0,.40);
  --glow-beacon: 0 0 0 1px rgba(255,176,32,.22), 0 8px 28px rgba(255,176,32,.20), 0 0 56px rgba(255,176,32,.14);
  --glow-ember:  0 0 0 1px rgba(228,87,46,.24), 0 8px 28px rgba(228,87,46,.22);

  /* --- Radius --- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* --- Spacing rhythm --- */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 48px;  --s-8: 64px;
  --s-9: 88px;  --s-10: 120px;

  /* --- Layout --- */
  --container: 1240px;
  --container-narrow: 880px;
  --gutter: clamp(20px, 5vw, 48px);
  --topbar-h: 40px;
  --header-h: 78px;
  --header-h-shrunk: 62px;

  /* --- z-index scale (10 / 20 / 30 / 50) --- */
  --z-base: 1;
  --z-raised: 10;
  --z-sticky: 20;
  --z-header: 30;
  --z-overlay: 50;

  /* --- Motion --- */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io:  cubic-bezier(.4, 0, .2, 1);
  --t-fast: 160ms;
  --t-mid:  260ms;
  --t-slow: 520ms;

  /* --- Type --- */
  --font-display: 'Oswald', 'Arial Narrow', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--snow);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure, blockquote { margin: 0; }

a {
  color: var(--beacon);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-io);
}
a:hover { color: var(--beacon-2); }

/* --------------------------------------------------------------------------
   Focus — always visible, never removed
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--beacon);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--beacon);
  color: var(--ink);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: top var(--t-mid) var(--ease-out);
}
.skip-link:focus { top: 0; color: var(--ink); }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 700; text-transform: uppercase; }
h2 { font-size: clamp(2rem, 4.2vw, 3.35rem); text-transform: uppercase; }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h4 { font-size: 1.08rem; letter-spacing: 0; }

p { margin: 0 0 1.15em; max-width: 68ch; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--snow); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--beacon);
  margin-bottom: var(--s-4);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--beacon));
  flex: none;
}

.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--chrome); }
.muted { color: var(--chrome); }
.dim   { color: var(--chrome-dim); }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Fallback for any engine that ignores background-clip */
  -webkit-text-fill-color: transparent;
}

/* Light-band typography overrides */
.band-light {
  background: var(--paper);
  color: var(--paper-ink);
}
.band-light h1, .band-light h2, .band-light h3, .band-light h4 { color: var(--paper-ink); }
.band-light p, .band-light .muted { color: var(--paper-muted); }
.band-light .eyebrow { color: var(--beacon-deep); }
.band-light .eyebrow::before { background: linear-gradient(90deg, transparent, var(--beacon-deep)); }

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { position: relative; padding-block: clamp(64px, 9vw, 120px); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }

.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 60px); }
/* Headings have margin:0 by default, so give them air before their intro copy */
.section-head h2 + p,
.pagehero h1 + p { margin-top: 18px; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head--center p { margin-inline: auto; }

.sr-only {
  position: absolute;
  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;
}

.hairline {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 20%, var(--line-strong) 80%, transparent);
  border: 0;
  margin: 0;
}

/* Ambient grain — kills gradient banding on large dark fields */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: var(--z-base);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Ambient radial glow blobs */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.glow--beacon { background: radial-gradient(circle, rgba(255,176,32,.20), transparent 68%); }
.glow--ember  { background: radial-gradient(circle, rgba(228,87,46,.16), transparent 68%); }
