:root {
  --bg: #081018;
  --panel: rgba(12, 22, 31, 0.82);
  --panel-strong: rgba(14, 28, 39, 0.94);
  --panel-elevated: rgba(16, 31, 44, 0.94);
  --line: rgba(118, 180, 214, 0.12);
  --line-strong: rgba(118, 180, 214, 0.24);
  --line-soft: rgba(255, 255, 255, 0.05);
  --text: #f2f8fb;
  --muted: #9db3c0;
  --muted-strong: #bdd0da;
  --accent: #86d9ff;
  --accent-strong: #38aef6;
  --accent-cool: #89ebcb;
  --safe: #8fe4c0;
  --optimal: #ffd980;
  --extreme: #ffab91;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.24);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(56, 174, 246, 0.18), transparent 24%),
    radial-gradient(circle at left 18% top 18%, rgba(137, 235, 203, 0.08), transparent 20%),
    radial-gradient(circle at center bottom, rgba(80, 120, 170, 0.08), transparent 28%),
    linear-gradient(180deg, #0b1620 0%, #081018 44%, #050b11 100%);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 84%);
}

.page-shell {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.topbar,
.hero-grid,
.profiles-layout,
.info-grid,
.filter-panel,
.meta-grid,
.noscript-grid {
  display: grid;
  gap: 24px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 28px;
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 30% 30%, rgba(134, 217, 255, 0.22), transparent 58%),
    linear-gradient(145deg, rgba(20, 40, 56, 0.96), rgba(13, 27, 39, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.brand h1,
.hero-copy h2,
.section-heading h3,
.info-card h3,
.detail-header h3,
.profile-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.toplink,
.button {
  color: var(--text);
  text-decoration: none;
}

.toplink,
.button,
.preset-card {
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.toplink {
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.toplink:hover,
.button:hover,
.preset-card:hover {
  transform: translateY(-2px);
}

.hero {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(12, 24, 33, 0.98), rgba(7, 14, 20, 0.98)),
    linear-gradient(135deg, rgba(134, 217, 255, 0.02), transparent 42%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-compact {
  padding-bottom: 20px;
}

.hero-grid-single {
  grid-template-columns: 1fr;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -34% auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(134, 217, 255, 0.14), transparent 68%);
}

.hero-grid {
  grid-template-columns: 1.25fr 0.9fr;
  align-items: start;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h2 {
  font-size: clamp(2.7rem, 5vw, 4.9rem);
  line-height: 0.92;
  max-width: 10ch;
}

.hero-text,
.results-summary,
.rule-list,
.detail-note,
.meta-card p,
.panel-footnote,
.timing-value,
.preset-copy,
.detail-intro {
  color: var(--muted);
}

.hero-text {
  max-width: 66ch;
  margin: 22px 0 0;
  font-size: 1.03rem;
  color: var(--muted-strong);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #04131d;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(56, 174, 246, 0.22);
}

.button-secondary {
  border-color: var(--line);
}

.hero-panel,
.detail-panel,
.info-card,
.preset-card,
.meta-card,
.bios-sheet {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.hero-panel {
  position: relative;
  z-index: 1;
  padding: 24px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(18, 36, 49, 0.96), rgba(11, 21, 30, 0.98)),
    var(--panel-strong);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel-kicker {
  margin: 0 0 18px;
  color: var(--accent-cool);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}

.hero-timing {
  display: grid;
  gap: 4px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.hero-timing:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.timing-key {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.section {
  margin-top: 34px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.section-heading h3 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.profiles-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  align-items: start;
}

.filter-panel {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 24, 34, 0.9), rgba(10, 19, 27, 0.88));
  backdrop-filter: blur(14px);
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.filter-group {
  display: grid;
  gap: 8px;
}

.filter-label {
  color: var(--accent);
  font-size: 0.83rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-strong);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.chip:hover {
  transform: translateY(-2px);
}

.chip.is-active {
  background: linear-gradient(135deg, rgba(134, 217, 255, 0.16), rgba(56, 174, 246, 0.28));
  border-color: var(--line-strong);
  color: var(--text);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.preset-card {
  position: relative;
  padding: 24px;
  border-radius: 24px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  border-width: 1px;
  background:
    linear-gradient(180deg, rgba(15, 26, 36, 0.92), rgba(11, 21, 29, 0.94)),
    var(--panel);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.preset-card::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 24px;
  width: 72px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(134, 217, 255, 0.42), rgba(134, 217, 255, 0));
}

.preset-card[data-preset-id="buildzoid"]::before {
  background: linear-gradient(90deg, rgba(137, 235, 203, 0.48), rgba(137, 235, 203, 0));
}

.preset-card[data-preset-id="safe"]::before {
  background: linear-gradient(90deg, rgba(143, 228, 192, 0.48), rgba(143, 228, 192, 0));
}

.preset-card[data-preset-id="optimal"]::before {
  background: linear-gradient(90deg, rgba(255, 217, 128, 0.48), rgba(255, 217, 128, 0));
}

.preset-card[data-preset-id="extreme"]::before {
  background: linear-gradient(90deg, rgba(255, 171, 145, 0.48), rgba(255, 171, 145, 0));
}

.preset-card:focus-visible,
.chip:focus-visible,
.button:focus-visible,
.toplink:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.preset-card.is-selected {
  border-color: var(--line-strong);
  background:
    linear-gradient(180deg, rgba(18, 38, 52, 0.96), rgba(10, 21, 29, 0.98)),
    var(--panel-elevated);
}

.preset-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.profile-title {
  font-size: 1.65rem;
  line-height: 1;
}

.tier-badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 5px 10px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.02);
}

.tier-badge.is-safe {
  color: var(--safe);
  border-color: rgba(124, 221, 181, 0.38);
  background: rgba(124, 221, 181, 0.08);
}

.tier-badge.is-optimal {
  color: var(--optimal);
  border-color: rgba(255, 213, 138, 0.35);
  background: rgba(255, 213, 138, 0.08);
}

.tier-badge.is-extreme {
  color: var(--extreme);
  border-color: rgba(255, 154, 134, 0.35);
  background: rgba(255, 154, 134, 0.09);
}

.tier-badge.is-buildzoid {
  color: var(--accent-cool);
  border-color: rgba(110, 217, 183, 0.35);
  background: rgba(110, 217, 183, 0.08);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}

.tag {
  color: var(--muted);
}

.preset-target {
  margin-top: 16px;
  color: var(--text);
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.preset-copy {
  margin: 14px 0 0;
  font-size: 0.98rem;
  line-height: 1.55;
}

.preset-facts {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.preset-fact {
  display: grid;
  gap: 4px;
}

.preset-fact-label {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.preset-fact-value {
  color: var(--muted-strong);
  font-size: 0.95rem;
  line-height: 1.45;
}

.detail-panel {
  position: sticky;
  top: 18px;
  padding: 24px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(16, 28, 39, 0.96), rgba(11, 20, 28, 0.98)),
    var(--panel-elevated);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.detail-panel[data-preset="buildzoid"] {
  border-color: var(--line);
}

.detail-panel[data-preset="safe"] {
  border-color: var(--line);
}

.detail-panel[data-preset="optimal"] {
  border-color: var(--line);
}

.detail-panel[data-preset="extreme"] {
  border-color: var(--line);
}

.detail-panel::before {
  content: "";
  display: block;
  width: 96px;
  height: 3px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(134, 217, 255, 0.38), rgba(134, 217, 255, 0));
}

.detail-panel[data-preset="buildzoid"]::before {
  background: linear-gradient(90deg, rgba(137, 235, 203, 0.52), rgba(137, 235, 203, 0));
}

.detail-panel[data-preset="safe"]::before {
  background: linear-gradient(90deg, rgba(143, 228, 192, 0.52), rgba(143, 228, 192, 0));
}

.detail-panel[data-preset="optimal"]::before {
  background: linear-gradient(90deg, rgba(255, 217, 128, 0.52), rgba(255, 217, 128, 0));
}

.detail-panel[data-preset="extreme"]::before {
  background: linear-gradient(90deg, rgba(255, 171, 145, 0.52), rgba(255, 171, 145, 0));
}

.detail-panel[data-preset="buildzoid"] .bios-label {
  color: var(--accent-cool);
}

.detail-panel[data-preset="safe"] .bios-label {
  color: var(--safe);
}

.detail-panel[data-preset="optimal"] .bios-label {
  color: var(--optimal);
}

.detail-panel[data-preset="extreme"] .bios-label {
  color: var(--extreme);
}

.detail-panel .tag-row .tag,
.detail-panel .tag-row .tier-badge {
  background: rgba(255, 255, 255, 0.025);
}

.detail-header {
  display: grid;
  gap: 12px;
}

.detail-header h3 {
  font-size: 2rem;
  line-height: 1;
}

.meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.meta-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.meta-card h4,
.detail-section h4 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.meta-card p {
  margin: 0;
}

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

.bios-sheet {
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 24, 34, 0.98), rgba(10, 18, 26, 0.98)),
    var(--panel);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 30px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.bios-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1fr);
  gap: 18px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
}

.bios-row:first-child {
  border-top: 0;
}

.bios-label {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.bios-value {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 0.93rem;
  color: var(--text);
  word-break: break-word;
}

.info-grid,
.noscript-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card {
  padding: 22px;
  border-radius: var(--radius);
}

.rule-list {
  margin: 10px 0 0;
  padding-left: 18px;
}

.rule-list li + li {
  margin-top: 8px;
}

.legal-wrap {
  display: grid;
  gap: 18px;
}

.legal-card {
  padding: 24px;
}

.legal-card p {
  margin: 10px 0 0;
  color: var(--muted-strong);
}

.legal-heading {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 36px;
  padding: 18px 2px 0;
  border-top: 1px solid var(--line-soft);
}

.footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-nav a {
  color: var(--muted-strong);
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-nav a:hover {
  color: var(--text);
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preset-card,
.detail-panel,
.info-card {
  animation: floatIn 520ms ease both;
}

@media (max-width: 1120px) {
  .hero-grid,
  .profiles-layout,
  .info-grid,
  .noscript-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 20px, 1360px);
  }

  .hero {
    padding: 22px;
    border-radius: 26px;
  }

  .topbar,
  .section-heading {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .toplink {
    justify-self: start;
  }

  .hero-copy h2 {
    font-size: clamp(2.2rem, 12vw, 3.8rem);
  }

  .profile-grid,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .bios-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
