/* main.css — Truckee Snowbotics */

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

/* ── Tokens ─────────────────────────────────── */
:root {
  --bg:          #ffffff;
  --bg-alt:      #f4f7fb;
  --bg-card:     #ffffff;

  --text:        #1a2332;
  --text-mid:    #4a5568;
  --text-dim:    #8896a8;

  --blue:        #1d8fd1;
  --blue-dark:   #0d5a8a;
  --blue-light:  #e8f4fc;
  --blue-border: #bde0f5;

  --border:      #e2e8f0;
  --border-h:    #c8d6e8;

  --font:        'Inter', system-ui, sans-serif;
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
  --max:         1100px;
  --max-narrow:  680px;
  --r:           8px;
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
ul { list-style: none; }
::selection { background: var(--blue); color: #fff; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 2px; }

/* ── Buttons ─────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center;
  background: var(--blue); color: #fff;
  font-size: .85rem; font-weight: 600;
  padding: .55rem 1.25rem; border-radius: var(--r);
  transition: background .15s, transform .15s var(--ease), box-shadow .15s;
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(13,90,138,.25);
}
.btn-outline {
  display: inline-flex; align-items: center;
  background: transparent; color: var(--blue);
  font-size: .85rem; font-weight: 600;
  padding: .55rem 1.25rem; border-radius: var(--r);
  border: 1.5px solid var(--blue-border);
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
}
.btn-outline:hover { border-color: var(--blue); background: var(--blue-light); }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 6px;
  color: var(--text-mid); border: 1.5px solid var(--border);
  transition: color .15s, border-color .15s, background .15s;
}
.btn-icon:hover { color: var(--blue); border-color: var(--blue-border); background: var(--blue-light); }

/* ── Header ─────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.header-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex; align-items: center; gap: 1.5rem;
}
.header-brand {
  display: flex; align-items: center; gap: .65rem;
  font-size: .95rem; font-weight: 700; color: var(--text);
  letter-spacing: -.01em; flex-shrink: 0;
  transition: color .15s;
}
.header-brand:hover { color: var(--blue); }
.header-brand img { flex-shrink: 0; }

.nav { display: flex; gap: 1.75rem; margin-right: auto; }
.nav a {
  font-size: .85rem; font-weight: 500; color: var(--text-mid);
  transition: color .15s; white-space: nowrap;
}
.nav a:hover, .nav a.active { color: var(--blue); }

.header-actions { display: flex; align-items: center; gap: .5rem; }

.hamburger {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; width: 34px; height: 34px;
  background: none; border: 1.5px solid var(--border);
  border-radius: 6px; cursor: pointer; padding: 6px;
}
.hamburger span {
  display: block; height: 2px; background: var(--text-mid);
  border-radius: 1px; transition: transform .2s, opacity .2s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Mobile nav ─────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed; top: 60px; left: 0; right: 0; z-index: 190;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  padding: 1.25rem 2rem;
  flex-direction: column; gap: .25rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-size: .95rem; font-weight: 500; color: var(--text-mid);
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
  transition: color .15s;
}
.mobile-nav a:last-of-type { border-bottom: none; }
.mobile-nav a:hover { color: var(--blue); }
.mobile-nav-actions {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding-top: 1rem;
}
.mobile-nav-actions a {
  border: none;
  font-size: .85rem; color: var(--text-dim); padding: 0;
  transition: color .15s;
}
.mobile-nav-actions .btn-primary { color: #fff; border: none; padding: .5rem 1rem; }

@media (max-width: 820px) {
  .nav { display: none; }
  .header-actions .btn-outline { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 500px) {
  .header-actions .btn-primary { display: none; }
  .header-actions { gap: .35rem; }
}

/* ── Hero ────────────────────────────────────── */
.hero {
  border-bottom: 1px solid var(--border);
  padding: 6rem 2rem 5rem;
}
.hero-inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto;
  gap: 5rem; align-items: center;
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 3rem; }
  .hero-visual { display: flex; gap: 2rem; align-items: center; }
  .hero-logo-img { width: 120px; height: 120px; }
}
@media (max-width: 560px) {
  .hero-visual { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .hero { padding: 4rem 1.5rem 3.5rem; }
}

.hero-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--blue-light); color: var(--blue-dark);
  font-size: .75rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; padding: .3rem .7rem;
  border-radius: 100px; border: 1px solid var(--blue-border);
  margin-bottom: 1.5rem;
  opacity: 0; animation: fade-up .5s var(--ease) .05s forwards;
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 2px rgba(29,143,209,.25);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.4} }

.hero-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 700; line-height: 1.0;
  color: var(--text); letter-spacing: -.04em;
  margin-bottom: .85rem;
  opacity: 0; animation: fade-up .6s var(--ease) .15s forwards;
}
.hero-location {
  font-size: .85rem; font-weight: 500; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 1.25rem;
  opacity: 0; animation: fade-up .6s var(--ease) .22s forwards;
}
.hero-body {
  font-size: 1rem; color: var(--text-mid); line-height: 1.8;
  max-width: 48ch; margin-bottom: 2rem;
  opacity: 0; animation: fade-up .6s var(--ease) .3s forwards;
}
.hero-cta {
  display: flex; gap: .75rem; flex-wrap: wrap;
  opacity: 0; animation: fade-up .6s var(--ease) .38s forwards;
}

.hero-visual {
  opacity: 0; animation: fade-up .7s var(--ease) .25s forwards;
}
.hero-logo-img {
  width: 180px; height: 180px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 8px 24px rgba(29,143,209,.2));
}
@media (max-width: 900px) { .hero-logo-img { margin-bottom: 0; } }

.hero-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .5rem; width: 200px;
}
@media (max-width: 900px) { .hero-stats { width: auto; flex: 1; } }

.hstat {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--r); padding: .85rem .9rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.hstat-val {
  font-size: 1.15rem; font-weight: 700; color: var(--blue-dark);
  letter-spacing: -.02em; line-height: 1;
}
.hstat-key {
  font-size: .65rem; font-weight: 500; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .07em;
}

/* ── Sections ────────────────────────────────── */
.section { padding: 5.5rem 2rem; border-bottom: 1px solid var(--border); }
.section--alt { background: var(--bg-alt); }
.section-inner { max-width: var(--max); margin: 0 auto; }
.section-inner--narrow { max-width: var(--max-narrow); }

.section-header { margin-bottom: 2.5rem; }
.section-header h2 {
  font-size: 1.75rem; font-weight: 700;
  color: var(--text); letter-spacing: -.025em;
  margin-bottom: .4rem;
}
.section-header p { font-size: .95rem; color: var(--text-dim); }

@media (max-width: 600px) { .section { padding: 4rem 1.5rem; } }

/* ── Team ────────────────────────────────────── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.4rem;
}

.member-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.75rem;
  display: flex; align-items: center; gap: 1.2rem;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
  min-height: 110px;
}
.member-card:hover {
  border-color: var(--blue-border);
  box-shadow: 0 4px 16px rgba(29,143,209,.1);
  transform: translateY(-2px);
}
.member-card--empty { opacity: .55; }
.member-card--empty:hover { opacity: 1; border-color: var(--blue-border); }

.member-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff; font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.member-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.member-avatar--empty { background: var(--border); color: var(--text-dim); }

.member-info { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.member-name { font-size: 1rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-role { font-size: .85rem; color: var(--text-dim); }

/* ── Gallery ─────────────────────────────────── */
.gallery-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 700px) { .gallery-track { gap: .75rem; } }
@media (max-width: 440px) { .gallery-track { gap: .5rem; } }

.section-header--with-action {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.gallery-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.gallery-track {
  display: flex;
  gap: 1rem;
  scroll-behavior: smooth;
}
.gallery-item {
  width: 320px;
  flex: 0 0 320px;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  transition: border-color .2s;
  scroll-snap-align: start;
}
.gallery-item:hover { border-color: var(--blue-border); }
.gallery-image {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.gallery-item span { font-size: .8rem; color: var(--text-dim); padding: 1rem; text-align: center; }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-wrapper {
  scroll-snap-type: x mandatory;
}

.gallery-wrapper::-webkit-scrollbar {
  height: 10px;
}
.gallery-wrapper::-webkit-scrollbar-thumb {
  background: rgba(128, 138, 150, .35);
  border-radius: 999px;
}
.gallery-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
}
.gallery-modal.hidden { display: none; }
.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.85);
}
.gallery-modal-panel {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  z-index: 1001;
}

.gallery-modal-copy {
  max-width: min(90vw, 640px);
  padding: 0 1rem;
  text-align: center;
}
.gallery-modal-caption {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.5;
}
.gallery-modal-close {
  position: fixed;
  right: 1rem;
  top: 1rem;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1002;
}
.gallery-modal-image {
  max-width: min(90vw, 1200px);
  max-height: calc(100vh - 10rem);
  width: 100%;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,.05);
  border-radius: var(--r);
}
.gallery-modal-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.gallery-modal-title {
  margin: 0 0 .5rem;
  font-size: 1.25rem;
  color: var(--text);
}
.gallery-modal-description {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.75;
}

/* ── Sponsors ────────────────────────────────── */
.sponsor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.sponsor-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r);
  min-height: 150px;
  display: flex; align-items: center; justify-content: flex-start;
  gap: 1.25rem;
  padding: 1.75rem;
  text-decoration: none;
}
.sponsor-item:hover { border-color: var(--blue-border); }
.sponsor-item-logo {
  width: 80px; height: 80px; flex-shrink: 0;
  border-radius: 18px; overflow: hidden;
  background: var(--bg-alt); display: flex;
  align-items: center; justify-content: center;
}
.sponsor-item-logo img { width: 100%; height: 100%; object-fit: cover; }
.sponsor-item-copy { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.sponsor-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.sponsor-description { font-size: .9rem; color: var(--text-dim); line-height: 1.5; }
.sponsor-item--cta {
  flex-direction: column; gap: .75rem; text-align: center;
  border-style: dashed; border-color: var(--blue-border);
  background: var(--blue-light);
  width: 100%;
  margin-top: 1.25rem;
}
.sponsor-item--cta p {
  font-size: 1rem; font-weight: 600; color: var(--blue-dark);
}
.sponsor-item--cta span {
  font-size: .85rem; color: var(--text-mid); line-height: 1.6;
}

/* ── Contact ─────────────────────────────────── */
.contact-placeholder {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--r); padding: 3rem;
  text-align: center;
}
.contact-placeholder p { font-size: .95rem; color: var(--text-dim); }
.contact-form {
  display: grid; gap: 1rem;
  max-width: 520px; margin: 0 auto;
  text-align: left;
}
.contact-form label {
  display: grid; gap: .5rem;
  font-size: .95rem; color: var(--text);
}
.contact-form input,
.contact-form textarea {
  width: 100%; border: 1px solid var(--border);
  border-radius: var(--r); background: var(--bg);
  color: var(--text); padding: .85rem 1rem;
  font: inherit;
}
.contact-form button {
  border: none; outline: none;
}
.contact-form button:focus {
  box-shadow: none;
}
.form-error {
  display: block; margin-top: 1rem;
  color: #bf2912; font-size: .95rem;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--blue); border-color: transparent;
}
.contact-form textarea { min-height: 140px; resize: vertical; }
.contact-form button { align-self: flex-start; }
.contact-actions {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .75rem; margin-top: 1.5rem;
}

/* ── Footer ──────────────────────────────────── */
.site-footer {
  background: var(--text); color: rgba(255,255,255,.6);
}
.footer-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 3rem 2rem 2rem;
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 3rem; align-items: start;
}
@media (max-width: 820px) {
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
}

.footer-brand { display: flex; align-items: center; gap: .75rem; }
.footer-brand img { flex-shrink: 0; }
.footer-name { display: block; font-size: .95rem; font-weight: 700; color: #fff; }
.footer-sub { display: block; font-size: .75rem; margin-top: .1rem; }

.footer-nav {
  display: flex; flex-wrap: wrap; gap: .25rem 1.5rem;
  align-content: flex-start;
}
.footer-nav a {
  font-size: .85rem; color: rgba(255,255,255,.5);
  transition: color .15s;
}
.footer-nav a:hover { color: #fff; }

.footer-actions {
  display: flex; flex-direction: column; gap: .5rem; align-items: flex-end;
}
@media (max-width: 820px) { .footer-actions { align-items: flex-start; } }
.footer-actions a {
  display: flex; align-items: center; gap: .4rem;
  font-size: .85rem; color: rgba(255,255,255,.5);
  transition: color .15s;
}
.footer-actions a:hover { color: #fff; }

.footer-bottom {
  max-width: var(--max); margin: 0 auto;
  padding: 1.25rem 2rem;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between;
  font-size: .75rem; color: rgba(255,255,255,.35);
}
.footer-bottom a { transition: color .15s; }
.footer-bottom a:hover { color: rgba(255,255,255,.7); }

/* ── Scroll reveal ───────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }

/* ── Keyframes ───────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
