/* ============================================================
   TEAM FORMULA STUDENT — motion & polish layer
   (fonts and colors untouched — animation/style only)
   ============================================================ */

/* ---------- selection & focus ---------- */
::selection { background: var(--orange); color: #0A0A0A; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* ---------- scroll progress (telemetry bar) ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  will-change: transform;
  background: linear-gradient(90deg, var(--orange-dim), var(--orange));
  transform: scaleX(0); transform-origin: left center;
  z-index: 300; pointer-events: none;
  box-shadow: 0 0 14px rgba(255, 107, 0, 0.45);
}

/* ---------- auto scroll-reveal ---------- */
.rv {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.75s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--rv-d, 0ms);
}
.rv.rv-in { opacity: 1; transform: translateY(0); }

/* section-title bar draws itself in alongside the reveal */
.sec-title.rv .bar,
.rv .sec-title .bar {
  transform: scaleY(0); transform-origin: top;
  transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: calc(var(--rv-d, 0ms) + 150ms);
}
.sec-title.rv.rv-in .bar,
.rv.rv-in .sec-title .bar { transform: scaleY(1); }

/* ---------- hero entrance ---------- */
.hero-bg { animation: heroSettle 2.6s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@keyframes heroSettle {
  from { transform: scale(1.07); }
  to   { transform: scale(1); }
}

.hero-line { display: block; overflow: hidden; }
.hero-line > span {
  display: block;
  transform: translateY(112%);
  animation: heroLineUp 0.9s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}
.hero-line:nth-child(1) > span { animation-delay: 0.18s; }
.hero-line:nth-child(2) > span { animation-delay: 0.32s; }
@keyframes heroLineUp { to { transform: translateY(0); } }

.hero-el {
  opacity: 0; transform: translateY(24px);
  animation: heroRise 0.85s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  animation-delay: calc(0.45s + var(--hi, 0) * 0.13s);
}
@keyframes heroRise { to { opacity: 1; transform: translateY(0); } }

.hero-ghost { opacity: 0; animation: ghostIn 1.8s ease 0.55s forwards; }
@keyframes ghostIn { to { opacity: 1; } }

.hero-car { animation: carReveal 1.05s cubic-bezier(0.22, 0.61, 0.36, 1) 0.5s both; }
@keyframes carReveal {
  from { clip-path: inset(0 100% 0 0); opacity: 0.4; }
  to   { clip-path: inset(0 0 0 0);   opacity: 1; }
}
.hero-caption {
  opacity: 0; transform: translateY(10px);
  animation: heroRise 0.7s ease 1.25s forwards;
}

/* one-shot speed streaks across the hero */
.hero-streak {
  position: absolute; left: -30%; width: 26%; height: 2px; top: 58%;
  z-index: 2; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  filter: drop-shadow(0 0 6px var(--orange));
  animation: streak 1.1s cubic-bezier(0.5, 0, 0.2, 1) 0.3s 1;
}
@keyframes streak {
  0%   { left: -30%; opacity: 0; }
  12%  { opacity: 0.85; }
  100% { left: 112%; opacity: 0; }
}

/* ---------- navbar ---------- */
.nav-link { transition: color 0.2s ease; }
.nav-link:hover { color: var(--orange) !important; }
.nav-link .nav-underline {
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.nav-link:hover .nav-underline,
.nav-link.active .nav-underline { transform: scaleX(1); }

/* mobile menu */
.mobile-menu { animation: mmDown 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@keyframes mmDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mm-item {
  opacity: 0;
  animation: mmItem 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  animation-delay: calc(60ms + var(--i, 0) * 50ms);
}
@keyframes mmItem {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------- buttons: sheen sweep ---------- */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-22deg); pointer-events: none;
}
.btn-primary:hover::before { animation: sheen 0.65s ease; }
@keyframes sheen { from { left: -70%; } to { left: 130%; } }

/* ---------- cards: corner notch + image zoom ---------- */
.card { position: relative; }
.card::before {
  content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0;
  border-top: 0 solid var(--orange); border-left: 0 solid transparent;
  transition: border-width 0.22s ease; pointer-events: none; z-index: 2;
}
.card:hover::before { border-top-width: 14px; border-left-width: 14px; }

.car-card { overflow: hidden; }
.car-card img { transition: transform 1.4s cubic-bezier(0.19, 1, 0.22, 1); }
.car-card:hover img { transform: scale(1.045); }

/* ---------- sponsor marquee: edge fade + perf ---------- */
.marquee-track { will-change: transform; }
.marquee.offscreen .marquee-track { animation-play-state: paused; }
.marquee {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

/* ---------- footer links ---------- */
.foot-link {
  display: inline-block;
  transition: color 0.18s ease, transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.foot-link:hover { color: var(--orange) !important; transform: translateX(6px); }

/* ---------- back to top ---------- */
.back-top {
  position: fixed; right: 22px; bottom: 22px; width: 48px; height: 48px;
  display: grid; place-items: center; z-index: 250;
  background: rgba(10, 10, 10, 0.85); color: var(--text);
  border: 1px solid var(--border-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 10px 100%);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.2s ease, color 0.2s ease;
}
.back-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-top:hover { border-color: var(--orange); color: var(--orange); }

/* ---------- achievements accordion ---------- */
.acc-wrap {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.acc-wrap.open { grid-template-rows: 1fr; }
.acc-body { overflow: hidden; min-height: 0; }
.acc-inner {
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.45s ease 0.08s, transform 0.45s ease 0.08s;
}
.acc-wrap.open .acc-inner { opacity: 1; transform: translateY(0); }
.season-trigger:hover .season-year { color: var(--orange) !important; }

/* ---------- discipline rows (About > What We Build) ---------- */
.discipline-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent, var(--orange));
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
}
.discipline-row:hover {
  transform: translateX(6px);
  box-shadow: -6px 0 24px -12px rgba(0, 0, 0, 0.6);
}
.discipline-photo {
  min-height: 320px;
  align-self: stretch;
  position: relative;
}
.discipline-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 55%, var(--surface) 100%);
  pointer-events: none;
}
.discipline-photo img { filter: saturate(0.92); }
.discipline-body {
  display: flex;
  flex-direction: column;
  padding: 36px 40px;
  min-width: 0;
}
.discipline-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.discipline-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid;
  border-radius: 50%;
  transition: background 0.25s ease, transform 0.25s ease;
}
.discipline-row:hover .discipline-icon {
  transform: scale(1.08);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

@media (max-width: 860px) {
  .discipline-row {
    grid-template-columns: 1fr;
  }
  .discipline-photo { min-height: 180px; }
  .discipline-body { padding: 26px 24px; }
  .discipline-row:hover { transform: none; }
}

/* ---------- org feature cards (INNOVATE / COLLABORATE / COMPETE) ---------- */
.feature-card {
  transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1),
              border-color 0.2s ease, box-shadow 0.22s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 16px 38px -20px rgba(0, 0, 0, 0.7); }
.feature-ico { transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1); }
.feature-card:hover .feature-ico { transform: scale(1.08) rotate(-7deg); }

/* ---------- crew / team member cards: slow image push-in ---------- */
.member-card img { transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1); }
.member-card:hover img { transform: scale(1.05); }

/* ---------- stat count-up: icon settles in with the number ---------- */
.stat-ico { animation: statIco 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@keyframes statIco {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------- reduced motion: show everything, skip theatrics ---------- */
@media (prefers-reduced-motion: reduce) {
  .rv, .hero-el, .hero-line > span, .hero-ghost, .hero-caption, .mm-item {
    opacity: 1 !important; transform: none !important;
    animation: none !important; transition: none !important;
  }
  .hero-bg, .hero-car, .mobile-menu { animation: none !important; clip-path: none !important; }
  .hero-streak, .scroll-progress { display: none !important; }
  .marquee-track { animation: none !important; }
  .sec-title .bar { transform: none !important; }
  .acc-wrap, .acc-inner { transition: none !important; }
  .feature-card, .feature-ico, .member-card img { transition: none !important; }
  .stat-ico { animation: none !important; }
}
