/* =============================================================
   LONDON THAMES RPC — Design System
   Brand palette drawn from the community logo:
   deep Thames navy, London bus red, cream white, skyline motifs.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

/* ---- Tokens ---- */
:root {
  --bg:        #0a1120;
  --bg-2:      #0c1628;
  --panel:     #111d36;
  --panel-2:   #16254a;
  --panel-3:   #1b2d59;
  --line:      rgba(226, 233, 246, .10);
  --line-2:    rgba(226, 233, 246, .22);

  --text:      #edf1f8;
  --muted:     #a3b1c9;
  --muted-2:   #71809c;
  --cream:     #f0ebdd;

  --red:       #d8352f;
  --red-2:     #b3251f;
  --red-soft:  rgba(216, 53, 47, .12);

  --navy-logo: #1d3763;
  --blue:      #5f92d8;
  --blue-soft: rgba(95, 146, 216, .12);
  --discord:   #5865f2;

  --green:     #3ecf8e;
  --green-soft: rgba(62, 207, 142, .12);
  --amber:     #f0b23e;
  --amber-soft: rgba(240, 178, 62, .14);

  --font-display: 'Archivo', 'Arial Black', sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;

  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1240px;
  --header-h: 74px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --shadow-card: 0 18px 40px -22px rgba(2, 6, 16, .9);
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -.01em;
  font-weight: 800;
  text-wrap: balance;
}
p { text-wrap: pretty; }
::selection { background: var(--red); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 400;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 0 0 10px 10px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; }

/* ---- Layout ---- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 26px; }
main { min-height: 60vh; }
.section { padding: 62px 0; }
.section.tight { padding: 36px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { margin-bottom: 34px; max-width: 780px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head .kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}
.section-head .kicker::before {
  content: "";
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--red);
}
.section-head.center .kicker::after {
  content: "";
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--red);
}
.section-head h1, .section-head h2 { font-size: clamp(26px, 4vw, 38px); }
.section-head p { color: var(--muted); margin-top: 12px; font-size: 16px; }

.split-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.split-head .section-head { margin-bottom: 0; }

.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- Announcement bar ---- */
.topbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
}
.topbar a { color: var(--cream); }
.topbar a:hover { text-decoration: underline; }
.topbar-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  margin-right: 9px;
  vertical-align: 1px;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 220;
  background: rgba(9, 15, 29, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s var(--ease), background .25s var(--ease);
}
.site-header.scrolled { box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .85); background: rgba(9, 15, 29, .94); }
.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 26px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand img { width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(240, 235, 221, .14); }
.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: .02em;
  line-height: 1.1;
  color: var(--cream);
}
.brand-name span { color: var(--red); }
.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .26em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.main-nav > a, .nav-group > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: color .18s, background .18s;
}
.main-nav > a:hover, .nav-group > button:hover { color: var(--text); background: rgba(226, 233, 246, .06); }
.main-nav > a.active { color: var(--cream); }
.main-nav > a.active::after {
  content: "";
  display: block;
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--red);
}
.main-nav > a { position: relative; }

.nav-group { position: relative; }
.nav-group > button .caret { font-size: 10px; transition: transform .2s var(--ease); }
.nav-group.open > button .caret { transform: rotate(180deg); }
.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 218px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: none;
  box-shadow: var(--shadow-card);
}
.nav-group.open .nav-dropdown { display: block; animation: dropIn .18s var(--ease); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.nav-dropdown a:hover { background: rgba(226, 233, 246, .06); color: var(--text); }
.nav-dropdown a.active { color: var(--cream); background: var(--red-soft); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Account chip */
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 7px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color .18s, background .18s;
}
.account-chip:hover { border-color: var(--blue); background: var(--panel-2); }
.account-chip img { width: 27px; height: 27px; border-radius: 50%; }
.account-menu {
  position: absolute;
  top: calc(var(--header-h) - 8px);
  right: 26px;
  width: 240px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: none;
  z-index: 230;
  box-shadow: var(--shadow-card);
}
.account-menu.open { display: block; animation: dropIn .18s var(--ease); }
.account-menu .acct-head { padding: 9px 11px 11px; border-bottom: 1px solid var(--line); margin-bottom: 7px; }
.account-menu .acct-head strong { display: block; font-size: 14.5px; }
.account-menu .acct-head span { font-size: 12.5px; color: var(--muted-2); }
.account-menu a, .account-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 7px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.account-menu a:hover, .account-menu button:hover { background: rgba(226, 233, 246, .06); color: var(--text); }
.account-menu .danger:hover { background: var(--red-soft); color: #ff8f8a; }

/* Hamburger + mobile drawer */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.hamburger span { height: 2px; background: var(--cream); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(5, 9, 18, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}
.mobile-nav.open { opacity: 1; pointer-events: auto; }
.mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(330px, 88vw);
  background: var(--bg-2);
  border-left: 1px solid var(--line-2);
  padding: 18px 20px 30px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .28s var(--ease);
}
.mobile-nav.open .mobile-nav-panel { transform: none; }
.mobile-nav-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mobile-nav-head img { width: 40px; height: 40px; border-radius: 50%; }
.mobile-nav-close {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}
.mobile-nav-panel a {
  display: block;
  padding: 12px 10px;
  border-radius: 8px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--muted);
}
.mobile-nav-panel a:hover, .mobile-nav-panel a.active { color: var(--cream); background: rgba(226, 233, 246, .06); }
.mobile-nav-label {
  display: block;
  margin: 16px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.mobile-nav-cta { margin-top: 22px; display: grid; gap: 10px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.small { padding: 8px 15px; font-size: 13.5px; border-radius: 8px; }
.btn.block { width: 100%; }

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #c22e29; }

.btn-ghost { background: transparent; color: var(--cream); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--cream); background: rgba(240, 235, 221, .06); }

.btn-discord { background: var(--discord); color: #fff; }
.btn-discord:hover { background: #4a56d8; }

.btn-success { background: var(--green); color: #06251b; }
.btn-success:hover { background: #57dca0; }
.btn-danger { background: transparent; color: #ff8f8a; border-color: rgba(216, 53, 47, .45); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-neutral { background: var(--panel-2); color: var(--text); border-color: var(--line-2); }
.btn-neutral:hover { border-color: var(--muted); }

.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }

.text-link { color: var(--blue); font-weight: 600; }
.text-link:hover { text-decoration: underline; }

/* ---- Badges & pills ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  background: rgba(226, 233, 246, .04);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { color: var(--green); border-color: rgba(62, 207, 142, .35); background: var(--green-soft); }
.badge.red { color: #ff8f8a; border-color: rgba(216, 53, 47, .4); background: var(--red-soft); }
.badge.amber { color: var(--amber); border-color: rgba(240, 178, 62, .35); background: var(--amber-soft); }
.badge.blue { color: var(--blue); border-color: rgba(95, 146, 216, .35); background: var(--blue-soft); }
.badge.neutral { color: var(--muted); }

/* ---- Cards ---- */
.card {
  background: linear-gradient(160deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  transition: transform .22s var(--ease), border-color .22s, box-shadow .25s var(--ease);
}
.card.hoverable:hover, a.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-card);
}
.card h3 { font-size: 19px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14.5px; }

.card-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(226, 233, 246, .04);
  color: var(--red);
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.card-icon.blue { color: var(--blue); }
.card-icon.green { color: var(--green); }
.card-icon.amber { color: var(--amber); }
.card-icon svg { width: 20px; height: 20px; }

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0e1a33 0%, var(--bg) 92%);
}
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 190px;
  background: url("../assets/skyline.svg") bottom center / cover no-repeat;
  opacity: .22;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 92px 26px 150px;
  text-align: center;
}
.hero .badge { margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(38px, 6.4vw, 66px);
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--cream);
  max-width: 900px;
  margin: 0 auto;
}
.hero h1 .accent { color: var(--red); }
.hero-sub {
  max-width: 640px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: clamp(15.5px, 2vw, 18px);
}
.hero-actions { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero.subpage { border-bottom: 1px solid var(--line); }
.hero.subpage .hero-inner { padding: 66px 26px 96px; }
.hero.subpage::after { height: 130px; opacity: .25; }

/* ---- Stats band ---- */
.stat-band {
  position: relative;
  z-index: 2;
  max-width: var(--wrap);
  margin: -62px auto 0;
  padding: 0 26px;
}
.stat-band-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.stat-cell {
  padding: 24px 20px;
  text-align: center;
  border-right: 1px solid var(--line);
}
.stat-cell:last-child { border-right: 0; }
.stat-value {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(24px, 3vw, 32px);
  color: var(--cream);
  line-height: 1;
}
.stat-value .unit { font-size: .55em; color: var(--muted); font-weight: 700; }
.stat-label {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---- Server status widget ---- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(9, 15, 29, .6);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex-shrink: 0; }
.status-pill.online { color: var(--green); border-color: rgba(62, 207, 142, .4); }
.status-pill.online .dot { background: var(--green); }
.status-pill.offline { color: #ff8f8a; border-color: rgba(216, 53, 47, .4); }
.status-pill.offline .dot { background: var(--red); }

/* ---- Live gallery cards (hover / auto cycle) ---- */
.live-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.live-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(160deg, var(--panel-2), var(--bg-2));
  overflow: hidden;
}
.live-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .8s var(--ease), transform 6s linear;
}
.live-media img.active { opacity: 1; transform: scale(1.05); }
.live-media .live-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(9, 15, 29, .8);
  border: 1px solid var(--line-2);
  color: var(--cream);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 5px 11px;
  border-radius: 999px;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}
.live-media .live-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.live-media .hover-note {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(9, 15, 29, .72);
  padding: 4px 10px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity .25s;
}
.live-card:hover .hover-note { opacity: 1; }
.live-media .media-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted-2);
  font-size: 13.5px;
  background:
    radial-gradient(400px 200px at 50% 0%, rgba(95, 146, 216, .1), transparent),
    url("../assets/skyline.svg") bottom center / cover no-repeat;
  background-color: var(--bg-2);
}
.live-body { padding: 18px 22px 22px; }
.live-body h3 { font-size: 17px; }
.live-body p { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

/* ---- Department cards ---- */
.dept-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.dept-banner {
  position: relative;
  padding: 28px 24px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--dept-accent, var(--blue));
  background: linear-gradient(160deg, var(--panel-2), var(--bg-2));
}
.dept-crest {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  background: rgba(240, 235, 221, .95);
  padding: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .7);
}
.dept-crest img { max-height: 100%; object-fit: contain; }
.dept-banner h3 { font-size: 20px; }
.dept-banner .dept-tag { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 3px; display: block; }
.dept-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.dept-body ul { list-style: none; display: grid; gap: 8px; }
.dept-body li { display: flex; gap: 10px; font-size: 14px; color: var(--muted); }
.dept-body li::before { content: "›"; color: var(--red); font-weight: 800; }
.dept-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---- Staff cards ---- */
.staff-card { text-align: center; padding: 30px 22px 26px; }
.staff-avatar {
  width: 86px;
  height: 86px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--panel-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  border: 2px solid var(--line-2);
}
.staff-avatar svg { width: 32px; height: 32px; }
.staff-avatar img { width: 100%; height: 100%; object-fit: cover; }
.staff-card .role {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
}
.staff-card .role.blue { color: var(--blue); }
.staff-card .role.amber { color: var(--amber); }
.staff-card h3 { margin-top: 7px; font-size: 17.5px; }
.staff-card p { margin-top: 6px; font-size: 13.5px; }

/* ---- News ---- */
.news-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.news-media { aspect-ratio: 16/8; background: linear-gradient(160deg, var(--panel-2), var(--bg-2)); position: relative; overflow: hidden; }
.news-media img { width: 100%; height: 100%; object-fit: cover; }
.news-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.news-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted-2); font-weight: 600; }
.news-meta .cat { color: var(--red); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; }
.news-body h3 { font-size: 18px; }
.news-body p { font-size: 14px; }

/* ---- Accordion (rules / FAQ) ---- */
.accordion { display: grid; gap: 12px; }
.acc-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  overflow: hidden;
  transition: border-color .2s;
}
.acc-item[open] { border-color: var(--line-2); }
.acc-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
  font-weight: 700;
  font-size: 15.5px;
  color: var(--cream);
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary .acc-num {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--red);
  font-size: 14px;
  min-width: 30px;
}
.acc-item summary .chev { margin-left: auto; color: var(--muted-2); transition: transform .22s var(--ease); font-size: 12px; }
.acc-item[open] summary .chev { transform: rotate(180deg); }
.acc-content { padding: 0 20px 20px 64px; color: var(--muted); font-size: 14.5px; }
.acc-content ul { margin: 8px 0 0 18px; display: grid; gap: 7px; }

/* ---- Steps (join page) ---- */
.steps { display: grid; gap: 0; position: relative; }
.step {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 20px;
  padding-bottom: 34px;
  position: relative;
}
.step::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 58px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--line-2), transparent);
}
.step:last-child::before { display: none; }
.step-num {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--red-soft);
  border: 1px solid rgba(216, 53, 47, .35);
  color: var(--red);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step h3 { font-size: 19px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14.5px; max-width: 620px; }
.step .step-extra { margin-top: 12px; }

.connect-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: 'Consolas', 'Menlo', monospace;
  font-size: 14.5px;
  color: var(--cream);
  max-width: 460px;
}
.connect-box code { flex: 1; overflow-x: auto; white-space: nowrap; }
.copy-btn {
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: color .18s, border-color .18s;
}
.copy-btn:hover { color: var(--cream); border-color: var(--cream); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* ---- Forms ---- */
.form-grid { display: grid; gap: 20px; }
.field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 8px;
}
.field label .req { color: var(--red); }
.field label .count { font-size: 12px; color: var(--muted-2); font-weight: 600; }
.field label .count.bad { color: #ff8f8a; }
.field input[type="text"], .field textarea, .field select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 12px 14px;
  transition: border-color .18s, box-shadow .18s;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(95, 146, 216, .18);
}
.field .hint { margin-top: 7px; font-size: 12.5px; color: var(--muted-2); }
.field.invalid input, .field.invalid textarea { border-color: var(--red); }
.field .error-note { margin-top: 7px; font-size: 12.5px; color: #ff8f8a; display: none; }
.field.invalid .error-note { display: block; }

/* ---- Alerts / notices ---- */
.notice {
  display: flex;
  gap: 13px;
  padding: 15px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel);
  font-size: 14px;
  color: var(--muted);
  align-items: flex-start;
}
.notice .n-icon { color: var(--muted); display: flex; padding-top: 2px; flex-shrink: 0; }
.notice .n-icon svg { width: 18px; height: 18px; }
.notice strong { color: var(--text); }
.notice.red { border-color: rgba(216, 53, 47, .4); background: var(--red-soft); }
.notice.red .n-icon { color: #ff8f8a; }
.notice.green { border-color: rgba(62, 207, 142, .4); background: var(--green-soft); }
.notice.green .n-icon { color: var(--green); }
.notice.amber { border-color: rgba(240, 178, 62, .4); background: var(--amber-soft); }
.notice.amber .n-icon { color: var(--amber); }
.notice.blue { border-color: rgba(95, 146, 216, .4); background: var(--blue-soft); }
.notice.blue .n-icon { color: var(--blue); }

/* ---- Toasts ---- */
.toast-region {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 400;
  display: grid;
  gap: 10px;
  max-width: min(380px, calc(100vw - 44px));
}
.toast {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--blue);
  color: var(--text);
  font-size: 14px;
  padding: 13px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  animation: toastIn .25s var(--ease);
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- Loading / skeleton / empty states ---- */
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--line-2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 46px 20px;
  color: var(--muted-2);
  font-size: 14px;
}
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state {
  text-align: center;
  padding: 52px 24px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--muted-2);
}
.empty-state .e-icon { display: flex; justify-content: center; margin-bottom: 14px; opacity: .55; }
.empty-state .e-icon svg { width: 30px; height: 30px; }
.empty-state h3 { color: var(--muted); font-size: 17px; margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; max-width: 420px; margin: 0 auto; }

/* ---- Application status list (dashboard) ---- */
.ticket-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  transition: border-color .2s;
  flex-wrap: wrap;
}
.ticket-row:hover { border-color: var(--line-2); }
.ticket-row .t-id {
  font-family: 'Consolas', monospace;
  font-size: 12.5px;
  color: var(--muted-2);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 9px;
}
.ticket-row .t-name { font-weight: 700; color: var(--cream); font-size: 15px; }
.ticket-row .t-date { font-size: 12.5px; color: var(--muted-2); }
.ticket-row .t-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ticket-row .t-reason { width: 100%; font-size: 13px; color: var(--muted); background: var(--bg-2); border-radius: 8px; padding: 10px 13px; border: 1px solid var(--line); }

/* ---- Staff review table/cards ---- */
.review-layout { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.review-side { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 10px; }
.review-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: border-color .18s, color .18s;
}
.review-filter:hover { border-color: var(--line-2); color: var(--text); }
.review-filter.active { border-color: rgba(216, 53, 47, .45); color: var(--cream); background: var(--red-soft); }
.review-filter .count-chip {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--muted);
  min-width: 28px;
  text-align: center;
  border-radius: 999px;
  font-size: 12px;
  padding: 2px 8px;
}
.review-filter.active .count-chip { border-color: rgba(216, 53, 47, .45); color: #ff8f8a; }

/* Detail drawer/modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(4, 8, 16, .68);
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 5vh 18px 40px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(760px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  animation: modalIn .22s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 19px; }
.modal-head .modal-close {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}
.modal-body { padding: 22px 24px; display: grid; gap: 18px; }
.qa-item { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.qa-item .qa-q {
  padding: 10px 15px;
  background: var(--panel);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.qa-item .qa-q .qa-num { color: var(--red); margin-right: 7px; }
.qa-item .qa-a { padding: 13px 15px; font-size: 14.5px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 24px 24px; }

/* ---- Site management panel ---- */
.m-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  flex-wrap: wrap;
}
.m-row .m-main { flex: 1; min-width: 200px; }
.m-row .m-title { font-weight: 700; color: var(--cream); font-size: 14.5px; }
.m-row .m-sub { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; }
.m-row .m-actions { display: flex; gap: 6px; align-items: center; }
.m-thumb {
  width: 52px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  flex-shrink: 0;
}
.icon-btn-sm {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  transition: color .15s, border-color .15s;
}
.icon-btn-sm:hover { color: var(--cream); border-color: var(--cream); }
.icon-btn-sm.danger:hover { color: #ff8f8a; border-color: var(--red); }
.icon-btn-sm[disabled] { opacity: .35; pointer-events: none; }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.thumb-pick {
  position: relative;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-2);
  padding: 0;
  transition: border-color .15s;
}
.thumb-pick img { width: 100%; height: 76px; object-fit: cover; display: block; }
.thumb-pick:hover { border-color: var(--blue); }
.thumb-pick .thumb-name {
  display: block;
  font-size: 10.5px;
  color: var(--muted-2);
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-savebar {
  position: sticky;
  bottom: 14px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  margin-top: 22px;
}
.m-savebar .m-dirty { font-size: 13px; color: var(--amber); }
.m-savebar .m-clean { font-size: 13px; color: var(--muted-2); }

.field input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--red);
}
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--cream); font-weight: 600; cursor: pointer; }

/* ---- Discord CTA band ---- */
.cta-band {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 44px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  flex-wrap: wrap;
  border-left: 3px solid var(--red);
  background: linear-gradient(160deg, var(--panel-2), var(--bg-2));
}
.cta-band h2 { font-size: clamp(22px, 3vw, 30px); }
.cta-band p { color: var(--muted); margin-top: 8px; max-width: 520px; }
.cta-band .cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- Footer ---- */
.site-footer { margin-top: 70px; background: #070d1a; border-top: 1px solid var(--line); position: relative; }
.footer-skyline {
  height: 120px;
  background: url("../assets/skyline.svg") bottom center / cover no-repeat;
  opacity: .22;
  border-bottom: 1px solid var(--line);
}
.footer-main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 46px 26px 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 34px;
}
.footer-brand { display: grid; gap: 14px; align-content: start; }
.footer-brand .brand img { width: 52px; height: 52px; }
.footer-brand p { color: var(--muted-2); font-size: 13.5px; max-width: 300px; }
.footer-socials { display: flex; gap: 10px; }
.footer-socials a {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--muted);
  transition: color .18s, border-color .18s, transform .18s;
}
.footer-socials a:hover { color: var(--cream); border-color: var(--cream); transform: translateY(-2px); }
.footer-col h4 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 15px;
}
.footer-col a { display: block; padding: 5px 0; color: var(--muted); font-size: 14px; transition: color .16s; }
.footer-col a:hover { color: var(--cream); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 26px 26px;
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted-2);
  font-size: 12.5px;
}

/* ---- Back to top ---- */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--cream);
  font-size: 17px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top:hover { border-color: var(--red); color: var(--red); }

/* ---- Reveal animations ---- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .06s; }
.reveal-d2 { transition-delay: .14s; }
.reveal-d3 { transition-delay: .22s; }
.reveal-d4 { transition-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .live-media img.active { transform: none; }
}

/* ---- Page content helpers ---- */
.prose { color: var(--muted); display: grid; gap: 14px; font-size: 15px; max-width: 720px; }
.prose strong { color: var(--text); }
.prose h3 { color: var(--cream); margin-top: 10px; }

.two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Responsive ---- */
@media (max-width: 1080px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .review-layout { grid-template-columns: 1fr; }
  .review-side { position: static; display: flex; flex-wrap: wrap; }
  .review-filter { width: auto; }
}

@media (max-width: 900px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .two-col { grid-template-columns: 1fr; gap: 26px; }
  .stat-band-inner { grid-template-columns: repeat(2, 1fr); }
  .stat-cell:nth-child(2) { border-right: 0; }
  .stat-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap, .header-inner { padding-left: 18px; padding-right: 18px; }
  /* The drawer carries the Apply CTA on phones - keep the header uncramped. */
  .header-actions > .btn-primary { display: none; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .section { padding: 46px 0; }
  .hero-inner { padding: 64px 18px 130px; }
  .brand-name { font-size: 15px; }
  .brand-sub { letter-spacing: .18em; }
  .footer-main { grid-template-columns: 1fr; gap: 26px; }
  .cta-band { padding: 32px 24px; }
  .step { grid-template-columns: 46px 1fr; gap: 14px; }
  .step-num { width: 46px; height: 46px; font-size: 17px; border-radius: 12px; }
  .step::before { left: 22px; top: 48px; }
  .acc-content { padding-left: 20px; }
  .account-chip .chip-name { display: none; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }
}
