/* ==========================================================================
   Base: fonts, design tokens, reset, shared utilities
   ========================================================================== */

@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Yellowtail";
  src: url("../fonts/yellowtail-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched fallbacks keep layout shift minimal while web fonts load. */
@font-face {
  font-family: "Barlow Condensed Fallback";
  src: local("Arial Narrow"), local("Roboto Condensed"), local("Helvetica Neue Condensed"), local("Arial");
  size-adjust: 88%;
  ascent-override: 100%;
}
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Roboto");
  size-adjust: 107%;
  ascent-override: 90%;
}
@font-face {
  font-family: "Barlow Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Roboto");
  size-adjust: 96%;
  ascent-override: 100%;
}

:root {
  /* Brand (overridden from env in base.html) */
  --primary: #C62D25;
  --accent: #E0A83E;
  --primary-strong: color-mix(in srgb, var(--primary) 82%, black);
  --primary-soft: color-mix(in srgb, var(--primary) 7%, white);

  /* Sunset palette, taken from the hero sky */
  --sky: linear-gradient(180deg, #0D1B3E 0%, #1F2456 26%, #4A2360 50%, #93243F 74%, #CF3A2E 100%);
  --sunset: linear-gradient(100deg, #B8241E 0%, #E2472F 100%);          /* buttons: white text stays AA */
  --sunset-hover: linear-gradient(100deg, #9E1E19 0%, #CC3A25 100%);
  --sunset-wide: linear-gradient(90deg, #C62D25 0%, #EF5A36 45%, #F5A524 100%); /* decorative bars */
  --orange: #EF5A36;

  /* Neutrals: crisp white with navy ink */
  --ink: #0D1B3E;
  --ink-2: #16254D;
  --ink-3: #2A3A66;
  --paper: #FFFFFF;
  --paper-2: #F3F6FB;
  --card: #FFFFFF;
  --text: #0F1730;
  --muted: #55607A;
  --line: #E2E7F0;
  --line-strong: #C4CCDB;
  --on-dark: #FFFFFF;
  --on-dark-muted: #C8D0E4;
  --chrome: #D9DDE3;

  --success: #157A4A;
  --success-soft: #E6F6EE;
  --danger: #B42318;
  --danger-soft: #FDEDEC;
  --warn: #8A5A00;
  --warn-soft: #FFF4DB;

  /* Type */
  --font-display: "Barlow Condensed", "Barlow Condensed Fallback", "Arial Narrow", sans-serif-condensed, Impact, sans-serif;
  --font-body: "Barlow", "Barlow Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-script: "Yellowtail", "Brush Script MT", cursive;
  --font-button: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.08rem);
  --step-1: clamp(1.18rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.45rem, 1.3rem + 0.8vw, 1.95rem);
  --step-3: clamp(1.9rem, 1.6rem + 1.5vw, 2.8rem);
  --step-4: clamp(2.5rem, 1.9rem + 3.2vw, 4.6rem);
  --step-5: clamp(3rem, 2rem + 5.4vw, 6.6rem);

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6.5rem;
  --gutter: clamp(1.1rem, 0.6rem + 2.5vw, 2.5rem);

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgb(13 27 62 / 0.06), 0 1px 1px rgb(13 27 62 / 0.04);
  --shadow: 0 1px 2px rgb(13 27 62 / 0.05), 0 8px 24px -6px rgb(13 27 62 / 0.14);
  --shadow-lg: 0 2px 4px rgb(13 27 62 / 0.06), 0 24px 60px -12px rgb(13 27 62 / 0.35);
  --focus: 0 0 0 3px var(--paper), 0 0 0 5.5px var(--ink);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, fieldset { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 600; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 3px;
}

main:focus { outline: none; }

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--ink);
  color: var(--on-dark);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

.nowrap { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
