/* HapLink v2 — Human-Centered Design System */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Backgrounds — slightly warm dark, not cold black */
  --bg:     #06060c;
  --bg2:    #0c0c16;
  --bg3:    #12121f;
  --bg4:    #1a1a2e;

  /* Primary palette */
  --blue:   #38bdf8;
  --purple: #a78bfa;
  --cyan:   #22d3ee;
  --amber:  #fbbf24;   /* warmth */
  --green:  #34d399;

  /* Text */
  --white:  #f1f5f9;
  --g1:     #e2e8f0;
  --g2:     #94a3b8;
  --g3:     #64748b;
  --g4:     #334155;

  /* Surfaces */
  --card:   rgba(255,255,255,0.04);
  --card-h: rgba(255,255,255,0.07);
  --bdr:    rgba(255,255,255,0.09);
  --bdr-h:  rgba(255,255,255,0.2);

  /* Glows */
  --glow-b: rgba(56,189,248,0.2);
  --glow-p: rgba(167,139,250,0.2);
  --glow-a: rgba(251,191,36,0.15);

  /* Radii */
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 22px; --r-xl: 30px;

  /* Motion */
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --t:    all 0.28s var(--ease);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── PROGRESSIVE ENHANCEMENT: content always visible by default.
   Only hide/animate when JS confirms it loaded. ── */
.reveal, .reveal-child { /* visible by default — no opacity:0 here */ }

.js-ready .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.js-ready .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.js-ready .reveal-child {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.js-ready .reveal-child.in-view { opacity: 1; transform: translateY(0); }

/* Stagger delays for sibling children */
.js-ready .stagger > *:nth-child(1) { transition-delay: 0s; }
.js-ready .stagger > *:nth-child(2) { transition-delay: 0.07s; }
.js-ready .stagger > *:nth-child(3) { transition-delay: 0.14s; }
.js-ready .stagger > *:nth-child(4) { transition-delay: 0.21s; }
.js-ready .stagger > *:nth-child(5) { transition-delay: 0.28s; }
.js-ready .stagger > *:nth-child(6) { transition-delay: 0.35s; }
.js-ready .stagger > *:nth-child(n+7) { transition-delay: 0.42s; }

/* ── NAV ── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 0 2.5rem; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  transition: var(--t);
}
#nav.scrolled {
  background: rgba(6,6,12,0.9);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--bdr);
}
.nav-logo {
  font-size: 1.3rem; font-weight: 800; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  text-decoration: none; flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-links a {
  color: var(--g2); text-decoration: none; font-size: 0.875rem; font-weight: 500;
  padding: 0.45rem 0.85rem; border-radius: var(--r-sm); transition: var(--t); white-space: nowrap;
}
.nav-links a:hover { color: var(--white); background: rgba(255,255,255,0.07); }
.nav-links .cta {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: var(--white) !important; padding: 0.45rem 1.15rem !important;
  border-radius: 100px !important; font-weight: 600 !important;
}
.nav-links .cta:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: 0 4px 20px var(--glow-b); }

.nav-ham {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 8px; background: none; border: none;
}
.nav-ham span { display: block; width: 22px; height: 2px; background: var(--g2); border-radius: 2px; transition: var(--t); }

#nav-mobile {
  display: none; position: fixed; top: 64px; left: 0; right: 0;
  background: rgba(6,6,12,0.97); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bdr); padding: 0.75rem 1.25rem;
  z-index: 999; flex-direction: column; gap: 2px;
}
#nav-mobile.open { display: flex; }
#nav-mobile a {
  color: var(--g2); text-decoration: none; font-size: 0.95rem;
  padding: 0.7rem 0.875rem; border-radius: var(--r-sm); transition: var(--t);
}
#nav-mobile a:hover { color: var(--white); background: rgba(255,255,255,0.06); }

/* ── GRADIENT TEXT ── */
.g  { background: linear-gradient(135deg, var(--blue), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.ga { background: linear-gradient(135deg, var(--amber), #f97316); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.gc { background: linear-gradient(135deg, var(--cyan), var(--blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 7rem 2rem 5rem;
  position: relative; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }

/* Soft ambient orbs — gentle, not glitchy */
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0;  /* start invisible, JS fades them in */
  transition: opacity 1.5s ease;
}
.orb.loaded { opacity: 0.3; }
.orb-1 { width: 700px; height: 700px; background: radial-gradient(circle, #1e40af 0%, transparent 70%); top: -200px; left: -200px; animation: drift1 16s ease-in-out infinite; }
.orb-2 { width: 600px; height: 600px; background: radial-gradient(circle, #5b21b6 0%, transparent 70%); bottom: -150px; right: -150px; animation: drift2 18s ease-in-out infinite; }
.orb-3 { width: 350px; height: 350px; background: radial-gradient(circle, #92400e 0%, transparent 70%); top: 45%; left: 55%; opacity: 0; }
.orb-3.loaded { opacity: 0.12; }

@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,-25px); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-25px,20px); } }

.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(56,189,248,0.1); border: 1px solid rgba(56,189,248,0.25);
  color: var(--blue); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 0.35rem 1rem; border-radius: 100px; margin-bottom: 2rem;
  position: relative; z-index: 1;
}
.hero-badge::before {
  content: ''; width: 6px; height: 6px; background: var(--blue);
  border-radius: 50%; animation: blink 2.5s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.35; transform:scale(0.7); } }

.hero-title {
  font-size: clamp(2.8rem, 8vw, 5.5rem); font-weight: 900;
  line-height: 1.05; letter-spacing: -0.045em;
  margin-bottom: 1.5rem; position: relative; z-index: 1;
}
.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.15rem); color: var(--g2);
  max-width: 560px; margin: 0 auto 2.5rem;
  position: relative; z-index: 1; line-height: 1.8;
}
.hero-btns {
  display: flex; gap: 0.875rem; justify-content: center;
  flex-wrap: wrap; position: relative; z-index: 1;
}
.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  color: var(--g3); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  z-index: 1; animation: bob 2.5s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.75rem; border-radius: 100px;
  font-size: 0.9rem; font-weight: 600;
  text-decoration: none; transition: var(--t);
  border: none; cursor: pointer; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; box-shadow: 0 0 24px rgba(56,189,248,0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(56,189,248,0.4); }
.btn-secondary {
  background: var(--card); color: var(--g1);
  border: 1px solid var(--bdr); backdrop-filter: blur(8px);
}
.btn-secondary:hover { background: var(--card-h); border-color: var(--bdr-h); transform: translateY(-2px); }
.btn-amber {
  background: linear-gradient(135deg, var(--amber), #f97316);
  color: #000; font-weight: 700;
}
.btn-amber:hover { transform: translateY(-2px); box-shadow: 0 0 36px var(--glow-a); }

/* ── LAYOUT ── */
.inner { max-width: 1200px; margin: 0 auto; }
.sec { padding: 6rem 2rem; }
.sec-sm { padding: 3.5rem 2rem; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--bdr), transparent); }

/* ── SECTION HEADERS ── */
.sec-hd { text-align: center; margin-bottom: 3.5rem; }
.sec-label {
  display: inline-block; color: var(--blue); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.875rem;
}
.sec-label.amber { color: var(--amber); }
.sec-title { font-size: clamp(1.8rem, 4vw, 2.75rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; margin-bottom: 1rem; }
.sec-desc { font-size: 1.05rem; color: var(--g2); max-width: 560px; margin: 0 auto; line-height: 1.8; }

/* ── GRIDS ── */
.g2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.5rem; }
.g3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.g4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; }

/* ── CARDS ── */
.card {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r-lg); padding: 1.75rem; transition: var(--t);
}
.card:hover { background: var(--card-h); border-color: var(--bdr-h); transform: translateY(-3px); }

/* ── PHOTO CARD (image + text overlay) ── */
.photo-card {
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--bdr); position: relative;
  transition: var(--t);
}
.photo-card:hover { transform: translateY(-5px); box-shadow: 0 30px 70px rgba(0,0,0,0.5); border-color: var(--bdr-h); }
.photo-card img { width: 100%; height: 320px; object-fit: cover; display: block; transition: transform 0.6s var(--ease); }
.photo-card:hover img { transform: scale(1.04); }
.photo-card-body { padding: 1.5rem; background: linear-gradient(to bottom, var(--bg3), var(--bg2)); }
.photo-card .tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.25rem 0.7rem; border-radius: 100px; margin-bottom: 0.6rem;
}
.tag-blue { background: rgba(56,189,248,0.15); color: var(--blue); }
.tag-amber { background: rgba(251,191,36,0.15); color: var(--amber); }
.tag-purple { background: rgba(167,139,250,0.15); color: var(--purple); }
.photo-card h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.photo-card p { font-size: 0.9rem; color: var(--g2); line-height: 1.65; }

/* ── TEAM CARDS ── */
.team-card {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r-lg); padding: 1.5rem; text-align: center; transition: var(--t);
}
.team-card:hover { background: var(--card-h); border-color: var(--bdr-h); transform: translateY(-4px); }
.team-avatar {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 1rem; display: block;
  border: 2px solid var(--bdr); transition: var(--t);
}
.team-card:hover .team-avatar { border-color: rgba(56,189,248,0.5); }
.team-name { font-size: 1rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 0.2rem; }
.team-seasons { font-size: 0.7rem; color: var(--blue); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.65rem; }
.team-bio { font-size: 0.83rem; color: var(--g2); line-height: 1.55; }
.coach-card { background: linear-gradient(135deg, rgba(56,189,248,0.05), rgba(167,139,250,0.05)); }

/* ── STATS STRIP ── */
.stats-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--bdr); border-radius: var(--r-lg);
  overflow: hidden;
}
.stat-item {
  padding: 2rem 1.5rem; text-align: center;
  border-right: 1px solid var(--bdr);
}
.stat-item:last-child { border-right: none; }
.stat-val {
  font-size: 2.25rem; font-weight: 900; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1; margin-bottom: 0.3rem;
}
.stat-lbl { font-size: 0.78rem; color: var(--g3); }

/* ── CALLOUT / HIGHLIGHT BOX ── */
.callout {
  background: var(--bg3); border: 1px solid var(--bdr);
  border-radius: var(--r-xl); padding: 2.5rem; position: relative; overflow: hidden;
}
.callout::after {
  content: ''; position: absolute;
  top: -80px; right: -80px; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(167,139,250,0.1), transparent 70%);
  pointer-events: none;
}
.price-tag {
  display: inline-block;
  background: rgba(251,191,36,0.15); border: 1px solid rgba(251,191,36,0.3);
  color: var(--amber); font-size: 2.25rem; font-weight: 900;
  padding: 0.4rem 1.25rem; border-radius: var(--r-md);
  letter-spacing: -0.03em; margin: 0.75rem 0;
}

/* ── TIMELINE ── */
.timeline { position: relative; max-width: 680px; margin: 0 auto; }
.timeline::before {
  content: ''; position: absolute; left: 23px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--blue), var(--purple), transparent);
  opacity: 0.35;
}
.tl-item { display: flex; gap: 1.5rem; margin-bottom: 2.25rem; align-items: flex-start; }
.tl-dot {
  width: 48px; height: 48px; border-radius: 50%; background: var(--bg2);
  border: 2px solid var(--blue); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; z-index: 1; font-size: 0.62rem; font-weight: 800;
  color: var(--blue); text-align: center; line-height: 1.15;
}
.tl-body { flex: 1; padding-top: 0.5rem; }
.tl-date { font-size: 0.75rem; color: var(--blue); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.35rem; }
.tl-text { font-size: 0.95rem; color: var(--g2); line-height: 1.65; }
.tl-text strong { color: var(--white); }
.tl-img { width: 100%; border-radius: var(--r-md); object-fit: cover; height: 175px; display: block; border: 1px solid var(--bdr); margin-bottom: 0.65rem; }

/* ── QUOTE ── */
.blockquote {
  border-left: 3px solid var(--amber); padding: 1.1rem 1.5rem;
  color: var(--g1); font-size: 1.05rem; font-style: italic;
  line-height: 1.75; background: rgba(251,191,36,0.05);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

/* ── GALLERY ── */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 1rem; }
.gallery-item { border-radius: var(--r-md); overflow: hidden; aspect-ratio: 4/3; background: var(--bg3); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); }
.gallery-item:hover img { transform: scale(1.06); }

/* ── SPONSOR LOGOS ── */
.sponsors { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; align-items: center; }
.spon {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r-md); padding: 1rem 1.75rem; transition: var(--t);
  display: flex; align-items: center; justify-content: center;
}
.spon:hover { background: var(--card-h); border-color: var(--bdr-h); transform: translateY(-2px); }
.spon img { height: 34px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.55; transition: var(--t); }
.spon:hover img { opacity: 1; }
.spon-name { color: var(--g2); font-size: 0.875rem; font-weight: 600; transition: var(--t); }
.spon:hover .spon-name { color: var(--white); }

/* ── PAGE HERO (inner pages) ── */
.page-hero {
  padding: 9rem 2rem 4.5rem; text-align: center;
  position: relative; overflow: hidden;
}
.page-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900;
  letter-spacing: -0.04em; line-height: 1.08;
  margin-bottom: 1rem; position: relative; z-index: 1;
}
.page-hero-desc {
  font-size: 1.05rem; color: var(--g2); max-width: 560px;
  margin: 0 auto 2rem; position: relative; z-index: 1; line-height: 1.8;
}

/* ── DONATE ── */
.donate-hero {
  background: linear-gradient(135deg, rgba(56,189,248,0.08), rgba(167,139,250,0.08));
  border: 1px solid rgba(56,189,248,0.2); border-radius: var(--r-xl); padding: 3rem; text-align: center;
}
.qr-img {
  width: 170px; height: 170px; object-fit: contain;
  border-radius: var(--r-md); border: 1px solid var(--bdr);
  background: #fff; padding: 0.5rem; margin: 1.5rem auto; display: block;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--bdr); padding: 3rem 2rem;
  background: var(--bg2); text-align: center;
}
.footer-logo {
  font-size: 1.6rem; font-weight: 900; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  display: inline-block; margin-bottom: 1.25rem;
}
.footer-links { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.25rem; }
.footer-links a { color: var(--g2); text-decoration: none; font-size: 0.875rem; transition: var(--t); }
.footer-links a:hover { color: var(--white); }
.footer-copy { color: var(--g3); font-size: 0.8rem; }

/* ── FEAT ROW (image left/right alternating) ── */
.feat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.feat-row.flip { }
.feat-row img { width: 100%; border-radius: var(--r-lg); object-fit: cover; height: 360px; display: block; border: 1px solid var(--bdr); }
.feat-row-text h3 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1rem; line-height: 1.2; }
.feat-row-text p { color: var(--g2); line-height: 1.8; font-size: 1rem; }

/* ── NOISE (subtle texture) ── */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9000;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .g3 { grid-template-columns: repeat(2,1fr); }
  .feat-row { grid-template-columns: 1fr; gap: 2rem; }
  .feat-row.flip .feat-row-text { order: -1; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-ham { display: flex; }
  #nav { padding: 0 1.25rem; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: repeat(2,1fr); }
  .stats-strip .stat-item:nth-child(2) { border-right: none; }
  .stats-strip .stat-item:nth-child(1),
  .stats-strip .stat-item:nth-child(2) { border-bottom: 1px solid var(--bdr); }
  .sec { padding: 4rem 1.25rem; }
  .page-hero { padding: 7rem 1.25rem 3.5rem; }
  .hero { padding: 6rem 1.25rem 4rem; }
  .hero-btns { flex-direction: column; align-items: center; }
  .callout { padding: 2rem; }
}
@media (max-width: 480px) {
  .stats-strip { grid-template-columns: 1fr; }
  .stats-strip .stat-item { border-right: none; border-bottom: 1px solid var(--bdr); }
  .stats-strip .stat-item:last-child { border-bottom: none; }
}
