/* ============================================================
   Robot Sports World - shared styles (used by all pages)
   ============================================================ */
:root {
  --bg: #ffffff;
  --ink: #0b0b0c;
  --red: #d70302;
  --muted: #6b6b70;
  --line: #e6e6ea;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Saira Condensed", "Arial Narrow", Arial, sans-serif;
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav-brand img { height: 40px; width: auto; display: block; }
.nav-brand .red { color: var(--red); }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 6px;
  transition: color 150ms ease, background 150ms ease;
}
.nav-links a:hover { color: #ffffff; background: var(--red); }
.nav-links a.active { color: var(--red); }
.nav-links a.active:hover { color: #ffffff; }

/* ---------- Hero (home page) ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 64px;
}
.logo {
  max-width: min(280px, 60vw);
  width: 100%;
  height: auto;
  display: block;
}
.wordmark {
  margin-top: 4px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 0.95;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  text-transform: uppercase;
}
.wordmark .red { color: var(--red); }
.rule {
  width: clamp(100px, 20vw, 180px);
  height: 3px;
  margin: 14px auto 0;
  background: var(--red);
  transform: skewX(-20deg);
}
.tagline {
  margin-top: 12px;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.video-wrap {
  position: relative;
  margin-top: 22px;
  width: 100%;
  max-width: min(1000px, 94vw);
}
.promo-video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}
.sound-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: rgba(11, 11, 12, 0.72);
  color: #ffffff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 150ms ease;
}
.sound-btn:hover { background: var(--red); }

/* Hero stage: video remains visible above the same-size autoplay carousel. */
.hero-stage {
  position: relative;
  width: 100%;
  max-width: min(1000px, 94vw);
  margin: 22px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
  overflow: visible;
}
.stage-pane {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}
.stage-pane.is-hidden { display: none; }
.stage-video { width: 100%; }
.stage-video .video-wrap { margin-top: 0; max-width: 100%; }
.stage-carousel { width: 100%; }

/* ---------- Page sections ---------- */
section { padding: 64px 24px; }
.section-title {
  font-weight: 800;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.section-title .red { color: var(--red); }
.section-rule {
  width: 110px;
  height: 3px;
  margin: 14px auto 26px;
  background: var(--red);
  transform: skewX(-20deg);
}
.about-text {
  max-width: 760px;
  margin: 0 auto;
  font-weight: 800;
  font-size: clamp(1.3rem, 3.2vw, 1.9rem);
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.sport-list {
  list-style: none;
  margin: 22px auto 0;
  padding: 0;
}
.sport-list li {
  font-weight: 600;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 2;
  color: var(--ink);
}

/* ---------- Contact form ---------- */
.form-wrap {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.form-row label .req { color: var(--red); }
.form-row .hint {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: 8px;
  outline: none;
  transition: border-color 150ms ease;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--red); }
.form-row textarea { min-height: 140px; resize: vertical; }
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.name-grid .sub {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 4px;
  display: block;
  text-transform: none;
}
.submit-btn {
  display: inline-block;
  padding: 14px 42px;
  border: none;
  border-radius: 8px;
  background: var(--red);
  color: #ffffff;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
}
.submit-btn:hover { background: #b00201; }
.submit-btn:active { transform: translateY(1px); }
.form-note {
  margin-top: 14px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
}
.alert {
  max-width: 640px;
  margin: 0 auto 22px;
  padding: 14px 18px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: none;
}
.alert.ok { display: block; background: #e8f7ec; color: #156a2c; border: 2px solid #9fd9af; }
.alert.err { display: block; background: #fdeaea; color: #8f0202; border: 2px solid #f0a8a8; }
.alert a { color: inherit; }

/* ---------- Footer ---------- */
footer {
  padding: 28px 24px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Animations ---------- */
@media (prefers-reduced-motion: no-preference) {
  .logo, .wordmark, .rule, .tagline, .video-wrap { animation: rise 700ms ease-out both; }
  .wordmark { animation-delay: 90ms; }
  .rule { animation-delay: 150ms; }
  .tagline { animation-delay: 210ms; }
  .video-wrap { animation-delay: 270ms; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 560px) {
  .nav { flex-direction: column; gap: 6px; }
  .name-grid { grid-template-columns: 1fr; }
}

/* ---------- Per-field validation errors ---------- */
.field-error {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--red);
  margin-top: 6px;
  min-height: 0;
}
.field-error:empty { margin-top: 0; }
.form-row.has-error input,
.form-row.has-error select,
.form-row.has-error textarea {
  border-color: var(--red);
  background: #fff7f7;
}

/* ============================================================
   Lineup carousel (robots.html)
   ============================================================ */
.carousel-intro {
  font-weight: 600;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: -8px auto 30px;
}
.carousel {
  position: relative;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}
.car-viewport { overflow: hidden; width: 100%; }
.car-track {
  display: flex;
  transition: transform 420ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.car-slide {
  flex: 0 0 100%;
  min-width: 100%;
  padding: 4px;
}
/* Single stage: before + after stacked, crossfading (dissolve) */
.car-stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: transparent;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}
.car-cell {
  position: absolute;
  inset: 0;
  margin: 0;
  /* Promote each layer onto its own GPU layer so the dissolve is
     composited, never repainted — no jank mid-fade. */
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.car-img {
  position: absolute;
  inset: 0;
  aspect-ratio: 4 / 5;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* keep the stage height driven by one in-flow image */
.car-stage > .car-spacer {
  aspect-ratio: 4 / 5;
  width: 100%;
}
.car-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* The "after" layer sits on top and dissolves in over the "before".
   Opacity + a near-imperceptible scale "bloom" give it the soft,
   premium settle you see in Apple Photos / Telegram media. Both are
   compositor-only properties, so this runs at a locked frame rate. */
.car-cell-before,
.car-cell-after {
  will-change: opacity;
}
/* The "after" sits beneath the particle canvas; it's revealed by the
   dispersion of the "before" particles rather than by an opacity fade. */
.car-cell-after {
  opacity: 0;
}
.car-stage.is-revealed .car-cell-after {
  opacity: 1;
}
/* Particle dispersion canvas: covers the stage, drawn above the images
   and below the tags. JS paints the dispersing "before" pixels here. */
.car-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}
.car-fx.is-active { opacity: 1; }
.car-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: opacity 700ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}
.car-tag-after { background: var(--red); opacity: 0; }
.car-stage.is-revealed .car-tag-before { opacity: 0; }
.car-stage.is-revealed .car-tag-after { opacity: 1; }
/* Small required disclosure beside the after carousel imagery. Hidden on before frames; visible only after the image is revealed. */
.visual-credit {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  font-size: 0.58rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(11, 11, 12, 0.55);
  background: rgba(255, 255, 255, 0.72);
  padding: 4px 6px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 700ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}
.car-stage.is-revealed .visual-credit { opacity: 1; }
.car-caption {
  position: relative;
  margin-bottom: 18px;
  min-height: 72px;
}
/* Two stacked caption layers that crossfade with the image dissolve:
   "before" shows the company name + sport; "after" shows only the sport. */
.cap-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: opacity 700ms cubic-bezier(0.4, 0, 0.2, 1);
}
.cap-after { opacity: 0; }
.car-slide.is-revealed .car-caption .cap-before { opacity: 0; }
.car-slide.is-revealed .car-caption .cap-after  { opacity: 1; }
.car-name {
  font-weight: 800;
  font-size: clamp(1.3rem, 3.4vw, 2rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  margin: 0;
}
.car-name .car-model { color: var(--red); }
.car-sport {
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
/* The sport, shown large on the "after" (the only text there). */
.car-sport-lg {
  font-weight: 800;
  font-size: clamp(1.4rem, 3.6vw, 2.1rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  line-height: 1;
}
/* Sport + RSW brand mark side by side on the "after". */
.sport-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
}
.car-rsw {
  font-weight: 800;
  font-size: clamp(1.1rem, 2.8vw, 1.6rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
}
.car-arrow {
  position: absolute;
  top: calc(50% - 40px);
  transform: translateY(-50%);
  z-index: 5;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: rgba(11, 11, 12, 0.72);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 150ms ease;
}
.car-arrow:hover { background: var(--red); }
.car-prev { left: -8px; }
.car-next { right: -8px; }
.car-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 26px;
}
.car-dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}
.car-dot:hover { background: var(--muted); }
.car-dot[aria-selected="true"] {
  background: var(--red);
  transform: scale(1.25);
}

@media (max-width: 640px) {
  .car-stage { max-width: 340px; }
  .car-tag { font-size: 0.62rem; padding: 4px 9px; letter-spacing: 0.1em; }
  .car-arrow { width: 38px; height: 38px; }
  .car-prev { left: 0; }
  .car-next { right: 0; }
}
/* Honor reduced-motion: swap instantly, no fade or scale */
@media (prefers-reduced-motion: reduce) {
  .car-cell-before,
  .car-cell-after,
  .car-tag,
  .visual-credit,
  .car-track { transition: none; }
  .car-cell-after { transform: translateZ(0) scale(1); }
}

/* Pause/Play control for the auto-cycling carousel. Sits at the bottom-left
   corner of the centered robot stage (480px desktop / 340px mobile); the
   bottom-right corner is occupied by the visual credit. */
.car-pause {
  position: absolute;
  bottom: 18px;
  left: calc(50% - 240px + 14px);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: rgba(11, 11, 12, 0.72);
  color: #ffffff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 200ms ease;
}
.car-pause:hover { background: var(--red); }
@media (max-width: 640px) {
  .car-pause { bottom: 14px; left: calc(50% - 170px + 10px); padding: 7px 12px; font-size: 0.78rem; }
}
