:root {
  color-scheme: light;
  --ink: #171b22;
  --muted: #667085;
  --paper: #f7f4ee;
  --surface: #ffffff;
  --line: #ded8cf;
  --teal: #0f5f63;
  --teal-dark: #0b3e43;
  --coral: #d36f4b;
  --gold: #b58933;
  --sky: #dbe9ee;
  --shadow: 0 24px 60px rgba(20, 30, 38, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(247, 244, 238, 0.88);
  border-bottom: 1px solid rgba(23, 27, 34, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0;
}

.brand-word {
  color: #22272e;
}

.brand-accent {
  color: #de9825;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 28px);
  color: #3f4854;
  font-size: 0.92rem;
  font-weight: 700;
}

.site-header nav a {
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.site-header nav a:hover {
  color: var(--teal);
  border-bottom-color: var(--coral);
}

.hero {
  position: relative;
  min-height: calc(100svh - 68px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #10161d;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 22, 29, 0.9), rgba(16, 22, 29, 0.62) 42%, rgba(16, 22, 29, 0.2)),
    linear-gradient(0deg, rgba(16, 22, 29, 0.72), rgba(16, 22, 29, 0) 46%);
  pointer-events: none;
}

.hero-media {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.9fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  opacity: 0.82;
  transform: scale(1.02);
}

.hero-tile {
  min-height: 180px;
  background: #2e3b44 center / cover no-repeat;
  filter: saturate(0.82) contrast(0.96);
}

.hero-tile:first-child {
  grid-row: span 2;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 36px));
  margin: 0 auto;
  padding: 0 0 clamp(32px, 7vw, 82px);
  color: #fff;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(4.2rem, 12vw, 10rem);
  line-height: 0.86;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 720px;
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.08rem, 2vw, 1.45rem);
  font-weight: 650;
  line-height: 1.65;
}

.hero-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(540px, 100%);
  min-height: 54px;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.search-box span {
  font-size: 1.35rem;
  line-height: 1;
}

.search-box input {
  width: 100%;
  color: #fff;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.search-jump {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  color: #fff;
  background: var(--coral);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 900;
}

.search-jump[hidden] {
  display: none;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 42px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
}

.hero-stats strong {
  color: #fff;
  font-size: 1.1rem;
}

.topic-band {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topic-band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 18px 0;
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  color: #3d4652;
  background: #f7f4ee;
  border: 1px solid #e3ddd4;
  border-radius: 999px;
  cursor: pointer;
}

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

.chip small {
  font-size: 0.74rem;
  opacity: 0.78;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.sort-control select {
  min-height: 38px;
  padding: 6px 32px 6px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.library-section {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(36px, 6vw, 72px) 0;
}

.library-section {
  padding-top: clamp(30px, 5vw, 52px);
}

.library-section.search-active {
  padding-top: clamp(30px, 5vw, 56px);
}

.library-section.search-active .section-heading {
  padding: 18px 0;
  border-top: 1px solid rgba(23, 27, 34, 0.1);
  border-bottom: 1px solid rgba(23, 27, 34, 0.1);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.article-card {
  background: var(--surface);
  border: 1px solid rgba(23, 27, 34, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(20, 30, 38, 0.08);
}

.article-card .card-media,
.article-cover {
  background: #26323c;
}

.card-media {
  display: block;
  overflow: hidden;
  min-height: 100%;
  background: #f4f1eb;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.article-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.card-meta span:first-child {
  color: var(--teal);
}

.article-card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.article-card p {
  margin: 0;
  color: #4e5865;
  font-size: 0.94rem;
}

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

.article-card {
  display: grid;
  grid-template-rows: 210px 1fr;
  min-height: 430px;
}

.article-card .card-body {
  min-height: 265px;
}

.article-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  color: #596574;
  background: #f2eee7;
  border: 1px solid #e5ded4;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 750;
}

.card-actions,
.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--teal-dark);
  background: #edf5f4;
  border: 1px solid #cce1df;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 850;
}

.button:hover {
  border-color: var(--teal);
}

.button-primary {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.button-ghost {
  color: #4d5965;
  background: transparent;
  border-color: #d7d0c6;
}

.empty-state {
  margin: 42px 0;
  color: var(--muted);
  font-weight: 800;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(18px, 4vw, 52px);
  color: #687382;
  background: #fff;
  border-top: 1px solid var(--line);
}

.site-footer span:first-child {
  color: var(--ink);
  font-weight: 900;
}

.article-page {
  background: #f7f4ee;
}

.article-shell {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) 0 84px;
}

.article-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: clamp(22px, 4vw, 46px);
  align-items: center;
}

.article-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.5rem);
  line-height: 1.03;
  letter-spacing: 0;
}

.article-subtitle {
  margin: 18px 0 0;
  color: #33404c;
  font-size: 1.16rem;
  font-weight: 750;
}

.article-summary {
  margin: 18px 0 0;
  color: #4e5865;
  font-size: 1rem;
}

.article-actions {
  margin-top: 24px;
}

.article-copy .tag-row {
  margin-top: 18px;
}

.article-cover {
  min-height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.article-cover img,
.cover-fallback {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(22px, 4vw, 42px);
  margin-top: clamp(36px, 7vw, 76px);
}

.article-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.article-body {
  padding: clamp(22px, 4vw, 46px);
  background: #fff;
  border: 1px solid rgba(23, 27, 34, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(20, 30, 38, 0.06);
}

.article-body h1,
.article-body h2,
.article-body h3 {
  margin: 1.6em 0 0.55em;
  line-height: 1.35;
  letter-spacing: 0;
}

.article-body h1:first-child,
.article-body h2:first-child {
  margin-top: 0;
}

.article-body p,
.article-body li {
  color: #303944;
  font-size: 1rem;
}

.article-body a {
  color: var(--teal);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  color: #3f4854;
  background: #f4f6f2;
  border-left: 4px solid var(--coral);
}

.article-cta {
  padding: clamp(22px, 4vw, 38px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(12, 96, 101, 0.98), rgba(34, 51, 60, 0.98) 56%, rgba(219, 128, 57, 0.92));
  border-radius: var(--radius);
  box-shadow: 0 18px 42px rgba(20, 30, 38, 0.12);
}

.article-cta-eyebrow {
  margin: 0 0 10px;
  color: #ffd9a6;
  font-size: 0.82rem;
  font-weight: 900;
}

.article-cta h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.24;
  letter-spacing: 0;
}

.article-cta p:not(.article-cta-eyebrow) {
  max-width: 760px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.86);
}

.article-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.article-cta .button-primary {
  color: var(--teal-dark);
  background: #fff;
  border-color: #fff;
}

.article-cta .button-ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.34);
}

.article-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-side-block {
  padding: 18px;
  background: #fff;
  border: 1px solid rgba(23, 27, 34, 0.08);
  border-radius: var(--radius);
}

.article-side-block h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.article-side-block dl {
  margin: 0;
}

.article-side-block dt {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.article-side-block dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.article-side-block a {
  color: var(--teal);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-side-block pre {
  margin: 0;
  white-space: pre-wrap;
  color: #3f4854;
  font-family: inherit;
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .hero {
    min-height: 760px;
  }

  .hero-media {
    grid-template-columns: 1fr 1fr;
  }

  .hero-tile:first-child {
    grid-row: auto;
  }

  .topic-band-inner,
  .section-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .article-cards,
  .article-hero,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-cover,
  .article-cover img,
  .cover-fallback {
    min-height: 320px;
  }

  .article-side {
    order: -1;
  }
}

@media (max-width: 640px) {
  .site-header nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    min-height: 700px;
  }

  .hero h1 {
    font-size: 4rem;
  }

  .hero-media {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
  }

  .article-card {
    grid-template-rows: 210px 1fr;
  }

  .article-card {
    min-height: auto;
  }

  .article-card .card-body {
    min-height: auto;
  }
}
