/* ============================================
   UltraGarrotxa Cycling Challenge — style.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Barlow+Condensed:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #1c1a17;
  --basalt: #14110e;
  --basalt-soft: #201a15;
  --lava-deep: #b8460e;
  --lava-bright: #f2830c;
  --ember: #ff5a1f;
  --ash: #f6f1e9;
  --stone: #8a8378;
  --cream-text: #f3ede2;
  --line: #e3dbcb;
  --max-width: 1200px;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--ash);
  line-height: 1.6;
}

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: 'Anton', 'Inter', sans-serif;
  font-weight: 400;
  letter-spacing: 0.5px;
  margin: 0;
}

.eyebrow {
  display: inline-block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--lava-deep);
  margin-bottom: 14px;
}

.section--dark .eyebrow {
  color: var(--lava-bright);
}

/* ---------- Header / Nav ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.logo img {
  height: 52px;
  width: auto;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 34px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cream-text);
  position: relative;
  transition: opacity 0.2s ease;
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.25s ease;
}

.main-nav a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--cream-text);
  margin: 5px 0;
  border-radius: 2px;
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--basalt-soft) 0%, transparent 60%),
    linear-gradient(180deg, var(--basalt) 0%, var(--lava-deep) 42%, var(--lava-bright) 78%, var(--lava-bright) 100%);
  color: var(--cream-text);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 24px 40px;
}

.hero-title {
  font-size: clamp(3rem, 10vw, 7rem);
  margin-top: 24px;
  line-height: 0.95;
  color: var(--cream-text);
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
  margin-top: 46px;
}

.stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-family: 'Anton', sans-serif;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1;
}

.stat-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 8px;
  opacity: 0.8;
}

.stat-divider {
  width: 1px;
  height: 46px;
  background: rgba(243, 237, 226, 0.35);
}

.btn {
  display: inline-block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 16px 34px;
  border: 2px solid var(--cream-text);
  border-radius: 6px;
  background: transparent;
  color: var(--cream-text);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  background: var(--ember);
  border-color: var(--ember);
  color: #fff;
  transform: translateY(-2px);
}

.hero-cta {
  margin-top: 40px;
}

.hero-date {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 2px;
  margin-top: 46px;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 6vw, 70px);
  margin-top: 34px;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-number {
  font-family: 'Anton', sans-serif;
  font-size: clamp(2.1rem, 5.5vw, 3.2rem);
  line-height: 1;
}

.countdown-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 2px;
  margin-top: 6px;
  opacity: 0.8;
}

/* ---------- Hero terrain (volcano skyline + elevation profile) ---------- */

.hero-terrain {
  width: 100%;
  height: clamp(160px, 24vw, 260px);
  line-height: 0;
}

.hero-terrain svg {
  width: 100%;
  height: 100%;
  display: block;
}

.terrain-line {
  fill: none;
  stroke: var(--ember);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation: draw-line 2.4s ease-out 0.3s forwards;
}

@media (prefers-reduced-motion: reduce) {
  .terrain-line {
    stroke-dashoffset: 0;
    animation: none;
  }
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- Content sections ---------- */

.section {
  padding: 90px 0;
}

.section--dark {
  background: var(--basalt);
  color: var(--cream-text);
}

.section--dark .col-text p {
  color: rgba(243, 237, 226, 0.8);
}

.section--dark .col-text p strong {
  color: var(--lava-bright);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.two-col.reverse .col-text {
  order: 2;
}

.two-col.reverse .col-media {
  order: 1;
}

.col-text h2 {
  font-size: 2rem;
  margin-bottom: 22px;
}

.col-text p {
  margin: 0 0 16px 0;
  color: #3a3a3a;
}

.col-text p strong {
  color: var(--lava-deep);
}

.col-text p:last-child {
  margin-bottom: 0;
}

/* ---------- Carousel ---------- */

.carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #ddd;
  box-shadow: 0 20px 45px rgba(20, 17, 14, 0.25);
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s ease;
}

.carousel-track img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 17, 14, 0.55);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.carousel-arrow:hover {
  background: var(--ember);
}

.carousel-arrow.prev {
  left: 14px;
}

.carousel-arrow.next {
  right: 14px;
}

.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.carousel-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 0;
}

.carousel-dots button.active {
  background: var(--ember);
}

.carousel-counter {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 0.85rem;
  color: #fff;
  background: rgba(20, 17, 14, 0.55);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ---------- Topographic divider ---------- */

.divider {
  height: 22px;
  max-width: var(--max-width);
  margin: 0 auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpolyline points='0,14 15,6 30,15 45,4 60,12 75,7 90,16 105,5 120,13 135,8 150,17 165,6 180,12 200,9' fill='none' stroke='%23e3dbcb' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 200px 20px;
  background-position: center;
  opacity: 0.9;
}

.section--dark + .divider,
.divider--dark {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpolyline points='0,14 15,6 30,15 45,4 60,12 75,7 90,16 105,5 120,13 135,8 150,17 165,6 180,12 200,9' fill='none' stroke='%23443a30' stroke-width='1.4'/%3E%3C/svg%3E");
}

/* ---------- Collaborators ---------- */

.collab-title {
  font-size: 1.7rem;
  margin-bottom: 34px;
}

.collab-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: center;
}

.collab-logos img {
  height: 70px;
  width: auto;
  filter: grayscale(15%);
  transition: filter 0.2s ease;
}

.collab-logos a:hover img {
  filter: grayscale(0%);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--basalt);
  color: var(--stone);
  padding: 34px 0;
}

.footer-inner {
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cream-text);
}

.footer-inner a:hover {
  color: var(--lava-bright);
}

.footer-copy {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 22px;
  opacity: 0.7;
}

/* ---------- Page header (galeria / contacte) ---------- */

.page-hero {
  background:
    radial-gradient(120% 140% at 50% 0%, var(--basalt-soft) 0%, transparent 65%),
    linear-gradient(180deg, var(--basalt) 0%, var(--lava-deep) 55%, var(--lava-bright) 100%);
  color: var(--cream-text);
  padding-bottom: 20px;
}

.page-hero-title {
  text-align: center;
  padding: 10px 24px 28px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-hero-title .eyebrow {
  color: var(--lava-bright);
}

.page-hero-title h1 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-family: 'Inter', sans-serif;
  font-weight: 700;
}

.page-hero-strip {
  height: 30px;
  line-height: 0;
}

.page-hero-strip svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Gallery page ---------- */

.gallery-group {
  padding: 56px 0 10px;
}

.gallery-group h2 {
  font-size: 1.4rem;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  margin-bottom: 6px;
}

.gallery-group .eyebrow {
  margin-bottom: 6px;
}

.gallery-group-intro {
  color: var(--stone);
  margin: 0 0 24px 0;
}

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

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid img:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(20, 17, 14, 0.2);
}

/* ---------- Contact page ---------- */

.contact-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 24px 110px;
}

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-label .required {
  color: var(--lava-deep);
}

.form-input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--lava-deep);
  box-shadow: 0 0 0 3px rgba(184, 70, 14, 0.15);
}

.btn-submit {
  background: var(--basalt);
  color: #fff;
  border: 2px solid var(--basalt);
}

.btn-submit:hover {
  background: var(--ember);
  border-color: var(--ember);
}

.form-note {
  font-size: 0.85rem;
  color: var(--stone);
  margin-top: 16px;
}

/* ---------- Thank-you page ---------- */

.thanks-section {
  text-align: center;
  padding: 120px 24px;
}

.thanks-section h1 {
  font-size: 2rem;
  font-family: 'Inter', sans-serif;
  margin-bottom: 16px;
}

.thanks-section p {
  color: #555;
  margin-bottom: 30px;
}

.thanks-section .btn {
  border-color: var(--basalt);
  color: var(--basalt);
}

.thanks-section .btn:hover {
  background: var(--ember);
  border-color: var(--ember);
  color: #fff;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .two-col,
  .two-col.reverse {
    grid-template-columns: 1fr;
  }

  .two-col.reverse .col-text,
  .two-col.reverse .col-media,
  .two-col .col-text,
  .two-col .col-media {
    order: initial;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--basalt);
    padding: 16px 24px;
  }

  .main-nav.open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 18px;
  }

  .nav-toggle {
    display: block;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    justify-content: center;
  }

  .hero-stats {
    gap: 20px;
  }
}
