:root {
  --bg: #f6e7d3;
  --panel: rgba(255, 252, 247, 0.7);
  --text: #241d17;
  --muted: #66584b;
  --line: #b49f8a;
  --accent: #8f4e21;
  --accent-soft: rgba(143, 78, 33, 0.12);
  --shadow: rgba(62, 44, 28, 0.12);
  --font-family: "Roboto Mono", monospace;
}

body[data-theme="dark"] {
  --bg: #121110;
  --panel: rgba(28, 25, 22, 0.82);
  --text: #f5efe6;
  --muted: #c1b4a5;
  --line: #7c6857;
  --accent: #f2a65a;
  --accent-soft: rgba(242, 166, 90, 0.14);
  --shadow: rgba(0, 0, 0, 0.35);
}

body[data-font="roboto-mono"] {
  --font-family: "Roboto Mono", monospace;
}

body[data-font="georgia"] {
  --font-family: Georgia, serif;
}

body[data-font="montserrat"] {
  --font-family: "Montserrat", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family);
  transition:
    background-color 160ms ease,
    color 160ms ease,
    font-family 160ms ease;
}

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

button,
input,
select {
  font: inherit;
}

button {
  background: none;
  border: 0;
  color: inherit;
}

.site-shell {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 2.5rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px dashed var(--line);
  background: var(--panel);
  box-shadow: 0 14px 38px var(--shadow);
  padding: 0.9rem 1rem;
}

.tabs,
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.tab {
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--text);
  background: transparent;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.tab.active {
  background: var(--accent-soft);
}

.control-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.control-link {
  cursor: pointer;
  border-bottom: 1px dotted transparent;
  padding: 0;
}

.control-link:hover,
.control-link[aria-pressed="true"] {
  color: var(--accent);
  border-color: currentColor;
}

main {
  padding-top: 2rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  align-items: center;
  gap: 2rem;
}

.eyebrow,
.summary-label,
.field-label,
.profile-year,
.profile-field {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 0.82rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 0.35rem;
  font-size: clamp(1.5rem, 4vw, 2.35rem);
  line-height: 1.1;
  font-weight: 500;
}

.lead {
  margin-top: 0.8rem;
  color: var(--muted);
  max-width: 64ch;
  line-height: 1.55;
}

.visual-card {
  margin: 0;
  padding: 1rem;
  text-align: center;
}

.ascii-art {
  margin: 0 auto;
  color: var(--muted);
  font-family: "Roboto Mono", monospace;
  font-size: clamp(0.34rem, 0.8vw, 0.48rem);
  line-height: 1;
  letter-spacing: 0;
  white-space: pre;
  text-align: left;
  user-select: none;
  display: inline-block;
  width: max-content;
}

.caption {
  margin-top: 0.7rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.96rem;
}

.divider {
  margin: 2rem 0 1.5rem;
  border-top: 2px dashed var(--line);
}

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

.summary-card,
.controls-panel,
.featured-panel,
.profile-card {
  border: 1px dashed var(--line);
  background: var(--panel);
  box-shadow: 0 14px 38px var(--shadow);
}

.summary-card {
  padding: 1rem;
}

.summary-value {
  margin-top: 0.35rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.controls-panel {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(140px, 1fr)) auto;
  gap: 0.9rem;
  padding: 1rem;
  position: sticky;
  top: 0.8rem;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.search-field,
.filter-field {
  display: grid;
  gap: 0.35rem;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
  color: var(--text);
  padding: 0.7rem 0.8rem;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select {
  background: rgba(255, 255, 255, 0.05);
}

.reset-button {
  align-self: end;
  height: 43px;
}

.result-meta {
  margin-top: 1rem;
  color: var(--muted);
}

.featured-panel {
  margin-top: 1rem;
  padding: 1.1rem;
}

.featured-panel[hidden] {
  display: none;
}

.featured-kicker {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.featured-name {
  margin-top: 0.45rem;
  font-size: clamp(1.25rem, 3vw, 1.9rem);
}

.featured-copy {
  margin-top: 0.65rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 70ch;
}

.featured-meta {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  padding: 0.34rem 0.55rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.directory-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.profile-card {
  padding: 1rem;
  display: grid;
  gap: 0.7rem;
}

.profile-meta,
.profile-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
}

.profile-name {
  font-size: 1.1rem;
  line-height: 1.25;
}

.profile-occupation {
  color: var(--accent);
  font-size: 0.94rem;
}

.profile-note {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.profile-badge {
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-confidence {
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-link {
  color: var(--accent);
  font-size: 0.92rem;
}

.featured-link {
  align-self: center;
}

.empty-state {
  border: 1px dashed var(--line);
  padding: 1.2rem;
  color: var(--muted);
  text-align: center;
}

footer {
  margin-top: 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .lead {
    margin-inline: auto;
  }

  .controls-panel {
    grid-template-columns: 1fr;
    position: static;
    top: auto;
    z-index: auto;
    backdrop-filter: none;
  }

  .reset-button {
    width: fit-content;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
  }

  .controls {
    gap: 0.55rem 0.85rem;
  }

  .control-group {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}
