:root {
  color-scheme: dark;
  --bg: #070914;
  --bg-deep: #03040a;
  --panel: rgba(12, 17, 34, .72);
  --panel-strong: rgba(15, 21, 42, .92);
  --line: rgba(165, 192, 255, .18);
  --line-bright: rgba(184, 211, 255, .42);
  --text: #eef5ff;
  --muted: #9aa9c8;
  --faint: #66728d;
  --cyan: #6de7f2;
  --violet: #a68cff;
  --gold: #e9c982;
  --shadow: 0 26px 90px rgba(0, 0, 0, .46);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-deep); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(48, 69, 140, .34), transparent 42rem),
    linear-gradient(180deg, #080b19 0%, #050711 72%, #03040a 100%);
  color: var(--text);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

#cosmos {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .72;
}

.aura {
  position: fixed;
  width: 38rem;
  height: 38rem;
  border-radius: 999px;
  filter: blur(90px);
  opacity: .12;
  pointer-events: none;
}
.aura-one { top: 18%; left: -18rem; background: var(--cyan); }
.aura-two { right: -18rem; top: 45%; background: var(--violet); }

.app {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 96px 0 64px;
}

.hero {
  max-width: 940px;
  margin: 0 auto 38px;
  text-align: center;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .26em;
}
h1 {
  margin: 0;
  color: #f5f9ff;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(52px, 9vw, 112px);
  font-weight: 500;
  letter-spacing: -.075em;
  line-height: .95;
  text-shadow: 0 0 42px rgba(115, 177, 255, .2);
}
h1 span { color: #c9d8ff; }
.lead {
  margin: 24px auto 0;
  color: #c5d3ef;
  font-size: clamp(16px, 2vw, 20px);
  letter-spacing: .08em;
}
.meta-line {
  color: var(--muted);
  font-size: 14px;
  margin: 16px 0 0;
}

.control-panel,
.oracle,
.quote-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(18, 26, 51, .86), rgba(8, 12, 27, .72));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.2);
}
.control-panel {
  border-radius: 26px;
  padding: 22px;
}
.search-row {
  display: flex;
  gap: 12px;
  align-items: end;
}
.search-box {
  flex: 1;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
input[type="search"],
select {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(3, 6, 15, .72);
  color: var(--text);
  outline: none;
}
input[type="search"] {
  min-width: 0;
  padding: 15px 16px;
  font-size: 16px;
}
input[type="search"]:focus,
select:focus {
  border-color: rgba(109, 231, 242, .72);
  box-shadow: 0 0 0 4px rgba(109, 231, 242, .1);
}
button {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
button:hover { transform: translateY(-1px); border-color: var(--line-bright); }
.primary-button {
  background: linear-gradient(135deg, rgba(76, 118, 194, .72), rgba(109, 231, 242, .24));
  color: #f4fbff;
}
.abyss-button {
  background: linear-gradient(135deg, rgba(77, 55, 132, .74), rgba(166, 140, 255, .16));
  color: #eee9ff;
}
.quiet-button,
.museum-tab {
  background: rgba(255, 255, 255, .045);
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.museum-tabs { display: flex; flex: 1; gap: 8px; flex-wrap: wrap; }
.museum-tab { padding: 9px 12px; color: var(--muted); font-size: 13px; }
.museum-tab.active {
  border-color: rgba(109, 231, 242, .62);
  background: rgba(109, 231, 242, .12);
  color: var(--cyan);
}
.featured-toggle,
.select-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.featured-toggle input { accent-color: var(--cyan); }
select { padding: 8px 10px; }
.stats { margin: 16px 0 0; color: var(--faint); font-size: 13px; }

.oracle {
  position: relative;
  margin: 28px auto;
  overflow: hidden;
  border-color: rgba(233, 201, 130, .38);
  border-radius: 26px;
  padding: 28px;
}
.oracle::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 88% 0%, rgba(233, 201, 130, .12), transparent 24rem);
  content: "";
  pointer-events: none;
}
.oracle.hidden { display: none; }
.oracle-label {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .24em;
}
.oracle blockquote {
  position: relative;
  max-width: 980px;
  margin: 18px 0;
  color: #fff8e7;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(21px, 3vw, 31px);
  line-height: 1.58;
}

.archive-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 40px 2px 18px;
}
h2 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 34px; font-weight: 500; }
.archive-heading p:last-child { max-width: 460px; margin: 0; color: var(--faint); font-size: 13px; text-align: right; }
.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  align-items: start;
}
.quote-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 18px;
}
.quote-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(109, 231, 242, .6), transparent);
  content: "";
}
.quote-card.featured { border-color: rgba(233, 201, 130, .34); }
.quote-card.featured::before { background: linear-gradient(180deg, transparent, rgba(233, 201, 130, .84), transparent); }
.quote-card.retired { border-color: rgba(166, 140, 255, .28); opacity: .82; }
.card-kicker,
.card-meta,
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.card-kicker { justify-content: space-between; }
.museum-label,
.featured-mark,
.retired-mark,
.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}
.featured-mark { border-color: rgba(233, 201, 130, .32); color: var(--gold); }
.retired-mark { border-color: rgba(166, 140, 255, .42); color: #c3b5ff; }
.context-title {
  margin: 15px 0 -7px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}
.quote-text {
  margin: 16px 0;
  color: #e8efff;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 17px;
  line-height: 1.66;
}
.card-meta { color: var(--faint); font-size: 11px; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 12px; }
.tag { color: #9bbde8; }
.actions { margin-top: 15px; }
.relations { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.relation-link {
  color: #c3b5ff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.relation-link:hover { color: #f1edff; text-decoration: underline; }
.tombstone-id { color: var(--faint); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.actions a,
.actions button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  padding: 7px 9px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}
.actions a:hover,
.actions button:hover { color: var(--text); border-color: var(--line-bright); }
mark { border-radius: 3px; background: rgba(233, 201, 130, .36); color: #fff9e9; padding: 0 2px; }
.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}
footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
  letter-spacing: .1em;
}
footer a { color: #92b5dc; text-decoration: none; }
footer a:hover { color: var(--cyan); text-decoration: underline; }
.sea-entry {
  border: 1px solid rgba(109, 231, 242, .22);
  border-radius: 999px;
  padding: 5px 9px;
}
.solaris-page {
  background:
    radial-gradient(circle at 50% -10%, rgba(0, 117, 135, .31), transparent 42rem),
    linear-gradient(180deg, #03151c 0%, #031019 58%, #01070d 100%);
}
.solaris-page .aura-one { background: #3ce0cb; opacity: .1; }
.solaris-page .aura-two { background: #237bb0; opacity: .14; }
.solaris-page .control-panel,
.solaris-page .oracle,
.solaris-page .quote-card {
  background: linear-gradient(145deg, rgba(5, 35, 46, .88), rgba(3, 17, 30, .76));
}
.solaris-page .sea-card::before {
  background: linear-gradient(180deg, transparent, rgba(82, 221, 211, .72), transparent);
}
.canonical-link { color: var(--gold); }

@media (max-width: 760px) {
  .app { padding-top: 58px; }
  .search-row { align-items: stretch; flex-wrap: wrap; }
  .search-box { flex-basis: 100%; }
  .primary-button,
  .abyss-button,
  .quiet-button { flex: 1; }
  .filter-row { align-items: start; }
  .museum-tabs { flex-basis: 100%; }
  .museum-tab { flex: 1 0 42%; }
  .archive-heading { align-items: start; flex-direction: column; }
  .archive-heading p:last-child { text-align: left; }
  footer { flex-direction: column; }
}
