/* ==========================================================================
   TONKATA — MTB Downhill site
   Dark, sporty, dynamic theme
   ========================================================================== */

:root {
  --bg: #0a0b0d;
  --bg-alt: #101216;
  --surface: #16181d;
  --surface-2: #1c1f26;
  --text: #f3f2ee;
  --text-dim: #a7abb4;
  --gold: #f2b705;
  --gold-soft: #f7cf4d;
  --red: #e8433a;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 20px 60px rgba(0,0,0,0.45);
  --radius: 18px;
  --font-display: 'Anton', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 5vw;
  display: flex;
  transition: background .35s ease, padding .35s ease, box-shadow .35s ease;
  background: transparent;
}
.site-header.scrolled {
  background: rgba(10,11,13,0.85);
  backdrop-filter: blur(14px) saturate(140%);
  padding: 12px 5vw;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  border-bottom: 1px solid var(--border);
}
.nav-wrap {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
}
.brand-logo {
  height: 72px;
  width: auto;
  display: block;
  transition: height .35s ease;
}
.site-header.scrolled .brand-logo { height: 56px; }

.nav-links {
  display: flex;
  gap: 2.2rem;
}
.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  position: relative;
  padding: 6px 0;
  transition: color .25s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--gold);
  transition: width .25s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active::after, .nav-link:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 110;
}
.nav-toggle span {
  width: 26px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.34) translateX(16%);
  animation: heroZoom 18s ease-in-out infinite alternate;
}
@keyframes heroZoom {
  from { transform: scale(1.34) translateX(16%); }
  to { transform: scale(1.42) translateX(16%); }
}
.hero-gradient {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,11,13,0.55) 0%, rgba(10,11,13,0.35) 35%, rgba(10,11,13,0.92) 100%),
    linear-gradient(90deg, rgba(10,11,13,0.75) 0%, rgba(10,11,13,0.15) 55%);
}
.hero-content {
  position: relative;
  z-index: 3;
  max-width: 900px;
  padding: 0 6vw;
  text-align: left;
  width: 100%;
}
.eyebrow {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 12vw, 7.5rem);
  line-height: 0.95;
  margin: 0 0 18px;
  letter-spacing: 0.01em;
}
.hero-title .accent { color: var(--gold); }
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 0 34px;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
}
.btn-primary {
  background: var(--gold);
  color: #14120a;
  box-shadow: 0 10px 30px rgba(242,183,5,0.28);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(242,183,5,0.4); }
.btn-ghost {
  border: 1.5px solid rgba(255,255,255,0.35);
  color: var(--text);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-3px); }

.scroll-hint {
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}
.scroll-hint span {
  display: block;
  width: 22px; height: 36px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 20px;
  position: relative;
}
.scroll-hint span::before {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  width: 4px; height: 8px;
  background: var(--gold);
  border-radius: 3px;
  transform: translateX(-50%);
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot {
  0% { top: 6px; opacity: 1; }
  70% { top: 18px; opacity: 0; }
  100% { top: 18px; opacity: 0; }
}

/* ---------- Sections generic ---------- */
.section { padding: 7rem 0; position: relative; }
.section-inner { max-width: 1200px; margin: 0 auto; padding: 0 6vw; }
.section-eyebrow {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  margin: 0 0 16px;
  letter-spacing: 0.01em;
}
.section-sub { color: var(--text-dim); max-width: 620px; margin: 0 0 3rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-sub.center { margin-left: auto; margin-right: auto; }

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- About ---------- */
.about { background: var(--bg-alt); }
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 4rem;
  align-items: center;
}
.about-photo-frame {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  aspect-ratio: 4/5;
}
.about-photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 1.4rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
}
.stat-num { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--gold); }
.stat-label { display: block; font-size: 0.72rem; color: var(--text-dim); margin-top: 4px; letter-spacing: .02em; }

.about-lead { font-size: 1.08rem; color: var(--text); margin-bottom: 1.6rem; }
.about-quote {
  margin: 0 0 1.8rem;
  padding: 1.4rem 1.6rem;
  border-left: 3px solid var(--gold);
  background: var(--surface);
  border-radius: 0 14px 14px 0;
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.98rem;
}
.about-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}

/* ---------- Gallery ---------- */
.gallery-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 2.5rem;
}
.tab-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 10px 26px;
  border-radius: 100px;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s ease;
}
.tab-btn.active, .tab-btn:hover { background: var(--gold); color: #14120a; border-color: var(--gold); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 14px;
}
.gallery-grid .g-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
}
.gallery-grid .g-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.gallery-grid .g-item:hover img { transform: scale(1.08); }
.gallery-grid .g-item::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.55) 100%);
  opacity: 0;
  transition: opacity .3s ease;
}
.gallery-grid .g-item:hover::after { opacity: 1; }
.gallery-grid .g-item:nth-child(6n+1) { grid-column: span 2; grid-row: span 2; }
.gallery-grid .g-item:nth-child(6n+4) { grid-column: span 2; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.video-grid .v-item {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.video-grid video { width: 100%; display: block; aspect-ratio: 9/16; object-fit: cover; background: #000; }

.loading-msg, .empty-msg, .error-msg {
  color: var(--text-dim);
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 0;
}
.error-msg { color: var(--red); }

/* ---------- Results / Timeline ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 820px;
  margin: 0 auto 3.5rem;
}
.t-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  align-items: center;
}
.t-place {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--gold);
  text-align: center;
  line-height: 1;
}
.t-place small { display: block; font-family: var(--font-body); font-size: 0.6rem; color: var(--text-dim); font-weight: 700; margin-top: 4px; letter-spacing: .05em;}
.t-event { font-weight: 800; font-size: 1.05rem; margin: 0 0 4px; }
.t-meta { color: var(--text-dim); font-size: 0.88rem; margin: 0; }
.t-photo {
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  max-width: 260px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.documents-block { max-width: 820px; margin: 0 auto; }
.documents-title { font-size: 1.1rem; margin-bottom: 1rem; }
.documents-list { display: flex; flex-direction: column; gap: 10px; }
.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  transition: border-color .25s ease, transform .25s ease;
}
.doc-item:hover { border-color: var(--gold); transform: translateX(4px); }
.doc-icon { font-size: 1.3rem; }
.doc-name { font-weight: 600; flex: 1; }
.doc-arrow { color: var(--gold); font-weight: 700; }

/* ---------- Contact ---------- */
.contact { background: var(--bg-alt); }
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.contact-list { display: flex; flex-direction: column; gap: 14px; margin-top: 1.6rem; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 22px;
  transition: border-color .25s ease, transform .25s ease;
}
.contact-item:hover { border-color: var(--gold); transform: translateY(-3px); }
.contact-icon { font-size: 1.5rem; }
.contact-label { display: block; font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.contact-value { display: block; font-weight: 700; font-size: 1.02rem; }
.contact-visual img { border-radius: var(--radius); border: 1px solid var(--border); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 2rem 6vw;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(6,6,8,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 4vw;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.lightbox-close {
  position: absolute;
  top: 24px; right: 34px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2.4rem;
  cursor: pointer;
  line-height: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-visual { order: -1; max-width: 260px; margin: 0 auto; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: rgba(10,11,13,0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    padding: 0 3rem;
    transform: translateX(100%);
    transition: transform .35s ease;
    border-left: 1px solid var(--border);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-link { font-size: 1.2rem; }

  .video-grid { grid-template-columns: 1fr; }
  .t-item { grid-template-columns: 1fr; text-align: left; }
  .t-place { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-bg { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
