@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --background: #f8fafc;
  --foreground: #0f172a;
  --card: #ffffff;
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --secondary: #0891b2;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #06b6d4;
  --border: #e2e8f0;
  --radius: 12px;
  --font-heading: 'DM Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-code: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); line-height: 1.15; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 0.875rem; }
ul { list-style: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Layout ── */
.container { max-width: 1152px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 768px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (min-width: 640px) and (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
.text-center { text-align: center; }
.hidden { display: none !important; }
@media (max-width: 768px) { .md-hidden { display: none !important; } }
@media (min-width: 769px) { .md-flex { display: flex !important; } .mobile-only { display: none !important; } }

/* ── Typography ── */
.eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--primary); margin-bottom: 12px; }
.h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.02em; color: #0f172a; }
.h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; color: #0f172a; }
.h3 { font-size: 1.15rem; font-weight: 700; color: #0f172a; }
.lead { font-size: 1.1rem; color: var(--muted-foreground); }
.text-muted { color: var(--muted-foreground); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.mono { font-family: var(--font-code); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; font-weight: 600; font-size: 0.9rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary { background: linear-gradient(135deg, #1d4ed8, #0891b2); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(29,78,216,0.3); }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); }
.btn-dark { background: #0f172a; color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ── Cards ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 24px; }
.card-hover { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(15,23,42,0.08); }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-green { background: #f0fdf4; color: #16a34a; }
.badge-yellow { background: #fef9c3; color: #ca8a04; }
.badge-red { background: #fef2f2; color: #dc2626; }
.badge-purple { background: #f3e8ff; color: #9333ea; }
.badge-slate { background: #f1f5f9; color: #475569; }

/* ── Forms ── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.8rem; font-weight: 500; color: #475569; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1.5px solid var(--border);
  outline: none; transition: border-color 0.15s ease; background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); }
.field-check { display: flex; align-items: center; gap: 8px; }
.field-check input { width: auto; }
.form-error { color: #dc2626; font-size: 0.8rem; margin-top: 4px; }
.form-success { color: #16a34a; font-size: 0.85rem; }

/* ── Navbar ── */
.navbar { position: sticky; top: 0; z-index: 40; background: rgba(248,250,252,0.85); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.navbar.scrolled { border-color: var(--border); box-shadow: 0 2px 12px rgba(15,23,42,0.04); }
.navbar-inner { max-width: 1152px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; }
.logo-link { display: flex; align-items: center; gap: 8px; }
.logo-link img { height: 34px; width: auto; }
.logo-word { font-family: var(--font-heading); font-weight: 800; font-size: 1.1rem; color: var(--primary-dark); letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: #475569; transition: color 0.15s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-toggle { display: none; font-size: 1.5rem; color: #0f172a; }
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.mobile-open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #fff; padding: 16px 24px; border-bottom: 1px solid var(--border); gap: 16px; }
}

/* ── Footer ── */
.footer { background: #0f172a; color: #94a3b8; padding: 56px 0 28px; }
.footer img { height: 36px; }
.footer a { color: #94a3b8; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-heading { color: #fff; font-weight: 600; font-size: 0.85rem; margin-bottom: 14px; }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 24px; font-size: 0.8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ── Hero ── */
.hero-light { background: linear-gradient(145deg, #f8fafc 0%, #eff6ff 50%, #f0fdfa 100%); padding: 96px 0; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; text-align: center; } .hero-grid > div:first-child { display: flex; flex-direction: column; align-items: center; } }

.hero-card-wrap { position: relative; max-width: 420px; margin: 0 auto; }
.hero-card {
  background: #fff; border: 1px solid var(--border); border-radius: 24px; padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(15,23,42,0.08);
}
.hero-icon-box {
  width: 92px; height: 92px; border-radius: 20px; background: #eff6ff; overflow: hidden;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 24px;
}
.hero-icon-box img { width: 100%; height: 100%; object-fit: cover; }
.hero-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.hero-stat { border: 1px solid var(--border); border-radius: 14px; padding: 16px 10px; text-align: center; }
.hero-stat .num { font-family: var(--font-heading); font-weight: 800; font-size: 1.4rem; color: var(--primary); }
.hero-stat .lbl { font-size: 0.78rem; color: var(--muted-foreground); margin-top: 2px; }
.hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hero-tags span { font-family: var(--font-code); font-size: 0.72rem; color: var(--secondary); background: #ecfeff; padding: 4px 10px; border-radius: 999px; }

.hero-badge-top {
  position: absolute; top: -18px; right: 4px; background: var(--primary); color: #fff;
  font-size: 0.78rem; font-weight: 700; padding: 8px 18px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(29,78,216,0.35); white-space: nowrap; z-index: 2;
}
.hero-badge-bottom {
  position: absolute; bottom: -16px; left: 4px; background: var(--secondary); color: #fff;
  font-size: 0.78rem; font-weight: 700; padding: 8px 18px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(8,145,178,0.35); white-space: nowrap; z-index: 2;
}
@media (max-width: 480px) {
  .hero-badge-top, .hero-badge-bottom { font-size: 0.68rem; padding: 6px 12px; }
}
.hero-dark { background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%); padding: 88px 0; }
.hero-dark .h1, .hero-dark .h2 { color: #fff; }
.hero-dark .lead { color: #94a3b8; }
.stat-pill { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 18px; padding: 16px 24px; text-align: center; }
.stat-pill .num { font-size: 1.6rem; font-weight: 800; color: #fff; font-family: var(--font-heading); }
.stat-pill .lbl { font-size: 0.75rem; color: #94a3b8; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 70px 24px; border-radius: 18px; background: #f8fafc; border: 1.5px dashed #cbd5e1; }
.empty-state .icon { font-size: 2.4rem; margin-bottom: 10px; }

/* ── Utility spacing ── */
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 24px; } .mt-6 { margin-top: 36px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 24px; } .mb-6 { margin-bottom: 36px; }

/* ── Loading / skeleton text ── */
.loading-text { text-align: center; padding: 60px 0; color: var(--muted-foreground); font-size: 0.9rem; }

/* ── Category pills (filters) ── */
.pill-filter { padding: 8px 18px; border-radius: 999px; font-size: 0.85rem; font-weight: 500; background: #f1f5f9; color: #475569; }
.pill-filter.active { background: var(--primary); color: #fff; }

/* ── Modal ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.6); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 18px; padding: 28px; width: 100%; max-width: 440px; }

/* ── Admin ── */
.admin-shell { min-height: 100vh; display: flex; background: #f8fafc; }
.admin-sidebar { width: 256px; flex-shrink: 0; background: #0f172a; min-height: 100vh; display: flex; flex-direction: column; }
@media (max-width: 900px) { .admin-sidebar { display: none; } }
.admin-sidebar .logo-word { color: #fff; }
.admin-nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; font-size: 0.9rem; font-weight: 500; color: #94a3b8; width: 100%; text-align: left; }
.admin-nav-item:hover { background: rgba(255,255,255,0.05); color: #e2e8f0; }
.admin-nav-item.active { background: rgba(29,78,216,0.25); color: #60a5fa; }
.admin-main { flex: 1; padding: 32px; overflow-x: auto; }
.admin-login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0f172a; padding: 16px; }
.admin-login-box { width: 100%; max-width: 380px; background: #1e293b; border: 1px solid #334155; border-radius: 18px; padding: 32px; }
.admin-login-box .field label { color: #94a3b8; }
.admin-login-box .field input { background: #0f172a; border-color: #334155; color: #fff; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 24px; }
.stat-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat-card .value { font-size: 1.6rem; font-weight: 800; font-family: var(--font-heading); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th { text-align: left; padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid var(--border); font-weight: 600; color: #475569; }
.admin-table td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; color: #334155; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-panel-box { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 24px; margin-bottom: 24px; }
.link-btn { font-size: 0.75rem; font-weight: 600; }
.link-blue { color: var(--primary); }
.link-red { color: #dc2626; }

/* ── CTF ── */
.ctf-card { text-align: left; padding: 22px; border-radius: 18px; background: #fff; border: 1px solid var(--border); transition: transform 0.15s ease; }
.ctf-card:hover { transform: translateY(-3px); }

/* ── Mission ── */
.mission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
@media (max-width: 900px) { .mission-grid { grid-template-columns: 1fr; } .mission-photo-wrap { display: none; } }
.mission-list { display: flex; flex-direction: column; gap: 24px; margin-top: 40px; }
.mission-item { display: flex; gap: 16px; }
.mission-icon { width: 40px; height: 40px; border-radius: 12px; background: #eff6ff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.mission-photo-wrap { position: relative; }
.mission-photo { border-radius: 24px; overflow: hidden; box-shadow: 0 24px 60px rgba(15,23,42,0.10); }
.mission-photo img { width: 100%; height: 420px; object-fit: cover; }
.mission-overlay-card {
  position: absolute; bottom: 24px; left: 24px; right: 24px; border-radius: 16px; padding: 16px;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.mission-overlay-icon { width: 40px; height: 40px; border-radius: 12px; background: #eff6ff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }

/* ── AI Assistant Widget ── */
#ai-widget-root { position: fixed; bottom: 22px; right: 22px; z-index: 999; }
#ai-widget-toggle {
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(29,78,216,0.35); transition: transform 0.15s ease;
}
#ai-widget-toggle:hover { transform: scale(1.06); }
#ai-widget-panel {
  position: absolute; bottom: 72px; right: 0; width: 340px; max-width: calc(100vw - 40px);
  height: 460px; max-height: 70vh; background: #fff; border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15,23,42,0.22); display: flex; flex-direction: column;
  overflow: hidden; border: 1px solid var(--border);
}
#ai-widget-panel.hidden { display: none; }
#ai-widget-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
}
#ai-widget-title { font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem; }
#ai-widget-subtitle { font-size: 0.72rem; opacity: 0.85; }
#ai-widget-close { background: none; border: none; color: #fff; font-size: 1rem; cursor: pointer; opacity: 0.85; }
#ai-widget-close:hover { opacity: 1; }
#ai-widget-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f8fafc; }
.ai-msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; font-size: 0.83rem; line-height: 1.45; }
.ai-msg-bot { align-self: flex-start; background: #fff; border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 3px; }
.ai-msg-user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }
.ai-msg-typing { color: var(--text-muted); font-style: italic; }
#ai-widget-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: #fff; }
#ai-widget-input { flex: 1; border: 1.5px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 0.85rem; }
#ai-widget-input:focus { outline: none; border-color: var(--primary); }
#ai-widget-send { width: 38px; border: none; border-radius: 10px; background: var(--primary); color: #fff; cursor: pointer; font-size: 0.9rem; }
#ai-widget-send:hover { background: var(--secondary); }
@media (max-width: 480px) { #ai-widget-panel { width: calc(100vw - 32px); right: -6px; } }

/* ── Social icons ── */
.social-icons-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.footer .social-icons-row { justify-content: flex-start; }
.social-icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08); color: #cbd5e1;
  transition: all 0.18s ease; border: 1px solid rgba(255,255,255,0.12);
}
.social-icon:hover { background: var(--icon-color, var(--primary)); color: #fff; border-color: transparent; transform: translateY(-2px); }

/* ── Ecosystem ── */
.ecosystem-card { display: block; text-decoration: none; }
.ecosystem-icon { width: 44px; height: 44px; border-radius: 12px; background: #eff6ff; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 14px; }

/* ── Timeline ── */
.timeline-item { display: grid; grid-template-columns: 80px 1fr; gap: 24px; padding-bottom: 32px; border-left: 2px solid var(--border); margin-left: 40px; padding-left: 24px; position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }
.timeline-year { font-family: var(--font-heading); font-weight: 800; color: var(--primary); font-size: 1.1rem; margin-left: -104px; text-align: right; padding-right: 20px; }
@media (max-width: 640px) { .timeline-item { grid-template-columns: 1fr; margin-left: 12px; } .timeline-year { margin-left: 0; text-align: left; padding-right: 0; } }
