:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #657268;
  --line: #d9e1d7;
  --paper: #fbfcf8;
  --soft: #eef4ec;
  --mint: #2d7d5f;
  --teal: #126c71;
  --gold: #a66f18;
  --red: #a54235;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(35, 51, 42, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(23, 33, 27, 0.10);
  background: rgba(251, 252, 248, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  font-weight: 800;
  letter-spacing: 0;
}

.topbar nav {
  display: flex;
  gap: 8px;
}

.topbar nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
}

.topbar nav a:hover,
.topbar nav a[aria-current="page"] {
  background: var(--soft);
  color: var(--ink);
}

.home-hero {
  min-height: 42vh;
  display: grid;
  align-items: end;
  padding: 80px 32px 56px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(251, 252, 248, 0.82), rgba(251, 252, 248, 0.98)),
    url("https://images.unsplash.com/photo-1456513080510-7bf3a84b82f8?auto=format&fit=crop&w=1800&q=80");
  background-position: center;
  background-size: cover;
}

.home-hero > div,
.tool-section,
.study-content {
  width: min(1120px, calc(100vw - 48px));
  margin: 0 auto;
}

.eyebrow,
.section-heading p,
.note-kicker,
.tool-label {
  margin: 0;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: 0;
}

.home-hero h1 {
  margin: 12px 0 18px;
  max-width: 760px;
  font-size: clamp(44px, 7vw, 86px);
}

.hero-copy {
  max-width: 680px;
  margin: 0;
  color: #415044;
  font-size: 19px;
}

.tool-section {
  padding: 44px 0 80px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-size: 28px;
}

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

.tool-card {
  min-height: 220px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 1px 0 rgba(23, 33, 27, 0.04);
}

.tool-card.live {
  border-color: rgba(18, 108, 113, 0.35);
  box-shadow: var(--shadow);
}

.tool-card h3 {
  margin: 42px 0 10px;
  font-size: 24px;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
}

.card-link {
  display: inline-block;
  margin-top: 22px;
  color: var(--teal);
  font-weight: 800;
}

.muted {
  opacity: 0.68;
}

.study-layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
}

.toc {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  overflow: auto;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: #f4f7f1;
}

.toc-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 900;
}

.toc a {
  display: block;
  border-radius: 6px;
}

.toc-main {
  margin-top: 8px;
  padding: 8px 10px;
  color: var(--ink);
  font-weight: 800;
}

.toc-sub {
  padding: 5px 10px 5px 22px;
  color: var(--muted);
  font-size: 13px;
}

.toc a:hover {
  background: rgba(45, 125, 95, 0.10);
}

.study-content {
  padding: 44px 0 80px;
}

.study-layout .study-content {
  width: min(960px, calc(100% - 48px));
  margin: 0 auto;
}

.zlfx-hero {
  padding: 40px 0 36px;
  border-bottom: 1px solid var(--line);
}

.zlfx-hero h1 {
  margin: 10px 0 14px;
  font-size: clamp(38px, 5vw, 64px);
}

.zlfx-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: #455348;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.primary-action,
.secondary-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-action {
  background: var(--ink);
  color: var(--white);
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--white);
}

.content-band {
  padding: 38px 0 8px;
}

.note {
  margin: 18px 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 1px 0 rgba(23, 33, 27, 0.04);
}

.note h1 {
  margin: 4px 0 18px;
  font-size: 34px;
}

.note h2 {
  margin: 30px 0 12px;
  padding-top: 8px;
  border-top: 1px solid #edf1eb;
  font-size: 25px;
}

.note h3 {
  margin: 22px 0 8px;
  font-size: 19px;
}

.note p,
.note li {
  color: #334238;
}

.note a {
  color: var(--teal);
  font-weight: 750;
}

.note code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eef4ec;
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--soft);
}

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

  .study-layout {
    display: block;
  }

  .toc {
    position: static;
    height: auto;
    max-height: 320px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 16px;
  }

  .brand {
    font-size: 15px;
  }

  .topbar nav a {
    padding: 0 8px;
  }

  .home-hero,
  .tool-section,
  .study-content {
    width: min(100vw - 28px, 1120px);
  }

  .home-hero {
    padding-top: 54px;
  }

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

  .note {
    padding: 20px 16px;
  }
}
