:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #10b981;
  --accent-soft: #ecfdf5;
  --accent-ink: #047857;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --radius: 18px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(16,185,129,.12), transparent 60%),
    radial-gradient(900px 400px at 90% 0%, rgba(15,23,42,.05), transparent 55%),
    var(--bg);
  line-height: 1.55;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent); }

.wrap {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(248,250,252,.85);
  border-bottom: 1px solid rgba(226,232,240,.85);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.02em;
}
.brand span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #34d399, #059669);
  color: white;
  font-size: .85rem;
}
.nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .92rem;
}
.nav a { color: var(--muted); }
.nav a:hover, .nav a.is-active { color: var(--ink); }

.hero {
  padding: 3.5rem 0 2rem;
}
.hero__eyebrow {
  display: inline-block;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero h1 {
  margin: 0 0 .8rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -.03em;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero p {
  margin: 0;
  max-width: 46rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  padding: 0 0 3.5rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: #a7f3d0;
}
.card h2 {
  margin: 0 0 .45rem;
  font-size: 1.15rem;
}
.card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .95rem;
}
.card__meta {
  font-size: .8rem;
  color: var(--accent-ink);
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
  padding-bottom: 4rem;
}
.sidebar {
  position: sticky;
  top: 84px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 110px);
  overflow: auto;
}
.sidebar h2 {
  margin: 0 0 .8rem;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.sidebar a {
  display: block;
  padding: .42rem .55rem;
  border-radius: 10px;
  color: var(--ink);
  font-size: .9rem;
}
.sidebar a:hover,
.sidebar a.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.search {
  flex: 1 1 280px;
  position: relative;
}
.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .85rem 1rem .85rem 2.6rem;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.search input:focus {
  outline: 2px solid rgba(16,185,129,.35);
  border-color: var(--accent);
}
.search i {
  position: absolute;
  left: .95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.count {
  align-self: center;
  color: var(--muted);
  font-size: .9rem;
}

.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  scroll-margin-top: 90px;
}
.section h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  letter-spacing: -.02em;
}
.terms {
  display: grid;
  gap: .7rem;
}
.term {
  display: grid;
  grid-template-columns: minmax(140px, 240px) 1fr;
  gap: .8rem 1rem;
  padding: .85rem 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 90px;
}
.term:first-child { border-top: 0; }
.term dt {
  margin: 0;
  font-family: var(--mono);
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
}
.term dd {
  margin: 0;
  color: #334155;
}
.term.is-hidden { display: none; }
.section.is-empty { display: none; }

.empty {
  display: none;
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
.empty.is-visible { display: block; }

.footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: .9rem;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.plan {
  max-width: 820px;
  padding-bottom: 4rem;
}
.plan__note {
  margin: 0 0 1.5rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid #a7f3d0;
  color: var(--accent-ink);
  font-size: .95rem;
}
.plan__list {
  display: grid;
  gap: .85rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: plan-step;
}
.plan__item {
  position: relative;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  scroll-margin-top: 90px;
}
.plan__days {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: .4rem .65rem;
  text-align: center;
  white-space: nowrap;
}
.plan__body h2 {
  margin: 0 0 .35rem;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}
.plan__body p {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}
.plan__links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .85rem;
  margin-top: .85rem;
  font-size: .88rem;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .25rem .5rem;
  }
  .sidebar h2 { grid-column: 1 / -1; }
  .term { grid-template-columns: 1fr; gap: .25rem; }
  .plan__item { grid-template-columns: 1fr; gap: .65rem; }
  .plan__days { justify-self: start; }
}
