:root {
  color-scheme: dark;
  --bg: #040711;
  --bg-soft: #0b1427;
  --panel: rgba(15, 25, 46, 0.78);
  --panel-strong: rgba(18, 31, 58, 0.92);
  --text: #eaf1ff;
  --muted: #9cb0d8;
  --accent: #79b8ff;
  --accent-strong: #4f8dff;
  --border: rgba(137, 170, 230, 0.3);
  --shadow: 0 24px 60px rgba(1, 6, 16, 0.55);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 20%, rgba(72, 112, 189, 0.3), transparent 36%),
    radial-gradient(circle at 87% 5%, rgba(110, 65, 170, 0.23), transparent 26%),
    radial-gradient(circle at 80% 80%, rgba(77, 124, 214, 0.22), transparent 30%),
    linear-gradient(180deg, #03060e 0%, #040913 45%, #071024 100%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.65) 0.7px, transparent 0.9px);
  background-size: 70px 70px;
  opacity: 0.22;
  pointer-events: none;
}

a { color: inherit; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 2rem;
  background: rgba(7, 12, 24, 0.84);
  border-bottom: 1px solid rgba(128, 156, 213, 0.2);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.site-header nav a {
  text-decoration: none;
  color: #d5e5ff;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 180ms ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  border-color: rgba(123, 176, 255, 0.4);
  background: rgba(95, 142, 219, 0.2);
}

main {
  padding: 2rem;
  max-width: 1150px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hero-copy,
.hero-feature {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.hero h1 { margin-top: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.hero p { color: var(--muted); max-width: 65ch; }

.statline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.pill {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #dce9ff;
  background: rgba(65, 96, 158, 0.26);
  border: 1px solid rgba(127, 159, 220, 0.38);
}

.hero-feature img {
  width: 100%;
  border-radius: 12px;
  max-height: 210px;
  object-fit: cover;
  border: 1px solid rgba(137, 170, 230, 0.25);
}

.hero-feature h2 { margin: 0 0 0.7rem; font-size: 1.05rem; color: #cae0ff; }
.hero-feature p { margin-bottom: 0; color: var(--muted); }

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

.card {
  background: var(--panel-strong);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(132, 166, 229, 0.24);
  box-shadow: 0 16px 35px rgba(2, 10, 27, 0.45);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(123, 176, 255, 0.55);
  box-shadow: 0 22px 40px rgba(5, 16, 38, 0.6);
}

.card a { text-decoration: none; display: block; }
.card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.card h3, .card p { padding: 0 0.9rem; }
.card h3 { margin: 0.8rem 0 0.25rem; }
.card p { margin-top: 0; padding-bottom: 0.95rem; color: var(--muted); }

.detail {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1rem;
}

.detail-media {
  margin: 0;
  position: relative;
}

.detail-image {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(134, 169, 231, 0.3);
  box-shadow: var(--shadow);
}

.fullscreen-toggle {
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  width: auto;
  padding: 0.45rem 0.75rem;
  margin: 0;
  border-radius: 999px;
  border: 1px solid rgba(151, 183, 240, 0.55);
  background: rgba(5, 13, 28, 0.76);
  color: #e7f0ff;
  backdrop-filter: blur(6px);
}

.fullscreen-toggle:hover,
.fullscreen-toggle:focus-visible {
  background: rgba(43, 84, 163, 0.85);
}

.detail-media.is-fullscreen {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #02050d;
}

.detail-media.is-fullscreen .detail-image {
  width: auto;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.panel {
  background: var(--panel);
  padding: 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.panel.narrow { max-width: 470px; margin: 0 auto; }

.metadata-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.5rem;
}

.metadata-list li {
  background: rgba(46, 73, 119, 0.2);
  border: 1px solid rgba(128, 157, 214, 0.25);
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.tag { 
  font-size: 0.8rem;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(138, 168, 226, 0.45);
  background: rgba(69, 108, 184, 0.26);
}

label { display: block; margin: 0.65rem 0; color: #d8e6ff; }
input, textarea, button {
  width: 100%;
  padding: 0.62rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(131, 165, 224, 0.35);
  background: rgba(4, 12, 27, 0.86);
  color: var(--text);
}

textarea { min-height: 100px; resize: vertical; }

button {
  background: linear-gradient(110deg, #3a67be, #5686ed);
  border: none;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}

.error { color: #ff9aa8; }
.success { color: #8ef0b6; }

footer {
  text-align: center;
  padding: 1.8rem 1rem;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

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


.button-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.button-row button {
  flex: 1 1 220px;
}

button.secondary {
  background: rgba(63, 92, 151, 0.45);
  border: 1px solid rgba(132, 168, 236, 0.45);
}

.wiki-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(128, 157, 214, 0.25);
}

.wiki-thumb {
  width: 100%;
  max-width: 260px;
  border-radius: 10px;
  border: 1px solid rgba(128, 157, 214, 0.35);
  margin-bottom: 0.7rem;
}

.attribution-note,
.muted {
  color: var(--muted);
  font-size: 0.9rem;
}
