:root {
  --bg: #071116;
  --bg-elevated: rgba(14, 26, 34, 0.9);
  --bg-soft: rgba(20, 36, 44, 0.7);
  --text: #ebf5f7;
  --muted: #9eb3bc;
  --line: rgba(141, 193, 205, 0.18);
  --teal: #5ee7da;
  --violet: #8b7dff;
  --amber: #ffcb79;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(94, 231, 218, 0.14), transparent 24rem),
    radial-gradient(circle at top right, rgba(139, 125, 255, 0.12), transparent 28rem),
    linear-gradient(180deg, #081117 0%, #050b10 100%);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.6;
}

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

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

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

h1,
h2,
h3 {
  letter-spacing: -0.03em;
}

.site-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-header {
  margin-bottom: 2.5rem;
  padding: 0.8rem 0 1.2rem;
}

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(94, 231, 218, 0.28);
  border-radius: 0.9rem;
  background: linear-gradient(135deg, rgba(94, 231, 218, 0.18), rgba(139, 125, 255, 0.16));
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: 1.45rem;
}

.brand-copy,
.site-nav,
.footer-links,
.dispatch-meta,
.archive-card-top,
.log-meta,
.cta-row,
.stack-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-copy {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}

.brand-name {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.04em;
}

.brand-tag,
.site-nav a,
.footer-links a,
time {
  color: var(--muted);
}

.brand-tag {
  font-size: 0.84rem;
}

.site-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.footer-links a:hover,
.text-link:hover,
.stack-links a:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  border-color: rgba(94, 231, 218, 0.5);
}

main {
  display: grid;
  gap: 1.4rem;
}

.panel {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: linear-gradient(180deg, rgba(14, 26, 34, 0.92), rgba(9, 18, 24, 0.92));
  box-shadow: var(--shadow);
}

.panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -55% auto;
  width: 12rem;
  height: 12rem;
  background: radial-gradient(circle, rgba(94, 231, 218, 0.1), transparent 70%);
  pointer-events: none;
}

.accent-panel::after {
  background: radial-gradient(circle, rgba(255, 203, 121, 0.12), transparent 70%);
}

.eyebrow,
.issue-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: rgba(94, 231, 218, 0.12);
  color: #aef6ef;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  margin-bottom: 1rem;
}

.hero-panel {
  padding: 2rem;
}

.hero-grid,
.section-grid,
.dispatch-layout {
  display: grid;
  gap: 1.4rem;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 0.8fr);
  align-items: stretch;
}

.hero-panel h1,
.page-intro h1,
.dispatch-article h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: 0.94;
  max-width: 12ch;
  margin-bottom: 1.25rem;
}

.hero-copy,
.deck,
.page-intro p {
  max-width: 44rem;
  font-size: 1.08rem;
  color: #d5e5e9;
}

.cta-row {
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(94, 231, 218, 0.26);
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, rgba(94, 231, 218, 0.2), rgba(139, 125, 255, 0.14));
}

.button-secondary {
  background: rgba(255, 255, 255, 0.02);
}

.signal-card,
.sidebar-card {
  height: 100%;
}

.signal-label {
  display: inline-block;
  color: var(--amber);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.signal-card h2,
.archive-card h2,
.log-entry h2,
.sidebar-card h2,
.panel h2,
.panel h3 {
  margin-bottom: 0.8rem;
}

.signal-card h2,
.panel h2,
.archive-card h2,
.log-entry h2,
.sidebar-card h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.05;
}

.panel p,
.signal-card p,
.archive-card p,
.log-entry p,
.dispatch-body p,
.sidebar-card p {
  color: #c5d6dc;
}

.text-link,
.signal-card a,
.stack-links a {
  color: #d8fbf6;
  font-weight: 700;
}

.section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.watch-grid article,
.archive-card,
.log-entry {
  padding: 1.2rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(141, 193, 205, 0.1);
}

.page-intro {
  padding: 1.8rem;
}

.dispatch-layout {
  grid-template-columns: minmax(0, 2fr) minmax(18rem, 0.8fr);
  align-items: start;
}

.dispatch-article {
  padding: 2rem;
}

.dispatch-meta,
.archive-card-top,
.log-meta {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.deck {
  font-size: 1.18rem;
  margin-bottom: 2rem;
}

.dispatch-body p {
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
}

.stack-links {
  flex-direction: column;
  align-items: flex-start;
}

.archive-list,
.log-list {
  display: grid;
  gap: 1rem;
}

.rich-text h2 {
  margin-top: 2rem;
}

.rich-text p,
.rich-text li {
  color: #c5d6dc;
  font-size: 1.05rem;
}

.search-form,
.admin-form,
.admin-actions,
.admin-header,
.admin-list {
  display: grid;
  gap: 1rem;
}

.search-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.admin-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.admin-actions {
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  margin-top: 1.5rem;
}

.admin-list a {
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(141, 193, 205, 0.14);
}

.admin-shell h1,
.narrow-panel h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 0.98;
}

.narrow-panel {
  max-width: 52rem;
}

.admin-form label {
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.search-form input {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(141, 193, 205, 0.18);
  background: rgba(5, 11, 16, 0.72);
  color: var(--text);
  font: inherit;
}

.form-error {
  color: #ffd2b8;
}

.stat-card h2 {
  font-size: clamp(2.6rem, 6vw, 4rem);
}

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

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

  .site-nav,
  .footer-links,
  .search-form,
  .admin-header {
    justify-content: flex-start;
    flex-wrap: wrap;
    grid-template-columns: 1fr;
  }

  .hero-panel h1,
  .page-intro h1,
  .dispatch-article h1 {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(calc(100% - 1.1rem), var(--max-width));
    padding-top: 0.8rem;
  }

  .panel,
  .hero-panel,
  .dispatch-article,
  .page-intro {
    padding: 1.2rem;
    border-radius: 1.1rem;
  }

  .site-nav {
    gap: 0.75rem 1rem;
  }

  .hero-copy,
  .deck,
  .page-intro p,
  .dispatch-body p {
    font-size: 1rem;
  }
}
