/* base.css — Shared Layout & Styles for RACE */
/* ========================================
   RACE — Heinz Platacis "THE CHAMPION"
   Design: Opencode (Lead Designer)
   Version: 1.0.0
   ======================================== */



/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4 {
  font-family: Impact, 'Arial Black', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* === NAVIGATION === */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 16px 40px;
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--primary);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: Impact, sans-serif;
  font-size: 1.5rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.nav-logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-links a {
  color: var(--gray);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
}

.lang-switch {
  display: flex;
  gap: 4px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.lang-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--gray);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  transition: var(--transition);
}

.lang-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.lang-btn:hover:not(.active) {
  color: var(--white);
  border-color: var(--primary);
}

/* === HERO SECTION === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--white) 0px,
    var(--white) 20px,
    var(--bg) 20px,
    var(--bg) 40px
  );
  opacity: 0.3;
  animation: checkered-slide 3s linear infinite;
}

@keyframes checkered-slide {
  0% { transform: translateX(-40px); }
  100% { transform: translateX(0); }
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 30% 50%, var(--primary-glow) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(201, 162, 39, 0.1) 0%, transparent 50%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding: 120px 20px 60px;
}

.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  color: var(--bg);
  padding: 8px 24px;
  border-radius: 4px;
  font-family: Impact, sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 24px;
  animation: badge-glow 2s ease-in-out infinite alternate;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes badge-glow {
  from { box-shadow: 0 0 20px rgba(201, 162, 39, 0.5); }
  to { box-shadow: 0 0 40px rgba(201, 162, 39, 0.8); }
}

.hero-name {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #E0E0E0 40%, #A0A0A0 60%, #808080 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
  position: relative;
}

.hero-name::after {
  content: '';
  display: block;
  width: 120px;
  height: 4px;
  background: var(--primary);
  margin: 16px auto 0;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--gray);
  margin-bottom: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-tagline {
  font-size: 1rem;
  color: var(--gray-dim);
  margin-bottom: 32px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 4px;
  font-family: Impact, sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--primary-glow);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--bg);
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  color: var(--bg);
  box-shadow: 0 4px 20px rgba(201, 162, 39, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201, 162, 39, 0.5);
}

/* === SECTIONS === */
.section {
  padding: 80px 20px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.section-title .divider {
  width: 60px;
  height: 4px;
  background: var(--primary);
  margin: 0 auto 16px;
}

.section-title p {
  color: var(--gray);
  font-size: 1rem;
}

/* === CHAMPION SECTION === */
.champion-section {
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}

.champion-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(201, 162, 39, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(225, 6, 0, 0.05) 0%, transparent 50%);
}

.champion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.champion-image {
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid var(--primary);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.champion-image img {
  width: 100%;
  display: block;
}

.champion-info h3 {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.champion-info .team {
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 8px;
}

.champion-info .teammates {
  color: var(--gray);
  margin-bottom: 16px;
}

.champion-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.stat-box {
  background: var(--bg);
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-box .stat-value {
  font-family: Impact, sans-serif;
  font-size: 2rem;
  color: var(--primary);
}

.stat-box .stat-label {
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
}

/* === TIMELINE === */
.timeline-section {
  background: var(--bg);
}

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 20px 40px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
}

.timeline-dot {
  position: absolute;
  top: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -25px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -25px;
}

.timeline-item.champion .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.5);
}

.timeline-year {
  font-family: Impact, sans-serif;
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.timeline-event {
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--gray);
}

/* === MACHINES === */
.machines-section {
  background: var(--bg-card);
}

.machines-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.machine-card {
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.4s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.machine-card:hover {
  transform: translateY(-8px) rotateX(5deg);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(225, 6, 0, 0.2);
}

.machine-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.machine-info {
  padding: 20px;
}

.machine-info h3 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.machine-info .machine-year {
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.machine-info .machine-achievement {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.machine-info .machine-quote {
  font-size: 0.9rem;
  color: var(--gray);
  font-style: italic;
}

.machine-info .machine-note {
  font-size: 0.75rem;
  color: var(--gray-dim);
  margin-top: 6px;
  font-style: italic;
}

/* Champion-Bike Highlight */
.machine-card.champion-bike {
  border: 2px solid var(--accent);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.3);
}

.machine-card.champion-bike:hover {
  border-color: var(--accent-bright);
  box-shadow: 0 0 40px rgba(201, 162, 39, 0.5);
}

.machine-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.spec {
  text-align: center;
}

.spec-value {
  font-family: Impact, sans-serif;
  font-size: 1rem;
  color: var(--white);
}

.spec-label {
  font-size: 0.7rem;
  color: var(--gray-dim);
  text-transform: uppercase;
}

/* === RACES === */
.races-section {
  background: var(--bg);
}

.races-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
}

.races-table th,
.races-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.races-table th {
  font-family: Impact, sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--gray);
  background: var(--bg-card);
}

.races-table tr:hover {
  background: rgba(225, 6, 0, 0.05);
}

.races-table .champion-year {
  color: var(--accent);
  font-weight: 700;
}

.races-table .points {
  font-family: Impact, sans-serif;
  color: var(--primary);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -12px;
  padding: 0 12px;
}

/* === TODAY === */
.today-section {
  background: var(--bg-card);
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.today-card {
  background: var(--bg);
  padding: 32px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.today-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
}

.today-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.today-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.today-card p {
  color: var(--gray);
  font-size: 0.9rem;
}

/* === GALLERY === */
.gallery-section {
  background: var(--bg);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.gallery-item:hover {
  transform: scale(1.02);
  z-index: 1;
  box-shadow: 0 8px 30px rgba(225, 6, 0, 0.3);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  color: var(--white);
  cursor: pointer;
  background: none;
  border: none;
}

/* === CONTACT === */
.contact-section {
  background: var(--bg-card);
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  position: absolute;
  top: 12px;
  left: 16px;
  color: var(--gray);
  font-size: 0.9rem;
  transition: var(--transition);
  pointer-events: none;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: -8px;
  left: 12px;
  font-size: 0.75rem;
  color: var(--primary);
  background: var(--bg-card);
  padding: 0 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--white);
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* === FOOTER === */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 40px 20px;
  text-align: center;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
}

.footer-social {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 20px;
}

.footer-social a {
  color: var(--gray);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-social a:hover {
  color: var(--primary);
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--gray-dim);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--white);
}

.footer-copy {
  color: var(--gray-dim);
  font-size: 0.8rem;
}

/* === THEME SWITCH === */
.theme-switch {
  display: flex;
  gap: 4px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.theme-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--gray);
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

.theme-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.theme-btn:hover:not(.active) {
  color: var(--white);
  border-color: var(--primary);
}

.theme-icon {
  font-size: 1rem;
}

.theme-name {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === HAMBURGER === */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

/* === ANIMATIONS === */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Ember Particles */
.ember {
  position: fixed;
  width: 4px;
  height: 4px;
  background: var(--speed-orange);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  animation: ember-float 8s infinite ease-in-out;
}

@keyframes ember-float {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-100px) scale(1); }
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .champion-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .machines-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .timeline::before {
    left: 30px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 20px;
    text-align: left;
  }
  
  .timeline-item:nth-child(odd) {
    text-align: left;
  }
  
  .timeline-item:nth-child(even) {
    left: 0;
  }
  
  .timeline-dot {
    left: 5px !important;
    right: auto !important;
  }
}

@media (max-width: 768px) {
  .nav {
    padding: 14px 20px;
  }
  
  .nav-links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: rgba(13, 13, 13, 0.98);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  
  .nav-links.open {
    display: flex;
  }
  
  .hamburger {
    display: flex;
  }
  
  .hero {
    padding: 100px 16px 40px;
  }
  
  .hero-name {
    font-size: 2.5rem;
  }
  
  .section {
    padding: 48px 16px;
  }
  
  .machines-grid,
  .today-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .champion-stats {
    grid-template-columns: 1fr;
  }
  
  .races-table {
    font-size: 0.85rem;
  }
  
  .races-table th,
  .races-table td {
    padding: 8px;
  }
}

/* Small devices (S22, 360-400px) */
@media (max-width: 400px) {
  body { overflow-x: hidden; }

  .hero {
    background-size: contain;
    background-position: center;
  }

  img, table, iframe {
    max-width: 100%;
    height: auto;
  }

  .nav {
    padding: 10px 14px;
  }

  .nav-links {
    padding: 12px;
    gap: 10px;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  .hero-content {
    padding: 80px 12px 30px;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .theme-switch {
    gap: 2px;
    padding-left: 8px;
    margin-left: 8px;
  }

  .theme-btn {
    padding: 3px 6px;
    font-size: 0.65rem;
  }

  .section {
    padding: 32px 12px;
  }

  .section-title h2 {
    font-size: 1.5rem;
  }

  .champion-grid {
    gap: 24px;
  }

  .champion-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-box {
    padding: 10px;
  }

  .stat-box .stat-value {
    font-size: 1.5rem;
  }

  .races-table {
    font-size: 0.7rem;
  }

  .races-table th,
  .races-table td {
    padding: 4px 6px;
  }

  .machine-info {
    padding: 12px;
  }

  .today-card {
    padding: 20px 16px;
  }

  .contact-form {
    padding: 0;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 0.85rem;
  }
}

