:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --panel: #ffffff;
  --panel-border: #e8e8ea;
  --ink: #181a2a;
  --muted: #696a75;
  --muted-2: #3b3c4a;
  --accent: #4b6bfb;
  --accent-soft: rgba(75, 107, 251, 0.08);
  --line: #dcdddf;
  --shadow: 0 12px 24px -8px rgba(24, 26, 42, 0.08);
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
  color: var(--ink);
  font-family: "Work Sans", "Plus Jakarta Sans", system-ui, sans-serif;
}

body.theme-dark {
  --bg: #141624;
  --bg-soft: #181a2a;
  --panel: #1f2235;
  --panel-border: rgba(255, 255, 255, 0.08);
  --ink: #ffffff;
  --muted: #b7b8c4;
  --muted-2: #d3d5df;
  --line: rgba(255, 255, 255, 0.14);
  --shadow: 0 18px 32px -12px rgba(0, 0, 0, 0.45);
  background: linear-gradient(180deg, #141624 0%, #10111a 100%);
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.category-shell {
  min-height: 100vh;
}

.category-header,
.category-main,
.footer-top,
.footer-bottom {
  width: min(1216px, calc(100% - 48px));
  margin: 0 auto;
}

.category-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 32px 0 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #5a7afe, #3f59d6);
  color: #fff;
  font-weight: 800;
}

.brand-copy strong,
.brand-copy small,
.footer-brand strong,
.footer-brand small {
  display: block;
}

.brand-copy strong,
.footer-brand strong {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-copy small,
.footer-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.top-nav,
.top-actions,
.footer-legal {
  display: flex;
  align-items: center;
}

.top-nav {
  justify-content: center;
  gap: 36px;
}

.top-nav a {
  color: var(--muted-2);
  font-size: 16px;
  line-height: 24px;
}

.top-nav a[aria-current="page"] {
  color: var(--ink);
}

.top-nav a:hover,
.footer-links a:hover,
.footer-legal a:hover {
  color: var(--accent);
}

.top-actions {
  gap: 12px;
}

.search-box {
  display: flex;
  width: 166px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 5px;
  background: #f4f4f5;
  color: #a1a1aa;
}

.search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

body.theme-dark .search-box,
body.theme-dark .mode-track,
body.theme-dark .newsletter-card {
  background: rgba(255, 255, 255, 0.06);
}

body.theme-dark .search-box input,
body.theme-dark .newsletter-input input {
  color: #fff;
}

.search-box svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-submit svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-box input,
.newsletter-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.mode-toggle {
  padding: 0;
  border: 0;
  background: transparent;
}

.mode-track {
  display: inline-flex;
  width: 48px;
  height: 28px;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: #e8e8ea;
}

.mode-thumb {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: #4b6bfb;
  font-size: 12px;
}

body.theme-dark .mode-thumb {
  transform: translateX(20px);
  background: var(--accent);
  color: #fff;
}

.page-intro {
  display: flex;
  padding: 16px 0;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.page-intro h1,
.banner-copy h2,
.footer-top h3,
.category-card h3 {
  margin-top: 0;
}

.page-intro h1 {
  margin-bottom: 0;
  font-size: 30px;
  font-weight: 600;
  line-height: 36px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 16px;
}

.feature-banner {
  position: relative;
  min-height: 450px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.feature-banner > img,
.banner-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.feature-banner > img {
  object-fit: cover;
}

.banner-overlay {
  background: linear-gradient(90deg, rgba(20, 22, 36, 0.72), rgba(20, 22, 36, 0.24));
}

.banner-copy {
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 40px;
  z-index: 1;
  max-width: 720px;
}

.banner-badge,
.category-topic {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.banner-copy h2 {
  margin: 16px 0 24px;
  color: #fff;
  font-size: 36px;
  font-weight: 600;
  line-height: 40px;
}

.banner-meta,
.author-meta,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.banner-meta {
  color: #fff;
  font-size: 16px;
}

.author-meta img,
.card-meta img {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
}

.category-grid-section {
  padding: 48px 0 0;
}

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

.category-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.category-card-link {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(75, 107, 251, 0.34);
  box-shadow: 0 22px 40px -18px rgba(24, 26, 42, 0.22);
}

.category-card img.card-image {
  width: 100%;
  height: 240px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.category-card-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 8px;
}

.category-card h3 {
  margin: 16px 0 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 28px;
}

.card-meta {
  justify-content: space-between;
  color: #97989f;
  font-size: 14px;
}

.card-meta > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-size: 18px;
  text-align: center;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 20px;
}

.load-more {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(105, 106, 117, 0.3);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #696a75;
}

.footer-links a.is-active {
  color: var(--ink);
  font-weight: 600;
}

.ad-banner {
  display: flex;
  width: min(750px, 100%);
  min-height: 100px;
  margin: 80px auto 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--radius-lg);
  background: #e8e8ea;
  color: #696a75;
  text-align: center;
}

.ad-banner span {
  font-size: 14px;
}

.ad-banner strong {
  font-size: 20px;
  font-weight: 600;
}

.ad-banner small {
  font-size: 18px;
}

.category-footer {
  margin-top: 80px;
  padding-top: 64px;
  border-top: 1px solid #e8e8ea;
  background: var(--bg-soft);
}

.footer-top {
  display: grid;
  grid-template-columns: 289px 1fr 392px;
  gap: 20px;
}

.footer-top h3 {
  margin-bottom: 12px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
}

.footer-about p,
.footer-links a,
.footer-legal a,
.newsletter-card p {
  color: var(--muted);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 16px;
  line-height: 24px;
}

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

.footer-links div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.newsletter-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: #fff;
}

body.theme-dark .newsletter-card,
body.theme-dark .newsletter-input {
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
}

.newsletter-card h3,
.newsletter-card p {
  text-align: center;
}

.newsletter-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #97989f;
}

.newsletter-button {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 64px;
  padding: 32px 0;
  border-top: 1px solid #dcdddf;
}

body.theme-dark .category-footer,
body.theme-dark .footer-bottom {
  border-color: rgba(255, 255, 255, 0.08);
}

.footer-legal {
  gap: 24px;
}

@media (max-width: 1180px) {
  .category-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .top-nav,
  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

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

  .footer-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .category-header,
  .category-main,
  .footer-top,
  .footer-bottom {
    width: calc(100% - 32px);
  }

  .category-header {
    gap: 20px;
    padding: 20px 0;
  }

  .top-nav {
    gap: 20px;
    flex-wrap: wrap;
  }

  .top-actions {
    width: 100%;
  }

  .search-box {
    width: 100%;
  }

  .feature-banner {
    min-height: 340px;
  }

  .banner-copy {
    left: 20px;
    right: 20px;
    bottom: 20px;
  }

  .banner-copy h2 {
    font-size: 28px;
    line-height: 32px;
  }

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

  .category-card img.card-image {
    height: 220px;
  }

  .footer-links,
  .footer-bottom {
    gap: 24px;
  }

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