:root {
  --bg: #091015;
  --paper: rgba(15, 22, 29, 0.78);
  --paper-strong: #111b23;
  --text: #edf3f7;
  --muted: #9fb0bc;
  --brand: #f07c58;
  --brand-dark: #ff9e7f;
  --accent: #63c7d6;
  --line: rgba(237, 243, 247, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(240, 124, 88, 0.2), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(99, 199, 214, 0.14), transparent 20%),
    linear-gradient(180deg, #071017 0%, #0d151d 100%);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

.hero,
.section,
.footer {
  position: relative;
  z-index: 1;
}

.navbar,
.hero-panel,
.post-card,
.spotlight-card,
.newsletter,
.footer {
  backdrop-filter: blur(18px);
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 999px;
}

.brand {
  font-family: "Fraunces", serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: 0;
  width: 44px;
  height: 44px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 6px auto;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 1.5rem;
  align-items: end;
  padding: 4.5rem 0 2rem;
}

.hero-copy h1,
.section-heading h2,
.spotlight-card h2,
.newsletter h2,
.hero-panel h2 {
  font-family: "Fraunces", serif;
  line-height: 1.05;
  margin: 0;
}

.hero-copy h1 {
  font-size: clamp(3rem, 7vw, 5.8rem);
  max-width: 10ch;
}

.eyebrow {
  margin: 0 0 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 0.78rem;
}

.hero-text,
.hero-panel p,
.post-card p,
.newsletter p,
.spotlight-card p,
.footer p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
}

.button.primary {
  background: var(--brand);
  color: #fff;
}

.button.primary:hover {
  background: var(--brand-dark);
}

.button.secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.hero-panel {
  padding: 1.6rem;
  border-radius: var(--radius-xl);
}

.hero-image,
.post-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.hero-image {
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  margin-bottom: 1rem;
  border: 1px solid rgba(29, 42, 51, 0.08);
  background: rgba(255, 255, 255, 0.55);
}

.panel-label,
.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: rgba(99, 199, 214, 0.12);
  color: var(--accent);
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.inline-link {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--brand-dark);
  font-weight: 800;
}

.section {
  padding: 1rem 0;
}

.section-grid {
  padding-top: 1.5rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.4rem;
}

.section-heading h2,
.spotlight-card h2,
.newsletter h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-button.active,
.filter-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.post-card {
  padding: 1.35rem;
  border-radius: var(--radius-lg);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.post-image {
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  margin-bottom: 1rem;
  border: 1px solid rgba(29, 42, 51, 0.08);
  background: rgba(255, 255, 255, 0.6);
}

.post-card:hover {
  transform: translateY(-6px);
}

.post-card h3 {
  margin: 1rem 0 0.5rem;
  font-size: 1.35rem;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.post-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--brand-dark);
  font-weight: 800;
}

.post-card.hidden {
  opacity: 0.18;
  transform: scale(0.98);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.article-page {
  width: min(980px, calc(100% - 2rem));
}

.article-layout {
  display: grid;
  gap: 1.5rem;
  padding-top: 2rem;
}

.article-header,
.article-body,
.article-nav {
  backdrop-filter: blur(18px);
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
}

.article-header {
  padding: 1.5rem;
}

.article-cover {
  width: 100%;
  border-radius: 22px;
  margin-top: 1rem;
  border: 1px solid rgba(29, 42, 51, 0.08);
  background: rgba(255, 255, 255, 0.6);
}

.article-title {
  font-size: clamp(2.3rem, 6vw, 4.8rem);
  max-width: 12ch;
}

.article-excerpt {
  max-width: 62ch;
  font-size: 1.08rem;
}

.article-body {
  padding: 2rem;
}

.article-body h2 {
  font-family: "Fraunces", serif;
  margin: 0 0 0.75rem;
  font-size: 1.8rem;
}

.article-body p {
  margin: 0 0 1.2rem;
  line-height: 1.8;
  color: var(--muted);
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
}

.article-nav a {
  font-weight: 800;
  color: var(--brand-dark);
}

.admin-page {
  width: min(1220px, calc(100% - 2rem));
}

.admin-layout {
  display: grid;
  gap: 1.5rem;
  padding-top: 2rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1rem;
}

.admin-card,
.admin-table-card,
.admin-metric {
  backdrop-filter: blur(18px);
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
}

.admin-card,
.admin-table-card {
  padding: 1.4rem;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.admin-metric {
  padding: 1.2rem;
}

.admin-metric strong {
  display: block;
  font-family: "Fraunces", serif;
  font-size: 2rem;
  margin-top: 0.5rem;
}

.admin-form {
  display: grid;
  gap: 0.9rem;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.admin-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  outline: none;
  color: var(--text);
}

.admin-form textarea {
  min-height: 120px;
  resize: vertical;
}

.admin-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-actions .button {
  cursor: pointer;
}

.button.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 0.9rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.row-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.table-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.table-button.delete {
  color: #9b3c30;
}

.status-message {
  min-height: 1.5rem;
  margin: 0;
  color: var(--accent);
  font-weight: 700;
}

.spotlight-card,
.newsletter,
.footer {
  border-radius: var(--radius-xl);
}

.spotlight-card {
  padding: 2rem;
}

.newsletter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 2rem;
  align-items: center;
  padding: 2rem;
}

.newsletter-form {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.newsletter-form input {
  min-width: min(320px, 100%);
  padding: 0.95rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  outline: none;
}

.newsletter-form input:focus {
  border-color: var(--brand);
}

.form-message {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--accent);
  min-height: 1.5rem;
  font-weight: 700;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
}

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

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

  .section-heading,
  .footer {
    align-items: start;
    flex-direction: column;
  }

  .newsletter-form {
    justify-content: start;
  }

  .article-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-grid,
  .admin-form-grid,
  .admin-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 1rem, 1180px);
  }

  .navbar {
    align-items: flex-start;
    border-radius: 26px;
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    width: 100%;
    display: none;
    flex-direction: column;
    padding-top: 0.5rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(8px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-8px) rotate(-45deg);
  }

  .hero-content {
    padding-top: 2rem;
  }

  .hero-copy h1 {
    max-width: 12ch;
  }

  .newsletter-form input {
    min-width: 100%;
  }
}
