:root {
  --bg: #f6f9fc;
  --bg-soft: #eef5fb;
  --text: #0f172a;
  --muted: #475569;
  --brand: #0b4a7f;
  --brand-2: #0f66a5;
  --accent: #ffd166;
  --card: #ffffff;
  --line: #e2e8f0;
  --success: #059669;
  --danger: #dc2626;
  --radius: 16px;
  --shadow-md: 0 8px 24px rgba(2, 6, 23, 0.08);
  --shadow-lg: 0 18px 40px rgba(2, 6, 23, 0.12);
  --nav-h: 88px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html:focus-within { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background:
    radial-gradient(1200px 800px at 15% -10%, var(--bg-soft), transparent 60%),
    radial-gradient(1400px 900px at 110% 10%, #dbeafe55, transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; }

a { color: var(--brand-2); }

a:hover { color: var(--brand); }

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 200;
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  gap: 16px;
}

.nav-list {
  display: flex;
  gap: 6px 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.95rem;
}
.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(11, 74, 127, 0.1);
  color: var(--brand);
  outline: none;
}
.nav-link.is-active {
  background: rgba(11, 74, 127, 0.12);
  color: var(--brand);
}

.logo-link { display: block; line-height: 0; flex-shrink: 0; }
.logo-img { height: 72px; width: auto; display: block; object-fit: contain; }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
  font-family: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); color: #fff; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-ghost {
  background: transparent;
  color: var(--brand-2);
  border: 1px solid var(--brand-2);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(15, 102, 165, 0.08); color: var(--brand); }
.btn-on-dark {
  background: #fff;
  color: var(--brand);
}
.btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.hero { padding: 72px 20px 56px; }
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.kicker {
  color: var(--brand-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
}
.headline {
  font-weight: 800;
  font-size: clamp(32px, 4.4vw, 54px);
  line-height: 1.1;
  margin: 10px 0 16px;
}
.lede { color: var(--muted); max-width: 60ch; margin: 0; }
.cta-row { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-art {
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  min-height: 280px;
  box-shadow: var(--shadow-md);
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

section { padding: clamp(48px, 8vw, 88px) 20px; }
.wrap { max-width: 1200px; margin: 0 auto; }
.section-title {
  text-align: center;
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 800;
  margin: 0 0 12px;
}
.section-lede {
  text-align: center;
  color: var(--muted);
  max-width: 70ch;
  margin: 0 auto;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: clamp(20px, 3.6vw, 28px);
  border: 1px solid var(--line);
  max-width: 900px;
  margin: 24px auto 0;
}

.band { background: var(--bg-soft); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 36px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card h3 { margin: 0; font-size: 1.35rem; color: var(--brand); }
.card p { margin: 0; color: var(--muted); flex: 1; }
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
  gap: 24px;
  margin-top: 40px;
  justify-content: center;
}
.board-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 28px 20px;
  text-align: center;
}
.board-card h3 { margin: 0 0 6px; font-size: 1.2rem; }
.board-role { color: var(--brand); font-size: 0.95rem; font-weight: 700; }

.fb-wrap { max-width: 1300px; margin: 0 auto; }
.fb-container { max-width: 500px; margin: 24px auto 0; }
.fb-page { border-radius: 12px; overflow: hidden; }

.contact-row { display: grid; gap: 8px; }
.contact-row a { font-weight: 600; }

.footer {
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  padding: 40px 20px 50px;
  background: rgba(255, 255, 255, 0.7);
}
.footer small { display: block; margin-top: 8px; }

/* Simulator chrome */
.sim-page { padding: 28px 20px 64px; }
.sim-wrap { max-width: 1100px; margin: 0 auto; }
.sim-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 700;
  color: var(--brand-2);
  margin-bottom: 16px;
}
.sim-back:hover { color: var(--brand); }
.sim-header { margin-bottom: 20px; }
.sim-header h1 { margin: 0 0 6px; color: var(--brand); font-size: clamp(1.6rem, 3vw, 2.1rem); }
.sim-header p { margin: 0; color: var(--muted); }

.tabs {
  display: flex;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px;
  border-radius: 999px;
  width: fit-content;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
}
.tab {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
}
.tab[aria-selected="true"] {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}
.tab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.panel-hidden { display: none !important; }

.atlas-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
.atlas-list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.atlas-item {
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.atlas-item:hover,
.atlas-item:focus-visible { background: var(--bg-soft); outline: none; }
.atlas-item[aria-current="true"] {
  background: rgba(11, 74, 127, 0.12);
  color: var(--brand);
}

.atlas-view {
  background: #0b1220;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid #0b1220;
}
.scan-frame {
  position: relative;
  background: #000;
  min-height: 280px;
}
.scan-frame canvas,
.scan-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  margin: 0 auto;
  background: #000;
}
.teaching-note {
  background: #fff;
  padding: 18px 22px 20px;
  border-top: 4px solid var(--accent);
}
.teaching-note h2 { margin: 0 0 8px; font-size: 1.15rem; color: var(--brand); }
.teaching-note p { margin: 0; color: var(--muted); }

.stats-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.quiz-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px;
}
.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.btn-choice {
  padding: 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand);
  background: #fff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.btn-choice kbd {
  float: right;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  background: #f8fafc;
}
.btn-choice:hover:not(:disabled) {
  border-color: var(--brand-2);
  background: #eff6ff;
  transform: translateY(-1px);
}
.btn-choice:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-choice:disabled { opacity: 0.85; cursor: not-allowed; }
.btn-choice.correct { background: var(--success); color: #fff; border-color: var(--success); }
.btn-choice.wrong { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-choice.missed { border-color: var(--success); background: #d1fae5; color: #065f46; }
.btn-choice.correct kbd,
.btn-choice.wrong kbd { color: inherit; border-color: transparent; background: transparent; }

.feedback-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: #f8fafc;
  border-left: 4px solid var(--brand-2);
  display: none;
}
.feedback-panel.is-open { display: block; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.status-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  display: none;
}
.status-banner.is-open { display: block; }

@media (max-width: 860px) {
  .nav { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .nav-list {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 12px;
  }
  .nav-list.is-open { display: flex; }
  .logo-img { height: 52px; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .lede { margin-inline: auto; }
  .cta-row { justify-content: center; }
  .hero-art { margin-top: 8px; height: 240px; min-height: 0; }
  .card-grid { grid-template-columns: 1fr; }
  .atlas-layout { grid-template-columns: 1fr; }
  .button-grid { grid-template-columns: 1fr; }
  .fb-container { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .btn-choice { transition: none; }
}
