:root {
  --font-body: "Source Sans 3", sans-serif;
  --font-display: "Space Grotesk", sans-serif;
  --bg: #f6f4f1;
  --bg-soft: #edf2f7;
  --ink: #0b1b2b;
  --muted: #50606d;
  --brand: #d61f2c;
  --brand-deep: #a20f1b;
  --brand-blue: #0b3a6d;
  --brand-teal: #1b8a84;
  --brand-gold: #f4c46a;
  --card: #ffffff;
  --glass: rgba(255, 255, 255, 0.9);
  --stroke: rgba(11, 27, 43, 0.12);
  --shadow: 0 24px 50px rgba(11, 27, 43, 0.12);
  --radius: 18px;
  --radius-lg: 28px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg), var(--bg-soft));
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(11, 27, 43, 0.04) 0 1px, transparent 1px 86px),
    repeating-linear-gradient(135deg, rgba(11, 27, 43, 0.03) 0 1px, transparent 1px 110px);
  pointer-events: none;
  opacity: 0.5;
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(214, 31, 44, 0.12), transparent 45%),
    radial-gradient(circle at 88% 18%, rgba(11, 58, 109, 0.18), transparent 40%),
    radial-gradient(circle at 22% 84%, rgba(27, 138, 132, 0.16), transparent 48%);
  z-index: -2;
}

body.theme-welcome {
  --brand: #c23b28;
  --brand-deep: #8f2416;
  --brand-blue: #622028;
  --brand-teal: #9a4a33;
  --brand-gold: #f0b35a;
  background: linear-gradient(180deg, #f9f0ea, #f2e7de);
}

body.theme-welcome::after {
  background:
    radial-gradient(circle at 12% 10%, rgba(194, 59, 40, 0.15), transparent 45%),
    radial-gradient(circle at 85% 18%, rgba(96, 32, 40, 0.16), transparent 45%),
    radial-gradient(circle at 20% 85%, rgba(240, 179, 90, 0.18), transparent 50%);
}

body.theme-welcome .site-header {
  background: rgba(249, 240, 234, 0.95);
}

body.theme-admin {
  --brand: #0b3a6d;
  --brand-deep: #072a52;
  --brand-blue: #0b3a6d;
  --brand-teal: #1b7c99;
  --brand-gold: #c6b078;
  background: linear-gradient(180deg, #edf2f9, #e4edf6);
}

body.theme-admin::after {
  background:
    radial-gradient(circle at 12% 12%, rgba(11, 58, 109, 0.12), transparent 45%),
    radial-gradient(circle at 85% 18%, rgba(27, 124, 153, 0.18), transparent 45%),
    radial-gradient(circle at 20% 85%, rgba(198, 176, 120, 0.14), transparent 50%);
}

body.theme-admin .site-header {
  background: rgba(237, 242, 249, 0.95);
}

body.theme-student {
  --brand: #1b8a84;
  --brand-deep: #116a64;
  --brand-blue: #0f5c6b;
  --brand-teal: #1b8a84;
  --brand-gold: #d7c27a;
  background: linear-gradient(180deg, #eef7f4, #e3f0ec);
}

body.theme-student::after {
  background:
    radial-gradient(circle at 12% 10%, rgba(27, 138, 132, 0.14), transparent 45%),
    radial-gradient(circle at 85% 18%, rgba(15, 92, 107, 0.18), transparent 45%),
    radial-gradient(circle at 20% 85%, rgba(215, 194, 122, 0.16), transparent 50%);
}

body.theme-student .site-header {
  background: rgba(238, 247, 244, 0.95);
}

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

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 244, 241, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--stroke);
  box-shadow: 0 12px 24px rgba(11, 27, 43, 0.12);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}

.brand-sub {
  font-size: 0.82rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 18px;
  font-size: 0.92rem;
  color: #1b2b3a;
  font-weight: 600;
}

.nav-links a {
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover {
  color: var(--brand-blue);
  border-bottom-color: rgba(11, 58, 109, 0.35);
}

.nav-links a[aria-current="page"],
.nav-links a.is-active {
  color: var(--brand);
  border-bottom-color: rgba(214, 31, 44, 0.45);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}

.site-header.nav-open .nav-toggle {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

.nav-cta {
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 14px 26px rgba(214, 31, 44, 0.28);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 16px 30px rgba(214, 31, 44, 0.3);
}

.btn-outline {
  border: 1px solid var(--brand);
  color: var(--brand);
  background: rgba(255, 255, 255, 0.7);
}

.btn-ghost {
  border: 1px solid var(--stroke);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.btn:hover {
  transform: translateY(-1px);
}

.section {
  padding: 78px 0;
}

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

.section-head h2 {
  font-family: var(--font-display);
  font-size: 2rem;
}

.section-note {
  max-width: 560px;
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: var(--brand-blue);
  font-weight: 700;
}

.hero {
  padding: 112px 0 70px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 15%, rgba(214, 31, 44, 0.12), transparent 45%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 3.3vw, 3.5rem);
  margin: 12px 0 16px;
}

.hero-lead {
  color: var(--muted);
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 24px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.metric-card {
  background: var(--glass);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--stroke);
  font-size: 0.85rem;
  color: var(--muted);
}

.metric-card span {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink);
  margin-top: 6px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.card.kicker {
  border-left: 4px solid var(--brand);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(11, 27, 43, 0.06);
  border: 1px solid var(--stroke);
  font-size: 0.75rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d4d;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.85);
  animation: live-pulse 1.4s infinite;
}

.status-good {
  background: rgba(27, 138, 132, 0.16);
  color: #0d5f59;
}

.status-warn {
  background: rgba(244, 196, 106, 0.22);
  color: #a36c0f;
}

.status-risk {
  background: rgba(214, 31, 44, 0.2);
  color: #9b1a25;
}

@keyframes live-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(1); opacity: 0.7; }
}

.live-panel {
  background: linear-gradient(140deg, rgba(11, 58, 109, 0.94), rgba(27, 138, 132, 0.9));
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 60px rgba(10, 22, 38, 0.4);
  color: #eef5f9;
  position: relative;
  overflow: hidden;
}

.live-panel::after {
  content: "";
  position: absolute;
  inset: -30% 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.16) 45%, transparent 70%);
  opacity: 0.65;
  animation: scan 8s infinite;
  pointer-events: none;
}

@keyframes scan {
  0% { transform: translateX(-60%); }
  100% { transform: translateX(60%); }
}

.live-panel .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.panel-item {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 12px;
  border-radius: 14px;
  font-size: 0.85rem;
}

.panel-item span {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-top: 6px;
}

.panel-row {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.panel-row div {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.list {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  list-style: none;
  padding-left: 0;
}

.list strong {
  color: var(--ink);
}

.list li {
  position: relative;
  padding-left: 22px;
}

.list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(11, 27, 43, 0.4);
  transform: translateY(-50%);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th,
.table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(11, 27, 43, 0.08);
}

.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.table tr:hover {
  background: rgba(11, 27, 43, 0.03);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(27, 138, 132, 0.12);
  border: 1px solid rgba(27, 138, 132, 0.3);
  font-size: 0.7rem;
  font-weight: 700;
  color: #0d5f59;
}

.alert {
  padding: 12px;
  border-radius: 14px;
  background: rgba(244, 196, 106, 0.18);
  border: 1px solid rgba(244, 196, 106, 0.35);
  font-size: 0.85rem;
}

.alert strong {
  display: block;
  margin-bottom: 4px;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(11, 27, 43, 0.08);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-gold));
}

.tab-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.map-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.8fr);
  align-items: stretch;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.map-panel {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 18px;
}

.map-canvas {
  position: relative;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(11, 58, 109, 0.12), rgba(27, 138, 132, 0.12));
  height: 420px;
  overflow: hidden;
}

.map-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 25% 35%, rgba(255, 255, 255, 0.35), transparent 45%);
  opacity: 0.6;
  z-index: 0;
}

.map-image {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
  opacity: 0.9;
  z-index: 1;
}

.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(11, 27, 43, 0.78);
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
}

.select-list {
  display: grid;
  gap: 10px;
}

.select-item {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(11, 27, 43, 0.12);
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  color: var(--ink);
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.select-item span {
  font-size: 0.8rem;
  color: var(--muted);
}

.select-item:hover {
  transform: translateY(-1px);
}

.select-item.is-active {
  border-color: rgba(214, 31, 44, 0.4);
  box-shadow: 0 14px 28px rgba(11, 27, 43, 0.12);
}

.detail-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(11, 27, 43, 0.04);
  font-size: 0.9rem;
  color: var(--muted);
}

.detail-row strong {
  color: var(--ink);
  font-weight: 600;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  border: 1px solid var(--stroke);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.feature-card span {
  font-size: 0.82rem;
  color: var(--muted);
}

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

.step-card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(214, 31, 44, 0.12);
  color: var(--brand-deep);
  font-weight: 700;
}

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

.quote-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  border: 1px solid var(--stroke);
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.quote-card p {
  color: var(--muted);
}

.quote-author {
  display: grid;
  gap: 2px;
  font-size: 0.85rem;
  color: var(--muted);
}

.quote-author strong {
  color: var(--ink);
}

.footer {
  padding: 30px 0 50px;
  border-top: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}

.footer-links {
  display: grid;
  gap: 6px;
}

.reveal {
  opacity: 0;
  animation: fade-up 0.8s ease forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Login theme */

body.login {
  background: linear-gradient(180deg, #f8f4f0, #edf2f7);
  color: var(--ink);
}

body.login::before {
  background:
    repeating-linear-gradient(90deg, rgba(11, 27, 43, 0.05) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(180deg, rgba(11, 27, 43, 0.05) 0 1px, transparent 1px 96px);
  opacity: 0.3;
}

body.login::after {
  background:
    radial-gradient(circle at 15% 10%, rgba(214, 31, 44, 0.1), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(11, 58, 109, 0.12), transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(27, 138, 132, 0.12), transparent 50%);
}

.login .site-header {
  background: rgba(248, 244, 240, 0.94);
  border-bottom: 1px solid var(--stroke);
}

.login-hero {
  padding: 110px 0 70px;
}

.login-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: start;
}

.login-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.login-card h1,
.login-card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.login-card p {
  color: var(--muted);
  font-size: 0.9rem;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.login-form label {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.login-form input,
.login-form select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(11, 27, 43, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-family: inherit;
}

.login-form input::placeholder {
  color: rgba(11, 27, 43, 0.45);
}

.login-form input:focus,
.login-form select:focus {
  outline: none;
  border-color: rgba(214, 31, 44, 0.6);
  box-shadow: 0 0 0 2px rgba(214, 31, 44, 0.2);
}

.login-hint {
  font-size: 0.75rem;
  color: rgba(11, 27, 43, 0.55);
}

.login-message {
  min-height: 18px;
  font-size: 0.78rem;
  color: #a85a1f;
}

.login .btn-ghost {
  border-color: rgba(11, 27, 43, 0.2);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
}

.login .live-panel {
  background: linear-gradient(140deg, rgba(11, 58, 109, 0.9), rgba(27, 138, 132, 0.88));
  color: #f5fbff;
}

.login .panel-item {
  background: rgba(255, 255, 255, 0.15);
}

.login .status-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f1fbff;
}

.login-side-note {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--stroke);
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 980px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: relative;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    background: var(--glass);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow);
    color: var(--ink);
    z-index: 20;
    font-size: 0.95rem;
  }

  .site-header.nav-open .nav-links {
    display: flex;
  }

  .map-grid {
    grid-template-columns: 1fr;
  }
}

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

  .login-hero {
    padding-top: 100px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-live::before,
  .live-panel::after,
  .reveal {
    animation: none;
  }
}
