/* ==========================================================================
   Kart Kountry - Design DNA stylesheet
   DNA: kk-nightrace-checker-anton-v1
   Night-race near-black canvas | racing red + bright yellow | checkered-flag motif
   Self-contained. Loaded by every page alongside the Tailwind CDN.
   ========================================================================== */

:root {
  /* ---- Color ---- */
  --ink: #0B0B0D;          /* base grounding near-black */
  --ink-2: #141418;        /* elevated panels */
  --card: #1A1A20;         /* card surface */
  --line: #2A2A31;         /* hairline borders */
  --bone: #F5F2EA;         /* headline / near-white ink */
  --smoke: #C7C5CE;        /* secondary text */
  --muted: #9A98A3;        /* tertiary text (still AA on ink) */
  --red: #E11B22;          /* racing red - white text on it = 4.8:1 */
  --red-hot: #F5232B;      /* red hover */
  --yellow: #FFD400;       /* bright yellow */
  --yellow-hot: #FFE04D;

  /* ---- Type ---- */
  --font-display: 'Anton', 'Archivo Narrow', system-ui, sans-serif;
  --font-body: 'Archivo', system-ui, -apple-system, sans-serif;

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-fast: 160ms;
  --dur: 320ms;

  /* ---- Checkered flag tile (black + bone squares) ---- */
  --checker: conic-gradient(var(--ink) 25%, var(--bone) 0 50%, var(--ink) 0 75%, var(--bone) 0);
  --checker-red: conic-gradient(#0B0B0D 25%, var(--red) 0 50%, #0B0B0D 0 75%, var(--red) 0);
}

/* -------------------------------------------------------------------------- */
/* Base                                                                       */
/* -------------------------------------------------------------------------- */
* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0.005em;   /* Anton is condensed; keep it open, never below -0.04em */
}

::selection { background: var(--red); color: #fff; }

a { color: inherit; }

/* Focus visibility (keyboard only) */
:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 300;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: 999px;
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* -------------------------------------------------------------------------- */
/* Fluid display type                                                         */
/* -------------------------------------------------------------------------- */
.h-mega  { font-size: clamp(2.6rem, 8vw, 7rem); }
.h-xl    { font-size: clamp(2.6rem, 7vw, 6rem); }
.h-lg    { font-size: clamp(2rem, 4.6vw, 3.75rem); }
.h-md    { font-size: clamp(1.6rem, 3vw, 2.5rem); }

.kicker {
  font-family: var(--font-body);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  color: var(--yellow);
}
.kicker-red { color: var(--red); }

.lead { color: var(--smoke); font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.55; }
.text-smoke { color: var(--smoke); }
.text-muted { color: var(--muted); }

/* -------------------------------------------------------------------------- */
/* Checkered motif                                                            */
/* -------------------------------------------------------------------------- */
.checker-strip {
  height: 18px;
  background-image: var(--checker);
  background-size: 18px 18px;
  width: 100%;
}
.checker-strip.tall { height: 26px; background-size: 26px 26px; }
.checker-strip.thin { height: 12px; background-size: 12px 12px; }

/* Diagonal moving checkered band used as a signature divider */
.checker-band {
  position: relative;
  height: 46px;
  overflow: hidden;
  background: var(--ink);
}
.checker-band::before {
  content: "";
  position: absolute;
  inset: -20px -40px;
  background-image: var(--checker);
  background-size: 26px 26px;
  transform: skewY(-2.2deg);
}

/* Speed lines: skewed momentum bars */
.speedlines {
  background-image: repeating-linear-gradient(
    -24deg,
    transparent 0 10px,
    rgba(225, 27, 34, 0.10) 10px 12px
  );
}
.speed-underline {
  position: relative;
  display: inline;
  background-image: linear-gradient(var(--yellow), var(--yellow));
  background-size: 0% 3px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size var(--dur) var(--ease-out);
  padding-bottom: 2px;
}
@media (hover: hover) and (pointer: fine) {
  a:hover .speed-underline, .speed-underline:hover { background-size: 100% 3px; }
}

/* -------------------------------------------------------------------------- */
/* Buttons - generous rounded pills                                           */
/* -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-body);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.06rem;
  line-height: 1;
  min-height: 54px;
  padding: 0 1.9rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--red); color: #fff; box-shadow: 0 10px 30px -12px rgba(225,27,34,0.85); }
.btn-secondary { background: var(--yellow); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--bone); border-color: rgba(245,242,234,0.35); }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--red-hot); transform: translateY(-2px); box-shadow: 0 16px 40px -14px rgba(225,27,34,0.95); }
  .btn-secondary:hover { background: var(--yellow-hot); transform: translateY(-2px); }
  .btn-ghost:hover { border-color: var(--red); color: #fff; }
}
.btn-sm { min-height: 44px; font-size: 0.95rem; padding: 0 1.3rem; }
.btn-lg { min-height: 62px; font-size: 1.18rem; padding: 0 2.4rem; }

/* Click-to-call in header */
.callbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--bone);
  min-height: 44px;
}
.callbtn .num { border-bottom: 3px solid var(--yellow); }

/* -------------------------------------------------------------------------- */
/* Cards                                                                      */
/* -------------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .card-hover:hover { transform: translateY(-6px); border-color: rgba(225,27,34,0.6); box-shadow: 0 24px 50px -24px rgba(0,0,0,0.9); }
}
.card-strip { height: 8px; background-image: var(--checker); background-size: 8px 8px; }

/* Numbered pill (for genuine ordered sequences only) */
.numchip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.6rem;
}

/* Stat figure */
.stat-num { font-family: var(--font-display); color: var(--yellow); line-height: 0.9; font-size: clamp(2.6rem, 6vw, 4.75rem); }

/* Image placeholder slots (art-directed, hold up before real assets) */
.imgslot {
  position: relative;
  background:
    linear-gradient(135deg, rgba(225,27,34,0.16), rgba(11,11,13,0.0) 55%),
    radial-gradient(120% 120% at 80% 0%, rgba(255,212,0,0.10), transparent 60%),
    #101014;
  overflow: hidden;
}
.imgslot::after {
  content: attr(data-label);
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245,242,234,0.55);
}
.imgslot .flagdot {
  position: absolute;
  inset: 0;
  background-image: var(--checker);
  background-size: 22px 22px;
  opacity: 0.06;
}
.imgslot .play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 78px; height: 78px;
  border-radius: 999px;
  background: var(--red);
  display: grid; place-items: center;
  box-shadow: 0 12px 40px -10px rgba(225,27,34,0.8);
}

/* -------------------------------------------------------------------------- */
/* Angled section cuts                                                        */
/* -------------------------------------------------------------------------- */
.slant-b { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2.8vw), 0 100%); }
.slant-t { clip-path: polygon(0 2.8vw, 100% 0, 100% 100%, 0 100%); }
.slant-both { clip-path: polygon(0 2.4vw, 100% 0, 100% calc(100% - 2.4vw), 0 100%); }

/* Block color helpers */
.block-red { background: var(--red); color: #fff; }
.block-yellow { background: var(--yellow); color: var(--ink); }
.block-ink2 { background: var(--ink-2); }

/* -------------------------------------------------------------------------- */
/* Header / nav                                                               */
/* -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,11,13,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.site-header.is-scrolled { background: rgba(11,11,13,0.97); box-shadow: 0 8px 24px -18px rgba(0,0,0,0.9); }

.navlink {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--smoke);
  padding: 0.4rem 0;
  transition: color var(--dur-fast) var(--ease-out);
}
.navlink[aria-current="page"] { color: var(--bone); }
@media (hover: hover) and (pointer: fine) {
  .navlink:hover { color: var(--bone); }
}

/* Wordmark - real Kart Kountry logo */
.wordmark { display: inline-flex; align-items: center; }
.kk-logo { display: block; height: 52px; width: auto; }
.kk-logo.lg { height: 78px; }

/* Real photo filling an art-directed slot */
.slot-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* -------------------------------------------------------------------------- */
/* Mobile menu - full-viewport overlay (HARD RULE)                            */
/* -------------------------------------------------------------------------- */
.mobile-menu {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 200;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  background: var(--ink);
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
.mobile-menu.is-open { display: flex; }
.mobile-menu .mm-link {
  font-family: var(--font-display);
  font-size: 2rem;
  text-transform: uppercase;
  color: var(--bone);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.mobile-menu .mm-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--bone);
}

/* -------------------------------------------------------------------------- */
/* Forms                                                                      */
/* -------------------------------------------------------------------------- */
.field label { display: block; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; color: var(--smoke); margin-bottom: 0.4rem; }
.field .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--bone);
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: #6f6d78; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(225,27,34,0.25); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23C7C5CE' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.6rem; }

/* -------------------------------------------------------------------------- */
/* Scroll reveal                                                              */
/* -------------------------------------------------------------------------- */
[data-animate] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  will-change: transform, opacity;
}
[data-animate].in { opacity: 1; transform: none; }

/* Checkered wipe reveal for dividers (signature moment) */
.wipe { position: relative; overflow: hidden; }
.wipe::before {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--checker);
  background-size: 26px 26px;
  transform: translateX(-101%);
  transition: transform 900ms var(--ease-in-out);
}
.wipe.in::before { transform: translateX(101%); }

/* -------------------------------------------------------------------------- */
/* Utility                                                                    */
/* -------------------------------------------------------------------------- */
.container-kk { max-width: 1200px; margin-inline: auto; padding-inline: 1.25rem; }
.rule { height: 1px; background: var(--line); }
.tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.72rem; padding: 0.4rem 0.8rem; border-radius: 999px;
}
.tag-seasonal { background: rgba(255,212,0,0.14); color: var(--yellow); border: 1px solid rgba(255,212,0,0.35); }
.tag-red { background: rgba(225,27,34,0.16); color: #ff8a8f; border: 1px solid rgba(225,27,34,0.4); }

/* Pricing table */
.ptable { width: 100%; border-collapse: collapse; }
.ptable th, .ptable td { text-align: left; padding: 1rem 1.1rem; }
.ptable thead th { font-family: var(--font-body); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; color: var(--muted); }
.ptable tbody tr { background: var(--card); }
.ptable tbody tr:nth-child(even) { background: var(--ink-2); }
.ptable td.price { font-family: var(--font-display); color: var(--yellow); font-size: 1.4rem; white-space: nowrap; }
.ptable tbody tr td:first-child { border-radius: 12px 0 0 12px; }
.ptable tbody tr td:last-child { border-radius: 0 12px 12px 0; }

/* -------------------------------------------------------------------------- */
/* Hero animated track (Thunder Road)                                         */
/* -------------------------------------------------------------------------- */
.hero-track { position: relative; }
.hero-glow {
  position: absolute;
  inset: 8% 2%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(60% 55% at 50% 50%, rgba(225, 27, 34, 0.22), transparent 72%);
  filter: blur(26px);
}

/* -------------------------------------------------------------------------- */
/* Reduced motion                                                             */
/* -------------------------------------------------------------------------- */
@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;
  }
  [data-animate] { opacity: 1 !important; transform: none !important; }
  .wipe::before { display: none !important; }
  .checker-band::before { transform: skewY(0deg); }
}

/* -------------------------------------------------------------------------- */
/* Print                                                                      */
/* -------------------------------------------------------------------------- */
@media print {
  .site-header, .mobile-menu, .checker-band, .checker-strip, .btn, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
  .card, .block-red, .block-yellow, .block-ink2 { background: #fff !important; color: #000 !important; border: 1px solid #999; }
}
