:root {
  --bg: #020202;
  --panel: rgba(255, 255, 255, 0.06);
  --text: #f5f2e8;
  --muted: #b5b0a3;
  --accent: #ff8c1a;
  --spark: #ffd166;
  --border: rgba(255, 255, 255, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Georgia", "Times New Roman", serif;
  background: radial-gradient(circle at top, #111 0%, var(--bg) 55%, #000 100%);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.2;
  pointer-events: none;
}

.site-header {
  padding: 1.2rem 1.5rem 0;
}

.main-nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-link,
.category-link {
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  transition: background 180ms ease, color 180ms ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.category-link:hover,
.category-link:focus-visible {
  background: rgba(255, 140, 26, 0.16);
  color: var(--accent);
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  display: none;
  flex-direction: column;
  min-width: 150px;
  padding: 0.65rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.dropdown-menu a {
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  display: flex;
}

.hero-shell,
.page-shell,
.landing-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.hero-card,
.page-card,
.panel,
.post-card,
.admin-panel,
.landing-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
}

.landing-shell {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: 2rem;
}

.landing-card {
  padding: 2.5rem;
  display: inline-block;
  min-width: min(90vw, 720px);
  margin-left: 0;
}

.landing-title {
  font-size: clamp(2rem, 4vw, 3.1rem);
  margin-bottom: 1.5rem;
  text-align: left;
}

.category-stack {
  display: grid;
  gap: 1rem;
}

.category-link {
  display: inline-block;
  font-size: 1.1rem;
  padding-left: 0;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.9rem;
}

h1,
h2,
h3 {
  margin-top: 0;
}

#site-title {
  font-size: clamp(2.1rem, 4vw, 3.35rem);
  margin-bottom: 1rem;
}

.hero-copy {
  color: var(--muted);
  font-size: 1rem;
  max-width: 680px;
  margin: 0 auto 1.5rem;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.button,
button {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.25rem;
  background: linear-gradient(135deg, var(--accent), #ffc55c);
  color: #110b04;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.button.secondary,
button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.content-grid,
.admin-layout {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel,
.admin-panel {
  padding: 1.3rem;
}

.post-list {
  display: grid;
  gap: 0.9rem;
}

.post-card {
  padding: 1rem;
}

.post-card h3 {
  margin-bottom: 0.3rem;
}

.post-meta,
.post-type,
.post-summary,
.post-date {
  color: var(--muted);
}

.post-summary {
  margin: 0.6rem 0;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.post-actions a,
.post-actions button {
  font-size: 0.92rem;
  padding: 0.55rem 0.9rem;
}

.posts-container {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.archive-list {
  margin: 0;
  padding-left: 1rem;
}

.archive-list a {
  color: var(--text);
  text-decoration: none;
}

.stack-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

textarea {
  resize: vertical;
}

.site-footer {
  text-align: center;
  padding: 1.2rem 1rem 2rem;
  color: var(--muted);
}

.spark-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.spark {
  position: absolute;
  bottom: -8px;
  left: var(--x);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--spark);
  box-shadow: 0 0 8px var(--spark), 0 0 16px var(--accent);
  opacity: 0;
  animation: drift var(--duration) ease-in forwards;
}

.spark::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
}

.password-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 20;
}

.password-card {
  width: min(92vw, 360px);
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.4rem;
  display: grid;
  gap: 0.8rem;
}

.password-message {
  color: #ffb48a;
  margin: 0;
}

.format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.format-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.format-btn:hover,
.format-btn:focus-visible {
  background: rgba(255, 140, 26, 0.18);
}

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

.tag-pill {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.sort-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.sort-controls label {
  min-width: 200px;
}

.post-image {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 0.8rem;
}

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

.photo-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0.7rem;
}

.photo-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
}

.photo-card h3 {
  margin: 0.65rem 0 0.3rem;
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(0.5);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translate3d(0, calc(var(--travel) * -1), 0) scale(1.2);
    opacity: 0;
  }
}

@media (max-width: 700px) {
  .main-nav {
    flex-direction: column;
    gap: 0.8rem;
    border-radius: 24px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .landing-card {
    padding: 1.4rem;
  }

  .hero-card {
    padding: 2rem 1.2rem;
  }
}
