:root {
  --ink: #14221f;
  --ink-soft: #3d4f49;
  --muted: #6b7c74;
  --paper: #f3f6f2;
  --paper-2: #e7efe8;
  --brand: #0d6b5c;
  --brand-deep: #084a40;
  --accent: #d97706;
  --line: rgba(20, 34, 31, 0.1);
  --shadow: 0 12px 40px rgba(8, 74, 64, 0.12);
  --radius: 14px;
  --max: 1080px;
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 100% -10%, rgba(13, 107, 92, 0.12), transparent 55%),
    radial-gradient(90% 60% at -10% 20%, rgba(217, 119, 6, 0.08), transparent 50%),
    linear-gradient(180deg, #eef4ef 0%, var(--paper) 40%, #f7faf7 100%);
  line-height: 1.55;
  min-height: 100vh;
}

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

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

button,
.btn {
  font: inherit;
}

.wrap {
  width: min(100% - 1.5rem, var(--max));
  margin-inline: auto;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(243, 246, 242, 0.86);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding-block: 0.55rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  text-decoration: none;
}

.logo__mark {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  display: block;
  border-radius: 0.45rem;
}

.logo__text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--brand-deep);
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--brand);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-weight: 650;
  color: var(--brand-deep);
}

/* Homepage top — compact carousel + text */
.hero {
  padding-top: 0.85rem;
  padding-bottom: 1.35rem;
  animation: rise 0.55s ease both;
}

.hero__intro {
  margin-bottom: 0.9rem;
}

.hero__headline {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 6.2vw, 1.95rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--brand-deep);
}

.hero__line {
  display: block;
}

.hero__line--accent {
  color: var(--ink-soft);
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.02em;
}

.hero__line--accent::after {
  content: "";
  display: block;
  width: 2.4rem;
  height: 3px;
  margin-top: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(217, 119, 6, 0.15));
}

.carousel {
  position: relative;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.carousel__viewport {
  overflow: hidden;
}

.carousel__track {
  display: flex;
  transition: transform 0.45s ease;
  will-change: transform;
}

.carousel__slide {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  align-items: stretch;
  min-height: 0;
  padding: 0.7rem;
  color: inherit;
}

.carousel__media {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: 150px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--paper-2);
}

.carousel__text {
  min-width: 0;
  padding: 0 0.1rem 0.05rem;
}

.carousel__source {
  display: inline-block;
  margin-bottom: 0.28rem;
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.carousel__title {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 4.2vw, 1.22rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.carousel__lede {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.carousel__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.7rem 0.7rem;
  border-top: 1px solid var(--line);
  background: rgba(247, 250, 247, 0.9);
}

.carousel__nav {
  display: flex;
  gap: 0.4rem;
}

.carousel__btn {
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-deep);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.carousel__btn:hover,
.carousel__btn:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
}

.carousel__dots {
  display: flex;
  gap: 0.15rem;
  align-items: center;
}

.carousel__dot {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.carousel__dot::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(13, 107, 92, 0.4);
  transition: width 0.2s ease, background 0.2s ease;
}

.carousel__dot.is-active::before {
  width: 1.15rem;
  background: var(--brand);
}

.carousel__dot:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: #f4faf7;
  color: var(--brand-deep);
}

.btn--ghost {
  background: transparent;
  color: #f4faf7;
  border: 1px solid rgba(244, 250, 247, 0.35);
}

.btn--primary:hover {
  background: #fff;
}

.btn--ghost:hover {
  border-color: #fff;
}

/* Sections */
.section {
  padding: 0.5rem 0 2.5rem;
}

.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.section__meta {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

/* Article list — mobile: stacked rows */
.story-list {
  display: grid;
  gap: 0.85rem;
}

.story {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.65rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: rise 0.55s ease both;
}

.story:nth-child(1) { animation-delay: 0.05s; }
.story:nth-child(2) { animation-delay: 0.1s; }
.story:nth-child(3) { animation-delay: 0.15s; }
.story:nth-child(4) { animation-delay: 0.2s; }
.story:nth-child(5) { animation-delay: 0.25s; }

.story:hover,
.story:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(13, 107, 92, 0.25);
}

.story__thumb {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--paper-2);
}

.story__thumb--empty {
  display: grid;
  place-items: center;
  background: #c5d4cb;
  color: #084a40;
  font-size: 0.75rem;
  font-weight: 800;
}

.story__body {
  min-width: 0;
}

.story__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.story__title {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.story__summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Filters on home */
.filters {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.85rem;
  margin-bottom: 0.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

a.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
}

.filter-chip.is-active,
.filter-chip:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Category / search pages */
.page {
  padding: 1.25rem 0 3rem;
}

.page-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  letter-spacing: -0.03em;
  color: var(--brand-deep);
}

.page-lede {
  margin: 0 0 1.1rem;
  max-width: 36rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.category-switch {
  margin-bottom: 0.35rem;
}

.topic-grid {
  display: grid;
  gap: 0.75rem;
}

.topic-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(13, 107, 92, 0.28);
}

.topic-card__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-deep);
}

.topic-card__desc {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.4;
}

.search-form {
  margin-bottom: 1rem;
}

.search-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
}

.search-row {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
}

.search-input {
  flex: 1;
  min-width: 0;
  min-height: 2.85rem;
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}

.search-input:focus {
  outline: 2px solid rgba(13, 107, 92, 0.35);
  outline-offset: 1px;
  border-color: var(--brand);
}

.search-submit {
  flex: 0 0 auto;
}

.btn--solid {
  background: var(--brand);
  color: #fff;
  border: 0;
}

.btn--solid:hover {
  background: var(--brand-deep);
}

.doc-body {
  max-width: 42rem;
  display: grid;
  gap: 1.15rem;
  margin-bottom: 1.5rem;
}

.doc-section h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
}

.doc-section p {
  margin: 0 0 0.65rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.65;
}

.doc-section p:last-child {
  margin-bottom: 0;
}

.doc-section a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.doc-links {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.doc-links a {
  color: var(--brand);
}

.story.is-hidden {
  display: none;
}

/* Article page */
.article-page {
  padding: 1.25rem 0 3rem;
}

.crumb {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.crumb a {
  color: var(--brand);
}

.article-figure {
  margin: 0.35rem 0 1.15rem;
  max-width: min(100%, 20rem);
  overflow: hidden;
  border-radius: 12px;
  background: var(--paper-2);
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 11rem;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

@media (min-width: 860px) {
  .article-figure {
    max-width: min(100%, 26rem);
  }

  .article-figure img {
    max-height: 14rem;
  }
}

.article-kicker {
  margin: 0 0 0.5rem;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.article-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6.5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-bottom: 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.article-summary {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 42rem;
}

.article-body {
  max-width: 42rem;
  margin-top: 0.25rem;
}

.article-body p {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.article-body p:first-child {
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 600;
}

.more-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer strong {
  color: var(--brand-deep);
  font-family: var(--font-display);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .carousel__track {
    transition: none !important;
  }
}

/* Larger phones / small tablets */
@media (min-width: 560px) {
  .carousel__media {
    max-height: 170px;
  }

  .story {
    grid-template-columns: 128px 1fr;
  }

  .story__thumb {
    width: 128px;
    height: 100px;
  }

  .story__summary {
    -webkit-line-clamp: 3;
  }
}

/* Desktop — side-by-side stays compact */
@media (min-width: 860px) {
  .wrap {
    width: min(100% - 2.5rem, var(--max));
  }

  .hero {
    padding-top: 1.15rem;
  }

  .carousel__slide {
    grid-template-columns: 240px 1fr;
    align-items: center;
    min-height: 160px;
    padding: 1rem 1.1rem;
    gap: 1.1rem;
  }

  .carousel__media {
    width: 240px;
    height: 150px;
    max-height: none;
    aspect-ratio: auto;
  }

  .carousel__title {
    font-size: 1.35rem;
    -webkit-line-clamp: 2;
  }

  .carousel__lede {
    -webkit-line-clamp: 2;
    font-size: 0.9rem;
  }

  .story-list {
    grid-template-columns: 1fr 1fr;
  }

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

  .topic-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile nav */
@media (max-width: 640px) {
  .menu-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    right: 0.75rem;
    left: 0.75rem;
    flex-direction: column;
    gap: 0;
    padding: 0.45rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
  }

  .nav a:hover {
    background: var(--paper-2);
  }

  .site-header {
    position: sticky;
  }

  .site-header__inner {
    position: relative;
  }
}
