:root {
  --bg: #f4efe8;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: #fffdf9;
  --text: #1d1b19;
  --muted: #615951;
  --line: rgba(38, 33, 27, 0.1);
  --accent: #d66a3d;
  --accent-dark: #9b4322;
  --accent-soft: #ffe5d8;
  --shadow: 0 16px 50px rgba(80, 47, 26, 0.12);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(214, 106, 61, 0.18), transparent 32%),
    linear-gradient(180deg, #fbf8f2 0%, var(--bg) 100%);
}

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

p,
li {
  color: var(--muted);
  line-height: 1.7;
}

.site-shell,
.site-footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px 0 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand strong,
.hero-card h1,
.section-heading h2,
.signal-card h2,
.article-header h1,
.empty-state h1 {
  font-family: Georgia, "Times New Roman", serif;
}

.brand-logo {
  display: block;
  width: auto;
  height: 68px;
  max-width: min(360px, 56vw);
  object-fit: contain;
  border-radius: 14px;
}

.topnav {
  display: inline-flex;
  gap: 12px;
}

.topnav a {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
}

.hero-grid,
.content-grid,
.article-body-wrap,
.management-grid {
  display: grid;
  gap: 24px;
}

.hero-grid > *,
.content-grid > *,
.article-body-wrap > *,
.management-grid > * {
  min-width: 0;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  margin: 18px 0 24px;
}

.hero-card,
.signal-card,
.feed-card,
.sidebar-card,
.article-highlight-box,
.empty-state,
.article-header {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card,
.signal-card,
.sidebar-card,
.empty-state,
.article-header {
  padding: 28px;
}

.hero-card {
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 106, 61, 0.25), transparent 65%);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent-dark);
}

.hero-card h1,
.signal-card h2,
.section-heading h2,
.article-header h1,
.empty-state h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.05;
  color: var(--text);
  text-wrap: balance;
}

.hero-card h1 {
  max-width: none;
  font-size: clamp(1.55rem, 2.7vw, 2.7rem);
  text-align: left;
  text-wrap: wrap;
  line-height: 1;
}

.signal-card h2 {
  max-width: none;
  font-size: clamp(1.22rem, 1.6vw, 1.95rem);
  line-height: 1.16;
}

.section-heading h2 {
  max-width: none;
  font-size: clamp(1.8rem, 2.8vw, 3.2rem);
  line-height: 1.08;
  text-wrap: wrap;
}

.article-header h1 {
  max-width: none;
  font-size: clamp(2rem, 3.4vw, 3.15rem);
  line-height: 1.08;
  text-wrap: wrap;
}

.hero-copy,
.article-excerpt {
  font-size: 1.08rem;
  max-width: none;
}

.hero-copy {
  width: 100%;
}

.hero-meta,
.feed-card-header,
.feed-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.metric-panel {
  margin: 24px 0;
  padding: 18px 20px;
  background: var(--surface-strong);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  max-width: 320px;
}

.metric-panel strong {
  display: block;
  font-size: 1.8rem;
  color: var(--accent-dark);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  font-weight: 700;
}

.signal-list,
.article-highlight-box ul,
.article-section ul {
  margin: 20px 0 0;
  padding-left: 18px;
}

.topics-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 28px;
}

.topics-strip span,
.topic-tag {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.92rem;
}

.content-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.75fr);
  align-items: start;
  padding-bottom: 40px;
}

.section-heading {
  margin-bottom: 18px;
}

.feed-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.feed-card {
  padding: 24px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.feed-card:hover,
.sidebar-card:hover,
.signal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 54px rgba(80, 47, 26, 0.16);
}

.feed-card h3,
.sidebar-card h3,
.article-highlight-box h2,
.article-section h2 {
  margin: 10px 0 8px;
  font-size: 1.4rem;
}

.article-section h3,
.article-section h4,
.article-section h5,
.article-section h6 {
  margin: 18px 0 8px;
  color: var(--text);
  line-height: 1.25;
}

.article-section h3 {
  font-size: 1.2rem;
}

.article-section h4 {
  font-size: 1.08rem;
}

.article-section h5,
.article-section h6 {
  font-size: 1rem;
}

.feed-card-footer {
  justify-content: space-between;
  align-items: center;
}

.feed-card-footer a,
.related-link strong {
  color: var(--accent-dark);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--accent-dark);
  font-weight: 600;
}

.pagination-link.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.sidebar-column {
  display: grid;
  gap: 18px;
}

.signal-card,
.sidebar-card {
  align-content: start;
}

.signal-card p,
.signal-card li,
.sidebar-card p {
  max-width: 34ch;
}

.signal-card {
  display: grid;
  align-content: start;
  justify-items: start;
  text-align: left;
}

.signal-card h2,
.signal-card .eyebrow,
.signal-card .signal-list,
.signal-card p {
  width: 100%;
  max-width: none;
}

.signal-card .signal-list {
  margin-top: 18px;
}

.article-layout {
  padding: 14px 0 40px;
}

.management-layout {
  display: grid;
  gap: 24px;
  padding: 14px 0 40px;
}

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

.article-body-wrap {
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.65fr);
  margin-top: 24px;
  align-items: start;
}

.article-body {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.article-highlight-box,
.article-section {
  padding: 24px 26px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.75);
  min-width: 0;
  overflow-wrap: anywhere;
}

.article-section p {
  margin-bottom: 0;
  font-size: 1.04rem;
}

.article-section p + p,
.article-section ul,
.article-section pre,
.article-section .table-wrap {
  margin-top: 16px;
}

.article-section pre {
  max-width: 100%;
  margin-bottom: 0;
  padding: 18px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: #201a17;
  color: #f9f1ea;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.article-section pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.7;
}

.mermaid-wrap {
  margin-top: 16px;
  max-width: 100%;
  overflow-x: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.mermaid {
  min-width: 640px;
  text-align: center;
}

.mermaid svg {
  max-width: 100%;
  height: auto;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.table-wrap th,
.table-wrap td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table-wrap th {
  background: rgba(214, 106, 61, 0.12);
  color: var(--accent-dark);
  font-size: 0.95rem;
}

.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.article-sidebar {
  display: grid;
  gap: 18px;
}

.related-link {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.related-link:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.steps-list {
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.steps-list li + li {
  margin-top: 10px;
}

.code-block {
  margin: 18px 0 0;
  padding: 18px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: #201a17;
  color: #f9f1ea;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.article-section code,
.article-excerpt code,
.steps-list code,
.sidebar-card code {
  padding: 0.18rem 0.4rem;
  border-radius: 8px;
  background: rgba(214, 106, 61, 0.12);
  color: var(--accent-dark);
}

.empty-state {
  text-align: center;
  margin: 40px auto 80px;
  max-width: 760px;
}

.site-footer {
  padding: 8px 0 48px;
}

.footer-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
}

.site-footer p {
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-meta-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
}

.footer-meta-nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

@media (max-width: 900px) {
  .hero-grid,
  .content-grid,
  .article-body-wrap,
  .management-grid {
    grid-template-columns: 1fr;
  }

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

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

  .hero-card h1,
  .signal-card h2,
  .section-heading h2,
  .article-header h1,
  .empty-state h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .signal-card h2 {
    max-width: none;
    font-size: clamp(1.2rem, 4.8vw, 1.7rem);
  }

  .section-heading h2 {
    max-width: none;
    font-size: clamp(1.7rem, 7vw, 2.5rem);
  }

  .article-header h1 {
    max-width: none;
    font-size: clamp(1.8rem, 7vw, 2.5rem);
  }
}

@media (max-width: 560px) {
  .site-shell,
  .site-footer {
    width: min(100% - 20px, 1160px);
  }

  .hero-card,
  .signal-card,
  .sidebar-card,
  .empty-state,
  .article-header,
  .feed-card,
  .article-highlight-box,
  .article-section {
    padding: 22px;
    border-radius: 22px;
  }

  .topnav {
    flex-wrap: wrap;
  }

  .brand-logo {
    height: 56px;
    max-width: 78vw;
  }
}
