:root {
  font-family: Inter, Segoe UI, system-ui, -apple-system, sans-serif;
  color: #f0eaf8;
  background: #0d0b14;
  --bg: #0d0b14;
  --bg-card: rgba(25, 19, 38, 0.75);
  --bg-card-hover: rgba(38, 28, 58, 0.9);
  --green: #e2b36e; /* Using cosmic gold as primary accent */
  --accent-gold: #e2b36e;
  --accent-purple: #9d72cf;
  --cyan-live: #5ce1e6;
  --muted: #a395b4;
  --line: rgba(168, 130, 210, 0.18);
  --line-highlight: rgba(226, 179, 110, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 12%, rgba(88, 48, 140, 0.22) 0%, rgba(13, 11, 20, 1) 78%);
  color: #f0eaf8;
  background-attachment: fixed;
}

a { color: var(--accent-gold); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #f5cf94; text-decoration: underline; }

button, input { font: inherit; }
button { cursor: pointer; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px 5vw;
  flex-wrap: wrap;
  gap: 14px;
}

.brand {
  text-decoration: none;
  font-size: 35px;
  line-height: 1;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f0eaf8;
}

.brand span {
  font-size: 11px;
  letter-spacing: 4px;
  font-weight: 600;
  color: var(--accent-gold);
}

.quiet {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 10px;
  font-size: 13px;
  transition: color 0.2s ease;
}
.quiet:hover { color: #fff; }

main {
  width: min(100%, 1100px);
  margin: 0 auto;
  flex: 1;
  padding: 0 24px;
}

.search-home {
  padding-top: 10vh;
  max-width: 840px;
  margin: 0 auto;
  text-align: center;
  transition: padding .2s;
}

.mark {
  font-size: 96px;
  line-height: 1.1;
  color: var(--accent-gold);
  font-family: Georgia, serif;
  text-shadow: 0 0 40px rgba(226, 179, 110, 0.35);
  margin-bottom: 6px;
}

h1 {
  font-weight: 450;
  font-size: clamp(28px, 4.2vw, 42px);
  letter-spacing: -1px;
  margin: 18px 0 10px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.intro {
  color: var(--muted);
  font-size: 17px;
  margin-bottom: 32px;
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(22, 16, 34, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(168, 130, 210, 0.28);
  border-radius: 20px;
  padding: 8px 10px 8px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(157, 114, 207, 0.12);
  transition: all 0.25s ease;
}

.searchbox:focus-within {
  border-color: var(--accent-gold);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(226, 179, 110, 0.3);
  outline: none;
}

.searchbox svg {
  width: 22px;
  fill: none;
  stroke: var(--accent-gold);
  stroke-width: 1.8;
  flex-shrink: 0;
  opacity: 0.85;
}

.searchbox input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  padding: 13px 0;
  color: #f0eaf8;
}

.searchbox input::placeholder {
  color: rgba(163, 149, 180, 0.55);
}

.searchbox button {
  background: linear-gradient(135deg, #7c4bb3, #a26dd4);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 14px 24px;
  white-space: nowrap;
  font-weight: 550;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(124, 75, 179, 0.45);
  transition: all 0.2s ease;
}

.searchbox button:hover {
  background: linear-gradient(135deg, #8f58cf, #b47ef0);
  box-shadow: 0 6px 22px rgba(143, 88, 207, 0.65);
  transform: translateY(-1px);
}

.searchbox button span {
  margin-left: 10px;
}

.scopes {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.scopes input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scopes span {
  display: block;
  padding: 8px 20px;
  border-radius: 25px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  background: rgba(30, 22, 45, 0.5);
  border: 1px solid rgba(168, 130, 210, 0.15);
  transition: all 0.2s ease;
}

.scopes span:hover {
  color: #fff;
  background: rgba(45, 33, 68, 0.7);
}

.scopes input:checked + span {
  background: rgba(157, 114, 207, 0.25);
  color: var(--accent-gold);
  border-color: rgba(226, 179, 110, 0.45);
  box-shadow: 0 0 12px rgba(226, 179, 110, 0.15);
}

.scopes input:focus-visible + span {
  outline: 2px solid var(--accent-gold);
}

.principle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 32px;
}

.suggestions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.suggestions button {
  background: rgba(28, 21, 42, 0.6);
  color: #c2b5d4;
  border: 1px solid var(--line);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 12.5px;
  transition: all 0.2s ease;
}

.suggestions button:hover {
  background: rgba(50, 37, 75, 0.8);
  border-color: var(--accent-gold);
  color: #fff;
  transform: translateY(-1px);
}

/* ==========================================================================
   CONSTELLATION PLATFORM DECK (Elevating all doors from footer)
   ========================================================================== */

.platform-doors {
  margin: 54px auto 36px;
  max-width: 900px;
  text-align: left;
}

.platform-doors-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 6px;
}

.platform-doors-header h2 {
  font-size: 12.5px;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin: 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.door-tag {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(157, 114, 207, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(157, 114, 207, 0.3);
  font-weight: 600;
}

.platform-doors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.door-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-decoration: none;
  color: #f0eaf8;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.door-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(226, 179, 110, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.door-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--line-highlight);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(157, 114, 207, 0.2);
  text-decoration: none;
}

.door-card:hover::before {
  opacity: 1;
}

.door-card .door-glyph {
  font-size: 22px;
  color: var(--accent-gold);
  margin-bottom: 10px;
}

.door-card h3 {
  font-size: 17px;
  font-weight: 550;
  margin: 0 0 8px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.door-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================================
   FOOTER & SEARCH RESULTS
   ========================================================================== */

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 60px;
  padding: 30px 5vw;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(13, 11, 20, 0.7);
}

footer div {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
footer a:hover {
  color: var(--accent-gold);
}

body.searched .search-home {
  padding-top: 16px;
  text-align: left;
  max-width: 900px;
}

body.searched .mark,
body.searched h1,
body.searched .intro,
body.searched #first-visit,
body.searched .platform-doors {
  display: none;
}

body.searched .scopes {
  justify-content: flex-start;
}

#results-area {
  max-width: 860px;
  margin: 20px auto;
}

.results-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.notice {
  font-size: 13px;
  color: var(--accent-gold);
  padding: 12px 0;
}

.result {
  padding: 24px 0 20px;
  max-width: 800px;
  border-bottom: 1px solid rgba(168, 130, 210, 0.1);
}

.result .url {
  font-size: 12.5px;
  color: #6fe3c5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.result h2 {
  font-weight: 500;
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -.3px;
  margin: 6px 0;
}

.result h2 a {
  color: #f5efff;
  text-decoration: none;
}

.result h2 a:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}

.result p {
  font-size: 14.5px;
  color: #c8bdd6;
  line-height: 1.75;
  margin: 8px 0;
}

.result details {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 7px;
}

.result summary {
  cursor: pointer;
  color: var(--accent-purple);
}

.coverage {
  font-size: 11.5px;
  color: #b0a0c4;
  margin: 5px 0;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0;
}

.pagination button {
  border: 1px solid var(--line);
  background: var(--bg-card);
  padding: 10px 20px;
  border-radius: 10px;
  color: var(--accent-gold);
  transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
}

button:disabled {
  opacity: .35;
  cursor: default;
}

#about {
  max-width: 800px;
  padding: 34px;
  margin: 34px auto;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  line-height: 1.8;
  font-size: 14.5px;
  backdrop-filter: blur(12px);
  color: #e6ddf2;
}

.about-heading {
  display: flex;
  align-items: start;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.about-heading h2 {
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  color: #fff;
}

#library-feature {
  max-width: 860px;
  margin: 30px auto;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
}

#library-feature h2 {
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: normal;
  margin: 12px 0;
}

#library-feature h2 a {
  color: var(--accent-gold);
}

#library-feature p {
  line-height: 1.7;
  max-width: 640px;
  color: #d8cde6;
}

#library-feature small {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.feature-label {
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--accent-gold);
  text-transform: uppercase;
  font-weight: 600;
}

.trail-teaser {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 22px;
}

.trail-teaser h3 {
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: normal;
  margin: 10px 0;
  color: #fff;
}

.trail-teaser h3 a {
  color: #f0eaf8;
}

.connections-nav {
  margin-left: auto;
  margin-right: 15px;
  font-size: 13.5px;
  color: var(--muted);
}
.connections-nav:hover {
  color: var(--accent-gold);
}

.connection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.connection-grid section {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 22px;
}

.connection-grid section h3 a {
  color: var(--accent-gold);
}

.showcase {
  max-width: 860px;
  padding: 45px 24px;
}

.showcase h1 {
  font-family: Georgia, serif;
  font-size: clamp(38px, 7vw, 68px);
  color: #fff;
}

.showcase .lead {
  font-size: 20px;
  line-height: 1.7;
  color: var(--muted);
}

.showcase article {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}

.showcase article h2 {
  font-size: 24px;
  font-weight: 500;
  color: #fff;
}

.showcase p {
  line-height: 1.8;
  color: #d8cde6;
}

.showcase .credit {
  font-size: 13px;
  color: var(--muted);
}

.trail-doors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0;
}

.trail-doors a {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 10px 18px;
  text-decoration: none;
  font-size: 14px;
  background: var(--bg-card);
  color: #e2b36e;
  transition: all 0.2s ease;
}

.trail-doors a:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}

input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

[hidden] {
  display: none !important;
}

@media(max-width: 600px) {
  header { padding: 20px; }
  .search-home { padding-top: 6vh; }
  .searchbox { padding-left: 14px; gap: 10px; }
  .searchbox button { padding: 12px 18px; font-size: 14px; }
  .searchbox button span { display: none; }
  .searchbox input { font-size: 15.5px; }
  main { padding: 0 18px; }
  footer div { gap: 16px; }
  .result h2 { font-size: 19px; }
  #about { padding: 22px; }
  .scopes span { padding: 8px 16px; font-size: 13px; }
  .platform-doors-grid { grid-template-columns: 1fr; }
}
