:root {
  --bg: #0A1420;
  --bg-panel: #0F1D2E;
  --bg-raised: #142B44;
  --ridge-back: #1B3050;
  --ridge-mid: #24446E;
  --ridge-front: #2E5686;
  --text: #EAF1FA;
  --text-muted: #8AA1BC;
  --text-faint: #5C7391;
  --line: #1E3350;
  --accent: #5B9BD5;
  --discord: #4C6FDB;
  --discord-hover: #5D80EE;
  --radius: 14px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { 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.55;
  -webkit-font-smoothing: antialiased;
  opacity: 1;
  transition: opacity 0.5s var(--ease);
}
body.is-loading { opacity: 0; }

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(10, 20, 32, 0.7);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), padding 0.25s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(10, 20, 32, 0.92);
  border-color: var(--line);
  padding: 11px 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.brand__crest {
  width: 40px;
  height: 40px;
  object-fit: contain;
  transition: transform 0.3s var(--ease);
}
.brand:hover .brand__crest { transform: rotate(-6deg) scale(1.05); }

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.dept-nav {
  display: flex;
  gap: 4px;
}

.dept-nav__link {
  position: relative;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.dept-nav__link::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 2px;
  background: var(--dept-color, var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.dept-nav__link:hover { color: var(--text); }
.dept-nav__link:hover::after,
.dept-nav__link.is-active::after { transform: scaleX(1); }
.dept-nav__link.is-active { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 100%;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.98); }

.btn--discord {
  background: var(--discord);
  color: #fff;
}
.btn--discord:hover { background: var(--discord-hover); box-shadow: 0 8px 24px -8px rgba(76, 111, 219, 0.6); }
.btn__icon { width: 17px; height: 17px; flex-shrink: 0; }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); background: rgba(91, 155, 213, 0.08); }

.btn--lg { padding: 14px 26px; font-size: 15px; }
.btn--block { width: 100%; margin-bottom: 10px; }
.btn--nav { flex-shrink: 0; }

.btn--shine { position: relative; overflow: hidden; }
.btn--shine::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.7s var(--ease);
}
.btn--shine:hover::before { left: 130%; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 32px 0;
  min-height: 680px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero__sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0A1420 0%, #12253C 40%, #1C3B5E 100%);
  z-index: 0;
}

.hero__slideshow { position: absolute; inset: 0; z-index: 1; }
.hero__slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 2.2s ease, transform 9s linear;
  filter: saturate(1.05);
}
.hero__slide.is-active { opacity: 1; transform: scale(1); }
.hero__scrim {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(180deg, rgba(10,20,32,0.55) 0%, rgba(10,20,32,0.72) 55%, rgba(10,20,32,0.96) 100%);
}

.hero__inner {
  position: relative;
  z-index: 3;
  max-width: 720px;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 18px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: 0.01em;
  margin: 0 0 22px;
  text-shadow: 0 2px 30px rgba(0,0,0,0.4);
}

.hero__desc {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto 34px;
}

.hero__actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 90px;
}

.hero__ridges {
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  z-index: 2;
  height: 300px;
  pointer-events: none;
}
.ridge { position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; }
.ridge--back { opacity: 0.7; }
.ridge--back path { fill: var(--ridge-back); }
.ridge--mid { opacity: 0.85; }
.ridge--mid path { fill: var(--ridge-mid); }
.ridge--front path { fill: var(--bg-panel); }

/* ---------- Stats ---------- */

.stats {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
}
.stats__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 24px;
  text-align: center;
}
.stat__num {
  display: block;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
}
.stat__label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Section head ---------- */

.section-head {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 32px 32px;
  text-align: center;
}
.section-head__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 10px;
}
.section-head__title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  margin: 0;
}

/* ---------- Shield / logo component ---------- */

.shield {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shield svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.shield__abbr {
  position: relative;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.shield__logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35));
  transition: transform 0.25s var(--ease);
}
.dept-card:hover .shield__logo { transform: scale(1.05); }

/* ---------- Department grid ---------- */

.departments { background: var(--bg-panel); padding-bottom: 80px; }

.dept-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.dept-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.dept-card:hover {
  border-color: var(--dept-color);
  transform: translateY(-6px);
  box-shadow: 0 16px 40px -20px var(--dept-color);
}

.dept-card__shield {
  width: 72px;
  height: 80px;
  margin-bottom: 18px;
}
.dept-card__shield .shield__abbr { font-size: 15px; }

.dept-card__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 8px;
}
.dept-card__tagline {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 0 0 18px;
}
.dept-card__cta {
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--dept-color);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dept-card__arrow { display: inline-block; transition: transform 0.25s var(--ease); }
.dept-card:hover .dept-card__arrow { transform: translateX(4px); }

/* ---------- About teaser (home) ---------- */

.about-teaser { background: var(--bg); padding: 88px 32px; }
.about-teaser__inner { max-width: 640px; margin: 0 auto; text-align: center; }
.about-teaser__title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 16px;
}
.about-teaser__desc {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0 0 24px;
}

/* ---------- CTA banner ---------- */

.cta {
  position: relative;
  margin: 0 32px 96px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(155deg, #12233A 0%, #0D1B2C 100%);
  border: 1px solid var(--line);
  padding: 64px 32px;
  text-align: center;
}
.cta__glow {
  position: absolute;
  top: -40%; left: 50%;
  width: 70%; height: 140%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(76, 111, 219, 0.28), transparent 70%);
  animation: cta-pulse 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes cta-pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}
.cta__inner { position: relative; max-width: 560px; margin: 0 auto; }
.cta__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.cta__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 600;
  margin: 0 0 14px;
}
.cta__desc { color: var(--text-muted); font-size: 15.5px; margin: 0 0 28px; }
.cta__meta { color: var(--text-faint); font-size: 13px; margin: 16px 0 0; }

/* ---------- Interior page hero (About) ---------- */

.page-hero {
  position: relative;
  padding: 150px 32px 80px;
  text-align: center;
  background-size: cover;
  background-position: center;
  background-color: var(--bg);
}
.page-hero__inner { max-width: 640px; margin: 0 auto; }
.page-hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.page-hero__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 50px);
  font-weight: 600;
  margin: 0;
  line-height: 1.08;
}

.about-body { background: var(--bg-panel); padding: 64px 32px 20px; }
.about-body__inner { max-width: 720px; margin: 0 auto; text-align: center; }
.about-body__intro { color: var(--text-muted); font-size: 17px; }

.features { background: var(--bg-panel); padding: 40px 32px 88px; }
.features__grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}
.feature-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.feature-card__index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  display: block;
  margin-bottom: 14px;
}
.feature-card__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 10px;
}
.feature-card__body { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ---------- Department detail hero ---------- */

.dept-hero {
  position: relative;
  padding: 140px 32px 70px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--dept-color) 22%, transparent), transparent 60%),
    linear-gradient(180deg, #0A1420 0%, #0F1D2E 100%);
}
.dept-hero__bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover;
  background-position: center;
}

.dept-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
}

.dept-hero__shield { width: 96px; height: 108px; flex-shrink: 0; }
.dept-hero__shield .shield__abbr { font-size: 20px; }

.dept-hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dept-color);
  margin: 0 0 8px;
}
.dept-hero__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 600;
  margin: 0 0 10px;
  line-height: 1.08;
}
.dept-hero__tagline {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0;
}

.ridge-divider {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 60px;
  color: var(--bg-panel);
  z-index: 1;
}
.ridge-divider svg { width: 100%; height: 100%; display: block; }
.ridge-divider--footer { position: relative; height: 70px; color: var(--bg-panel); }

/* ---------- Department detail body ---------- */

.dept-detail { background: var(--bg-panel); padding: 64px 32px 96px; }

.dept-detail__grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
}

.dept-detail__heading {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 16px;
}
.dept-detail__desc { color: var(--text-muted); font-size: 16px; }

.side-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}
.side-card__title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 14px;
}
.req-list li {
  font-size: 14px;
  color: var(--text);
  padding: 9px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.req-list li:first-child { border-top: none; }
.req-list li::before { content: "—"; color: var(--accent); flex-shrink: 0; }

/* ---------- 404 ---------- */

.not-found {
  min-height: 64vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 80px 24px;
}
.not-found__badge { width: 84px; height: 94px; color: var(--text-faint); margin-bottom: 14px; }
.not-found__badge svg { width: 100%; height: 100%; }
.not-found__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 6px;
}
.not-found h1 { font-family: var(--font-display); font-size: 30px; margin: 0 0 6px; }
.not-found__desc { color: var(--text-muted); margin: 0 0 26px; max-width: 420px; }
.not-found__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- Footer ---------- */

.site-footer { background: var(--bg-panel); position: relative; }
.site-footer__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 32px 56px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.site-footer__crest { width: 44px; height: 44px; object-fit: contain; opacity: 0.9; }
.site-footer__title { font-family: var(--font-display); font-size: 16px; margin: 0; }
.site-footer__tag { font-size: 13px; color: var(--text-faint); margin: 2px 0 0; }
.site-footer__links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-left: auto;
  margin-right: 20px;
}
.site-footer__links a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.site-footer__links a:hover { color: var(--text); }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .dept-detail__grid { grid-template-columns: 1fr; }
  .dept-hero__inner { flex-direction: column; text-align: center; }
}

@media (max-width: 720px) {
  .site-header { padding: 12px 18px; flex-wrap: wrap; }
  .site-header.is-scrolled { padding: 10px 18px; }
  .dept-nav {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 6px;
    border-top: 1px solid var(--line);
    margin-top: 10px;
  }
  .dept-nav.is-open { display: flex; }
  .dept-nav__link {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
  }
  .dept-nav__link:last-child { border-bottom: none; }
  .nav-toggle { display: flex; width: 44px; height: 44px; }
  .btn--nav { display: none; }

  .hero { padding: 88px 20px 0; min-height: 560px; }
  .hero__actions { margin-bottom: 56px; gap: 12px; }
  .hero__desc { font-size: 15.5px; }

  .page-hero { padding: 120px 20px 60px; }
  .dept-hero { padding: 110px 20px 56px; }
  .dept-detail { padding: 44px 20px 64px; }
  .dept-detail__grid { gap: 32px; }

  .section-head { padding: 52px 20px 26px; }
  .about-teaser { padding: 60px 20px; }
  .about-body { padding: 44px 20px 8px; }
  .features { padding: 28px 20px 60px; }
  .cta { margin-left: 16px; margin-right: 16px; padding: 44px 22px; }

  .dept-grid { gap: 14px; }
  .dept-card { padding: 24px 20px; }

  .not-found { padding: 60px 20px; min-height: 56vh; }

  .site-footer__inner { flex-wrap: wrap; }
  .site-footer__links { margin: 0; order: 3; width: 100%; }
  .site-footer__inner .btn { width: 100%; }
}

@media (max-width: 400px) {
  .hero__title { font-size: 34px; }
  .dept-hero__title { font-size: 26px; }
}
