:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-soft: #fbfaf7;
  --surface-card: #fffdf9;
  --ink: #1f2933;
  --muted: #687385;
  --line: #ded8ce;
  --rose: #d9546f;
  --rose-dark: #b83853;
  --teal: #1d8a8a;
  --sage: #6f8f72;
  --gold: #b9851d;
  --shadow: 0 18px 44px rgba(46, 38, 30, 0.13);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15171c;
  --surface: #20242c;
  --surface-soft: #282d36;
  --surface-card: #252a33;
  --ink: #f3f5f7;
  --muted: #a8b1bf;
  --line: #3a414d;
  --rose: #ff7f9a;
  --rose-dark: #ff6383;
  --teal: #4fc3c3;
  --sage: #9fca9b;
  --gold: #e0b75f;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(217, 84, 111, 0.13), transparent 34%),
    linear-gradient(225deg, rgba(29, 138, 138, 0.13), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 900;
}

.theme-toggle {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 900;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 18px;
}

.hero__content,
.spotlight,
.filters,
.recommendations,
.shortlist {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.hero__content {
  padding: 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 900;
}

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

h1 {
  max-width: 680px;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: 1.04;
}

.intro {
  max-width: 620px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.spotlight {
  display: grid;
  align-content: space-between;
  gap: 16px;
  padding: 26px;
}

.spotlight__label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

#featured-name {
  color: var(--rose);
  font-size: 4.4rem;
  line-height: 1;
}

#featured-meaning {
  color: var(--muted);
  line-height: 1.6;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
}

.filter-button,
.primary-button,
.secondary-button,
.name-card,
.name-chip {
  border-radius: 8px;
  cursor: pointer;
}

.filter-button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 16px;
  font-weight: 800;
}

.filter-button.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border: 0;
  padding: 0 18px;
  font-weight: 900;
}

.primary-button {
  background: var(--rose);
  color: #fff;
}

.primary-button:hover {
  background: var(--rose-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.recommendations,
.shortlist {
  padding: 22px;
}

.recommendations {
  margin-bottom: 18px;
}

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

.section-heading > div {
  display: grid;
  gap: 6px;
}

h2 {
  font-size: 1.25rem;
}

#summary {
  color: var(--muted);
  font-size: 0.95rem;
}

.name-groups {
  display: grid;
  gap: 14px;
}

.name-group {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.name-group__header {
  display: grid;
  align-content: start;
  gap: 8px;
}

.name-group__header p {
  color: var(--muted);
  line-height: 1.5;
}

.name-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.name-card {
  display: grid;
  min-height: 128px;
  gap: 10px;
  align-content: center;
  border: 1px solid var(--line);
  background: var(--surface-card);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.name-card:hover {
  border-color: var(--rose);
  transform: translateY(-1px);
}

.name-card strong {
  color: var(--rose);
  font-size: 1.75rem;
  line-height: 1;
}

.name-card span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.name-group--boy .name-card strong {
  color: var(--teal);
}

.name-group--neutral .name-card strong {
  color: var(--sage);
}

.saved-names {
  display: flex;
  min-height: 48px;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.saved-names.is-empty {
  color: var(--muted);
}

.name-chip {
  border: 1px solid rgba(217, 84, 111, 0.3);
  background: rgba(217, 84, 111, 0.1);
  color: var(--rose-dark);
  padding: 10px 14px;
  font-weight: 900;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 24px, 680px);
    padding: 24px 0;
  }

  .hero,
  .name-group {
    grid-template-columns: 1fr;
  }

  .name-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .hero__content,
  .spotlight,
  .recommendations,
  .shortlist {
    padding: 18px;
  }

  #featured-name {
    font-size: 3.2rem;
  }

  .filter-button,
  .primary-button,
  .secondary-button,
  .theme-toggle {
    width: 100%;
  }

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

  .name-list {
    grid-template-columns: 1fr;
  }
}
