:root {
  color-scheme: dark;
  --bg: #090b0c;
  --bg-soft: #101415;
  --panel: #121719;
  --panel-strong: #171d20;
  --line: #2c3638;
  --text: #f3f5ef;
  --muted: #a8b3ad;
  --subtle: #69756f;
  --calcite: #86e6a6;
  --quartz: #7dd7e8;
  --hematite: #d36a62;
  --sulfur: #e1bd4f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    var(--bg);
  background-size: 72px 72px;
  color: var(--text);
  min-width: 320px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(134, 230, 166, 0.09), transparent 28rem),
    radial-gradient(circle at 80% 0%, rgba(125, 215, 232, 0.12), transparent 28rem);
  opacity: 0.65;
  z-index: -1;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 11, 12, 0.82);
  backdrop-filter: blur(18px);
}

.brand,
.site-footer {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 750;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--calcite);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-nav a {
  padding: 0.45rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  border-color: var(--calcite);
}

main {
  width: min(1460px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-section {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 1.12fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(3rem, 7vw, 7rem) 0 clamp(2rem, 5vw, 4rem);
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1.1rem;
  font-size: clamp(4rem, 8vw, 8.25rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0.55rem;
  font-size: 1rem;
  line-height: 1.25;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-subtitle {
  max-width: 610px;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
}

.hero-actions,
.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.primary-button,
.secondary-button,
.link-button,
.icon-button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0.72rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  background: var(--calcite);
  border-color: var(--calcite);
  color: #06110a;
}

.secondary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.secondary-button:hover,
.icon-button:hover,
.candidate:hover,
.filter-group button:hover {
  border-color: rgba(134, 230, 166, 0.75);
}

.hero-media {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 10;
  background: var(--panel);
}

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

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  margin-bottom: clamp(3rem, 7vw, 6rem);
}

.stats-strip div {
  display: grid;
  gap: 0.25rem;
  min-height: 108px;
  padding: 1.2rem;
  background: rgba(18, 23, 25, 0.92);
}

.stats-strip strong {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.stats-strip span,
.section-label,
.filter-group > span,
.search-box span,
.note-kind,
.reference-list span,
.candidate small,
.candidate-score {
  color: var(--subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 1.2rem;
}

.section-label {
  margin-bottom: 0.55rem;
  color: var(--calcite);
}

.explorer-section,
.notes-section,
.data-section,
.about-section {
  padding: clamp(2.5rem, 6vw, 5.5rem) 0;
}

.explorer-shell {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(280px, 340px);
  gap: 0.85rem;
  align-items: start;
}

.filter-panel,
.profile-panel,
.candidate-panel,
.note-card,
.data-section,
.about-section,
.quiz-card,
.method-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 23, 25, 0.88);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.filter-panel,
.candidate-panel {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.filter-panel,
.profile-panel,
.candidate-panel {
  padding: 1rem;
}

.panel-heading,
.profile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-heading h3,
.profile-heading h2,
.profile-heading p,
.panel-heading span {
  margin-bottom: 0;
}

.link-button {
  min-height: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
}

.search-box {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-box input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0f10;
  color: var(--text);
  padding: 0 0.85rem;
}

.filter-group {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-group button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  padding: 0.42rem 0.58rem;
  font-size: 0.78rem;
}

.filter-group button.is-active,
.icon-button.is-active {
  border-color: var(--calcite);
  background: rgba(134, 230, 166, 0.12);
  color: var(--calcite);
}

.profile-panel {
  min-height: 680px;
}

.profile-heading h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.trait-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.2rem 0;
}

.trait-list span {
  border: 1px solid rgba(125, 215, 232, 0.28);
  border-radius: 999px;
  color: var(--quartz);
  padding: 0.38rem 0.62rem;
  font-size: 0.82rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}

.quick-grid article {
  min-height: 156px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.quick-grid h3 {
  color: var(--calcite);
}

.quick-grid p {
  font-size: 0.92rem;
  line-height: 1.55;
}

.profile-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.profile-row {
  display: grid;
  gap: 0.35rem;
  min-height: 74px;
  padding: 0.8rem;
  background: rgba(9, 11, 12, 0.7);
}

.profile-row span {
  color: var(--subtle);
  font-size: 0.78rem;
}

.profile-row strong {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
}

.candidate-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.candidate {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  padding: 0.75rem;
}

.candidate.is-selected {
  border-color: var(--calcite);
  background: rgba(134, 230, 166, 0.08);
}

.candidate-mark {
  width: 12px;
  height: 48px;
  border-radius: 999px;
  background: var(--mark);
}

.candidate strong,
.candidate small {
  display: block;
}

.candidate small {
  margin-top: 0.22rem;
  text-transform: none;
  line-height: 1.3;
}

.candidate-score {
  color: var(--calcite);
  text-align: right;
}

.empty-state {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.note-card {
  min-height: 280px;
  padding: 1rem;
}

.note-card h3 {
  font-size: 1.25rem;
}

.note-card ul,
.quiz-card ul {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
}

.note-kind {
  color: var(--quartz);
  margin-bottom: 0.7rem;
}

.data-section,
.about-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.2rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

.reference-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.reference-list li {
  display: grid;
  gap: 0.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.reference-list a {
  color: var(--text);
  font-weight: 700;
}

.reference-list a:hover {
  color: var(--calcite);
}

.disclaimer {
  margin-top: 1rem;
  border-left: 3px solid var(--hematite);
  padding: 0.75rem 0 0.75rem 1rem;
  color: var(--text);
  background: linear-gradient(90deg, rgba(211, 106, 98, 0.1), transparent);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  grid-column: 1 / -1;
}

.method-grid article {
  min-height: 170px;
  padding: 1rem;
}

.method-grid span {
  color: var(--hematite);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.quiz-card {
  grid-column: 1 / -1;
  padding: 1rem;
}

.quiz-card h3 {
  font-size: 1.5rem;
}

.site-footer {
  justify-content: space-between;
  width: min(1460px, calc(100% - 32px));
  min-height: 84px;
  margin: 2rem auto 0;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 1180px) {
  .hero-section,
  .explorer-shell,
  .data-section,
  .about-section {
    grid-template-columns: 1fr;
  }

  .filter-panel,
  .candidate-panel {
    position: static;
    max-height: none;
  }

  .explorer-shell {
    grid-template-areas:
      "filters"
      "profile"
      "candidates";
  }

  .filter-panel {
    grid-area: filters;
  }

  .profile-panel {
    grid-area: profile;
  }

  .candidate-panel {
    grid-area: candidates;
  }
}

@media (max-width: 780px) {
  main,
  .site-footer {
    width: min(100% - 24px, 1460px);
  }

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

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .hero-section {
    min-height: auto;
    padding-top: 2rem;
  }

  h1 {
    font-size: clamp(3.2rem, 18vw, 5rem);
  }

  .stats-strip,
  .quick-grid,
  .profile-table,
  .notes-grid,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .stats-strip div,
  .quick-grid article,
  .note-card,
  .method-grid article {
    min-height: auto;
  }

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

  .candidate {
    grid-template-columns: auto 1fr;
  }

  .candidate-score {
    grid-column: 2;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
