:root {
  color-scheme: light;
  --bg: #f5f2ee;
  --surface: #ffffff;
  --surface-muted: #ece7e0;
  --text: #152014;
  --muted: #687464;
  --accent: #31512e;
  --accent-strong: #233d22;
  --accent-soft: #dfe7d9;
  --border: rgba(25, 32, 20, 0.08);
  --shadow: 0 18px 40px rgba(36, 50, 31, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --container: 428px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(
    circle at top,
    #ffffff 0,
    #f6f1eb 36%,
    #eee7df 100%
  );
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 20px 14px 0;
}

.app {
  width: min(100%, var(--container));
  min-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
}

.is-hidden {
  display: none !important;
}

.hero-shell,
.category-page,
.category-detail-page,
.info-page,
.article-page,
.state-card,
.empty-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-page,
.article-page {
  flex: 1;
}

.topbar,
.simple-header,
.section-header,
.article-meta,
.story-card__meta,
.banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.state-card__eyebrow,
.banner-card__eyebrow,
.article-type,
.story-card__category {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 1.9rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.3rem;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.topbar h1 {
  max-width: 11ch;
  font-size: clamp(1.9rem, 5.8vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.topbar {
  align-items: flex-start;
}

.topbar > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.icon-button,
.share-button,
.back-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.icon-button {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  padding: 14px;
}

.icon-button span {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 8px;
  background: var(--accent);
  border-radius: 6px;
}

.icon-button:active,
.share-button:active,
.back-button:active,
.story-card__button:active,
.chip:active,
.primary-button:active,
.category-tile:active,
.text-button:active {
  transform: scale(0.98);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(49, 81, 46, 0.16);
  box-shadow:
    0 14px 30px rgba(36, 50, 31, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

.search-box--tight {
  margin-top: -8px;
}

.search-box svg {
  width: 22px;
  height: 22px;
  fill: #6f8268;
  flex: none;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box input::placeholder {
  color: #7e8a79;
}

.search-box:focus-within {
  border-color: rgba(49, 81, 46, 0.34);
  box-shadow:
    0 18px 36px rgba(36, 50, 31, 0.12),
    0 0 0 4px rgba(49, 81, 46, 0.1);
}

.banner-card,
.story-card,
.state-card,
.empty-card,
.category-tile {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.banner-card {
  overflow: hidden;
  align-items: stretch;
  min-height: 240px;
  border-radius: 30px;
  background: linear-gradient(135deg, #ede3d1 0, #f8f3eb 45%, #e4efde 100%);
}

.banner-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 24px;
}

.banner-card__content h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1.15;
}

.banner-card__content p:last-of-type {
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.banner-card__image {
  width: 42%;
  object-fit: cover;
}

.primary-button,
.chip.is-active,
.category-tile.is-active {
  background: var(--accent);
  color: #fff;
}

.primary-button,
.text-button,
.chip,
.category-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.primary-button {
  align-self: flex-start;
  padding: 14px 20px;
  border-radius: 999px;
  font-weight: 700;
}

.text-button {
  color: var(--accent);
  font-weight: 700;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tabs-scroll {
  display: flex;
  gap: 12px;
  overflow: auto hidden;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.tabs-scroll::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  padding: 14px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #524f4a;
  white-space: nowrap;
  font-weight: 700;
  border: 1px solid rgba(38, 54, 34, 0.08);
}

.story-list,
.story-grid,
.category-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.story-card {
  border-radius: 24px;
  overflow: hidden;
}

.story-card--spotlight {
  border-radius: 30px;
}

.story-card--home {
  height: 100%;
}

.story-card--compact {
  border-radius: 22px;
}

.story-card__button {
  display: grid;
  width: 100%;
  grid-template-columns: 120px minmax(0, 1fr);
  text-align: left;
  text-decoration: none;
}

.story-card--compact .story-card__button {
  grid-template-columns: 110px minmax(0, 1fr);
}

.story-card--spotlight .story-card__button {
  grid-template-columns: minmax(0, 1.2fr) 160px;
}

.story-card--home .story-card__button {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.story-card__thumb {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  background: #d9d9d9;
}

.story-card--home .story-card__thumb {
  min-height: 0;
  aspect-ratio: 4 / 3;
}

.story-card--spotlight .story-card__thumb {
  min-height: 100%;
}

.story-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.story-card--home .story-card__body {
  flex: 1;
  gap: 10px;
  padding: 18px 18px 20px;
}

.story-card--spotlight .story-card__body {
  justify-content: center;
  padding: 24px;
}

.story-card__body h3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-card--home .story-card__body h3 {
  font-size: 1.15rem;
}

.story-card__intro {
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-card--home .story-card__intro {
  -webkit-line-clamp: 2;
}

.story-card__meta {
  align-items: flex-start;
  color: #7a8476;
  font-size: 0.92rem;
}

.story-card--home .story-card__meta {
  margin-top: auto;
  flex-direction: column;
  gap: 6px;
}

.story-card__meta span:last-child {
  text-align: right;
}

.story-card--home .story-card__meta span:last-child {
  text-align: left;
}

.category-page h1,
.category-detail-page h1,
.article-page h1 {
  font-size: clamp(2rem, 7vw, 3rem);
}

.simple-header {
  align-items: flex-start;
}

.simple-header--article {
  align-items: center;
}

.back-button {
  width: auto;
  min-width: 70px;
  padding: 0 18px;
  font-weight: 700;
}

.category-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px;
  border-radius: 22px;
  text-align: left;
}

.category-tile span {
  font-size: 1.08rem;
  font-weight: 700;
}

.category-tile small {
  color: inherit;
  opacity: 0.78;
  font-size: 0.95rem;
}

.article-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-lead {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.8;
}

.article-meta {
  align-items: flex-end;
}

.article-meta strong,
.article-meta span {
  display: block;
}

.article-meta span {
  margin-top: 8px;
  color: var(--muted);
}

.social-actions {
  display: flex;
  gap: 12px;
}

.share-button {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--accent);
}

.article-cover {
  overflow: hidden;
  border-radius: 28px;
  background: #dae0d5;
  box-shadow: var(--shadow);
}

.article-cover img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

.article-content {
  color: #2e3b30;
  line-height: 1.9;
  font-size: 1.08rem;
}

.article-content > * + * {
  margin-top: 1.2em;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  color: #182216;
  line-height: 1.28;
  margin-top: 1.8em;
}

.article-content p {
  white-space: normal;
}

.article-content img {
  width: 100%;
  border-radius: 24px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}

.article-content ul,
.article-content ol {
  padding-left: 1.3em;
}

.article-related {
  padding-top: 8px;
}

.home-feature-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.info-card,
.info-section {
  padding: 26px 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-card__lead,
.info-section p {
  color: var(--muted);
  line-height: 1.8;
}

.info-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-section h2 {
  font-size: 1.35rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.state-card,
.empty-card {
  padding: 28px;
  border-radius: 28px;
}

.state-card h1,
.empty-card h2 {
  max-width: 14ch;
}

.state-card p,
.empty-card p {
  color: var(--muted);
  line-height: 1.7;
}

.state-card--error {
  background: #fff3f0;
}

.site-footer {
  margin-top: auto;
  padding: 34px 18px 18px;
  border-radius: 0;
  background: #060606;
  color: #ffffff;
  text-align: center;
}

#index-footer {
  margin-top: 20px;
}

.site-footer--spaced {
  margin-top: 40px;
}

.site-footer__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer__link {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-footer__divider {
  color: rgba(255, 255, 255, 0.58);
}

.site-footer__copyright {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

@media (max-width: 760px) {
  .app-shell {
    padding-inline: 10px;
  }

  .banner-card {
    flex-direction: column;
  }

  .banner-card__image {
    width: 100%;
    max-height: 220px;
  }

  .site-footer {
    margin-inline: -10px;
  }

  .story-card--spotlight .story-card__button {
    grid-template-columns: 1fr;
  }

  .story-card--spotlight .story-card__thumb {
    min-height: 220px;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2.7rem;
  }

  .story-card__button,
  .story-card--compact .story-card__button {
    grid-template-columns: 98px minmax(0, 1fr);
  }

  .story-card__body {
    padding: 14px;
  }

  .story-card__thumb {
    min-height: 136px;
  }

  .home-story-grid {
    grid-template-columns: 1fr;
  }
}
