:root {
  --ink: #1f2523;
  --muted: #626b67;
  --paper: #f8f7f2;
  --panel: #ffffff;
  --line: #d9d5c9;
  --green: #2e6f5d;
  --green-dark: #1f4f42;
  --red: #9d3b3b;
  --gold: #c99832;
  --blue: #356f91;
  --violet: #6c5a8d;
  --shadow: 0 18px 50px rgba(31, 37, 35, 0.12);
  color-scheme: light;
  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:
    linear-gradient(180deg, rgba(46, 111, 93, 0.08), transparent 420px),
    var(--paper);
  line-height: 1.6;
}

a {
  color: var(--green-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  padding: 0.1rem 0.28rem;
  border: 1px solid #ded8ca;
  border-radius: 5px;
  background: #f4f0e7;
  font-size: 0.92em;
}

pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 8px;
  background: #202725;
  color: #f2efe6;
  line-height: 1.45;
}

pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.78rem clamp(1rem, 4vw, 2.2rem);
  border-bottom: 1px solid rgba(31, 37, 35, 0.1);
  background: rgba(248, 247, 242, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.site-nav a,
.nav-toggle,
.button {
  border-radius: 7px;
}

.site-nav a {
  padding: 0.55rem 0.72rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.93rem;
}

.site-nav a:hover {
  background: rgba(46, 111, 93, 0.12);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0.55rem 0.75rem;
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.7fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2.2rem) clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--green-dark);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 0.78rem;
}

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

h1 {
  max-width: 780px;
  font-size: clamp(2.3rem, 6vw, 4.9rem);
}

h2 {
  padding-top: 1rem;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
}

h3 {
  margin-top: 1.8rem;
  font-size: 1.25rem;
}

h4 {
  font-size: 1rem;
}

.hero-text {
  max-width: 760px;
  color: #424a46;
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.68rem 1rem;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
}

.button.primary {
  background: var(--green);
  color: white;
}

.button.secondary {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.hero-panel {
  min-width: 0;
}

.window-frame {
  padding: 1rem;
  border: 1px solid rgba(31, 37, 35, 0.14);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.window-title {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin-bottom: 1rem;
}

.window-title span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
}

.window-title span:nth-child(2) {
  background: var(--gold);
}

.window-title span:nth-child(3) {
  background: var(--green);
}

.window-title strong {
  margin-left: 0.4rem;
  font-size: 0.88rem;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.flow-grid div,
.mini-plot,
.screen-card,
.card,
.callout,
.code-card,
.workflow div,
.checklist div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.flow-grid div {
  min-height: 70px;
  padding: 0.75rem;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 700;
}

.flow-grid div:nth-child(2),
.flow-grid div:nth-child(5) {
  border-color: rgba(53, 111, 145, 0.35);
  background: #edf5f8;
}

.flow-grid div:nth-child(3),
.flow-grid div:nth-child(6) {
  border-color: rgba(201, 152, 50, 0.4);
  background: #fbf4df;
}

.mini-plot {
  display: flex;
  align-items: end;
  gap: 0.6rem;
  height: 150px;
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(180deg, #fbfaf6, #eef4f1);
}

.mini-plot i {
  display: block;
  flex: 1;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--green), var(--blue));
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.2rem) 4rem;
}

.toc {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.toc label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.toc input {
  width: 100%;
  margin-bottom: 0.8rem;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
}

.toc nav {
  display: grid;
  gap: 0.18rem;
}

.toc a {
  padding: 0.42rem 0.5rem;
  border-radius: 6px;
  color: #3b423f;
  text-decoration: none;
  font-size: 0.92rem;
}

.toc a:hover {
  background: rgba(46, 111, 93, 0.12);
}

.content {
  min-width: 0;
}

.guide-section {
  margin-bottom: 1.4rem;
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid rgba(31, 37, 35, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.guide-section[hidden] {
  display: none;
}

.guide-section > p,
.guide-section li {
  color: #414945;
}

.guide-section ul,
.guide-section ol {
  padding-left: 1.3rem;
}

.guide-section li + li {
  margin-top: 0.36rem;
}

.checklist,
.cards,
.two-column,
.wizard-grid,
.visual-row {
  display: grid;
  gap: 1rem;
}

.checklist {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checklist div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  padding: 1rem;
}

.checklist span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.checklist p,
.card p,
.callout p {
  margin: 0;
}

.callout {
  margin: 1rem 0;
  padding: 1rem;
  border-left: 5px solid var(--green);
  background: #eef6f1;
}

.callout.warning {
  border-left-color: var(--red);
  background: #fff1ef;
}

.two-column,
.wizard-grid,
.visual-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.card,
.code-card {
  padding: 1rem;
}

.card h3,
.card h4,
.code-card h4 {
  margin-bottom: 0.5rem;
}

.screen-card {
  overflow: hidden;
  background: #fdfcf8;
  box-shadow: 0 12px 30px rgba(31, 37, 35, 0.08);
}

.screen-title {
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: #eee8dc;
  font-weight: 800;
  font-size: 0.88rem;
}

.screen-body {
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem;
  min-height: 190px;
}

.screen-body span {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(31, 37, 35, 0.12);
  border-radius: 7px;
  background: white;
  font-weight: 700;
  color: #3e4642;
}

.project-visual span:nth-child(2),
.dashboard-visual span:nth-child(3) {
  background: #edf5f8;
  border-color: rgba(53, 111, 145, 0.3);
}

.project-visual span:nth-child(4),
.dashboard-visual span:nth-child(4) {
  background: #f7efe8;
  border-color: rgba(157, 59, 59, 0.24);
}

.workflow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}

.workflow div {
  position: relative;
  min-height: 150px;
  padding: 1rem;
}

.workflow strong,
.workflow span {
  display: block;
}

.workflow strong {
  margin-bottom: 0.6rem;
  color: var(--green-dark);
}

.workflow span {
  color: #4a524e;
  font-size: 0.92rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

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

th {
  background: #ede8dc;
  color: #27302c;
  font-size: 0.88rem;
}

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

.accordion details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.accordion details + details {
  margin-top: 0.6rem;
}

.accordion summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: 800;
}

.accordion details p {
  margin: 0;
  padding: 0 1rem 1rem;
  color: #414945;
}

.reference-list {
  columns: 2;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem clamp(1rem, 4vw, 2.2rem);
  border-top: 1px solid var(--line);
  background: #eee8dc;
}

.footer p {
  margin: 0;
}

@media (max-width: 1040px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    max-height: none;
  }

  .workflow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 68px;
    right: 1rem;
    left: 1rem;
    flex-direction: column;
    align-items: stretch;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow);
  }

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

  .hero {
    padding-top: 2rem;
  }

  .hero-actions,
  .footer {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .checklist,
  .two-column,
  .wizard-grid,
  .visual-row,
  .cards,
  .workflow {
    grid-template-columns: 1fr;
  }

  .flow-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reference-list {
    columns: 1;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
