:root {
  --color-bg: #000000;
  --color-bg-alt: #111111;
  --color-surface: #1a1a1a;

  --color-primary: #ff7b00;
  --color-primary-soft: #ff000020;

  --color-text: #ffffff;
  --color-text-muted: #cccccc;

  --color-border: #2a2a2a;

  --font-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-md: 10px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.45);

  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
}

/* RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

h1, h2, h3 {
  line-height: 1.2;
  margin-top: 0;
}

.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

.section {
  padding-block: var(--space-xl);
}

.section-alt {
  background: var(--color-bg-alt);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid var(--color-border);
  z-index: 25;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 0.75rem;
}

.logo {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.1rem;
}

.logo-small {
  max-width: 150px; /* Adjust this value to your preferred size */
  height: auto;
}

/* NAVIGATION */
.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  gap: 0.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--color-text-muted);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  transition: color 0.3s ease;
}

.nav-list a:hover {
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  align-items: center;
  gap: 0.75rem;
  transition: background 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-toggle-bar {
  display: block;
  width: 30px;
  height: 4px;
  background: var(--color-text);
  margin: 4px 0;
}

/* HERO */
.hero {
  padding-block: var(--space-xl);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(1,5vw, 3.5rem, 5vw, 2.5rem);
  margin-bottom: 0.8rem;
}

.hero-media {
  margin: 0;
  width: 100%;
}


/* BUTTONS */
.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

/* VISUAL SCHEDULE */
.schedule-timeline {
  margin-top: 2rem;
  border-left: 2px solid var(--color-border);
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.event-card {
  position: relative;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border-radius: 10px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.event-card::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: 1.4rem;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.event-date {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.event-day {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
}

.event-month {
  font-size: 0.85rem;
}

.event-content h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.event-content p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* NEXT EVENT HIGHLIGHT */
.event-card.next-event {
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 18px rgba(255, 0, 0, 0.35);
}

.event-card.next-event::after {
  content: "Seuraava kilpailu";
  position: absolute;
  top: -12px;
  right: 12px;
  background: var(--color-primary);
  color: #fff;
  padding: 2px 8px;
  font-size: 0.75rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* PARTNER CAROUSEL */
.partner-level {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1.1rem;
}

.partner-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-bottom: 2rem;
}

.partner-carousel-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(144px, 1fr));
  gap: var(--space-md);
  margin-bottom: 2rem;
}

/* LOGO LINK */
.ph-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}

.ph-logo-link:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(255, 123, 0, 0.2);
}

/* PARTNER LOGO IMAGE */
.ph-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* EQUIPMENT / BIKE CARDS */
.bike-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 4rem;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.bike-image {
  width: 100%;
  height: auto;
  background: #000;
  overflow: hidden;
}

.bike-image img {
  width: 100%;
  height: auto;
  display: block;
  object-position: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.bike-card:hover .bike-image img {
  transform: scale(1.05);
}

.bike-details {
  padding: 2rem;
}

.bike-details h3 {
  margin-top: 0;
  margin-bottom: 2rem;
  font-size: 1.8rem;
  color: var(--color-primary);
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
  letter-spacing: 0.05em;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.spec-column h4 {
  color: #fff;
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spec-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.spec-column li {
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  border-bottom: 1px solid #2a2a2a;
  padding-bottom: 0.25rem;
}

.spec-column li:last-child {
  border-bottom: none;
}

.perf-list {
  margin: 0;
}

.perf-list > div {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid #2a2a2a;
}

.perf-list dt {
  color: var(--color-text-muted);
}

.perf-list dd {
  color: var(--color-primary);
  font-family: monospace;
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
}

/* CONTACT LIST */
.contact-grid {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.contact-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem;
  text-align: center;
  width: 100%;
  max-width: 600px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.contact-block:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-soft);
  border-color: var(--color-primary);
}

.contact-block h3 {
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 1rem;
  text-transform: uppercase;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}

.contact-name {
  font-weight: 700;
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.contact-cta {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 123, 0, 0.1);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.contact-cta:hover {
  background: var(--color-primary);
  color: #fff;
}

/* SOCIAL BAR */
.social-bar {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: rgba(255, 123, 0, 0.1);
  transition: all 0.3s ease;
  border: 2px solid var(--color-primary);
}

.social-link:hover {
  background: var(--color-primary);
  transform: scale(1.15);
}

.social-link img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  filter: brightness(1);
}

.social-link:hover img {
  filter: brightness(0) invert(1);
}

/* TEAM GALLERY */
.team-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.team-member {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.team-member:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(255, 123, 0, 0.2);
}

.member-image {
  width: 100%;
  height: 260px;
  overflow: hidden;
  background: var(--color-bg);
}

.member-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-info {
  padding: 1rem;
  text-align: center;
}

.member-info h3 {
  margin: 0 0 0.3rem;
  color: var(--color-text);
  font-size: 0.8rem;
}

.member-role {
  color: var(--color-primary);
  font-weight: 600;
  margin: 0 0 0.75rem;
  font-size: 0.6rem;
}

member-bio {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.1;
}

/* FOOTER */
.site-footer {
  padding: 1.25rem 0;
  text-align: center;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

/* ACHIEVEMENTS */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.achievement-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
}

.achievement-card h3 {
  color: var(--color-primary);
  font-size: 1.6rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
  letter-spacing: 0.05em;
}

.achievement-group h4 {
  color: #fff;
  font-size: 1.1rem;
  margin: 1.5rem 0 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.achievement-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.achievement-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
  line-height: 1.4;
}

.achievement-list li:last-child {
  border-bottom: none;
}

.achievement-year {
  color: var(--color-text-muted);
  font-weight: 600;
  margin-right: 1rem;
}

.achievement-result {
  text-align: right;
  color: #fff;
}

/* LIGHTBOX STYLES */
.lightbox {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: #bbb;
  text-decoration: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .section {
    padding-block: 3rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .header-inner {
    justify-content: space-between;
    gap: 1rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle-text {
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
  }


  .nav-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 10, 10, 0.98);
    padding: 2rem 0;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    gap: 1.5rem;
    display: none;
  }

  .nav-list li a {
    font-size: 0.8rem;
    display: block;
  }

  /* alternate selector when parent has open state */
  .main-nav.open .nav-list {
    display: flex;
  }

  .event-card {
    grid-template-columns: 1fr;
  }

  .event-date {
    flex-direction: row;
    gap: 0.5rem;
    align-items: baseline;
  }

  .specs-grid, 
  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .contact-block {
    padding: 2rem 1.5rem;
  }

  .bike-details h3 {
    font-size: 1.4rem;
  }
}
