/* ==========================================================================
   Silicon Badgers — UW-Madison Chip Design Club
   ==========================================================================
   1.  Design tokens
   2.  Reset & base
   3.  Background layers
   4.  Header / nav
   5.  Hero
   6.  Shared section rules
   7.  Components (about, why-join, leadership, FAQ, signup, footer)
   8.  Scroll reveal & animations
   9.  Cursor-reactive glow system
   10. Media queries
   ========================================================================== */


/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root{
  --uw-red:#c5050c;
  --uw-red-bright:#ff2a2a;
  --uw-red-dark:#9b0000;
  --red-950:#1a0202;
  --red-900:#2b0505;
  --red-850:#3a0707;
  --white:#ffffff;
  --bg:#050303;
  --surface:#0d0808;
  --surface-2:#140a0a;
  --ink:#f2e6e6;
  --muted:#b89a9a;
  --line:rgba(197,5,12,0.35);
  --border:rgba(197,5,12,0.28);
  --mono: 'JetBrains Mono','Consolas','SFMono-Regular',Menlo,monospace;
  --sans: 'Inter','Segoe UI',system-ui,-apple-system,sans-serif;
}


/* ==========================================================================
   2. Reset & base
   ========================================================================== */
*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  font-family:var(--sans);
  background:var(--bg);
  color:var(--ink);
  line-height:1.6;
  overflow-x:hidden;
}
a{color:inherit;}


/* ==========================================================================
   3. Background layers
   ========================================================================== */

/* Tiled circuit traces sitting behind everything. */
.circuit-bg{
  position:fixed; inset:0; z-index:-2;
  background-color:var(--bg);
  background-image:url("../img/circuit.png");
  background-repeat:repeat;
  background-size:420px 420px;
  opacity:0.55;
  animation:circuitPulse 6s ease-in-out infinite;
}
.circuit-bg::after{
  content:"";
  position:absolute; inset:0;
  background:radial-gradient(ellipse at 50% 0%, transparent 0%, rgba(5,3,3,0.3) 65%, rgba(5,3,3,0.6) 100%);
}
@keyframes circuitPulse{
  0%,100%{opacity:0.5;}
  50%{opacity:0.7;}
}

/* Same tile again, brightened and masked to a circle that follows the
   cursor (--mx / --my are written by main.js). */
.circuit-glow{
  position:fixed; inset:0; z-index:-1; pointer-events:none;
  background-image:url("../img/circuit.png");
  background-repeat:repeat;
  background-size:420px 420px;
  filter:brightness(3) saturate(1.7) drop-shadow(0 0 10px rgba(255,60,60,0.85));
  -webkit-mask-image: radial-gradient(circle 130px at var(--mx,50%) var(--my,30%), black 0%, black 30%, transparent 72%);
  mask-image: radial-gradient(circle 130px at var(--mx,50%) var(--my,30%), black 0%, black 30%, transparent 72%);
  opacity:0.95;
  transition:opacity 0.4s ease;
}


/* ==========================================================================
   4. Header / nav
   ========================================================================== */
header{
  position:sticky; top:0; z-index:100;
  background:rgba(5,3,3,0.25);
  border-bottom:1px solid var(--border);
}
header::before{
  content:""; position:absolute; inset:0; z-index:-1;
  background:#000;
  opacity:var(--header-fade, 0.92);
  transition:opacity 0.15s linear;
  pointer-events:none;
}
nav{
  max-width:1200px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 24px; position:relative;
}
.brand{
  display:flex; align-items:center; gap:12px;
  color:var(--white); font-family:var(--mono); font-weight:700;
  letter-spacing:0.5px; font-size:1.05rem;
  text-decoration:none;
}
.brand img{height:50px; width:50px; border-radius:6px;}

.navlinks{display:flex; gap:26px; list-style:none;}
.navlinks a{
  position:relative;
  color:#e8c9c9; text-decoration:none; font-size:0.9rem;
  font-family:var(--mono); letter-spacing:0.3px;
  padding:6px 2px; border-bottom:2px solid transparent;
  transition:all .15s ease;
}
.navlinks a:hover{color:var(--white); border-bottom-color:var(--uw-red);}

/* Underline sweep on hover. */
.navlinks a::after{
  content:""; position:absolute; left:0; bottom:-2px; width:0; height:2px;
  background:var(--uw-red-bright); transition:width 0.25s ease;
}
.navlinks a:hover::after{width:100%;}

.nav-cta{
  background:var(--uw-red); color:var(--white)!important;
  padding:8px 16px; border-radius:4px; font-weight:600;
  border-bottom:none!important;
}
.nav-cta:hover{background:#e0060e!important;}

/* Mobile menu is driven by this visually-hidden checkbox, so it opens and
   closes with pure CSS even when JavaScript is unavailable. */
.nav-check{
  position:absolute; left:-9999px; width:1px; height:1px; opacity:0;
}
.navtoggle{
  display:none; flex-direction:column; justify-content:center; gap:5px;
  width:36px; height:32px; background:transparent; border:none; cursor:pointer;
  padding:0;
}
.navtoggle span{
  display:block; width:100%; height:2px; background:var(--white);
  border-radius:2px; transition:transform .25s ease, opacity .25s ease;
  pointer-events:none;
}
.nav-check:checked ~ .navtoggle span:nth-child(1){transform:translateY(7px) rotate(45deg);}
.nav-check:checked ~ .navtoggle span:nth-child(2){opacity:0;}
.nav-check:checked ~ .navtoggle span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}


/* ==========================================================================
   5. Hero
   ========================================================================== */
.hero{
  position:relative;
  background:radial-gradient(circle at 30% 20%, rgba(43,5,5,0.4), transparent 60%);
  color:var(--white);
  padding:90px 24px 100px;
  text-align:center;
  overflow:hidden;
  border-bottom:1px solid var(--border);
}
.hero::before{
  content:""; position:absolute; inset:-20%; z-index:0;
  background:radial-gradient(circle at 35% 30%, rgba(197,5,12,0.16), transparent 55%);
  animation:heroGlowMove 8s ease-in-out infinite;
  pointer-events:none;
}
@keyframes heroGlowMove{
  0%,100%{transform:translate(-4%,-2%) scale(1);}
  50%{transform:translate(4%,2%) scale(1.08);}
}
.hero-inner{position:relative; z-index:1; max-width:820px; margin:0 auto;}

.logo-wrap{
  position:relative; display:inline-block; margin-bottom:26px;
}
/* Soft red bloom behind the logo. */
.logo-wrap::after{
  content:""; position:absolute; z-index:-2;
  inset:6%;
  background:rgba(197,5,12,0.55);
  filter:blur(34px);
  border-radius:50%;
  pointer-events:none;
}
/* Denser circuit tile behind the logo, revealed by the cursor via
   --logo-fade on the black cover below. */
.logo-circuit-dense{
  position:absolute; z-index:-1;
  inset:17%;
  background-image:url("../img/circuit.png");
  background-repeat:repeat;
  background-size:180px 180px;
  filter:brightness(1.6) saturate(1.5);
  border-radius:6%;
  pointer-events:none;
}
.logo-wrap::before{
  content:""; position:absolute; z-index:0;
  inset:17%;
  background:#000;
  border-radius:6%;
  opacity:var(--logo-fade, 0.97);
  transition:opacity 0.15s linear;
  pointer-events:none;
}
.hero img.logo{
  position:relative; z-index:1;
  width:320px; height:320px;
  border-radius:22px;
}
.hero h1{
  font-size:clamp(2.2rem, 5vw, 3.6rem); font-weight:800;
  letter-spacing:-0.5px; margin-bottom:18px;
  color:var(--white);
}
.hero-btns{display:flex; gap:16px; justify-content:center; flex-wrap:wrap;}


/* ==========================================================================
   6. Shared section rules
   ========================================================================== */
section{padding:90px 24px; max-width:1100px; margin:0 auto;}

/* Opt out of the centred column for full-bleed sections (hero, signup). */
.section-full{max-width:none;}

h2{font-size:clamp(1.8rem,3.5vw,2.6rem); font-weight:800; margin-bottom:16px; letter-spacing:-0.5px; color:var(--white);}
.section-intro{color:var(--muted); max-width:680px; margin-bottom:48px; font-size:1.05rem;}

/* Buttons */
.btn{
  position:relative; overflow:hidden;
  display:inline-block; padding:14px 28px; border-radius:6px;
  font-weight:700; text-decoration:none; font-size:0.95rem;
  transition:transform .15s ease, box-shadow .15s ease;
  font-family:var(--sans);
}
.btn:hover{transform:translateY(-2px);}
/* Shine sweep across the button on hover. */
.btn::before{
  content:""; position:absolute; top:0; left:-60%; width:40%; height:100%;
  background:linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform:skewX(-20deg);
  transition:left 0.6s ease;
}
.btn:hover::before{left:120%;}
.btn-primary{background:var(--uw-red); color:var(--white); box-shadow:0 4px 24px rgba(197,5,12,0.55);}
.btn-primary:hover{background:#e0060e;}
.btn-slack{background:#4A154B; color:var(--white);}
.btn-slack:hover{background:#611f63;}


/* ==========================================================================
   7. Components
   ========================================================================== */

/* ---- about ---- */
.about-grid{display:grid; grid-template-columns:1.1fr 0.9fr; gap:50px; align-items:start;}
.about-grid-single{grid-template-columns:1fr; max-width:800px;}
.about-text p{margin-bottom:16px; color:#d3bdbd;}
.about-text strong{color:var(--uw-red-bright);}

/* ---- why join ---- */
.why-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:24px;}
.why-card{
  background:rgba(13,8,8,0.3); border:1px solid var(--border); border-radius:14px;
  padding:28px; box-shadow:0 6px 30px rgba(0,0,0,0.5);
  position:relative; overflow:hidden;
  transition:transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.why-card:hover{
  transform:translateY(-6px);
  border-color:var(--uw-red);
  box-shadow:0 12px 40px rgba(197,5,12,0.25);
}
.why-card .icon{
  width:46px; height:46px; border-radius:10px; background:var(--red-950);
  border:1px solid var(--border);
  color:var(--uw-red-bright); display:flex; align-items:center; justify-content:center;
  font-family:var(--mono); font-weight:700; font-size:1.1rem; margin-bottom:16px;
}
.why-card h3{font-size:1.1rem; margin-bottom:10px; font-weight:700; color:var(--white);}
.why-card p{color:var(--muted); font-size:0.94rem;}

/* ---- leadership ---- */
/* 240px min: narrow enough for 4-up on a wide screen, wide enough that
   'Co-Founder / Vice President' still fits the badge on one line. Below
   that the grid drops to 3 columns, which are wider still. */
.lead-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:22px;}
.lead-card{
  display:flex; flex-direction:column;
  text-align:center; background:rgba(13,8,8,0.3); border:1px solid var(--border);
  border-radius:14px; padding:26px 18px; box-shadow:0 6px 30px rgba(0,0,0,0.5);
  position:relative; overflow:hidden;
  transition:transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.lead-card:hover{
  transform:translateY(-8px) scale(1.02);
  border-color:var(--uw-red);
  box-shadow:0 14px 44px rgba(197,5,12,0.3);
}
.lead-card:hover .avatar{
  box-shadow:0 0 24px 4px rgba(255,42,42,0.55);
}
.avatar{
  width:110px; height:110px; border-radius:50%; margin:0 auto 16px;
  background:linear-gradient(135deg, var(--red-950), var(--red-900));
  display:flex; align-items:center; justify-content:center;
  border:3px solid var(--uw-red); position:relative;
  transition:box-shadow 0.3s ease;
}
.avatar svg{width:52px; height:52px; opacity:0.6;}
.avatar img{width:100%; height:100%; object-fit:cover; border-radius:50%;}
.lead-card h3{font-size:1.05rem; font-weight:700; margin-bottom:4px; color:var(--white);}
.role-badge{
  /* align-self keeps the pill hugging its text: as a flex child a block-level
     box would otherwise stretch to the full card width. */
  align-self:center; max-width:100%;
  display:inline-block; font-family:var(--mono); font-size:0.65rem;
  color:#ffb3b3; background:rgba(197,5,12,0.15); padding:4px 11px;
  border:1px solid var(--border);
  border-radius:999px; margin-top:6px; letter-spacing:0.15px;
  line-height:1.45; text-wrap:balance;
}
.lead-email{font-size:0.78rem; margin-top:auto; padding-top:10px;}
.lead-email a{color:var(--uw-red-bright); text-decoration:none;}
.lead-email a:hover{text-decoration:underline;}

/* ---- FAQ ---- */
.faq-item{
  border-bottom:1px solid var(--border); padding:22px 0;
}
.faq-q{
  display:flex; justify-content:space-between; align-items:center;
  cursor:pointer; font-weight:700; font-size:1.03rem; gap:16px;
  color:var(--white);
}
.faq-q .plus{
  font-family:var(--mono); color:var(--uw-red-bright); font-size:1.3rem; flex-shrink:0;
  transition:transform .2s ease;
}
.faq-item.open .plus{transform:rotate(45deg);}
.faq-a{
  max-height:0; overflow:hidden; transition:max-height .25s ease;
  color:var(--muted); font-size:0.96rem;
}
.faq-item.open .faq-a{max-height:300px; margin-top:14px;}

/* ---- signup ---- */
.signup{
  background:radial-gradient(circle at 70% 30%, rgba(43,5,5,0.4), rgba(13,8,8,0.25) 75%);
  border:1px solid var(--border);
  border-radius:20px; padding:60px 40px; color:var(--white); text-align:center;
  position:relative; overflow:hidden;
  max-width:1100px; margin:0 auto;
  animation:borderPulse 3.5s ease-in-out infinite;
}
@keyframes borderPulse{
  0%,100%{box-shadow:0 0 0 0 rgba(197,5,12,0.35);}
  50%{box-shadow:0 0 0 8px rgba(197,5,12,0);}
}
.signup-inner{position:relative;}
.signup h2{color:var(--white);}
.signup p{color:#d9bcbc; max-width:560px; margin:0 auto 34px;}
.signup-btns{display:flex; gap:16px; justify-content:center; flex-wrap:wrap;}

/* ---- footer ---- */
footer{
  background:rgba(13,8,8,0.3); border-top:1px solid var(--border); color:#c9a8a8; padding:50px 24px 30px;
  text-align:center; margin-top:40px; position:relative; overflow:hidden;
}
footer .brand{justify-content:center; margin-bottom:16px;}
footer .brand img{height:44px; width:44px;}
footer .flinks{display:flex; gap:22px; justify-content:center; margin-bottom:22px; flex-wrap:wrap;}
footer .flinks a{color:#d9bcbc; text-decoration:none; font-size:0.92rem;}
footer .flinks a:hover{color:var(--white); text-decoration:underline;}
footer .fine{font-size:0.8rem; color:#7a6363; font-family:var(--mono);}


/* ==========================================================================
   8. Scroll reveal & animations
   ========================================================================== */

/* Scroll progress bar */
.scroll-progress{
  position:fixed; top:0; left:0; height:3px; width:0%;
  background:linear-gradient(90deg, var(--uw-red-dark), var(--uw-red-bright));
  box-shadow:0 0 12px 1px rgba(255,42,42,0.8);
  z-index:1000; transition:width 0.08s linear;
}

/* Scroll reveal.
   Content is visible by default, so it still renders with no JS and no
   IntersectionObserver. The hidden pre-animation state only turns on once
   html.js-reveal is set by the inline script in <head>, which makes the
   fade-in progressive enhancement rather than a requirement. */
.reveal{ opacity:1; transform:none; }
.reveal-stagger > *{ opacity:1; transform:none; }
html.js-reveal .reveal{
  opacity:0; transform:translateY(36px);
  transition:opacity 0.8s ease, transform 0.8s ease;
}
html.js-reveal .reveal.in-view{opacity:1; transform:translateY(0);}
html.js-reveal .reveal-stagger > *{
  opacity:0; transform:translateY(24px);
  transition:opacity 0.6s ease, transform 0.6s ease;
}
html.js-reveal .reveal-stagger.in-view > *{opacity:1; transform:translateY(0);}
.reveal-stagger.in-view > *:nth-child(1){transition-delay:0.05s;}
.reveal-stagger.in-view > *:nth-child(2){transition-delay:0.15s;}
.reveal-stagger.in-view > *:nth-child(3){transition-delay:0.25s;}
.reveal-stagger.in-view > *:nth-child(4){transition-delay:0.35s;}
.reveal-stagger.in-view > *:nth-child(5){transition-delay:0.45s;}
.reveal-stagger.in-view > *:nth-child(6){transition-delay:0.55s;}


/* ==========================================================================
   9. Cursor-reactive glow system
   ==========================================================================
   Each surface gets a black cover on ::before whose opacity is driven by
   --glow-fade, written per-element by main.js based on cursor distance.
   Direct children are lifted above the cover so they stay readable. */
.why-card::before, .lead-card::before,
.signup::before, footer::before{
  content:""; position:absolute; inset:0; z-index:0;
  background:#000;
  opacity:var(--glow-fade, 0.94);
  border-radius:inherit;
  transition:opacity 0.15s linear;
  pointer-events:none;
}
.why-card > *, .lead-card > *,
.signup > *, footer > *{
  position:relative; z-index:1;
}


/* ==========================================================================
   10. Media queries
   ========================================================================== */
@media(max-width:900px){
  .why-grid{grid-template-columns:1fr;}
}

@media(max-width:760px){
  .about-grid{grid-template-columns:1fr;}
  .navtoggle{display:flex;}
  .navlinks{
    position:absolute; top:100%; left:0; right:0;
    flex-direction:column; align-items:stretch; gap:0;
    background:rgba(5,3,3,0.98); border-bottom:1px solid var(--border);
    max-height:0; overflow:hidden; opacity:0;
    transition:max-height .3s ease, opacity .25s ease;
  }
  .navlinks.open, .nav-check:checked ~ .navlinks{max-height:400px; opacity:1;}
  .navlinks li{width:100%;}
  .navlinks a{
    display:block; padding:16px 24px; border-bottom:1px solid var(--border);
    font-size:1rem;
  }
  .nav-cta{
    border-radius:0; text-align:center;
  }
  section{padding:60px 20px;}
  .signup{padding:44px 24px;}
}

/* Touch-only fallback: works even with no JS at all. JS gives a smooth
   position-tracking glow; this gives an instant reveal the moment a finger
   is actually down on the element. */
@media (hover:none){
  /* cursor:pointer nudges iOS Safari into treating these as tappable so
     :active actually engages without any JS */
  .logo-wrap, header, .why-card,
  .lead-card, .signup, footer{ cursor:pointer; }
  .logo-wrap:active::before{opacity:0.12;}
  header:active::before{opacity:0.15;}
  .why-card:active::before, .lead-card:active::before,
  .signup:active::before, footer:active::before{opacity:0.15;}
}

@media (prefers-reduced-motion: reduce){
  .circuit-bg, .hero img.logo, .hero::before, .signup{animation:none!important;}
  .reveal, .reveal-stagger > *{opacity:1!important; transform:none!important; transition:none!important;}
}
