:root {
  --background: #f7f9fb;
  --surface: #ffffff;
  --surface-soft: #f0f4f7;
  --surface-high: #e3e9ed;
  --text: #2c3437;
  --text-muted: #596064;
  --primary: #42b7db;
  --primary-bright: #6bdaff;
  --border: rgba(100, 116, 125, 0.16);
  --shadow: 0 20px 55px rgba(31, 48, 58, 0.09);
  --on-surface: var(--text);
  --on-surface-variant: var(--text-muted);
  --surface-container-lowest: var(--surface);
  --surface-container-high: var(--surface-high);
  --glass-border: var(--border);
}

.dark {
  --background: #0e1518;
  --surface: #161e21;
  --surface-soft: #1a2326;
  --surface-high: #242d30;
  --text: #dee3e6;
  --text-muted: #bec8cb;
  --primary: #6bdaff;
  --primary-bright: #8ce3ff;
  --border: rgba(255, 255, 255, 0.09);
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: "Manrope", sans-serif;
  transition: color 0.25s ease, background-color 0.25s ease;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: #003543;
  background: var(--primary-bright);
  border-radius: 0.75rem;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(22px);
}

.blog-shell {
  width: min(100% - 2rem, 75rem);
  margin-inline: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 1.5rem, 80rem);
  min-height: 5rem;
  margin-inline: auto;
  gap: 0.5rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.site-brand:hover,
.site-links a:hover,
.site-links a[aria-current="page"],
.site-language:hover {
  color: var(--primary);
}

.site-brand img {
  width: 2rem;
  height: 2rem;
}

.site-links,
.site-actions {
  display: flex;
  align-items: center;
}

.site-links {
  gap: 2rem;
}

.site-actions {
  gap: 0.75rem;
}

.site-links a,
.site-language {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.site-language {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  background: var(--surface-soft);
  border-radius: 999px;
}

.theme-toggle {
  display: inline-grid;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  place-items: center;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.site-cta,
.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #07343f;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-bright) 100%);
  box-shadow: 0 10px 28px rgba(66, 183, 219, 0.22);
  font-weight: 800;
  text-decoration: none;
}

.site-cta {
  min-height: 2.6rem;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.menu-toggle {
  display: none;
}

.menu-toggle span {
  font-size: 1.25rem;
  line-height: 1;
}

.site-mobile-menu {
  padding: 1rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(22px);
}

.site-mobile-menu[hidden] {
  display: none;
}

.site-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: min(100%, 78rem);
  margin-inline: auto;
}

.site-mobile-links a {
  color: var(--text-muted);
  font-weight: 700;
  text-decoration: none;
}

.site-mobile-links .mobile-cta {
  padding: 0.8rem 1rem;
  color: #07343f;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-bright) 100%);
  border-radius: 0.8rem;
  text-align: center;
}

.blog-hero {
  position: relative;
  overflow: hidden;
  padding: 9.5rem 0 4.5rem;
}

.blog-hero::before,
.blog-hero::after {
  position: absolute;
  width: 24rem;
  height: 24rem;
  content: "";
  pointer-events: none;
  background: rgba(66, 183, 219, 0.14);
  border-radius: 999px;
  filter: blur(90px);
}

.blog-hero::before {
  top: -10rem;
  left: -10rem;
}

.blog-hero::after {
  top: 2rem;
  right: -12rem;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.breadcrumbs a {
  text-underline-offset: 0.2em;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blog-hero h1 {
  max-width: 58rem;
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero-intro {
  max-width: 46rem;
  margin: 1.5rem 0 0;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.topic-list li {
  display: flex;
}

.topic-filter {
  padding: 0.55rem 0.85rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.topic-filter:hover {
  color: var(--text);
  border-color: rgba(66, 183, 219, 0.55);
  transform: translateY(-1px);
}

.topic-filter.is-active {
  color: #07343f;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-bright) 100%);
  border-color: transparent;
}

.topic-filter:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 3px;
}

.articles-section {
  padding: 1.5rem 0 6rem;
}

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

.article-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.55rem;
  box-shadow: 0 8px 26px rgba(31, 48, 58, 0.045);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-card-link {
  display: flex;
  min-height: 100%;
  color: inherit;
  flex-direction: column;
  text-decoration: none;
}

.card-cover-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card-read {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: auto;
  padding-top: 1.15rem;
  color: #087f9f;
  font-size: 0.82rem;
  font-weight: 800;
}

.dark .card-read {
  color: var(--primary-bright);
}

.article-card:hover {
  border-color: rgba(66, 183, 219, 0.4);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.card-cover {
  position: relative;
  display: grid;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  place-items: center;
  color: rgba(10, 52, 64, 0.82);
  background: linear-gradient(135deg, var(--cover-a), var(--cover-b));
}

.card-cover::before,
.card-cover::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
}

.card-cover::before {
  width: 13rem;
  height: 13rem;
  top: -6.5rem;
  right: -3.5rem;
  background: rgba(255, 255, 255, 0.16);
}

.card-cover::after {
  width: 7rem;
  height: 7rem;
  bottom: -4rem;
  left: -1rem;
  background: rgba(255, 255, 255, 0.12);
}

.card-cover svg {
  position: relative;
  z-index: 1;
  width: 44%;
  height: auto;
  filter: drop-shadow(0 12px 18px rgba(0, 57, 70, 0.13));
}

.cover-1 { --cover-a: #d8f6ff; --cover-b: #78dcfb; }
.cover-2 { --cover-a: #e6e8ff; --cover-b: #aebcf7; }
.cover-3 { --cover-a: #ddf8ef; --cover-b: #86dfbd; }
.cover-4 { --cover-a: #fff1dc; --cover-b: #ffc779; }
.cover-5 { --cover-a: #f2e7ff; --cover-b: #c9a1f6; }

.card-body {
  display: flex;
  padding: 1.35rem;
  flex: 1;
  flex-direction: column;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.8rem;
}

.card-tag {
  padding: 0.3rem 0.55rem;
  color: #00617a;
  background: rgba(66, 183, 219, 0.11);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.dark .card-tag {
  color: var(--primary-bright);
}

.article-card[hidden] {
  display: none;
}

.article-card h2 {
  margin: 0;
  font-size: 1.24rem;
  line-height: 1.28;
  letter-spacing: -0.025em;
}

.article-card p:last-child {
  margin: 0.85rem 0 0;
  color: var(--text-muted);
  font-size: 0.91rem;
  line-height: 1.62;
}

.blog-cta {
  display: grid;
  margin-top: 4rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 2rem;
}

.blog-cta h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: -0.04em;
}

.blog-cta p {
  max-width: 42rem;
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.hero-cta {
  min-height: 3.25rem;
  padding: 0.8rem 1.3rem;
  border-radius: 1rem;
  white-space: nowrap;
}

.blog-footer {
  padding: 2.5rem 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a,
.footer-links button {
  padding: 0;
  color: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.article-hero {
  padding: 8.5rem 0 2.5rem;
}

.article-hero__inner {
  max-width: 54rem;
}

.article-hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 4.35rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.article-deck {
  max-width: 46rem;
  margin: 1.35rem 0 0;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.15rem;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.article-cover-image {
  display: block;
  width: min(100% - 2rem, 75rem);
  height: auto;
  max-height: 32rem;
  margin: 0 auto 3.5rem;
  object-fit: cover;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 2rem;
  box-shadow: var(--shadow);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 45rem) minmax(14rem, 18rem);
  justify-content: center;
  gap: 4rem;
  padding-bottom: 6rem;
}

.article-content {
  min-width: 0;
  font-size: 1.03rem;
  line-height: 1.82;
}

.article-content > :first-child {
  margin-top: 0;
}

.article-content h2 {
  margin: 3.25rem 0 1rem;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.article-content h3 {
  margin: 2.2rem 0 0.75rem;
  font-size: 1.18rem;
  line-height: 1.35;
}

.article-content p,
.article-content ul,
.article-content ol {
  margin-block: 1rem;
}

.article-content li + li {
  margin-top: 0.55rem;
}

.article-content a:not(.hero-cta),
.source-list a {
  color: #087f9f;
  font-weight: 650;
  text-underline-offset: 0.2em;
}

.dark .article-content a:not(.hero-cta),
.dark .source-list a {
  color: var(--primary-bright);
}

.answer-box,
.formula-card {
  padding: 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
}

.answer-box {
  margin-bottom: 2.5rem;
  border-left: 0.3rem solid var(--primary);
  font-size: 1.08rem;
}

.answer-box p,
.formula-card p {
  margin: 0;
}

.formula-card {
  margin: 1.5rem 0;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.formula {
  display: block;
  margin: 0.75rem 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 750;
}

.table-wrap {
  margin: 1.75rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 1.15rem;
}

.article-table {
  width: 100%;
  min-width: 38rem;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.92rem;
  line-height: 1.55;
}

.article-table th,
.article-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.article-table th {
  background: var(--surface-soft);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.article-table tr:last-child td {
  border-bottom: 0;
}

.article-aside {
  position: sticky;
  top: 6.5rem;
  align-self: start;
}

.toc {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
}

.toc h2 {
  margin: 0 0 0.8rem;
  font-size: 0.92rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  color: var(--primary);
}

.related-links {
  margin-top: 1rem;
}

.related-links h2 {
  margin: 0 0 0.8rem;
  font-size: 0.98rem;
}

.related-links ul {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-card {
  display: block;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(31, 48, 58, 0.06);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.related-card:hover,
.related-card:focus-visible {
  color: var(--text);
  border-color: rgba(66, 183, 219, 0.5);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.related-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.related-card__body {
  display: block;
  padding: 0.8rem 0.9rem 0.95rem;
}

.related-card__topic,
.related-card__action {
  display: block;
  color: #087f9f;
  font-size: 0.68rem;
  font-weight: 800;
}

.dark .related-card__topic,
.dark .related-card__action {
  color: var(--primary-bright);
}

.related-card__body strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.84rem;
  line-height: 1.35;
}

.related-card__action {
  margin-top: 0.7rem;
}

.source-list {
  margin-top: 3rem;
}

.source-list h2 {
  margin-top: 0;
}

.source-list {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.source-list ol {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.article-disclaimer {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.article-end-cta {
  margin-top: 3rem;
  padding: 1.5rem 1.75rem;
  gap: 1.25rem;
  border-radius: 1.5rem;
}

.article-end-cta h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.article-end-cta p {
  margin: 0.45rem 0 0;
  font-size: 0.93rem;
}

@media (max-width: 900px) {
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-cta {
    align-items: start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .article-layout {
    grid-template-columns: minmax(0, 45rem);
  }

  .article-aside {
    display: contents;
  }

  .toc {
    order: -1;
  }

  .related-links {
    order: 1;
    margin-top: 0;
  }
}

@media (max-width: 700px) {
  .blog-shell {
    width: min(100% - 1.5rem, 75rem);
  }

  .site-nav {
    width: calc(100% - 1.5rem);
    min-height: 4rem;
  }

  .site-brand span,
  .site-links,
  .site-cta {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .blog-hero {
    padding: 7.5rem 0 3rem;
  }

  .article-hero {
    padding: 7rem 0 2rem;
  }

  .article-cover-image {
    width: calc(100% - 1.5rem);
    margin-bottom: 2rem;
    border-radius: 1.35rem;
  }

  .article-layout {
    gap: 2rem;
    padding-bottom: 4rem;
  }

  .article-content {
    font-size: 0.98rem;
    line-height: 1.75;
  }

  .answer-box,
  .formula-card {
    padding: 1.1rem;
  }

  .hero-intro {
    font-size: 1rem;
  }

  .articles-section {
    padding-bottom: 4rem;
  }

  .article-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .article-card {
    border-radius: 1.3rem;
  }

  .blog-cta {
    margin-top: 2.5rem;
    border-radius: 1.4rem;
  }

  .hero-cta {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .article-card,
  .related-card {
    transition: none;
  }
}
