:root {
  color-scheme: light;
  --bg: #FBF9F4;
  --bg-soft: #FBF9F4;
  --surface: rgba(251, 249, 244, 0.94);
  --surface-strong: #ffffff;
  --surface-muted: rgba(255, 248, 240, 0.86);
  --text: #54453A;
  --muted: #A16A46;
  --accent: #E77D3F;
  --accent-dark: #d4692f;
  --border: rgba(109, 88, 69, 0.16);
  --border-strong: rgba(221, 121, 27, 0.22);
  --shadow: 0 24px 56px rgba(67, 43, 21, 0.12);
  --shadow-soft: 0 18px 32px rgba(67, 43, 21, 0.08);
  --radius: 28px;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #2a2825;
  --bg-soft: #2a2825;
  --surface: rgba(54, 50, 45, 0.94);
  --surface-strong: #36322d;
  --surface-muted: rgba(44, 40, 36, 0.92);
  --text: #e3e3e3;
  --muted: #d0cac4;
  --border: rgba(168, 141, 111, 0.34);
  --border-strong: rgba(221, 121, 27, 0.34);
  --shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 18px 32px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color 250ms ease, color 250ms ease;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-dark);
}

:root[data-theme='dark'] a {
  color: #f2b173;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  letter-spacing: -0.02em;
}

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

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  width: 100%;
  background-color: transparent;
  border-bottom: none;
  box-shadow: none;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-lockup img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-self: center;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav-link {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.site-nav-link:hover {
  background-color: var(--accent);
  color: #fffdfb;
  transform: translateY(-1px);
}

.site-nav-link.is-current {
  background-color: var(--accent);
  color: #fffdfb;
}

:root[data-theme='dark'] .site-nav-link {
  color: var(--text);
}

:root[data-theme='dark'] .site-nav-link:hover,
:root[data-theme='dark'] .site-nav-link.is-current {
  color: #fffdfb;
}

.site-header-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  color: #fffdfb;
}

.site-header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
}

.site-mobile-controls {
  display: none;
}

.site-header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 44px;
  padding: 0;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

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

.site-mobile-menu-button__icon {
  align-items: center;
  display: inline-flex;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.site-mobile-menu-button__icon svg {
  height: 22px;
  width: 22px;
}

.site-mobile-menu-button[data-menu-state='closed'] .site-mobile-menu-button__icon--close,
.site-mobile-menu-button[data-menu-state='open'] .site-mobile-menu-button__icon--menu {
  display: none;
}

.site-mobile-menu-button[data-menu-state='open'] .site-mobile-menu-button__icon--close,
.site-mobile-menu-button[data-menu-state='closed'] .site-mobile-menu-button__icon--menu {
  display: inline-flex;
}

.site-mobile-menu {
  display: none;
}

.site-mobile-menu.is-open {
  display: flex;
}

.site-mobile-menu-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-mobile-menu-link {
  align-items: center;
  background: var(--surface-soft);
  border-radius: 22px;
  color: var(--text);
  display: flex;
  font-size: 16px;
  font-weight: 600;
  min-height: 44px;
  padding: 0 14px;
  text-decoration: none;
}

.site-mobile-menu-link.is-current,
.site-mobile-menu-link--primary {
  background: var(--accent);
  color: #fffdfb;
}

.site-mobile-menu-link--outline {
  background: transparent;
  border: 1px solid #a16a46;
}

.site-mobile-menu-divider {
  background: var(--border-soft);
  height: 1px;
}

.site-auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

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

.site-auth-button--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid #a16a46;
  box-shadow: none;
}

.site-auth-button--primary,
:root[data-theme='dark'] .site-auth-button--primary {
  background: var(--accent);
  color: #fffdfb;
  border: 1px solid var(--accent);
  box-shadow: none;
}

.site-auth-button--outline:hover,
.site-auth-button--primary:hover,
:root[data-theme='dark'] .site-auth-button--outline:hover,
:root[data-theme='dark'] .site-auth-button--primary:hover {
  color: #fffdfb;
}

.site-auth-button--outline:hover {
  background: rgba(231, 125, 63, 0.18);
}

.site-auth-button--primary:hover {
  background: #d4692f;
}

.site-theme-toggle {
  align-items: center;
  background: transparent;
  border: 2px solid #a16a46;
  border-radius: 999px;
  box-shadow: none;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  min-width: 48px;
  height: 48px;
  justify-content: center;
  padding: 0 12px;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.site-theme-toggle:hover {
  background: #F7CA9B;
  color: #E77D3F;
  transform: translateY(-1px);
}

:root[data-theme='dark'] .site-theme-toggle:hover {
  background: #d4692f;
  color: #FEF5EB;
}

.site-theme-toggle__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  position: relative;
}

.site-theme-toggle__icon {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.site-theme-toggle__icon svg {
  width: 24px;
  height: 24px;
}

.site-theme-toggle[data-theme-mode='light'] .site-theme-toggle__icon--moon,
.site-theme-toggle[data-theme-mode='dark'] .site-theme-toggle__icon--sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.site-theme-toggle[data-theme-mode='light'] .site-theme-toggle__icon--sun,
.site-theme-toggle[data-theme-mode='dark'] .site-theme-toggle__icon--moon {
  opacity: 0;
  transform: rotate(180deg) scale(0.84);
}

.site-footer {
  padding: 40px 20px;
  background: transparent;
  text-align: center;
  color: var(--muted);
}

.site-footer__copyright {
  margin: 0;
}

.site-footer__links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.site-footer__links a {
  color: var(--muted);
  text-decoration: none;
}

:root[data-theme='dark'] .site-footer__links a {
  color: var(--muted);
}

.site-footer__links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

:root[data-theme='dark'] .site-footer__links a:hover {
  color: var(--accent);
}

.button-link--primary {
  color: #fffdfb;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 14px 28px rgba(181, 96, 15, 0.22);
}

.button-link--secondary {
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--border-strong);
}

:root[data-theme='dark'] .button-link--secondary {
  color: #f2b173;
  background: rgba(54, 50, 45, 0.9);
}

.page-shell {
  padding: 104px 0 72px;
}

.page-shell--index {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.page-with-ad-rail {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.page-with-ad-rail__sidebar {
  position: relative;
}
.page-with-ad-rail__content {
  min-width: 0;
}
.blog-promo {
  display: flex;
  flex-direction: column;
}

.blog-promo--rail {
  position: sticky;
  top: 132px;
}
.blog-promo__link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.blog-promo__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 28, 20, 0.12);
}

.blog-promo__image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
}

.blog-promo__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  text-align: center;
}

.blog-promo__mascot {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.blog-promo__headline {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-dark);
}

.blog-promo__body {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

.blog-promo__cta {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 14px;
}

.filter-panel,
.filter-empty-state {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  background: var(--surface);
}

.filter-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px 18px;
  align-items: start;
  margin-top: 10px;
  padding: 18px 22px;
}

.filter-copy,
.filter-copy p,
.filter-kicker,
.filter-empty-state {
  margin: 0;
}

.filter-kicker {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-dark);
  white-space: nowrap;
}

.filter-empty-state {
  color: var(--muted);
  line-height: 1.7;
}

.tag-filter-list,
.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-filter-list {
  align-items: center;
}

.tag-filter-list--overflow {
  margin-top: 10px;
}

.tag-filter-button,
.post-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--muted);
  font: inherit;
}

:root[data-theme='dark'] .tag-filter-button,
:root[data-theme='dark'] .post-tag-chip,
:root[data-theme='dark'] .hero-stat,
:root[data-theme='dark'] .index-chip,
:root[data-theme='dark'] .keyword-chip,
:root[data-theme='dark'] .chip,
:root[data-theme='dark'] .related-list li,
:root[data-theme='dark'] .link-list li,
:root[data-theme='dark'] .featured-callout {
  background: rgba(54, 50, 45, 0.88);
}

.tag-filter-button {
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, transform 120ms ease;
}

.tag-filter-button:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.tag-filter-button.is-active {
  color: #fffdfb;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-color: transparent;
}

.tag-filter-button span,
.post-tag-chip {
  font-weight: 700;
}

.tag-filter-overflow {
  grid-column: 2;
  margin-top: -2px;
}

.tag-filter-overflow summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-dark);
  list-style: none;
}

.tag-filter-overflow summary::-webkit-details-marker {
  display: none;
}

.tag-filter-overflow summary::after {
  content: ' +';
}

.tag-filter-overflow[open] summary::after {
  content: ' -';
}

.post-tag-chip {
  color: var(--accent-dark);
  border-color: var(--border-strong);
}

.filter-empty-state {
  margin-top: 20px;
  padding: 18px 22px;
}

.post-card.is-hidden {
  display: none;
}

.content-card,
.sidebar-card,
.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.index-hero-block {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 420px);
  overflow: hidden;
}

.hero-panel {
  padding: 34px;
}

.hero-panel--index {
  display: grid;
  align-content: start;
  gap: 18px;
}

.hero-kicker,
.featured-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent-dark);
}

.hero-description {
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.index-hero-block h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.9rem);
  line-height: 0.95;
}

.hero-subtitle {
  margin: 0;
  color: var(--accent-dark);
  font-size: 1.16rem;
  line-height: 1.6;
}

.hero-stats,
.eyebrow,
.meta-row,
.card-eyebrow,
.index-meta,
.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-stat,
.badge,
.chip,
.index-chip,
.keyword-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.hero-stat,
.index-chip,
.keyword-chip,
.chip {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  color: var(--muted);
}

.badge {
  background: rgba(221, 121, 27, 0.14);
  color: var(--accent-dark);
  font-weight: 800;
}

.category-chip,
.keyword-chip {
  color: var(--accent-dark);
  border-color: var(--border-strong);
}

.context-chip {
  background: rgba(54, 35, 21, 0.05);
}

.featured-callout {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
}

.featured-callout h2,
.featured-callout p,
.post-card h2,
.post-card p {
  margin: 0;
}

.featured-callout {
  display: grid;
  gap: 12px;
}

.featured-callout h2 {
  font-size: 1.6rem;
  line-height: 1.1;
}

.featured-callout a,
.post-card h2 a {
  color: inherit;
  text-decoration: none;
}

.index-hero-visual {
  position: relative;
  overflow: hidden;
}

.index-hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.index-hero-visual {
  min-height: 100%;
}

.article-inline-media figcaption {
  padding: 14px 18px 18px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.media-credit {
  margin-left: 6px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 12px;
  text-decoration: none;
  font-weight: 700;
}

.article-cover {
  margin: 0 0 28px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.article-cover img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.article-cover figcaption {
  padding: 14px 18px 18px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.article-header-block {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.article-title {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 3.9rem);
  line-height: 0.98;
}

.article-dek {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
  max-width: 68ch;
}

.article-meta-row,
.article-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.article-meta-row {
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 600;
}

.article-meta-author a {
  color: inherit;
  text-decoration: none;
}

.article-meta-separator {
  color: rgba(109, 88, 69, 0.66);
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 820px) 280px;
  gap: 24px;
  align-items: start;
  margin-top: 28px;
  justify-content: center;
}

.content-layout--single {
  grid-template-columns: minmax(0, 820px);
}

.content-column,
.sidebar-column {
  display: grid;
  gap: 24px;
}

.content-column {
  min-width: 0;
}

.sidebar-column {
  position: sticky;
  top: 100px;
}

.content-card,
.sidebar-card {
  padding: 28px;
}

.article-card {
  padding: 34px;
}

.article-body {
  font-size: 1.08rem;
  line-height: 1.85;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre,
.article-body figure {
  margin: 1.2em 0;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  scroll-margin-top: 110px;
}

.article-body img {
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

.article-inline-media {
  margin: 2rem 0;
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.article-body pre {
  overflow-x: auto;
  padding: 18px;
  border-radius: 18px;
  background: #2f2117;
  color: #fff7ef;
}

:root[data-theme='dark'] .article-body code {
  background: rgba(221, 121, 27, 0.2);
}

.article-body code {
  padding: 0.15em 0.4em;
  border-radius: 8px;
  background: rgba(221, 121, 27, 0.12);
}

.article-body pre code {
  padding: 0;
  background: transparent;
}

.toc h2,
.auxiliary-card h2,
.author-card h2 {
  margin: 0 0 14px;
  font-size: 1.15rem;
}

.toc ol,
.related-list,
.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.toc li {
  margin-left: calc((var(--depth, 2) - 2) * 14px);
}

.toc .toc-depth-3 { --depth: 3; }
.toc .toc-depth-4 { --depth: 4; }
.toc .toc-depth-5 { --depth: 5; }
.toc .toc-depth-6 { --depth: 6; }

.related-list li,
.link-list li {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
}

.related-list p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.author-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
}

.author-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
}

.author-name {
  margin: 0 0 8px;
  font-weight: 700;
}

.post-grid {
  display: grid;
  gap: 22px;
  margin-top: 26px;
}

.post-card {
  display: grid;
  grid-template-columns: 300px 1fr;
  overflow: hidden;
}

.post-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-cover--generated {
  object-fit: contain;
  object-position: top center;
  background: linear-gradient(180deg, #fff8f0 0%, #f6eadc 100%);
  padding: 18px;
}

.post-card-body {
  padding: 26px;
  display: grid;
  gap: 14px;
}

.post-card h2 {
  font-size: 1.92rem;
  line-height: 1.08;
}

.post-card-subtitle {
  color: var(--accent-dark);
  font-size: 1.04rem;
  line-height: 1.6;
}

.post-card-author {
  color: var(--accent-dark);
  font-size: 0.96rem;
  font-weight: 700;
}

.post-card-description {
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 980px) {
  .page-with-ad-rail {
    grid-template-columns: 1fr;
  }

  .page-with-ad-rail__sidebar {
    display: none;
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .tag-filter-overflow {
    grid-column: 1;
    margin-top: 0;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .post-card-cover {
    max-height: 280px;
  }

  .post-card-cover--generated {
    padding: 14px;
  }

  .sidebar-column {
    position: static;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: calc(100% - 20px);
  }

  .site-header-shell {
    width: calc(100% - 40px);
  }

  .site-header-inner {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 10px 0;
  }

  .site-nav,
  .site-header-actions {
    display: none;
  }

  .site-mobile-controls {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
  }

  .site-mobile-menu {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    box-shadow: 0 24px 50px rgba(37, 28, 20, 0.22);
    flex-direction: column;
    gap: 12px;
    margin: 8px 20px 0;
    padding: 16px;
  }

  .blog-promo--rail {
    position: static;
  }

  .page-shell {
    padding: 104px 0 44px;
  }

  .hero-panel,
  .content-card,
  .sidebar-card,
  .post-card-body,
  .footer-panel {
    padding: 22px;
  }

  .article-card {
    padding: 24px;
  }

  .brand-lockup img {
    height: 42px;
  }

  .author-card {
    grid-template-columns: 1fr;
  }
}