:root {
  --bg: #07111f;
  --bg-soft: rgba(14, 28, 48, 0.72);
  --panel: rgba(12, 24, 43, 0.82);
  --panel-strong: rgba(15, 33, 59, 0.94);
  --border: rgba(151, 206, 255, 0.18);
  --border-strong: rgba(124, 247, 207, 0.28);
  --text: #edf6ff;
  --muted: #9eb4cb;
  --accent: #62d0ff;
  --accent-2: #7cf7cf;
  --accent-3: #ffd46f;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(98, 208, 255, 0.16), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(124, 247, 207, 0.12), transparent 20%),
    radial-gradient(circle at 70% 80%, rgba(255, 212, 111, 0.09), transparent 24%),
    linear-gradient(160deg, #030813 0%, #07111f 45%, #0a1830 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(40px);
  z-index: -1;
}

body::before {
  width: 18rem;
  height: 18rem;
  top: 6rem;
  right: -4rem;
  background: rgba(98, 208, 255, 0.18);
}

body::after {
  width: 22rem;
  height: 22rem;
  bottom: 5rem;
  left: -6rem;
  background: rgba(124, 247, 207, 0.12);
}

a {
  color: var(--accent);
}

img,
iframe {
  max-width: 100%;
}

.page-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.topbar {
  position: sticky;
  top: 1rem;
  z-index: 20;
  margin: 0 auto 2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(5, 13, 25, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #04111b;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 24px rgba(98, 208, 255, 0.35);
}

.brand-copy strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-copy span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.7rem 1rem;
  font: inherit;
}

.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: transform 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.primary-nav a.is-current {
  color: var(--text);
  background: rgba(98, 208, 255, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.site-main {
  display: grid;
  gap: 1.5rem;
}

.page-hero,
.content-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.page-hero {
  position: relative;
  overflow: hidden;
  padding: 2rem;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: -30% auto auto -8%;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(98, 208, 255, 0.2), transparent 65%);
  z-index: 0;
}

.page-hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(124, 247, 207, 0.2);
  border-radius: 999px;
  color: var(--accent-2);
  background: rgba(124, 247, 207, 0.08);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-hero h1 {
  margin: 1rem 0 0.6rem;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.page-hero p {
  margin: 0;
  max-width: 46rem;
  color: #d6e7f7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.25s ease, background 0.25s ease;
}

.hero-link:hover,
.hero-link:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.hero-link-primary {
  color: #031018;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.hero-link-secondary {
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.content-panel {
  padding: 1.5rem;
}

.legacy-shell-table {
  width: 100%;
  border-collapse: collapse;
}

.legacy-shell-table > tbody > tr > td {
  padding: 0;
}

.legacy-content {
  color: #ebf3ff;
}

.legacy-content center {
  text-align: center;
}

.legacy-content font,
.legacy-content p,
.legacy-content td,
.legacy-content li,
.legacy-content div {
  font-family: inherit !important;
}

.legacy-content font[size="6"],
.legacy-content font[size="5"],
.legacy-content h2,
.legacy-content h3 {
  color: var(--text);
}

.legacy-content p,
.legacy-content td,
.legacy-content li,
.legacy-content font[size="3"],
.legacy-content font[size="4"] {
  font-size: 1rem;
}

.legacy-content table {
  width: 100% !important;
  max-width: 100%;
  border-color: rgba(151, 206, 255, 0.14);
}

.legacy-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.legacy-content iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: var(--radius-md);
}

.legacy-content .embed-shell {
  width: min(100%, 100%);
  margin: 1.2rem auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(4, 10, 19, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.legacy-content .embed-shell iframe {
  height: 100%;
}

.legacy-content p.ex {
  width: auto !important;
  max-width: 78ch;
  margin: 1.4rem auto 0;
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(151, 206, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.legacy-content u {
  text-decoration: none;
  font-weight: 800;
  color: var(--accent-2);
}

.legacy-content form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  justify-content: center;
  margin: 1rem 0;
}

.legacy-content input,
.legacy-content select,
.legacy-content textarea,
.legacy-content button {
  font: inherit;
}

.legacy-content input,
.legacy-content select,
.legacy-content textarea {
  min-height: 2.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.legacy-content button {
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  color: #031018;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
}

.legacy-content .generatorButton.stopTuning {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.page-type-category .legacy-content > .legacy-shell-table > tbody > tr > td > table {
  border-collapse: separate;
  border-spacing: 0 1rem;
}

.page-type-category .legacy-content > .legacy-shell-table > tbody > tr > td > table tr {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr);
  gap: 1.1rem;
  align-items: stretch;
}

.page-type-category .legacy-content > .legacy-shell-table > tbody > tr > td > table td {
  display: block;
  padding: 1rem;
  border: 1px solid rgba(151, 206, 255, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  vertical-align: top;
}

.page-type-category .legacy-content > .legacy-shell-table > tbody > tr > td > table td:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-type-category .legacy-content > .legacy-shell-table > tbody > tr > td > table img {
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.page-type-article .legacy-content > .legacy-shell-table > tbody > tr > td {
  max-width: 76ch;
  margin: 0 auto;
}

.page-type-article .legacy-content table td {
  padding: 1rem;
}

.page-type-simulation .legacy-content > .legacy-shell-table > tbody > tr > td {
  text-align: center;
}

.site-footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.94rem;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--max-width));
    padding-top: 0.5rem;
  }

  .topbar {
    top: 0.5rem;
    border-radius: 28px;
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .primary-nav {
    width: 100%;
    display: none;
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav ul {
    justify-content: flex-start;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding-top: 0.8rem;
  }

  .primary-nav a {
    width: 100%;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
  }

  .page-hero,
  .content-panel {
    padding: 1.2rem;
    border-radius: 22px;
  }

  .page-type-category .legacy-content > .legacy-shell-table > tbody > tr > td > table tr {
    grid-template-columns: 1fr;
  }

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