:root {
  color: #edf2f7;
  background: #090c13;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 15% -10%, rgba(58, 100, 180, .2), transparent 36rem),
    radial-gradient(circle at 90% 20%, rgba(145, 66, 160, .14), transparent 32rem),
    #090c13;
}

button, input, textarea { font: inherit; }

button {
  border: 1px solid #354156;
  border-radius: .65rem;
  padding: .55rem .8rem;
  color: #e9eef7;
  background: rgba(20, 27, 40, .88);
  cursor: pointer;
}

button:hover, button:focus-visible { border-color: #75a7ff; background: #18243a; }
button:disabled { opacity: .4; cursor: default; }

a { color: #8db7ff; }
a:hover { color: #bfd5ff; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(8rem, 1fr) auto minmax(12rem, 20rem) auto;
  align-items: center;
  gap: clamp(.65rem, 2vw, 1.25rem);
  min-height: 3.8rem;
  padding: .55rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid rgba(128, 154, 192, .2);
  background: rgba(9, 12, 19, .84);
  backdrop-filter: blur(18px);
}
.account-nav { display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.account-nav a { text-decoration: none; }

.brand { display: flex; gap: .75rem; align-items: center; color: inherit; text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: .15rem; color: #91a0b6; }

.brand-mark {
  width: 2rem;
  aspect-ratio: 1;
  border: .55rem solid #8899af;
  border-radius: 50%;
  box-shadow: 0 0 1.5rem rgba(130, 176, 255, .35), inset 0 0 .5rem #111827;
}

.focus-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-button { white-space: nowrap; }

.search { position: relative; display: block; color: #9caac0; font-size: .75rem; }
.search input {
  width: 100%;
  border: 1px solid #354156;
  border-radius: .7rem;
  padding: .65rem .8rem;
  color: #f7f9fc;
  background: #101622;
}

.search-results {
  position: absolute;
  z-index: 30;
  top: 100%;
  right: 0;
  display: grid;
  width: 100%;
  margin-top: .35rem;
  overflow: hidden;
  border-radius: .7rem;
  background: #151d2b;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, .35);
}
.search-results:empty { display: none; }
.search-results button { border: 0; border-radius: 0; text-align: left; }

main { width: min(1300px, calc(100% - 2rem)); margin: 1rem auto 3rem; }
.map-card, .article-card {
  border: 1px solid rgba(125, 150, 186, .22);
  border-radius: 1.15rem;
  background: rgba(13, 18, 28, .86);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .24);
}

.map-stage { position: relative; min-height: 32rem; overflow: hidden; border-bottom: 1px solid rgba(125, 150, 186, .15); border-radius: 1.15rem 1.15rem 0 0; }
canvas { display: block; width: 100%; height: min(70vh, 700px); min-height: 32rem; cursor: grab; touch-action: none; }
canvas.dragging { cursor: grabbing; }
.labels { position: absolute; inset: 0; pointer-events: none; }
.node-label {
  position: absolute;
  max-width: 14rem;
  border: 0;
  padding: .22rem .45rem;
  color: #f5f7fb;
  background: rgba(8, 11, 17, .72);
  text-shadow: 0 1px .25rem #000;
  pointer-events: auto;
  white-space: nowrap;
}
.node-label:hover, .node-label:focus-visible { color: white; background: #223453; }
.node-label small { margin-left: .35rem; color: #b9c6d9; }
.axis-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: .16rem .38rem;
  border: 1px solid color-mix(in srgb, var(--axis-color) 52%, transparent);
  border-radius: 999px;
  color: #f2f6fc;
  background: rgba(8, 11, 17, .78);
  box-shadow: 0 0 1rem color-mix(in srgb, var(--axis-color) 20%, transparent);
  font-size: clamp(.68rem, 1.4vw, .78rem);
  line-height: 1.2;
  text-shadow: 0 1px .25rem #000;
  white-space: nowrap;
}
.map-help { margin: 0; padding: .7rem 1.35rem 1rem; color: #8e9bb0; font-size: .86rem; }

.article-card { margin-top: 1rem; padding: clamp(1.2rem, 4vw, 3rem); line-height: 1.7; }
.article-meta { margin: 0 0 1rem; color: #93a4bc; font-size: .84rem; }
.coordinate-value {
  padding: 0 .08rem;
  color: color-mix(in srgb, var(--pole-color) 82%, white);
  text-shadow:
    0 0 .35rem color-mix(in srgb, var(--pole-color) 70%, transparent),
    0 0 .8rem color-mix(in srgb, var(--pole-color) 36%, transparent);
  cursor: help;
  font-weight: 700;
}
.point-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; color: #93a4bc; }
.point-actions .pole-vote { border-color: var(--pole-color); color: color-mix(in srgb, var(--pole-color) 72%, white); }
.point-actions .pole-vote.selected { background: color-mix(in srgb, var(--pole-color) 32%, #101622); box-shadow: inset 0 0 1rem color-mix(in srgb, var(--pole-color) 22%, transparent); }
.point-actions .support-button { border-color: var(--concept-color); }
.point-actions .support-button.selected { background: color-mix(in srgb, var(--user-color) 42%, #101622); box-shadow: inset 0 0 1rem color-mix(in srgb, var(--user-color) 24%, transparent); }
.article-card h1 { margin-top: 0; font-size: clamp(1.8rem, 5vw, 3rem); }
.article-card h2 { margin-top: 2rem; }
.article-card pre { overflow: auto; padding: 1rem; border-radius: .8rem; background: #080b11; }
.article-card code { padding: .12rem .3rem; border-radius: .3rem; background: #080b11; }
.article-card pre code { padding: 0; }
.article-card li + li { margin-top: .35rem; }
.article-card img { display: block; max-width: 100%; height: auto; margin: 1.25rem auto; border-radius: .9rem; box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .3); }
.article-tags { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid rgba(125, 150, 186, .18); }
.article-tags span { color: #93a4bc; font-size: .84rem; }
.article-tags a { padding: .2rem .55rem; border: 1px solid #354156; border-radius: 999px; color: #bcd3ff; text-decoration: none; font-size: .86rem; }
.article-tags a:hover, .article-tags a:focus-visible { border-color: #75a7ff; background: #18243a; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(1300px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 2.5rem;
  color: #8492a8;
  font-size: .85rem;
}
footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .8rem; }

@media (max-width: 900px) {
  .brand small { display: none; }
  .brand-mark { width: 1.7rem; border-width: .45rem; }
  .topbar { grid-template-columns: auto minmax(7rem, 1fr) auto; }
  .search, .account-nav { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .search { grid-column: 1 / -1; }
  footer { align-items: stretch; flex-direction: column; }
  canvas, .map-stage { min-height: 25rem; }
  canvas { height: 25rem; }
  footer nav { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
