:root {
  color-scheme: light;
  --ink: #231a13;
  --muted: #6b5c4f;
  --cream: #f5efe6;
  --leaf: #2f6b4f;
  --sun: #f0b55a;
  --clay: #d37b61;

  --page-bg: radial-gradient(circle at top, #fff9f1 0%, #f3e4cf 45%, #e6d1b4 100%);
  --mist: rgba(245, 239, 230, 0.85);
  --panel-bg: rgba(255, 255, 255, 0.86);
  --card-bg: linear-gradient(145deg, #fff, #f7efe3);
  --border: rgba(35, 26, 19, 0.12);
  --card-border: rgba(35, 26, 19, 0.08);
  --control-bg: #fff;
  --control-border: rgba(35, 26, 19, 0.1);
  --mark-bg: rgba(240, 181, 90, 0.6);
  --mark-fg: var(--ink);
  --mark-ring: rgba(35, 26, 19, 0.12);

  --aura-one: radial-gradient(circle, rgba(47, 107, 79, 0.5), transparent 65%);
  --aura-two: radial-gradient(circle, rgba(211, 123, 97, 0.45), transparent 70%);

  --shadow: 0 20px 60px rgba(35, 26, 19, 0.15);
  --hover-shadow: 0 12px 20px rgba(35, 26, 19, 0.12);

  --hit-bg: rgba(47, 107, 79, 0.12);
  --hit-hover-bg: rgba(47, 107, 79, 0.2);
  --hit-empty-bg: rgba(107, 92, 79, 0.14);
}

html[data-theme="dark"] {
  color-scheme: dark;

  /* Catppuccin Mocha */
  --ink: #cdd6f4; /* Text */
  --muted: #a6adc8; /* Subtext0 */
  --cream: #1e1e2e; /* Base */
  --leaf: #a6e3a1; /* Green */
  --sun: #fab387; /* Peach */
  --clay: #cba6f7; /* Mauve */

  --page-bg: radial-gradient(circle at top, #313244 0%, #1e1e2e 55%, #11111b 100%);
  --mist: rgba(49, 50, 68, 0.86); /* Surface0 */
  --panel-bg: rgba(30, 30, 46, 0.92); /* Base */
  --card-bg: linear-gradient(145deg, #313244, #1e1e2e);
  --border: rgba(127, 132, 156, 0.35); /* Overlay1 */
  --card-border: rgba(127, 132, 156, 0.22);
  --control-bg: #181825; /* Mantle */
  --control-border: rgba(186, 194, 222, 0.18); /* Subtext1 */
  --mark-bg: rgba(250, 179, 135, 0.88); /* Peach */
  --mark-fg: #11111b; /* Crust */
  --mark-ring: rgba(250, 179, 135, 0.35);

  --aura-one: radial-gradient(circle, rgba(166, 227, 161, 0.28), transparent 65%);
  --aura-two: radial-gradient(circle, rgba(203, 166, 247, 0.25), transparent 70%);

  --shadow: 0 24px 70px rgba(17, 17, 27, 0.6); /* Crust */
  --hover-shadow: 0 14px 28px rgba(17, 17, 27, 0.55);

  --hit-bg: rgba(166, 227, 161, 0.16); /* Green */
  --hit-hover-bg: rgba(166, 227, 161, 0.24);
  --hit-empty-bg: rgba(127, 132, 156, 0.18); /* Overlay1 */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Futura", "Gill Sans", sans-serif;
  color: var(--ink);
  background: var(--page-bg);
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}

.page {
  position: relative;
  overflow: hidden;
  padding: 48px 6vw 72px;
}

.aura {
  position: absolute;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.4;
  z-index: 0;
}

.aura-one {
  width: 420px;
  height: 420px;
  background: var(--aura-one);
  top: -140px;
  right: -120px;
}

.aura-two {
  width: 560px;
  height: 560px;
  background: var(--aura-two);
  bottom: -200px;
  left: -120px;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}

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

.brand-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 2px;
}

.brand img {
  width: 54px;
  height: 54px;
}

.eyebrow {
  font-family: "Iowan Old Style", "Garamond", "Times New Roman", serif;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 12px;
  color: var(--leaf);
  margin: 0 0 8px;
}

h1 {
  font-family: "Iowan Old Style", "Garamond", "Times New Roman", serif;
  font-size: clamp(2.2rem, 3vw, 3.4rem);
  margin: 0;
  max-width: 720px;
}

.lead {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.05rem;
}

.controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  background: var(--mist);
  padding: 20px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.controls label {
  display: grid;
  gap: 10px;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.controls input[type="search"],
.controls select {
  border: none;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 1rem;
  background: var(--control-bg);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--control-border);
}

.controls input[type="range"] {
  width: 100%;
}

.controls small {
  font-size: 0.9rem;
  color: var(--leaf);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 32px;
  position: relative;
  z-index: 1;
}

.results,
.details-card {
  background: var(--panel-bg);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.results-list {
  display: grid;
  gap: 14px;
}

.card {
  border-radius: 18px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.35s ease both;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--hover-shadow);
}

.card h3 {
  font-family: "Iowan Old Style", "Garamond", "Times New Roman", serif;
  margin: 0 0 6px;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.hit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.hit-list span,
.hit-chip,
.hit-empty {
  background: var(--hit-bg);
  color: var(--leaf);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hit-chip {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.hit-chip:hover {
  background: var(--hit-hover-bg);
}

.hit-empty {
  background: var(--hit-empty-bg);
  color: var(--muted);
}

mark {
  background: var(--mark-bg);
  color: var(--mark-fg);
  padding: 0 2px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--mark-ring);
  font-weight: 600;
}

.details {
  display: grid;
}

.details-card h2 {
  font-family: "Iowan Old Style", "Garamond", "Times New Roman", serif;
  margin-top: 0;
}

.detail-block {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
}

.detail-block h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--leaf);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

  .brand-actions {
    margin-left: 0;
    align-self: flex-end;
  }
}
