/* DJRC Racing — Design System */

/* ===========================================
   VARIABLES
   =========================================== */
:root {
  --bg: #0A0A0C;
  --bg-2: #121216;
  --card: #18181D;
  --line: rgba(255, 255, 255, 0.08);
  --red: #E60000;
  --red-2: #FF2A2A;
  --red-glow: rgba(255, 42, 42, 0.25);
  --text: #ffffff;
  --text-2: #A1A1AA;
  --body: #d4d4d8;
  --gold: #EAB308;
  --silver: #94A3B8;
  --bronze: #D97706;
  --font-display: "Barlow Condensed", Impact, sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --header-h: 80px;
  --radius: 6px;
}

/* ===========================================
   RESET & BASE
   =========================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: #fff;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* ===========================================
   TYPOGRAPHY
   =========================================== */
h1, h2, h3, h4, h5,
.btn-red,
.btn-ghost,
.site-nav a {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 0.9;
}

h1, h2, h3, h4, h5 {
  color: #fff;
}

/* ===========================================
   LAYOUT
   =========================================== */
.container-r {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 1024px) {
  .container-r {
    padding: 0 40px;
  }
}

/* ===========================================
   EYEBROW
   =========================================== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red-2);
  line-height: 1;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--red-2);
  flex-shrink: 0;
}

/* ===========================================
   TITLES
   =========================================== */
.title-xl {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.9;
  color: #fff;
}

.title-xl .accent {
  color: var(--red-2);
  font-style: italic;
  font-weight: 900;
}

/* ===========================================
   CARDS
   =========================================== */
.card-r {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.card-r.card-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 42, 42, 0.55);
  box-shadow: 0 18px 50px -20px var(--red-glow);
}

/* ===========================================
   BUTTONS
   =========================================== */
.btn-red,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1;
  font-family: var(--font-display);
  text-transform: uppercase;
}

.btn-red {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-red:hover {
  background: var(--red-2);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(255, 42, 42, 0.6);
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.btn-ghost:hover {
  border-color: var(--red-2);
  background: rgba(255, 42, 42, 0.08);
  transform: translateY(-2px);
}

/* ===========================================
   FORM FIELDS
   =========================================== */
.field,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  background: #0F0F13;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0.75rem 0.9rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.field:focus,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--red-2);
  box-shadow: 0 0 0 3px rgba(255, 42, 42, 0.15);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--red-2) 50%),
    linear-gradient(135deg, var(--red-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem;
  cursor: pointer;
}

.field-label,
label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 8px;
  font-weight: 600;
}

/* ===========================================
   DECORATIVE ELEMENTS
   =========================================== */
.stripe-line {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--red), var(--red-2) 40%, transparent);
  border: 0;
}

.carbon {
  background-color: #111115;
  background-image: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.025) 0% 25%,
    transparent 0% 50%
  );
  background-size: 8px 8px;
}

.grain {
  position: relative;
  overflow: hidden;
}

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ===========================================
   RICH CONTENT
   =========================================== */
.rich h2,
.rich h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 0.9;
  color: #fff;
  margin: 1.5em 0 0.75em;
}

.rich ul,
.rich ol {
  list-style: none;
  padding: 0;
  margin: 1em 0;
}

.rich ul li,
.rich ol li {
  position: relative;
  padding-left: 18px;
  margin: 8px 0;
  line-height: 1.75;
}

.rich ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--red);
}

.rich ol li {
  counter-increment: list-counter;
}

.rich ol li::before {
  content: counter(list-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--red-2);
  font-family: var(--font-mono);
  font-weight: 600;
}

.rich table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.rich thead th {
  background: rgba(230, 0, 0, 0.14);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  padding: 12px 14px;
  color: #fff;
  text-align: left;
}

.rich tbody tr {
  border-bottom: 1px solid var(--line);
}

.rich tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.rich tbody td {
  padding: 12px 14px;
}

.rich p {
  margin: 1em 0;
  line-height: 1.75;
}

.rich a {
  color: var(--red-2);
  text-decoration: underline;
}

.rich a:hover {
  color: var(--red);
}

/* ===========================================
   ANIMATIONS
   =========================================== */
@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

@keyframes kenburns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

/* ===========================================
   REVEAL
   =========================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ===========================================
   MONO / TECH TEXT
   =========================================== */
.mono,
.tech {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ===========================================
   HEADER
   =========================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 50;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
  border: 0;
  box-shadow: none;
  transition: background-color 0.35s ease, backdrop-filter 0.35s ease;
}

.site-header.is-scrolled {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(to left, rgba(230, 0, 0, 0.35), transparent);
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 2;
  height: calc(var(--header-h) - 3px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.site-header .logo {
  flex-shrink: 0;
}

.site-header .logo img,
.site-header #logo {
  max-height: 58px;
  margin: 0;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.site-header .logo img:hover,
.site-header #logo:hover {
  animation: rotate-scale-up 0.4s linear both;
}

@keyframes rotate-scale-up {
  0% { transform: scale(1) rotateZ(0); }
  50% { transform: scale(1.1) rotateZ(180deg); }
  100% { transform: scale(1) rotateZ(360deg); }
}

.spin {
  animation: rotate-scale-up 0.4s linear both;
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  position: relative;
  display: inline-block;
  padding: 10px 12px 12px;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  text-align: left;
  transition: color 0.25s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: #fff;
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

.site-nav a .nav-num {
  display: none;
}

.btn-diag-nav {
  position: relative;
  padding: 0.6rem 1.1rem;
  font-size: 13px;
  margin-left: 8px;
}

.btn-diag-nav .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulse-dot 1.6s ease infinite;
}

.hamburger {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  z-index: 52;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.hamburger:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

body.has-fixed-nav {
  padding-top: var(--header-h);
}

body.page-accueil.has-fixed-nav,
body.page-index {
  padding-top: 0;
}

@media (max-width: 1279px) {
  .site-header {
    transition: background-color 0.35s ease;
  }

  .hamburger {
    display: flex;
    margin-left: auto;
  }

  .site-nav {
    margin-left: 0;
  }

  body.nav-open .site-header.is-scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .site-nav ul {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 90px 28px 40px;
    gap: 0;
    z-index: 51;
  }

  .site-nav ul.show {
    display: flex;
  }

  .site-nav li {
    border-bottom: 1px solid var(--line);
  }

  .site-nav a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 22px;
    padding: 16px 0;
    color: #fff;
  }

  .site-nav a .nav-num {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--text-2);
  }

  .site-nav a::after {
    display: none;
  }

  .btn-diag-nav {
    width: 100%;
    margin: 22px 0 0;
    justify-content: center;
  }

  body.nav-open {
    overflow: hidden;
  }
}

/* ===========================================
   FOOTER
   =========================================== */
.site-footer {
  position: relative;
  background: #0c0c10;
  color: #fff;
  padding: 0;
  text-align: left;
  border-top: 1px solid var(--line);
  box-shadow: none;
  background-image: none;
  margin-top: auto;
}

.footer-check {
  height: 8px;
  opacity: 0.07;
  background: repeating-linear-gradient(
    90deg,
    #fff 0 8px,
    #111 8px 16px
  );
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 40px;
  padding-top: 56px;
  padding-bottom: 36px;
  align-items: start;
}

.site-footer .footer-logo {
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 60px);
  font-weight: 900;
  margin: 0 0 14px;
  text-align: left;
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.site-footer .footer-logo span {
  color: var(--red-2);
  font-style: italic;
}

.footer-tagline {
  color: var(--body);
  max-width: 420px;
  font-size: 16px;
  line-height: 1.6;
}

.site-footer .footer-pages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  justify-content: start;
}

.site-footer .footer-pages a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 15px;
  font-weight: 700;
  transition: color 0.25s ease;
}

.site-footer .footer-pages a:hover {
  color: var(--red-2);
}

.site-footer .socials {
  display: flex;
  gap: 12px;
  margin: 0;
  justify-content: flex-start;
}

.site-footer .socials a {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #fff;
  box-shadow: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.site-footer .socials a:hover {
  background: var(--red);
  border-color: var(--red);
  transform: translateY(-2px);
}

.footer-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 16px 40px 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 40px;
  }

  .footer-bar {
    padding: 16px 20px 22px;
  }
}

/* ===========================================
   PAGE HERO
   =========================================== */
.page-hero {
  position: relative;
  padding: 170px 0 70px;
  overflow: hidden;
  isolation: isolate;
}

.page-hero.grain {
  position: relative;
}

.page-hero .hero-bg {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.25;
  animation: kenburns 6s ease-in-out infinite alternate;
  z-index: -2;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 12, 0.2) 0%, var(--bg) 100%);
  z-index: -1;
}

.page-hero::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -40px;
  width: 380px;
  height: 280px;
  background: rgba(230, 0, 0, 0.3);
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
}

.page-hero h1 {
  font-size: clamp(48px, 8vw, 110px);
  margin: 16px 0 18px;
  text-align: left;
  line-height: 0.9;
}

.page-hero h1 .accent {
  color: var(--red-2);
  font-style: italic;
  font-weight: 900;
}

.page-hero p {
  color: var(--body);
  max-width: 650px;
  font-size: 18px;
  line-height: 1.75;
  text-align: left;
}

/* ===========================================
   RESPONSIVE 390px
   =========================================== */
@media (max-width: 390px) {
  body {
    font-size: 16px;
    overflow-x: hidden;
  }

  .title-xl {
    font-size: 34px;
  }

  .page-hero {
    padding-top: 130px;
  }

  .page-hero h1 {
    font-size: 44px;
  }

  .page-hero p {
    font-size: 16px;
  }

  .container-r {
    padding: 0 16px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .footer-bar {
    padding: 16px 16px 22px;
  }
}
