/* ===== Dark "WOW" Theme ===== */
:root {
  --bg: #0b1120;
  --bg-alt: #111827;
  --card: #1e293b;
  --card-hover: #273549;
  --border: rgba(148, 163, 184, 0.12);
  --primary: #22d3ee;
  --primary-dim: #0891b2;
  --accent: #a78bfa;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --gold: #fbbf24;
  --silver: #94a3b8;
  --bronze: #d97706;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --glow: 0 0 40px rgba(34, 211, 238, 0.15);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px; /* fixed header height */
}

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

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(11, 17, 32, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.header.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo span { color: var(--primary); }

.nav-menu {
  display: flex;
  gap: 1.4rem;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active { color: var(--primary); }

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #0b1120;
}

.btn-primary:hover {
  background: #67e8f9;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.4);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(34, 211, 238, 0.4);
  color: var(--primary);
}

.btn-ghost:hover {
  background: rgba(34, 211, 238, 0.1);
  border-color: var(--primary);
}

.btn-full { width: 100%; }

/* =========================================
   PREMIUM HERO
========================================= */

.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  padding: 90px 0 80px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  width: 650px;
  height: 650px;
  right: -260px;
  top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.11), transparent 68%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 70px;
  align-items: center;
}

.hero-content {
  position: relative;
  z-index: 3;
  min-width: 0;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--primary);
}

.hero-eyebrow span {
  width: 38px;
  height: 1px;
  flex: 0 0 38px;
  background: var(--primary);
}

.hero h1 {
  margin: 0;
  font-size: clamp(70px, 8vw, 112px);
  line-height: 0.86;
  letter-spacing: -0.075em;
  font-weight: 800;
}

.hero h1 em {
  font-style: normal;
  color: var(--primary);
}

.hero-intro {
  max-width: 590px;
  margin: 32px 0 27px;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.75;
}

.hero-intro strong {
  color: var(--text);
  font-weight: 700;
}

.hero-awards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.hero-award {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 57px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(12px);
}

.hero-award:first-child {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.055);
}

.hero-award-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--primary);
  font-size: 15px;
  font-weight: 800;
}

.hero-award strong {
  display: block;
  font-size: 11px;
  line-height: 1.25;
}

.hero-award small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 8.5px;
  line-height: 1.35;
}

.hero-actions {
  display: flex;
  gap: 11px;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 19px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hero-btn-primary {
  background: var(--primary);
  color: #06201d;
}

.hero-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(34, 211, 238, 0.2);
}

.hero-btn-secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.hero-btn-secondary:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.35);
}

.hero-micro-proof {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 34px;
  padding-top: 19px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
}

.hero-micro-proof b {
  color: var(--text);
  font-size: 11px;
}

.hero-micro-proof i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--primary);
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 570px;
}

.hero-photo-frame {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 0.82;
  z-index: 2;
}

.hero-photo-frame::before {
  content: "";
  position: absolute;
  inset: 28px -18px -18px 18px;
  border: 1px solid rgba(34, 211, 238, 0.27);
  border-radius: 38px;
  transform: rotate(4deg);
}

.hero-photo-frame::after {
  content: "";
  position: absolute;
  inset: -12px 20px 20px -12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 38px;
  transform: rotate(-3deg);
  pointer-events: none;
}

.hero-photo-glow {
  position: absolute;
  inset: 8% -10% -5%;
  background: radial-gradient(circle at center, rgba(34, 211, 238, 0.25), transparent 67%);
  filter: blur(28px);
}

.hero-photo-frame img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.42), 0 0 50px rgba(34, 211, 238, 0.07);
  display: block;
}

.hero-floating {
  position: absolute;
  z-index: 5;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(7, 17, 31, 0.88);
  backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  animation: heroFloat 5s ease-in-out infinite;
}
.hero-award-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.hero-award-link:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 10px 30px rgba(34, 211, 238, 0.10);
}

.hero-award-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.hero-python {
  left: -24px;
  top: 20%;
  color: var(--primary);
}

.hero-python span { margin-right: 5px; }

.hero-ai {
  right: -25px;
  top: 43%;
  animation-delay: -1.5s;
}

.hero-edtech {
  left: 7%;
  bottom: -14px;
  animation-delay: -3s;
}

.hero-recognition {
  position: absolute;
  right: -30px;
  bottom: 11%;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 13px;
  background: rgba(7, 18, 31, 0.92);
  backdrop-filter: blur(15px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.hero-recognition > span {
  color: var(--primary);
  font-size: 20px;
}

.hero-recognition strong {
  display: block;
  font-size: 10px;
  line-height: 1.25;
}

.hero-recognition small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 8px;
}

.hero-orbit {
  position: absolute;
  border: 1px solid rgba(34, 211, 238, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-one {
  width: 510px;
  height: 510px;
  transform: rotate(25deg);
}

.orbit-two {
  width: 390px;
  height: 390px;
  transform: rotate(-20deg);
  border-color: rgba(255, 255, 255, 0.035);
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (max-width: 900px) {
  .hero { padding-top: 60px; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 55px;
  }

  .hero-visual {
    order: -1;
    min-height: auto;
  }

  .hero-photo-frame { width: min(80vw, 390px); }

  .hero h1 { font-size: clamp(60px, 15vw, 90px); }

  .hero-intro { font-size: 15px; }

  .orbit-one,
  .orbit-two { display: none; }
}

@media (max-width: 600px) {
  .hero { padding: 45px 0 70px; }

  .hero-photo-frame { width: 82vw; }

  .hero-python,
  .hero-ai,
  .hero-edtech { display: none; }

  .hero-recognition {
    right: -5px;
    max-width: calc(100% - 10px);
  }

  .hero-awards { flex-direction: column; }
  .hero-award { width: 100%; }
  .hero-micro-proof { gap: 9px; }
  .hero-micro-proof i { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-floating { animation: none; }
}

/* ===== Sections ===== */
.section {
  padding: 80px 0;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

/* ===== Achievements ===== */
.achievements {
  background: var(--bg-alt);
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.ach-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.ach-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}

.ach-card:hover {
  background: var(--card-hover);
  border-color: rgba(34, 211, 238, 0.35);
  transform: translateY(-5px);
  box-shadow: var(--glow);
}

.ach-card:hover::before {
  opacity: 1;
}

.ach-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.85rem;
}

.ach-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--primary);
}

.ach-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.ach-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Featured Project ===== */
.project { background: var(--bg); }

.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  background: linear-gradient(145deg, var(--card) 0%, #1a1535 100%);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow), 0 0 40px rgba(167, 139, 250, 0.12);
}

.project-text h3 {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
}

.project-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.project-text .tags { margin-bottom: 1.5rem; }
.code-box {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3rem 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.25;
  color: #e6edf3;
  overflow-x: auto;
}

.code-line {
  display: block;
  line-height: 1.25;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}

.js .project-card.visible .code-line {
  animation: type var(--t) steps(var(--n)) var(--d) both;
}

@keyframes type {
  from { width: 0; }
  to { width: var(--w); }
}

.pj-badge {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: rgba(46, 164, 79, 0.2);
  border: 1px solid #2ea44f;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
}

.js .project-card.visible .pj-badge {
  animation: fadein 0.6s ease 5.6s both;
}

@keyframes fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Quick Access ===== */
.quick-access {
  background: var(--bg);
}
.teaching-hub .class-grid {
  margin-bottom: 4rem;
}

.teaching-hub .leaderboard-heading {
  margin-top: 0;
}

.teaching-hub .notice-board {
  margin-bottom: 3.5rem;
}

.teaching-hub .leaderboard-grid {
  margin-top: 1.5rem;
}
.qa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.qa-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition: all var(--transition);
}

.qa-card:hover {
  background: var(--card-hover);
  border-color: rgba(34, 211, 238, 0.35);
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.qa-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.7rem;
}

.qa-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.qa-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Leaderboards */
.leaderboard-heading {
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 960px;
  margin-inline: auto;
  width: 100%;
}

.lb-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
}

.lb-card:hover {
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: var(--glow);
}

.lb-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.lb-badge { font-size: 1.3rem; }

.lb-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.lb-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0b1120;
}

.rank.gold { background: var(--gold); }
.rank.silver { background: var(--silver); }
.rank.bronze { background: var(--bronze); color: #fff; }

/* ===== Classes ===== */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
}

.class-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  text-align: center;
  transition: all var(--transition);
}

.class-card:hover {
  background: var(--card-hover);
  border-color: rgba(34, 211, 238, 0.35);
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.class-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.4rem;
  letter-spacing: -0.03em;
}

.class-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.class-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Learn ===== */
.learn {
  background: var(--bg-alt);
}

.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.15rem;
}

.learn-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.25rem;
  text-align: center;
  transition: all var(--transition);
}

.learn-card:hover {
  background: var(--card-hover);
  border-color: rgba(34, 211, 238, 0.35);
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.learn-icon {
  font-size: 1.7rem;
  display: block;
  margin-bottom: 0.6rem;
}

.learn-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.learn-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Portfolios ===== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.15rem;
}

.port-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all var(--transition);
}

.port-card:hover {
  background: var(--card-hover);
  border-color: rgba(34, 211, 238, 0.35);
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.port-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dim), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.port-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.port-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== About ===== */
.about {
  background: var(--bg-alt);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.about-bio p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.about-bio strong { color: var(--primary); }

.about-bio .btn { margin-top: 0.5rem; }

.about-exp h3 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--primary);
}

.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: rgba(34, 211, 238, 0.25);
}

.tl-item {
  position: relative;
  padding-bottom: 1.4rem;
}

.tl-item:last-child { padding-bottom: 0; }

.tl-dot {
  position: absolute;
  left: -1.5rem;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25);
}

.tl-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  margin-top: 0.6rem;
  padding: 6px 12px;
  border-radius: 8px;
}

.tl-item h4 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.tl-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.skills-tags {
  margin-bottom: 2.5rem;
}

.skills-tags h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  transition: all var(--transition);
}

.tag:hover {
  background: rgba(34, 211, 238, 0.2);
  border-color: var(--primary);
}

.skill-group { margin-bottom: 1.1rem; }

.skill-group h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.roles-heading {
  font-size: 1.15rem;
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.role-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
}

.role-card:hover {
  background: var(--card-hover);
  border-color: rgba(34, 211, 238, 0.3);
  transform: translateY(-3px);
}

.role-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.6rem;
}

.role-card h4 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.role-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Contact ===== */
.contact-form {
  max-width: 580px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #8493a8;
}

.contact-alt {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-alt a {
  color: var(--primary);
  font-weight: 600;
}

.contact-alt a:hover { text-decoration: underline; }

/* ===== Footer ===== */
.footer {
  background: #060a14;
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.footer-nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-nav a:hover { color: var(--primary); }

.footer-social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.footer-social a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 0.35rem 0.95rem;
  border-radius: 20px;
  transition: all var(--transition);
}

.footer-social a:hover {
  background: rgba(34, 211, 238, 0.2);
  border-color: var(--primary);
}

.copyright {
  font-size: 0.8rem;
  color: #8493a8;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-grid,
  .project-card,
  .qa-grid,
  .roles-grid,
  .ach-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-grid,
  .leaderboard-grid.four {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  /* Mobile / tablet menu */
  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    background: rgba(11, 17, 32, 0.97);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    opacity: 0;
    visibility: hidden;          /* keeps closed links out of the tab order */
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .nav-link { font-size: 1rem; }
  .nav-link.active::after { bottom: -4px; width: 2.2rem; }
}

/* Home link is redundant on desktop (the logo goes home); keep it in the mobile menu */
@media (min-width: 901px) {
  .nav-home { display: none; }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .project-card { padding: 1.5rem; }
  .code-box { font-size: 0.72rem; }
  .badge { font-size: 0.7rem; }
  .leaderboard-grid,
  .leaderboard-grid.four {
    grid-template-columns: 1fr;
  }
}

/* ===== Scroll Reveal Animations ===== */
/* Content is only hidden when JS has added .js to <html>, so it never stays invisible without JS */
.js .reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.js .reveal-delay-1 { transition-delay: 0.1s; }
.js .reveal-delay-2 { transition-delay: 0.2s; }

/* ===== About Photo ===== */
.about-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
  margin-bottom: 1.25rem;
  display: block;
}

/* ===== Announcements / Notice Board ===== */
.announcements {
  background: var(--bg);
}

.notice-board {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin-inline: auto;
  margin-bottom: 2.5rem;
}

.notice-item {
  display: flex;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: all var(--transition);
  align-items: flex-start;
}

.notice-item:hover {
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: var(--glow);
}

.notice-date {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  white-space: nowrap;
}

.notice-body h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.notice-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .notice-item {
    flex-direction: column;
    gap: 0.6rem;
  }
  .hero-stats {
    justify-content: center;
  }
  .about-photo {
    margin-inline: auto;
  }
}

/* ===== Final polish / accessibility ===== */
.badge-secondary {
  background: rgba(167, 139, 250, 0.10);
  border-color: rgba(167, 139, 250, 0.35);
  color: #c4b5fd;
}

.nav-toggle:focus-visible,
.nav-link:focus-visible,
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.contact-form button:disabled {
  cursor: default;
  opacity: 0.85;
  transform: none;
}

/* Honeypot (visually hidden, still in the DOM for bots) */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 1.4em;
  margin-top: 0.9rem;
  font-size: 0.88rem;
  text-align: center;
  color: var(--text-muted);
}

.form-status.success { color: #4ade80; }
.form-status.error { color: #f87171; }

.form-group input.invalid,
.form-group textarea.invalid {
  border-color: #f87171;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
