:root {
  --bg: #090b12;
  --panel: #11151f;
  --panel-strong: #171d2a;
  --panel-soft: rgba(255, 255, 255, 0.04);
  --text: #f3f6fb;
  --muted: #98a3b8;
  --line: rgba(255, 255, 255, 0.08);
  --brand: #27d0a8;
  --brand-soft: rgba(39, 208, 168, 0.16);
  --danger: #ff7b7b;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Battambang", "Noto Sans Khmer", "Khmer OS Battambang", sans-serif;
  background:
    radial-gradient(circle at top, rgba(39, 208, 168, 0.12), transparent 22%),
    linear-gradient(180deg, #0a0d14 0%, #090b12 48%, #0f1320 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 90%);
}

.page-shell {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.1rem 0 3rem;
}

.topbar {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 13, 20, 0.82);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #1487ff);
  color: #071016;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand strong,
.section-title h2,
h1,
.story-title {
  font-family: "Playfair Display", serif;
}

.brand div {
  display: grid;
}

.brand span {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-links,
.topbar__actions,
.featured-actions,
.story-footer,
.split,
.form-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

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

.topbar__actions {
  justify-content: end;
}

.search-shell {
  width: min(100%, 360px);
}

.search-shell input,
input,
select,
textarea,
.btn,
.delete-btn {
  font: inherit;
}

.search-shell input,
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.9rem 1rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.search-shell input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(39, 208, 168, 0.5);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
}

.btn,
.delete-btn,
.pill {
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.btn:hover,
.delete-btn:hover,
.pill:hover {
  transform: translateY(-1px);
}

.btn {
  padding: 0.82rem 1.1rem;
  border-radius: 999px;
}

.btn--primary {
  background: linear-gradient(135deg, var(--brand), #1487ff);
  color: #04121a;
  font-weight: 700;
  text-decoration: none;
}

.btn--ghost,
.delete-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--line);
}

.hero-stage {
  display: grid;
  grid-template-columns: 1.55fr 0.8fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.featured-panel,
.spotlight-panel,
.category-strip,
.library-panel,
.editor-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(17, 21, 31, 0.82);
  box-shadow: var(--shadow);
}

.featured-panel {
  position: relative;
  min-height: 540px;
  overflow: hidden;
}

.featured-backdrop,
.featured-overlay {
  position: absolute;
  inset: 0;
}

.featured-backdrop {
  background-image: url("https://images.unsplash.com/photo-1512820790803-83ca734da794?auto=format&fit=crop&w=1400&q=80");
  background-position: center;
  background-size: cover;
  transform: scale(1.04);
  filter: saturate(1.05);
}

.featured-overlay {
  background:
    linear-gradient(90deg, rgba(5, 8, 13, 0.9) 0%, rgba(5, 8, 13, 0.54) 45%, rgba(5, 8, 13, 0.82) 100%),
    linear-gradient(180deg, transparent, rgba(5, 8, 13, 0.75));
}

.featured-content {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  gap: 0.9rem;
  height: 100%;
  padding: 2rem;
}

.eyebrow {
  margin: 0;
  color: #5cf0c5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 4vw, 4.8rem);
  line-height: 0.97;
  max-width: 720px;
}

.featured-meta,
.featured-excerpt,
.spotlight-item__meta,
.story-meta,
.record-date,
.section-title span {
  color: var(--muted);
}

.featured-excerpt {
  max-width: 680px;
  line-height: 1.8;
  font-size: 1rem;
}

.spotlight-panel,
.library-panel,
.editor-panel,
.category-strip {
  padding: 1rem;
}

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

.spotlight-list {
  display: grid;
  gap: 0.75rem;
}

.spotlight-item {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 0.8rem;
  padding: 0.6rem;
  border-radius: 18px;
  background: var(--panel-soft);
}

.spotlight-item__cover {
  width: 78px;
  height: 94px;
  object-fit: cover;
  border-radius: 14px;
}

.spotlight-item__body {
  display: grid;
  align-content: center;
  gap: 0.2rem;
}

.spotlight-item__title {
  font-size: 1rem;
  line-height: 1.35;
}

.category-strip {
  margin-bottom: 1rem;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.pill {
  padding: 0.72rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.pill--active {
  background: var(--brand-soft);
  color: #aaf5e2;
  border: 1px solid rgba(39, 208, 168, 0.28);
}

.content-layout {
  display: grid;
  grid-template-columns: 1.45fr 0.82fr;
  gap: 1rem;
}

.status-banner {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.status-banner strong {
  color: var(--text);
}

.status-banner span {
  color: var(--muted);
  line-height: 1.65;
}

.status-banner[data-tone="success"] {
  border-color: rgba(39, 208, 168, 0.25);
  background: rgba(39, 208, 168, 0.08);
}

.status-banner[data-tone="danger"] {
  border-color: rgba(255, 123, 123, 0.3);
  background: rgba(255, 123, 123, 0.08);
}

.empty-state {
  padding: 1.4rem;
  margin-bottom: 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

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

.story-card {
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
}

.story-card__media {
  position: relative;
}

.story-cover {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.story-badge {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(5, 8, 13, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #dffdf5;
  font-size: 0.82rem;
}

.story-card__body {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.story-category {
  color: #5cf0c5;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.story-title {
  font-size: 1.4rem;
  line-height: 1.12;
}

.story-excerpt {
  color: #d7ddeb;
  line-height: 1.65;
}

.story-content {
  color: var(--muted);
  line-height: 1.7;
}

.story-footer {
  justify-content: space-between;
}

.editor-panel {
  align-self: start;
  position: sticky;
  top: 6.5rem;
}

.story-form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: #dce3f2;
  font-size: 0.95rem;
}

.split {
  align-items: stretch;
}

.split > label {
  flex: 1;
}

@media (max-width: 1120px) {
  .hero-stage,
  .content-layout,
  .topbar {
    grid-template-columns: 1fr;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .topbar__actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .search-shell {
    width: 100%;
  }

  .editor-panel {
    position: static;
  }
}

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

  .featured-panel {
    min-height: 460px;
  }

  .featured-content,
  .spotlight-panel,
  .library-panel,
  .editor-panel,
  .category-strip {
    padding: 1rem;
  }

  .story-grid {
    grid-template-columns: 1fr;
  }

  .split,
  .form-actions,
  .featured-actions,
  .story-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    position: static;
    border-radius: 24px;
  }
}
