/* ===== AIM Club - shared styles ===== */

:root {
  --bg: #171717;
  --bg-alt: #121212;
  --surface: #1f1f1f;
  --surface-solid: #1f1f1f;
  --border: #333333;
  --border-strong: #4d4d4d;
  --text: #F5F5F5;
  --text-muted: #a3a3a3;
  --text-dim: #737373;

  --ai: #38BDF8;
  --infosec: #F04438;
  --mentorship: #E0A93A;

  --accent: #F04438;
  --accent-dark: #DC2626;
  --accent-darker: #B91C1C;
  --destructive: #DC2626;

  --radius: 6px;
  --radius-sm: 4px;
  --max-width: 1160px;

  --font-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--text);
}

.brand:hover { text-decoration: none; }

.brand-mark {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.94rem;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.15s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  transition: right 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

.nav-links a:hover::after,
.nav-links a.active::after { right: 0; }

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

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .nav-links.open { max-height: 400px; }

  .nav-links li { border-top: 1px solid var(--border); }

  .nav-links a { display: block; padding: 14px 24px; }
  .nav-links a::after { display: none; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent-dark);
  color: #FFFFFF;
  border-color: var(--accent-dark);
}

.btn-primary:hover { background: var(--accent-darker); border-color: var(--accent-darker); }

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 96px 0 72px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

/* Circuit-board trace graphic, used at the top of every page. Etched lines, no glow, one-time draw-in. */
.circuit-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, transparent 35%, black 85%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, transparent 35%, black 85%);
}

.circuit-bg svg {
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

.circuit-bg path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: trace-draw 2.4s ease-out forwards;
}

.circuit-bg rect,
.circuit-bg circle {
  fill: var(--accent);
  opacity: 0;
  animation: pad-fade-in 0.6s ease-out 1.8s forwards;
}

@keyframes trace-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes pad-fade-in {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .circuit-bg path { stroke-dashoffset: 0; animation: none; }
  .circuit-bg rect, .circuit-bg circle { opacity: 1; animation: none; }
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.hero .eyebrow::before {
  content: "//";
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  margin: 0 0 20px;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.hero .accent-ai { color: var(--ai); }
.hero .accent-infosec { color: var(--infosec); }
.hero .accent-mentorship { color: var(--mentorship); }

.hero p.lead {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 660px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Badge strip (affiliation / frameworks / competitions) ===== */
.badge-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.badge svg { width: 14px; height: 14px; stroke: var(--accent); flex-shrink: 0; }
.badge strong { color: var(--text); font-weight: 600; }

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

.section-alt { background: var(--bg-alt); }

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 52px;
}

.section-header h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.section-header p { color: var(--text-muted); margin: 0; }

/* ===== Pillar cards ===== */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 800px) {
  .pillars { grid-template-columns: 1fr; }
}

.pillar-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--pillar-color, var(--accent));
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.15s ease;
}

.pillar-card:hover { border-color: var(--border-strong); border-top-color: var(--pillar-color, var(--accent)); }

.pillar-card.ai { --pillar-color: var(--ai); }
.pillar-card.infosec { --pillar-color: var(--infosec); }
.pillar-card.mentorship { --pillar-color: var(--mentorship); }

.pillar-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  color: var(--pillar-color, var(--accent));
}

.pillar-icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.5; }

.pillar-card h3 { margin: 0 0 10px; }
.pillar-card p { color: var(--text-muted); margin: 0; }

/* ===== Competitions / frameworks strip ===== */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.chip {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  transition: border-color 0.15s ease;
}

.chip:hover { border-color: var(--accent); }

/* ===== Cards grid (events / team) ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.card:hover { border-color: var(--border-strong); }

.card-body { padding: 22px; }

.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.card-tag.ai { background: rgba(56, 189, 248, 0.12); color: var(--ai); }
.card-tag.infosec { background: rgba(240, 68, 56, 0.12); color: var(--infosec); }
.card-tag.mentorship { background: rgba(224, 169, 58, 0.12); color: var(--mentorship); }
.card-tag.competition { background: rgba(148, 163, 184, 0.14); color: var(--text); }
.card-tag.neutral { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); }

.card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); text-decoration: underline; }
.card .meta { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 10px; }
.card p.desc { color: var(--text-muted); margin: 0; font-size: 0.92rem; }

/* ===== Project schedule ===== */
.schedule-box {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 480px;
  overflow: auto;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
}

.schedule-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-solid);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.schedule-table tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.schedule-table tbody tr:last-child td { border-bottom: none; }

.schedule-table tbody tr:hover { background: var(--bg-alt); }

.schedule-name {
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}

.schedule-person {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.schedule-avatar {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  overflow: hidden;
}

.schedule-avatar svg { width: 14px; height: 14px; }

.schedule-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
}

.schedule-location {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .schedule-table { min-width: 640px; }
}

/* ===== Gallery ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ===== Team ===== */
.team-section-label {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin: 0 0 24px;
}

.team-card {
  text-align: center;
  padding: 30px 20px;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  background: var(--border);
  border: 1px solid var(--border-strong);
}

.team-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.team-card .role { color: var(--text-muted); font-size: 0.88rem; margin: 0 0 10px; font-weight: 600; }
.team-card .role-desc { color: var(--text-dim); font-size: 0.82rem; margin: 0; }

/* ===== Membership tiers ===== */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .tier-grid { grid-template-columns: 1fr; }
}

.tier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.tier-card h3 { margin: 0 0 12px; }
.tier-card p { color: var(--text-muted); font-size: 0.94rem; }
.tier-card ul { color: var(--text-muted); font-size: 0.9rem; padding-left: 20px; margin: 14px 0 0; }
.tier-card li { margin-bottom: 6px; }

.mentor-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.mentor-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.mentor-category h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.98rem;
}

.mentor-category p { margin: 0; color: var(--text-muted); font-size: 0.88rem; }

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 800px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.info-list .label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.form-card h3 { margin-top: 0; }

.form-card .btn-primary {
  width: 100%;
  text-align: center;
  margin-top: 8px;
}

/* ===== CTA banner ===== */
.cta-banner {
  position: relative;
  text-align: center;
  padding: 56px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
}

.cta-banner h2 { margin: 0 0 10px; }
.cta-banner p { color: var(--text-muted); margin: 0 0 24px; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 44px 0 32px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-note { margin-top: 14px; font-size: 0.82rem; color: var(--text-dim); max-width: 320px; }

.footer-legal {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.7;
}

.footer-legal a { color: var(--text-dim); text-decoration: underline; }

/* ===== Page header (non-home pages) ===== */
.page-header {
  position: relative;
  padding: 64px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.page-header h1 { margin: 0 0 12px; font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -0.01em; }
.page-header p { color: var(--text-muted); max-width: 640px; margin: 0 auto; }

/* ===== Prose (Constitution page) ===== */
.prose {
  max-width: 780px;
  margin: 0 auto;
  color: var(--text-muted);
}

.prose h2 {
  color: var(--text);
  margin: 44px 0 14px;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.prose h2:first-child { margin-top: 0; }

.prose h3 {
  color: var(--text);
  margin: 26px 0 10px;
  font-size: 1.05rem;
}

.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }

.prose-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
}

@media (max-width: 640px) {
  .prose-card { padding: 24px; }
}

/* ===== Reveal-on-scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
