:root {
  color-scheme: light;
  --bg: #eaf3ff;
  --bg-strong: #d7e8ff;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: rgba(247, 251, 255, 0.94);
  --ink: #10213f;
  --muted: #5d7394;
  --accent: #2d7fff;
  --accent-strong: #0d58dd;
  --accent-soft: rgba(45, 127, 255, 0.12);
  --border: rgba(42, 102, 196, 0.16);
  --shadow: 0 26px 70px rgba(26, 79, 169, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(84, 174, 255, 0.34), transparent 22%),
    radial-gradient(circle at 84% 16%, rgba(62, 118, 245, 0.24), transparent 24%),
    radial-gradient(circle at 72% 72%, rgba(142, 202, 255, 0.24), transparent 20%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 50%, var(--bg-strong) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
}

body::before {
  top: -10rem;
  right: -6rem;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 111, 255, 0.16), transparent 68%);
}

body::after {
  bottom: -12rem;
  left: -7rem;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 197, 255, 0.2), transparent 70%);
}

.shell {
  width: min(980px, calc(100vw - 1.4rem));
  margin: 0 auto;
  padding: 1.2rem 0 2.5rem;
}

.panel {
  position: relative;
  margin-top: 0.9rem;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 249, 255, 0.86));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 1rem;
  align-items: stretch;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  top: -35%;
  right: -10%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(73, 149, 255, 0.14), transparent 70%);
}

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

.hero-copy {
  padding: 0.1rem;
}

.brand-row {
  display: inline-block;
  margin-bottom: 0.75rem;
}

.brand-logo {
  display: block;
  width: clamp(156px, 28vw, 206px);
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
  font-weight: 700;
  color: #2d67c6;
}

h1,
h2,
.pattern {
  font-family: "Sora", "Manrope", sans-serif;
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2rem, 4.2vw, 3.35rem);
  line-height: 0.93;
  font-weight: 800;
  letter-spacing: -0.06em;
}

h2 {
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 54ch;
  margin: 0.8rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  font-weight: 500;
  color: var(--muted);
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chip,
.word-chip,
.score-pill {
  border-radius: 999px;
  font-weight: 700;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(50, 107, 201, 0.14);
  background: rgba(255, 255, 255, 0.74);
  color: #2058af;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.45rem 0.68rem;
}

.hero-aside {
  display: grid;
}

.hero-card {
  align-self: end;
  padding: 1rem;
  border: 1px solid rgba(42, 102, 196, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(250, 253, 255, 0.98), rgba(231, 241, 255, 0.85)),
    linear-gradient(135deg, rgba(45, 127, 255, 0.08), transparent);
  box-shadow: 0 22px 40px rgba(21, 69, 155, 0.12);
}

.hero-list {
  margin: 0.7rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.88rem;
  font-weight: 500;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.section-note {
  margin: 0;
  color: var(--muted);
  text-align: right;
  max-width: 24ch;
  font-size: 0.8rem;
  font-weight: 500;
}

.search-panel {
  padding-top: 1rem;
}

.finder-form {
  display: grid;
  gap: 0.75rem;
}

.label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.title-with-icon,
.label-inline,
.button-inline,
.pattern-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.button-inline {
  justify-content: center;
}

.icon,
.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon {
  width: 0.95rem;
  height: 0.95rem;
  color: currentColor;
}

.icon svg,
.icon-chip svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
}

input,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(45, 127, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(45, 127, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(45, 127, 255, 0.12);
  transform: translateY(-1px);
}

button {
  min-width: 132px;
  padding: 0.82rem 1.05rem;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow:
    0 18px 34px rgba(13, 88, 221, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  font-size: 0.88rem;
}

button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 22px 36px rgba(13, 88, 221, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  filter: saturate(1.05);
}

button:active {
  transform: translateY(0);
}

.hint,
.subtle {
  color: var(--muted);
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
}

.status {
  margin: 0.8rem 0 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease, background 180ms ease;
  font-size: 0.84rem;
}

.status:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

.status[data-state="loading"] {
  background: rgba(45, 127, 255, 0.08);
  border-color: rgba(45, 127, 255, 0.16);
  color: #1656ba;
}

.status[data-state="error"] {
  background: rgba(228, 61, 113, 0.1);
  border-color: rgba(228, 61, 113, 0.18);
  color: #a12e4d;
}

.status[data-state="success"] {
  background: rgba(33, 102, 210, 0.08);
  border-color: rgba(33, 102, 210, 0.16);
  color: #1553b4;
}

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.card-list {
  display: grid;
  gap: 0.7rem;
}

.card {
  padding: 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(42, 102, 196, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(241, 247, 255, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.card.muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}

.result-card {
  animation: rise-in 220ms ease;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
}

.pattern-row {
  min-width: 0;
}

.pattern {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.score-pill {
  flex-shrink: 0;
  padding: 0.34rem 0.58rem;
  background: rgba(45, 127, 255, 0.1);
  color: #1553b4;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.icon-chip {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 12px;
  background: rgba(45, 127, 255, 0.1);
  color: #1553b4;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin: 0.6rem 0 0;
}

.meta.single-word {
  display: block;
  margin: 0;
  font-weight: 700;
  color: #18499e;
  font-size: 0.88rem;
}

.word-stack {
  margin-top: 0.55rem;
}

.word-chip {
  padding: 0.3rem 0.52rem;
  border: 1px solid rgba(45, 127, 255, 0.12);
  background: var(--accent-soft);
  color: #1c4ea6;
  font-size: 0.74rem;
}

.subtle {
  margin: 0.58rem 0 0;
  line-height: 1.42;
  font-size: 0.79rem;
  font-weight: 500;
}

.hidden {
  display: none;
}

.field-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.select-field {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #2353a7 50%),
    linear-gradient(135deg, #2353a7 50%, transparent 50%);
  background-position:
    calc(100% - 1.1rem) calc(50% - 0.12rem),
    calc(100% - 0.8rem) calc(50% - 0.12rem);
  background-size: 0.38rem 0.38rem, 0.38rem 0.38rem;
  background-repeat: no-repeat;
}

.search-footnote {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.text-link {
  color: #1754b7;
  text-decoration: none;
  font-weight: 700;
}

.text-link:hover {
  text-decoration: underline;
}

.admin-results {
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
}

.admin-form {
  gap: 1rem;
}

.admin-divider {
  margin: 1rem 0;
  height: 1px;
  background: rgba(42, 102, 196, 0.12);
}

.compact-head {
  margin-bottom: 0;
}

.admin-fieldset {
  margin: 0;
  padding: 0.8rem;
  border: 1px solid rgba(42, 102, 196, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.admin-fieldset legend {
  padding: 0 0.3rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
}

.checkbox-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 600;
}

.checkbox-row input {
  width: auto;
  transform: none;
  box-shadow: none;
}

.candidate-card {
  display: grid;
  gap: 0.7rem;
}

.candidate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ghost-button {
  min-width: 0;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(42, 102, 196, 0.16);
  color: #194c9b;
  box-shadow: none;
}

.ghost-button:hover {
  box-shadow: none;
}

.success-chip {
  background: rgba(51, 168, 86, 0.12);
  color: #246e3d;
}

.muted-chip {
  background: rgba(90, 116, 148, 0.12);
  color: #4d6280;
}

.admin-actions {
  display: flex;
  align-items: end;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

@media (max-width: 900px) {
  .hero,
  .results {
    grid-template-columns: 1fr;
  }

  .section-note {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 0.8rem, 980px);
    padding-top: 0.8rem;
  }

  .panel {
    padding: 0.95rem;
    border-radius: 18px;
  }

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

  .input-row {
    grid-template-columns: 1fr;
  }

  .field-grid,
  .admin-grid,
  .admin-hero {
    grid-template-columns: 1fr;
    display: grid;
  }

  button {
    width: 100%;
  }

  .pattern {
    font-size: 0.98rem;
  }

  .card-topline {
    flex-direction: column;
    align-items: start;
  }
}
