/* ============================================================
   racingroute — styles.css
   Dark, premium theme. BEM naming.
   ============================================================ */

:root {
  --bg:        #0a0c0f;
  --bg-alt:    #0e1116;
  --surface:   #14181e;
  --surface-2: #191e26;
  --border:    rgba(255, 255, 255, 0.08);
  --border-2:  rgba(255, 255, 255, 0.14);

  --text:      #e9edf2;
  --muted:     #9aa4b1;
  --faint:     #6b7480;

  --accent:      #f5842b;
  --accent-soft: rgba(245, 132, 43, 0.14);
  --accent-line: rgba(245, 132, 43, 0.35);

  --star:      #f5b02b;

  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  --maxw: 1200px;
  --gap: 24px;

  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);

  --font-sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p { margin: 0; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #0a0c0f;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}
.container--narrow { max-width: 820px; }

.section {
  padding: 84px 0;
  border-top: 1px solid var(--border);
}
.section--alt { background: var(--bg-alt); }
.section--navy {
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 55%),
    var(--bg-alt);
}

/* ---------- Subscribe ---------- */
.subscribe {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: start;
}
.subscribe__points {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.subscribe__point {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.98rem;
}
.subscribe__point svg {
  flex: none;
  width: 20px;
  height: 20px;
  padding: 4px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

/* ---------- Form ---------- */
.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.form__row { margin-bottom: 16px; }
.form__label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
.form__req { color: var(--accent); }
.form__input {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.form__input::placeholder { color: var(--faint); }
.form__input:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form__error {
  margin-top: 8px;
  font-size: 0.82rem;
  color: #ff7b6b;
}
.form__consent {
  display: flex;
  gap: 10px;
  margin: 4px 0 20px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
.form__consent input {
  flex: none;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.form__consent a { color: var(--accent); text-decoration: underline; }
.form .btn--primary { width: 100%; }
.form__success {
  margin-top: 16px;
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
}

.section__head {
  max-width: 720px;
  margin: 0 0 48px;
}
.section__title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin: 12px 0 14px;
  text-wrap: balance;
}
.section__sub {
  color: var(--muted);
  font-size: 1.05rem;
  text-wrap: pretty;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--accent);
  color: #0a0c0f;
}
.btn--primary:hover { background: #ff9540; }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-2);
}
.btn--ghost:hover { border-color: var(--accent-line); color: #fff; }
.btn--sm { padding: 9px 16px; font-size: 0.85rem; }
.btn--card {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
  margin-top: auto;
}
.btn--card:hover { border-color: var(--accent-line); color: var(--accent); }

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}
.brand__name { letter-spacing: -0.02em; }

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 15, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.header.has-scroll {
  border-bottom-color: var(--border);
  background: rgba(10, 12, 15, 0.9);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.header__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header__link {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.header__link:hover { color: var(--text); background: var(--surface); }
.header__link--cta {
  color: var(--accent);
  border: 1px solid var(--accent-line);
}
.header__link--cta:hover { background: var(--accent-soft); color: var(--accent); }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.burger__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.burger[aria-expanded="true"] .burger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__bar:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] .burger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 88px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 60% at 80% 0%, var(--accent-soft), transparent 70%),
    radial-gradient(50% 50% at 0% 100%, rgba(255,255,255,0.04), transparent 70%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.hero__title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  margin: 18px 0 20px;
  text-wrap: balance;
}
.hero__accent { color: var(--accent); }
.hero__lede {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 46ch;
  text-wrap: pretty;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0 36px;
}
.hero__stats {
  display: flex;
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero__stat { display: flex; flex-direction: column; }
.hero__stat strong {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--text);
}
.hero__stat span { color: var(--faint); font-size: 0.9rem; }

.hero__media {
  position: relative;
  min-height: 360px;
}
.hero__card {
  position: absolute;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  background: var(--surface);
}
.hero__card img { width: 100%; height: 100%; object-fit: cover; }
.hero__card--lead {
  width: 62%;
  top: 8%;
  left: 18%;
  z-index: 3;
  transform: rotate(-3deg);
}
.hero__card--a {
  width: 40%;
  bottom: 2%;
  left: 0;
  z-index: 2;
  transform: rotate(4deg);
}
.hero__card--b {
  width: 40%;
  top: 0;
  right: 0;
  z-index: 2;
  transform: rotate(5deg);
}

/* ---------- Games grid ---------- */
.games {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-2);
}
.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card__media img { transform: scale(1.04); }
.card__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #0a0c0f;
  font-weight: 600;
}
.card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  flex: 1;
}
.card__meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}
.card__title { font-size: 1.2rem; }
.card__dev { color: var(--faint); font-size: 0.88rem; margin-top: -4px; }
.card__rating { display: flex; align-items: center; gap: 8px; }
.card__score { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.card__text {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

/* Stars (rendered via JS as inline SVG) */
.stars { display: inline-flex; gap: 2px; color: var(--star); }
.stars svg { width: 16px; height: 16px; }

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.step__num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}
.step__title { font-size: 1.2rem; margin: 12px 0 8px; }
.step__text { color: var(--muted); font-size: 0.96rem; }

.disclosure {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 760px;
}
.disclosure a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Trust ---------- */
.trust {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
.trust__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.trust__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
  margin-bottom: 16px;
}
.trust__title { font-size: 1.1rem; margin-bottom: 8px; }
.trust__text { color: var(--muted); font-size: 0.94rem; }

/* ---------- FAQ ---------- */
.faq {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq__q { margin: 0; font-size: 1rem; }
.faq__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  padding: 18px 20px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
}
.faq__icon {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}
.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  background: var(--accent);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.faq__icon::before { top: 8px; left: 0; width: 18px; height: 2px; }
.faq__icon::after { left: 8px; top: 0; width: 2px; height: 18px; }
.faq__item--open .faq__icon::after { transform: scaleY(0); opacity: 0; }
.faq__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.faq__a p {
  padding: 0 20px 20px;
  color: var(--muted);
  font-size: 0.96rem;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 56px 0 28px;
}
.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.3fr;
  gap: 32px;
}
.footer__tagline { color: var(--muted); font-size: 0.92rem; margin-top: 14px; max-width: 30ch; }
.footer__col { display: flex; flex-direction: column; gap: 10px; }
.footer__heading {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}
.footer__link { color: var(--muted); font-size: 0.95rem; transition: color 0.15s ease; }
.footer__link:hover { color: var(--accent); }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 0.88rem;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #0a0c0f;
  border: 0;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 40;
  box-shadow: var(--shadow);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- Cookie banner ---------- */
.cookie {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cookie__text { color: var(--muted); font-size: 0.92rem; flex: 1; min-width: 240px; }
.cookie__text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.cookie__actions { display: flex; gap: 10px; }

/* ---------- Legal pages ---------- */
.legal { padding: 56px 0 84px; }
.legal__head { max-width: 760px; margin-bottom: 36px; }
.legal__title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 14px 0 12px; }
.legal__updated { color: var(--faint); font-size: 0.9rem; }
.legal__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 0.92rem;
  margin-top: 20px;
}
.legal__body { max-width: 800px; }
.legal__body h2 {
  font-size: 1.35rem;
  margin: 40px 0 12px;
  padding-top: 8px;
}
.legal__body h3 { font-size: 1.1rem; margin: 24px 0 8px; }
.legal__body p { color: var(--muted); margin-bottom: 14px; }
.legal__body ul { color: var(--muted); margin: 0 0 16px; padding-left: 22px; }
.legal__body li { margin-bottom: 8px; }
.legal__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .games,
  .trust { grid-template-columns: repeat(2, 1fr); }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .burger { display: flex; }
  .header__nav {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 20px 24px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
  }
  .header__nav.is-open { transform: translateY(0); }
  .header__link { padding: 12px 14px; font-size: 1rem; }
  .header__link--cta { text-align: center; margin-top: 6px; }

  .hero { padding: 48px 0 64px; }
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__media { min-height: 300px; order: -1; }
  .hero__stats { gap: 24px; }

  .steps { grid-template-columns: 1fr; }
  .subscribe { grid-template-columns: 1fr; gap: 32px; }
  .section { padding: 64px 0; }
}

@media (max-width: 560px) {
  .games,
  .trust { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
  .hero__stat strong { font-size: 1.6rem; }
  .cookie { flex-direction: column; align-items: stretch; }
  .cookie__actions { justify-content: flex-end; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .card:hover { transform: none; }
  .btn:hover { transform: none; }
}
