/* ==========================================================================
   Petro USA — Design Tokens & Component Styles
   Patriotic Americana: navy, red, warm cream. Retro-confident display type
   paired with a clean modern sans body.
   ========================================================================== */

/* ---------- Fonts ----------
   Display: "Rajdhani"? No — chosen: "Oswald" (bold condensed Americana signage feel)
   Actually chosen pairing: "Bebas Neue" felt too thin; going with:
   Display: "Anton" (bold, confident, poster/highway-signage energy)
   Body: "Work Sans" (clean modern humanist sans)
*/

:root {
  /* ---- Type Scale (fluid clamp) ---- */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 1.2rem + 6vw, 7rem);

  /* ---- Spacing (4px base) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ---- Radius ---- */
  --radius-sm: 0.3rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.85rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  /* ---- Transitions ---- */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- Content widths ---- */
  --content-narrow: 640px;
  --content-default: 1000px;
  --content-wide: 1240px;
  --content-full: 100%;

  /* ---- Fonts ---- */
  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Work Sans', 'Helvetica Neue', sans-serif;
}

/* ---- Light mode (default) — Americana palette ---- */
:root,
[data-theme='light'] {
  /* Surfaces — warm cream, not flat white */
  --color-bg: #faf6ec;
  --color-surface: #fffdf7;
  --color-surface-2: #fffefb;
  --color-surface-offset: #f2ead8;
  --color-surface-offset-2: #ecdfc4;
  --color-surface-dynamic: #e7d9ba;
  --color-divider: #e2d4b4;
  --color-border: #d8c69d;

  /* Text — deep navy-charcoal */
  --color-text: #16223d;
  --color-text-muted: #55617c;
  --color-text-faint: #9099ac;
  --color-text-inverse: #faf6ec;

  /* Primary — Navy */
  --color-primary: #16295c;
  --color-primary-hover: #0e1c42;
  --color-primary-active: #0a1330;
  --color-primary-highlight: #d7deee;

  /* Navy block — stable brand navy for header/footer/CTA backgrounds.
     Unlike --color-primary (which inverts to a light accent in dark mode
     for links/buttons), this stays a deep navy in both themes so the
     Americana brand blocks never turn into a pale panel. */
  --color-navy-block: #16295c;
  --color-navy-block-2: #0e1c42;
  --color-on-navy: #ffffff;
  --color-on-navy-muted: #d9dfef;

  /* Accent — Old Glory Red */
  --color-red: #bc2333;
  --color-red-hover: #971c29;
  --color-red-active: #74151f;
  --color-red-highlight: #f3d6d9;

  /* Warning */
  --color-warning: #a15d17;
  --color-warning-hover: #7c4712;
  --color-warning-active: #5a340e;
  --color-warning-highlight: #ecd9bd;

  /* Error (reuse red family, distinct role) */
  --color-error: #b3212f;
  --color-error-hover: #8e1a26;
  --color-error-active: #66131b;
  --color-error-highlight: #f1d3d6;

  /* Success */
  --color-success: #2e6b3e;
  --color-success-hover: #23532f;
  --color-success-active: #1a3e23;
  --color-success-highlight: #d7e8da;

  /* Gold — secondary accent for badges/stars */
  --color-gold: #b8862b;
  --color-gold-hover: #966d22;
  --color-gold-active: #74551a;
  --color-gold-highlight: #efdfbe;

  --shadow-sm: 0 1px 2px oklch(0.25 0.03 260 / 0.08);
  --shadow-md: 0 4px 14px oklch(0.25 0.03 260 / 0.12);
  --shadow-lg: 0 16px 40px oklch(0.25 0.03 260 / 0.18);
}

/* ---- Dark mode ---- */
[data-theme='dark'] {
  --color-bg: #0d1326;
  --color-surface: #121a33;
  --color-surface-2: #16203d;
  --color-surface-offset: #1a2440;
  --color-surface-offset-2: #202c4c;
  --color-surface-dynamic: #263255;
  --color-divider: #263255;
  --color-border: #33406a;

  --color-text: #f1ede1;
  --color-text-muted: #b3bad0;
  --color-text-faint: #7c86a3;
  --color-text-inverse: #16223d;

  --color-primary: #7d93cc;
  --color-primary-hover: #99acdb;
  --color-primary-active: #b3c2e6;
  --color-primary-highlight: #22305a;

  /* Navy block — stays a deep navy in dark mode too (slightly deeper than
     light mode) so header/footer/CTA blocks read as brand panels, not
     surfaces that got inverted to a pale color. */
  --color-navy-block: #0a1330;
  --color-navy-block-2: #060a1c;
  --color-on-navy: #ffffff;
  --color-on-navy-muted: #b3bad0;

  --color-red: #ef5c68;
  --color-red-hover: #f37c86;
  --color-red-active: #f79ba3;
  --color-red-highlight: #4a2027;

  --color-warning: #dba15a;
  --color-warning-hover: #e6b578;
  --color-warning-active: #efc998;
  --color-warning-highlight: #46341c;

  --color-error: #ef5c68;
  --color-error-hover: #f37c86;
  --color-error-active: #f79ba3;
  --color-error-highlight: #4a2027;

  --color-success: #6fbf80;
  --color-success-hover: #8ccc9a;
  --color-success-active: #abdab5;
  --color-success-highlight: #1f3a26;

  --color-gold: #e0b667;
  --color-gold-hover: #e8c785;
  --color-gold-active: #f0d8a5;
  --color-gold-highlight: #4a3c1e;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 16px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0d1326;
    --color-surface: #121a33;
    --color-surface-2: #16203d;
    --color-surface-offset: #1a2440;
    --color-surface-offset-2: #202c4c;
    --color-surface-dynamic: #263255;
    --color-divider: #263255;
    --color-border: #33406a;
    --color-text: #f1ede1;
    --color-text-muted: #b3bad0;
    --color-text-faint: #7c86a3;
    --color-text-inverse: #16223d;
    --color-primary: #7d93cc;
    --color-primary-hover: #99acdb;
    --color-primary-active: #b3c2e6;
    --color-primary-highlight: #22305a;
    --color-navy-block: #0a1330;
    --color-navy-block-2: #060a1c;
    --color-on-navy: #ffffff;
    --color-on-navy-muted: #b3bad0;
    --color-red: #ef5c68;
    --color-red-hover: #f37c86;
    --color-red-active: #f79ba3;
    --color-red-highlight: #4a2027;
    --color-warning: #dba15a;
    --color-warning-hover: #e6b578;
    --color-warning-active: #efc998;
    --color-warning-highlight: #46341c;
    --color-error: #ef5c68;
    --color-error-hover: #f37c86;
    --color-error-active: #f79ba3;
    --color-error-highlight: #4a2027;
    --color-success: #6fbf80;
    --color-success-hover: #8ccc9a;
    --color-success-active: #abdab5;
    --color-success-highlight: #1f3a26;
    --color-gold: #e0b667;
    --color-gold-hover: #e8c785;
    --color-gold-active: #f0d8a5;
    --color-gold-highlight: #4a3c1e;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 4px 16px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.55);
  }
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--color-primary);
}

[data-theme='dark'] h1,
[data-theme='dark'] h2,
[data-theme='dark'] h3,
[data-theme='dark'] h4 {
  color: var(--color-text);
}

h1 {
  font-size: var(--text-2xl);
}
h2 {
  font-size: var(--text-xl);
}
h3 {
  font-size: var(--text-lg);
  text-transform: none;
  font-family: var(--font-body);
  font-weight: 700;
}
h4 {
  font-size: var(--text-base);
  text-transform: none;
  font-family: var(--font-body);
  font-weight: 700;
}

p {
  color: var(--color-text-muted);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-red);
}

.lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-8);
  }
}

.container--default {
  max-width: var(--content-default);
}
.container--narrow {
  max-width: var(--content-narrow);
}

.section {
  padding-block: clamp(var(--space-12), 7vw, var(--space-24));
}
.section--tight {
  padding-block: clamp(var(--space-8), 4vw, var(--space-16));
}

.stripe-divider {
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--color-red) 0 40px,
    var(--color-surface) 40px 80px
  );
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-navy-block);
  border-bottom: 3px solid var(--color-red);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-2);
}

.logo-badge {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-3);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.logo-badge img {
  height: 52px;
  width: auto;
  display: block;
}

.main-nav {
  display: none;
}

@media (min-width: 900px) {
  .main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
  }
}

.main-nav a {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-1);
  position: relative;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: #fff;
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: var(--space-1);
  right: var(--space-1);
  bottom: 0;
  height: 2px;
  background: var(--color-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-interactive);
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after,
.main-nav a[aria-current='page']::after {
  transform: scaleX(1);
}

.main-nav a[aria-current='page'] {
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #fff;
  border-radius: var(--radius-md);
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: oklch(from #fff l c h / 0.12);
}

.mobile-nav {
  display: none;
  background: var(--color-navy-block-2);
  border-top: 1px solid oklch(from #fff l c h / 0.15);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav ul {
  display: flex;
  flex-direction: column;
}

.mobile-nav a {
  display: block;
  padding: var(--space-4) var(--space-4);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-text-inverse);
  border-bottom: 1px solid oklch(from #fff l c h / 0.08);
  min-height: 44px;
}

.mobile-nav a[aria-current='page'] {
  color: var(--color-red-hover);
  background: oklch(from #fff l c h / 0.06);
}

@media (min-width: 900px) {
  .mobile-nav {
    display: none !important;
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  min-height: 44px;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-red);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-red-hover);
  box-shadow: var(--shadow-md);
}
.btn-primary:active {
  background: var(--color-red-active);
}

.btn-secondary {
  background: transparent;
  border-color: currentColor;
  color: var(--color-primary);
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--color-primary-highlight);
}

.btn-on-dark {
  border-color: #fff;
  color: #fff;
}
.btn-on-dark:hover,
.btn-on-dark:focus-visible {
  background: oklch(from #fff l c h / 0.12);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}

.badge--red {
  background: var(--color-red-highlight);
  color: var(--color-red-hover);
}
.badge--gold {
  background: var(--color-gold-highlight);
  color: var(--color-gold-hover);
}
.badge--success {
  background: var(--color-success-highlight);
  color: var(--color-success-hover);
}

[data-theme='dark'] .badge {
  color: var(--color-text);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  color: #fff;
  overflow: hidden;
  min-height: 78vh;
  display: flex;
  align-items: center;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    oklch(0.14 0.05 265 / 0.92) 0%,
    oklch(0.16 0.05 265 / 0.72) 45%,
    oklch(0.2 0.04 265 / 0.35) 100%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  padding-block: var(--space-20);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fadfe1;
  margin-bottom: var(--space-4);
}

.hero__eyebrow::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 3px;
  background: var(--color-red);
}

.hero h1 {
  color: #fff;
  font-size: var(--text-hero);
  line-height: 1.02;
  max-width: 16ch;
  margin-bottom: var(--space-6);
}

.hero p {
  color: #f1ede1;
  font-size: var(--text-lg);
  max-width: 46ch;
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* Page (non-home) hero — shorter */
.page-hero {
  position: relative;
  color: #fff;
  overflow: hidden;
  min-height: 42vh;
  display: flex;
  align-items: center;
}
.page-hero .hero__content {
  padding-block: var(--space-16);
}
.page-hero h1 {
  color: #fff;
  font-size: var(--text-3xl);
  max-width: 22ch;
  margin-bottom: var(--space-4);
}
.page-hero p {
  color: #f1ede1;
  font-size: var(--text-base);
  max-width: 56ch;
  margin-bottom: 0;
}

/* ==========================================================================
   Feature / highlight blocks
   ========================================================================== */

.highlight-strip {
  background: var(--color-navy-block);
  color: var(--color-on-navy);
}

.highlight-strip .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  padding-block: var(--space-8);
}

@media (min-width: 700px) {
  .highlight-strip .container {
    grid-template-columns: repeat(4, 1fr);
  }
}

.highlight-item {
  text-align: left;
}

.highlight-item .stat {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: #fff;
  display: block;
}

.highlight-item .stat-label {
  font-size: var(--text-sm);
  color: #cdd6ea;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--color-navy-block-2);
  color: var(--color-on-navy-muted);
  border-top: 6px solid var(--color-red);
}

.site-footer a {
  color: #d9dfef;
}
.site-footer a:hover,
.site-footer a:focus-visible {
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  padding-block: var(--space-16);
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
}

.footer-brand .logo-badge {
  margin-bottom: var(--space-4);
}

.footer-brand p {
  color: #b4bedc;
  max-width: 32ch;
}

.footer-col h4 {
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-col a {
  font-size: var(--text-sm);
}

.footer-bottom {
  border-top: 1px solid oklch(from #fff l c h / 0.12);
  padding-block: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: #97a2c4;
}

.footer-legal {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ==========================================================================
   Utility
   ========================================================================== */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-red);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  z-index: 200;
  border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus {
  left: 0;
}

.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 {
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1000px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.section-head {
  max-width: 60ch;
  margin-bottom: var(--space-10);
}

.section-head h2 {
  margin-top: var(--space-3);
}

.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--color-red);
}

[data-theme-toggle] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: #fff;
}
[data-theme-toggle]:hover,
[data-theme-toggle]:focus-visible {
  background: oklch(from #fff l c h / 0.12);
}
