:root {
  --bg: #07131f;
  --bg-soft: #102033;
  --surface: rgba(10, 24, 41, 0.9);
  --surface-strong: rgba(9, 28, 47, 0.98);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --line: rgba(126, 196, 255, 0.18);
  --line-strong: rgba(126, 196, 255, 0.48);
  --text: #edf6ff;
  --muted: #9fb7ce;
  --brand: #83d0ff;
  --brand-strong: #d0edff;
  --brand-soft: rgba(131, 208, 255, 0.12);
  --brand-glow: rgba(131, 208, 255, 0.24);
  --accent: #f0c07b;
  --warning: #ffc96f;
  --danger: #ff8080;
  --success: #7addaa;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 16px 36px rgba(0, 0, 0, 0.18);
  --shadow-raise: 0 24px 54px rgba(0, 0, 0, 0.28);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --font-body: "Roboto", "Segoe UI", sans-serif;
  --font-display: "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-mono: "Roboto Mono", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(circle at top, rgba(131, 208, 255, 0.16), transparent 30%),
    radial-gradient(circle at 86% 14%, rgba(240, 192, 123, 0.1), transparent 18%),
    linear-gradient(180deg, #122133 0%, #09131f 38%, #040912 100%);
  letter-spacing: 0;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.86), transparent 94%);
}

body::after {
  background:
    linear-gradient(180deg, rgba(131, 208, 255, 0.035), transparent 22%, transparent 78%, rgba(240, 192, 123, 0.03)),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 10% 20%, rgba(131, 208, 255, 0.09), transparent 22%),
    radial-gradient(circle at 90% 8%, rgba(240, 192, 123, 0.06), transparent 18%);
  animation: atmosphere 16s ease-in-out infinite alternate;
}

a,
button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 72px;
  overflow-x: clip;
}

.shell::before,
.shell::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.shell::before {
  inset: 18px;
  border: 1px solid rgba(131, 208, 255, 0.08);
  clip-path: polygon(0 18px, 18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px));
  opacity: 0.7;
}

.shell::after {
  inset: 34px 28px auto 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(131, 208, 255, 0.42), transparent);
  box-shadow: 0 0 18px rgba(131, 208, 255, 0.2);
}

.topbar,
.hero,
.overview,
.filters,
.summary,
.section-card,
.section,
.sidebar-card,
.note-card,
.closing-note,
.empty-state {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-strong));
  box-shadow: var(--shadow);
  isolation: isolate;
  transform: translateZ(0);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), border-color 240ms ease, box-shadow 320ms ease, background 320ms ease;
}

.topbar::before,
.hero::before,
.overview::before,
.filters::before,
.summary::before,
.section-card::before,
.section::before,
.sidebar-card::before,
.note-card::before,
.closing-note::before,
.empty-state::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 10%, rgba(255, 255, 255, 0.04) 40%, transparent 70%),
    linear-gradient(180deg, rgba(131, 208, 255, 0.02), transparent 24%);
  transform: translateX(-120%);
  transition: transform 800ms ease;
}

.topbar::after,
.hero::after,
.overview::after,
.filters::after,
.summary::after,
.section-card::after,
.section::after,
.sidebar-card::after,
.note-card::after,
.closing-note::after,
.empty-state::after {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    radial-gradient(240px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(131, 208, 255, 0.12), transparent 38%),
    radial-gradient(180px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(240, 192, 123, 0.08), transparent 34%),
    linear-gradient(90deg, transparent, rgba(131, 208, 255, 0.04), transparent);
  opacity: 0;
  transition: opacity 260ms ease;
  pointer-events: none;
  z-index: 0;
}

.topbar:hover::before,
.hero:hover::before,
.overview:hover::before,
.filters:hover::before,
.summary:hover::before,
.section-card:hover::before,
.section:hover::before,
.sidebar-card:hover::before,
.note-card:hover::before,
.closing-note:hover::before,
.empty-state:hover::before {
  transform: translateX(120%);
}

.topbar:hover::after,
.hero:hover::after,
.overview:hover::after,
.filters:hover::after,
.summary:hover::after,
.section-card:hover::after,
.section:hover::after,
.sidebar-card:hover::after,
.note-card:hover::after,
.closing-note:hover::after,
.empty-state:hover::after {
  opacity: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 20px;
  backdrop-filter: blur(14px);
}

.topbar:hover {
  border-color: rgba(208, 237, 255, 0.22);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.28);
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--brand), #2c78bd);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 14px 26px rgba(131, 208, 255, 0.24);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-copy span,
.eyebrow,
.mini-label,
.table-meta,
.tag {
  display: block;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.69rem;
  color: var(--brand-strong);
}

.brand-copy strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.topbar-nav,
.hero-actions,
.chip-row,
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-nav a,
.hero-actions a,
.chip,
.jump-link,
.section-link,
.anchor-list a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease, background 180ms ease, box-shadow 220ms ease, color 180ms ease;
}

.nav-icon,
.action-icon {
  font-size: 0.92em;
  color: var(--brand-strong);
  flex: 0 0 auto;
}

.topbar-nav a::after,
.hero-actions a::after,
.chip::after,
.jump-link::after,
.section-link::after,
.anchor-list a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 12%, rgba(255, 255, 255, 0.16), transparent 42%);
  transform: translateX(-140%);
  transition: transform 400ms ease;
}

.topbar-nav a:hover,
.hero-actions a:hover,
.chip:hover,
.jump-link:hover,
.section-link:hover,
.anchor-list a:hover,
.chip.is-active {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: rgba(131, 208, 255, 0.12);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(208, 237, 255, 0.08);
}

.topbar-nav a:hover::after,
.hero-actions a:hover::after,
.chip:hover::after,
.jump-link:hover::after,
.section-link:hover::after,
.anchor-list a:hover::after,
.chip.is-active::after {
  transform: translateX(140%);
}

.topbar-nav a:focus-visible,
.hero-actions a:focus-visible,
.chip:focus-visible,
.jump-link:focus-visible,
.section-link:focus-visible,
.anchor-list a:focus-visible,
.search-box:focus-within {
  outline: none;
  border-color: rgba(208, 237, 255, 0.64);
  box-shadow: 0 0 0 4px rgba(131, 208, 255, 0.12), 0 14px 30px rgba(0, 0, 0, 0.2);
}

.hero,
.summary,
.overview,
.filters,
.section-card,
.section,
.sidebar-card,
.note-card,
.closing-note,
.empty-state {
  border-radius: var(--radius-lg);
}

.hero {
  margin-top: 24px;
  padding: 42px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(6, 18, 30, 0.72), rgba(6, 18, 30, 0.88)),
    linear-gradient(120deg, rgba(131, 208, 255, 0.18), rgba(7, 18, 31, 0.08)),
    url("banner.png") center/cover no-repeat,
    radial-gradient(circle at 88% 12%, rgba(240, 192, 123, 0.12), transparent 20%),
    linear-gradient(135deg, rgba(131, 208, 255, 0.15), transparent 42%),
    linear-gradient(180deg, rgba(14, 35, 56, 0.98), rgba(7, 18, 31, 0.98));
}

.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(131, 208, 255, 0.18), transparent 70%);
  animation: pulseGlow 8s ease-in-out infinite;
}

.hero:hover {
  transform: translateY(-4px);
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.38);
  border-color: rgba(208, 237, 255, 0.18);
}

.hero-grid,
.overview-grid,
.summary-grid,
.filters-grid,
.content-grid,
.layout,
.rules-grid,
.section-head {
  position: relative;
  z-index: 1;
  display: grid;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 28px;
  align-items: end;
}

.page-rules .hero-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  align-items: end;
}

.hero h1,
.section-card h2,
.section h2,
.sidebar-card h3,
.note-card h2,
.closing-note h2 {
  font-family: var(--font-display);
  font-weight: 700;
}

.hero h1 {
  margin: 12px 0 14px;
  font-size: clamp(2.8rem, 4vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-wrap: balance;
  text-shadow: 0 0 22px rgba(131, 208, 255, 0.1);
  text-transform: uppercase;
}

.page-rules .hero h1 {
  font-size: clamp(2.6rem, 4vw, 4.8rem);
}

.hero p,
.stat-card p,
.overview-card p,
.summary-card p,
.filters p,
.section-intro,
.rule-card p,
.sidebar-card p,
.sidebar-card li,
.note-card li,
.closing-note p,
.closing-note li,
footer {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.68;
}

.hero-copy {
  max-width: 760px;
}

.hero-actions {
  margin-top: 24px;
}

.hero-actions .primary {
  border-color: rgba(208, 237, 255, 0.52);
  background: linear-gradient(135deg, rgba(131, 208, 255, 0.26), rgba(131, 208, 255, 0.08));
}

.hero-panel,
.filters-side,
.sidebar,
.content {
  display: grid;
  gap: 14px;
}

.stat-card,
.overview-card,
.summary-card,
.rule-card,
.mini-panel {
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(126, 196, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), border-color 220ms ease, box-shadow 280ms ease, background 280ms ease;
}

.stat-card:hover,
.overview-card:hover,
.summary-card:hover,
.rule-card:hover,
.mini-panel:hover,
.sidebar-card:hover,
.section-card:hover,
.section:hover,
.note-card:hover,
.closing-note:hover {
  transform: translateY(-5px);
  border-color: rgba(208, 237, 255, 0.22);
  box-shadow: var(--shadow-raise), 0 0 0 1px rgba(208, 237, 255, 0.05);
}

.stat-card strong,
.overview-card strong,
.summary-card strong,
.mini-panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.03rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.overview,
.summary,
.filters {
  margin-top: 24px;
  padding: 26px;
}

.overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.filters-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.search-wrap {
  display: grid;
  gap: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 200ms ease, background 200ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.search-box span {
  color: var(--brand-strong);
  font-size: 1rem;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box input::placeholder {
  color: #7a93aa;
}

.search-box:hover {
  transform: translateY(-2px);
  border-color: rgba(208, 237, 255, 0.24);
  background: rgba(255, 255, 255, 0.03);
}

.chip {
  cursor: pointer;
  color: var(--text);
}

.legend {
  margin-top: 16px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.legend span:hover {
  transform: translateY(-2px);
  border-color: rgba(208, 237, 255, 0.2);
  background: rgba(131, 208, 255, 0.08);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-light { background: var(--brand); }
.dot-medium { background: var(--warning); }
.dot-heavy { background: #ff9f6b; }
.dot-critical { background: var(--danger); }

.content-grid,
.layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  margin-top: 24px;
  align-items: start;
  min-width: 0;
}

.content,
.sidebar,
.filters-grid,
.hero-grid,
.overview-grid,
.summary-grid,
.rules-grid {
  min-width: 0;
}

.section-card,
.section,
.sidebar-card,
.note-card,
.closing-note,
.empty-state {
  padding: 28px;
}

.section-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.section-card h2,
.section h2,
.closing-note h2 {
  margin: 0 0 10px;
  font-size: 1.58rem;
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.section-card h3,
.section h3,
.sidebar-card h3,
.note-card h2,
.closing-note h2,
.summary-card strong,
.stat-card strong,
.overview-card strong,
.mini-panel strong {
  text-wrap: balance;
}

.section-intro {
  margin: 0;
  max-width: 72ch;
}

.section-footer {
  margin-top: 20px;
}

.table-shell {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(126, 196, 255, 0.12);
  transition: border-color 220ms ease, box-shadow 260ms ease, transform 260ms ease;
}

.table-meta {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.68rem;
}

.table-shell:hover {
  border-color: rgba(208, 237, 255, 0.2);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.2);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(159, 183, 206, 0.12);
  text-align: left;
  vertical-align: top;
  font-size: 0.965rem;
  line-height: 1.45;
}

thead th {
  position: sticky;
  top: 0;
  background: #0d1a29;
  color: var(--brand-strong);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr {
  transition: background 180ms ease;
}

tbody tr:hover {
  background: var(--brand-soft);
}

tbody tr.is-hidden {
  display: none;
}

.rule-card.is-hidden {
  display: none;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.penalty {
  font-weight: 700;
  white-space: nowrap;
}

.penalty--light {
  color: var(--brand);
}

.penalty--medium {
  color: var(--warning);
}

.penalty--heavy {
  color: #ff9f6b;
}

.penalty--critical {
  color: var(--danger);
}

.inline-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(122, 221, 170, 0.18);
  background: rgba(122, 221, 170, 0.06);
  color: var(--muted);
}

.sidebar {
  position: sticky;
  top: 22px;
  align-self: start;
  gap: 18px;
}

.sidebar-card h3 {
  margin: 0 0 12px;
  font-size: 1.18rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.sidebar-card ul,
.note-card ul,
.closing-note ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.sidebar-card li,
.note-card li,
.closing-note li {
  position: relative;
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 0.98rem;
  line-height: 1.6;
}

.sidebar-card li::before,
.note-card li::before,
.closing-note li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--brand), rgba(131, 208, 255, 0.2));
  box-shadow: 0 0 10px rgba(131, 208, 255, 0.22);
}

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

.anchor-list a {
  display: block;
  border-radius: 14px;
  font-weight: 500;
}

.empty-state {
  display: none;
  margin-top: 22px;
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

footer {
  margin-top: 28px;
  padding-top: 24px;
  text-align: center;
  border-top: 1px solid rgba(159, 183, 206, 0.14);
}

.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.982);
  transition: opacity 820ms cubic-bezier(0.22, 1, 0.36, 1), transform 820ms cubic-bezier(0.22, 1, 0.36, 1), filter 820ms ease;
  filter: blur(6px);
}

.reveal-delay-1 {
  transition-delay: 80ms;
}

.reveal-delay-2 {
  transition-delay: 160ms;
}

body.is-ready .reveal.is-visible,
body.is-ready .reveal.is-instant {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

@keyframes atmosphere {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.7;
  }
  100% {
    transform: translate3d(0, 12px, 0) scale(1.04);
    opacity: 1;
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@media (max-width: 1100px) {
  .hero-grid,
  .overview-grid,
  .summary-grid,
  .filters-grid,
  .content-grid,
  .layout,
  .rules-grid,
  .section-head {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1320px);
    padding-top: 14px;
  }

  .topbar,
  .hero,
  .overview,
  .summary,
  .filters,
  .section-card,
  .section,
  .sidebar-card,
  .note-card,
  .closing-note,
  .empty-state {
    border-radius: 20px;
  }

  .topbar {
    padding: 14px;
  }

  .hero,
  .overview,
  .summary,
  .filters,
  .section-card,
  .section,
  .sidebar-card,
  .note-card,
  .closing-note,
  .empty-state {
    padding: 20px;
  }

  .topbar-nav,
  .hero-actions {
    width: 100%;
  }

  .topbar-nav a,
  .hero-actions a,
  .chip,
  .jump-link,
  .section-link {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 11vw, 3.6rem);
  }

  .shell::before,
  .shell::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
