:root {
  --page: #0a0e1a;
  --panel: #111827;
  --panel-soft: #121d31;
  --border: #1e2d4a;
  --text: #ffffff;
  --muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 34rem),
    linear-gradient(135deg, #0a0e1a 0%, #0d1424 48%, #071020 100%);
  color: var(--text);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

.site-header,
.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 18px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid rgba(30, 45, 74, 0.8);
  background: rgba(10, 14, 26, 0.86);
  backdrop-filter: blur(18px);
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 800;
}

.brand-logo,
.footer-logo {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 6px;
}

.brand-logo img,
.footer-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
}

.brand-logo.large {
  width: 54px;
  height: 54px;
}

.brand-word,
.footer-wordmark {
  overflow-wrap: anywhere;
  font-family: "Oswald", Arial, sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.site-nav a {
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
  transition: background 160ms ease, color 160ms ease;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
  padding: 10px 14px;
  transition: background 160ms ease, color 160ms ease;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.nav-dropdown[open] summary,
.nav-dropdown summary:hover {
  background: rgba(37, 99, 235, 0.14);
  color: var(--text);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 190px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 8px;
}

.nav-dropdown-menu a {
  padding: 10px 12px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.site-nav .admin-shortcut {
  background: rgba(37, 99, 235, 0.14);
  color: var(--text);
}

.site-nav .admin-shortcut {
  border: 1px solid rgba(37, 99, 235, 0.48);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
}

.hero {
  min-height: min(640px, calc(100vh - 96px));
  display: grid;
  align-items: center;
  padding: clamp(72px, 10vw, 130px) clamp(18px, 5vw, 72px) 84px;
}

.hero-inner,
.content-band,
.page-shell,
.post-shell,
.admin-shell {
  width: min(1160px, calc(100% - 36px));
  margin-inline: auto;
}

.hero-inner {
  margin: 0;
  max-width: 880px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  font-family: "Oswald", Arial, sans-serif;
  font-size: clamp(48px, 9vw, 116px);
}

h2 {
  font-family: "Oswald", Arial, sans-serif;
  font-size: clamp(32px, 5vw, 56px);
}

h3 {
  font-size: 22px;
}

.hero-copy {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2.4vw, 24px);
}

.content-band {
  padding: 42px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-edit-button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--accent-hover);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 12px;
}

.section-edit-button:hover {
  border-color: var(--accent-hover);
  color: var(--text);
}

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

.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-height: 720px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-color: var(--accent) var(--panel);
}

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

.archive-shell {
  width: min(1160px, calc(100% - 36px));
  min-height: calc(100vh - 210px);
  margin-inline: auto;
  padding: 76px 0;
}

.post-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(13, 20, 36, 0.96));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.post-card.featured {
  min-height: 420px;
}

.cover-frame {
  display: grid;
  min-height: 180px;
  place-items: center;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.96), rgba(5, 18, 43, 0.96)),
    #111827;
  color: rgba(255, 255, 255, 0.86);
  font-family: "Oswald", Arial, sans-serif;
  font-size: 48px;
  font-weight: 700;
}

.cover-frame img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.cover-frame .fallback-cover-logo {
  width: min(62%, 210px);
  height: auto;
  object-fit: contain;
  mix-blend-mode: screen;
}

.post-card-body {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.post-card time,
.post-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.post-card h3 {
  font-size: 22px;
}

.post-card p {
  margin: 0;
  color: var(--muted);
}

.view-all-card {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 210px;
  padding: 24px;
  transition: border-color 160ms ease, transform 160ms ease;
}

.view-all-card:hover {
  border-color: var(--accent-hover);
  transform: translateY(-2px);
}

.view-all-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent-hover);
  font-size: 26px;
  font-weight: 800;
}

.view-all-title {
  color: var(--text);
  font-family: "Oswald", Arial, sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.08;
}

.view-all-text {
  color: var(--muted);
  font-weight: 600;
}

.search-field {
  width: min(100%, 340px);
}

.search-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.read-more,
.back-link,
.button-link,
.admin-edit-link {
  color: var(--accent-hover);
  font-weight: 800;
}

.read-more:hover,
.back-link:hover,
.button-link:hover,
.admin-edit-link:hover {
  color: var(--text);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.is-admin .admin-edit-link {
  display: inline-flex;
}

.post-edit-link {
  margin-top: 12px;
}

.empty-state,
.notice-state {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.78);
  color: var(--muted);
  padding: 22px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 18, 0.72);
  padding: 18px;
}

.picker-panel {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

.picker-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.highlight-picker-list {
  display: grid;
  gap: 10px;
}

.picker-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1220;
  cursor: pointer;
  padding: 12px;
}

.picker-option input {
  width: 18px;
  height: 18px;
}

.picker-option span {
  display: grid;
  gap: 2px;
}

.picker-option small {
  color: var(--muted);
  font-weight: 700;
}

.page-shell,
.post-shell {
  padding: 76px 0;
}

.about-layout {
  display: grid;
  gap: 46px;
  max-width: 860px;
}

.about-layout p,
.post-article p,
.post-article li {
  color: #dbe6f6;
  font-size: 18px;
}

.about-layout section {
  border-left: 3px solid var(--accent);
  padding-left: 24px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}

.button-link,
.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 800;
  padding: 10px 16px;
}

.button-link,
.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--text);
}

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

.primary-button:hover,
.button-link:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.ghost-button:hover {
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

.post-shell {
  max-width: 900px;
}

.post-article {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 38px;
}

.post-article h1 {
  max-width: 820px;
  margin-bottom: 12px;
  font-size: clamp(42px, 7vw, 78px);
}

.post-article h2,
.post-article h3 {
  margin-top: 38px;
  margin-bottom: 14px;
}

.post-article a {
  color: var(--accent-hover);
  font-weight: 700;
}

.post-article img {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 28px 0;
}

.post-article blockquote {
  margin: 32px 0;
  border-left: 3px solid var(--accent);
  color: #dbe6f6;
  padding: 4px 0 4px 22px;
}

.post-article hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

.back-link.bottom {
  display: inline-flex;
  margin-top: 34px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

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

.footer-wordmark {
  color: var(--text);
  font-size: 20px;
}

.admin-body {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 28rem),
    var(--page);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-panel,
.table-panel,
.editor-panel,
.access-panel {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.96);
  box-shadow: var(--shadow);
}

.auth-panel {
  display: grid;
  gap: 12px;
  max-width: 440px;
  padding: 30px;
}

.access-panel {
  display: grid;
  gap: 16px;
  max-width: 560px;
  margin: 64px auto;
  padding: 30px;
}

.access-panel h1 {
  font-size: clamp(38px, 6vw, 58px);
}

.access-panel p {
  margin: 0;
  color: var(--muted);
}

.auth-panel h1 {
  font-size: 40px;
}

.auth-panel p {
  margin: 0 0 8px;
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  color: #dbe6f6;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1220;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

input[type="file"] {
  border-style: dashed;
  color: var(--muted);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  padding: 7px 12px;
}

input:focus,
textarea:focus,
select:focus,
.rich-editor:focus {
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
}

.form-status.error {
  color: #fca5a5;
}

.form-status.success {
  color: #86efac;
}

.admin-shell {
  padding: 42px 0 72px;
}

.admin-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-title-row h1 {
  font-size: clamp(38px, 6vw, 64px);
}

.table-panel {
  overflow: hidden;
}

.post-row,
.post-row.header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 130px 150px 260px;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.post-row.header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-row:last-child {
  border-bottom: 0;
}

.post-row-title {
  min-width: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  justify-content: center;
  width: max-content;
  min-width: 86px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
}

.status-pill.published {
  border-color: rgba(34, 197, 94, 0.42);
  color: #86efac;
}

.status-pill.highlighted {
  border-color: rgba(59, 130, 246, 0.55);
  color: #93c5fd;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions .ghost-button {
  min-height: 36px;
  padding: 7px 11px;
}

.editor-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
}

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

.field-grid label:nth-child(3) {
  grid-column: 1 / -1;
}

.publish-toggle {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 10px;
}

.cover-preview {
  width: min(100%, 520px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1220;
}

.cover-preview img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.publish-toggle input {
  width: 18px;
  height: 18px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1220;
  padding: 10px;
}

.toolbar button,
.toolbar select {
  width: auto;
  min-width: 42px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 8px 10px;
}

.toolbar button:hover {
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

.underline {
  text-decoration: underline;
}

.strike {
  text-decoration: line-through;
}

.rich-editor {
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1220;
  color: #e5edf8;
  padding: 22px;
  outline: none;
}

.rich-editor:empty::before {
  content: "Write the post...";
  color: var(--muted);
}

.rich-editor h1,
.rich-editor h2,
.rich-editor h3 {
  margin: 22px 0 12px;
}

@media (max-width: 900px) {
  .featured-grid,
  .latest-grid,
  .stories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-row,
  .post-row.header {
    grid-template-columns: minmax(180px, 1fr) 110px 120px;
  }

  .post-row > :last-child,
  .post-row.header > :last-child {
    grid-column: 1 / -1;
  }

  .site-footer,
  .admin-title-row,
  .admin-header-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .site-header,
  .admin-header {
    padding-inline: 18px;
  }

  .menu-button {
    display: grid;
  }

  .site-nav {
    position: absolute;
    inset: 76px 18px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    padding: 8px;
    box-shadow: var(--shadow);
  }

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

  .site-nav a {
    padding: 12px;
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown summary {
    justify-content: space-between;
    padding: 12px;
  }

  .nav-dropdown-menu {
    position: static;
    min-width: 0;
    margin-top: 6px;
    box-shadow: none;
  }

  .brand-word {
    font-size: 20px;
  }

  .hero {
    min-height: 520px;
    padding-top: 60px;
  }

  .featured-grid,
  .latest-grid,
  .stories-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .latest-grid {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .about-layout section {
    padding-left: 16px;
  }

  .post-row,
  .post-row.header {
    grid-template-columns: 1fr;
  }

  .post-row.header {
    display: none;
  }

  .auth-panel,
  .editor-panel {
    padding: 18px;
  }
}
