:root {
  color-scheme: light;
  --ink: #161713;
  --muted: #5f6963;
  --line: #d9e3dc;
  --paper: #f5f8f4;
  --panel: #ffffff;
  --panel-soft: #edf4f0;
  --teal: #167b72;
  --green: #4b8b5a;
  --orange: #d8662c;
  --gold: #b78b2e;
  --red: #b54d38;
  --shadow: 0 24px 70px rgba(21, 24, 18, 0.13);
  --radius: 8px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, #f9fbf8 0%, #eef5f1 45%, #f7f2e8 100%);
}

body.modal-open {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

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

code {
  font-family: var(--font-mono);
}

.skip-link {
  background: var(--ink);
  color: #fff;
  left: 16px;
  padding: 10px 14px;
  position: fixed;
  top: -80px;
  z-index: 40;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(217, 227, 220, 0.96);
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  left: 18px;
  padding: 12px;
  position: fixed;
  right: 18px;
  top: 14px;
  z-index: 30;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-weight: 850;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.brand strong,
.brand em {
  display: block;
  font-style: normal;
  line-height: 1.2;
}

.brand em {
  color: var(--muted);
  font-size: 12px;
}

.nav-links,
.site-actions,
.hero-actions,
.modal-links {
  align-items: center;
  display: flex;
  gap: 8px;
}

.nav-links a {
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  padding: 9px 10px;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--panel-soft);
  color: var(--ink);
}

.icon-button,
.primary-button,
.ghost-button {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  justify-content: center;
  min-height: 40px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.icon-button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  min-width: 40px;
  padding: 0 10px;
  text-decoration: none;
}

.primary-button,
.ghost-button {
  border: 1px solid transparent;
  padding: 0 15px;
  text-decoration: none;
}

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

.ghost-button {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--line);
  color: var(--ink);
}

.icon-button:hover,
.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.icon-button:focus-visible,
.primary-button:focus-visible,
.ghost-button:focus-visible,
.nav-links a:focus-visible {
  box-shadow: 0 0 0 3px rgba(22, 123, 114, 0.24);
  outline: none;
}

main {
  overflow: hidden;
}

.hero {
  background: #f7faf6;
  isolation: isolate;
  min-height: clamp(580px, 70vh, 720px);
  overflow: hidden;
  padding: 136px 24px 72px;
  position: relative;
}

.hero::before,
.hero::after {
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.hero::before {
  background:
    linear-gradient(90deg, rgba(247, 250, 246, 0.99) 0%, rgba(247, 250, 246, 0.98) 46%, rgba(247, 250, 246, 0.86) 61%, rgba(247, 250, 246, 0.2) 100%),
    url("/assets/larkcli-hero-background.png") center / cover no-repeat;
}

.hero::after {
  background: linear-gradient(180deg, rgba(247, 250, 246, 0) 68%, rgba(247, 250, 246, 0.86) 100%);
}

.hero-copy {
  margin: 0 auto;
  max-width: 1180px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.eyebrow {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(40px, 5.5vw, 72px);
  letter-spacing: 0;
  line-height: 1.14;
  margin: 0;
  max-width: 820px;
}

.hero-lede {
  color: var(--muted);
  font-size: clamp(17px, 1.75vw, 20px);
  line-height: 1.78;
  margin: 22px 0 0;
  max-width: 660px;
}

.hero-actions {
  flex-wrap: wrap;
  margin-top: 28px;
}

.command-strip {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  max-width: 560px;
}

.command-strip code,
.capability-card code,
.workflow-list code {
  background: #151713;
  border: 1px solid #2b312a;
  border-radius: 8px;
  color: #fff5df;
  display: block;
  line-height: 1.6;
  overflow-wrap: anywhere;
  padding: 11px 13px;
}

.section {
  margin: 0 auto;
  max-width: 1180px;
  padding: 76px 24px;
}

.intro-band {
  font-size: clamp(20px, 2.6vw, 34px);
  font-weight: 750;
  line-height: 1.45;
  max-width: 1000px;
  padding-bottom: 42px;
  padding-top: 54px;
}

.intro-band p {
  margin: 0;
}

.section-heading {
  margin-bottom: 28px;
  max-width: 720px;
}

.section-heading h2,
.boundary-section h2 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  margin: 0;
}

.section-heading p,
.boundary-list,
.audience-grid p,
.resource-links span,
.capability-card p,
.workflow-list p,
.facts-grid span,
.layer-grid p,
.automation-grid p {
  color: var(--muted);
  line-height: 1.72;
}

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

.capability-card,
.audience-grid article,
.resource-links a,
.facts-grid article,
.layer-grid article,
.automation-grid article {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(217, 227, 220, 0.95);
  border-radius: var(--radius);
  box-shadow: 0 18px 54px rgba(22, 23, 19, 0.06);
}

.capability-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 18px;
}

.card-index {
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
}

.capability-card h3,
.audience-grid h3 {
  font-size: 22px;
  margin: 18px 0 8px;
}

.capability-card p {
  margin: 0 0 18px;
}

.capability-card code {
  font-size: 13px;
  margin-top: 10px;
}

.capability-card code:first-of-type {
  margin-top: auto;
}

.path-section {
  max-width: 1220px;
}

.fact-section,
.command-section,
.automation-section {
  max-width: 1220px;
}

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

.facts-grid article {
  display: grid;
  gap: 10px;
  min-height: 170px;
  padding: 20px;
}

.facts-grid strong {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.layer-grid,
.automation-grid {
  display: grid;
  gap: 14px;
}

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

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

.layer-grid article,
.automation-grid article {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 20px;
}

.layer-grid span {
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 850;
}

.layer-grid h3,
.automation-grid h3 {
  font-size: 22px;
  line-height: 1.25;
  margin: 16px 0 8px;
}

.layer-grid p,
.automation-grid p {
  margin: 0 0 18px;
}

.layer-grid code,
.automation-grid code {
  background: #151713;
  border: 1px solid #2b312a;
  border-radius: 8px;
  color: #fff5df;
  display: block;
  font-size: 13px;
  line-height: 1.6;
  margin-top: auto;
  overflow-wrap: anywhere;
  padding: 11px 13px;
}

.layer-grid code + code {
  margin-top: 10px;
}

.domain-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.domain-cloud span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  padding: 10px 13px;
}

.workflow-list {
  counter-reset: path;
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.workflow-list li {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(110px, 0.42fr) minmax(240px, 1fr) minmax(220px, 0.9fr);
  padding: 16px;
  position: relative;
}

.workflow-list li::before {
  color: var(--teal);
  content: counter(path, decimal-leading-zero);
  counter-increment: path;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 850;
  position: absolute;
  right: 16px;
  top: 12px;
}

.workflow-list span {
  font-size: 22px;
  font-weight: 820;
}

.workflow-list p {
  margin: 0;
  padding-right: 30px;
}

.audience-grid,
.resource-links {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.audience-grid article {
  padding: 20px;
}

.audience-grid p {
  margin-bottom: 0;
}

.agent-section,
.boundary-section {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: 0.8fr 1.2fr;
}

.agent-copy p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.agent-card {
  background: #151713;
  border: 1px solid #2b312a;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: #fff5df;
  display: grid;
  gap: 12px;
  padding: 22px;
}

.agent-card p {
  color: #cbd7cf;
  margin: 0;
}

.agent-card code {
  background: #fff5df;
  border-radius: 8px;
  color: #151713;
  display: block;
  line-height: 1.6;
  overflow-wrap: anywhere;
  padding: 12px 13px;
}

.boundary-list {
  background: #fff9ec;
  border: 1px solid #ead8a6;
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 20px 22px 20px 42px;
}

.resources-section {
  padding-bottom: 50px;
}

.resource-links a {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 20px;
  text-decoration: none;
}

.resource-links a:hover,
.resource-links a:focus-visible {
  border-color: rgba(22, 123, 114, 0.5);
}

.resource-links strong {
  font-size: 20px;
}

.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin: 28px auto 0;
  max-width: 1180px;
  padding: 28px 24px 42px;
}

.site-footer a,
.site-footer span {
  color: var(--muted);
  font-size: 14px;
}

.toast-stack {
  bottom: 18px;
  display: grid;
  gap: 8px;
  position: fixed;
  right: 18px;
  z-index: 60;
}

.toast {
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.leaving {
  opacity: 0;
  transform: translateY(6px);
}

.modal-layer[hidden] {
  display: none;
}

.modal-layer {
  inset: 0;
  position: fixed;
  z-index: 50;
}

.modal-backdrop {
  background: rgba(21, 23, 19, 0.46);
  inset: 0;
  position: absolute;
}

.modal-panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  left: 50%;
  max-height: calc(100vh - 36px);
  max-width: min(520px, calc(100vw - 36px));
  overflow: auto;
  padding: 24px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.modal-panel h2 {
  font-size: 26px;
  margin: 0 44px 12px 0;
}

.modal-panel p {
  color: var(--muted);
  line-height: 1.72;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
}

.modal-qr {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 18px auto;
  max-height: 280px;
  object-fit: contain;
}

.modal-links {
  flex-wrap: wrap;
}

.not-found-page {
  align-items: center;
  display: flex;
  min-height: 100vh;
  padding: 24px;
}

.not-found {
  margin: auto;
  max-width: 560px;
  text-align: center;
}

.not-found h1 {
  font-size: clamp(34px, 5vw, 58px);
  margin: 0;
}

.not-found p {
  color: var(--muted);
  line-height: 1.72;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: 640px;
    padding-top: 118px;
  }

  .hero::before {
    background:
      linear-gradient(180deg, rgba(247, 250, 246, 0.98) 0%, rgba(247, 250, 246, 0.95) 48%, rgba(247, 250, 246, 0.7) 100%),
      url("/assets/larkcli-hero-background.png") 60% 40% / auto 92% no-repeat,
      #f7faf6;
  }

  .hero-copy {
    max-width: none;
  }

  .capability-grid,
  .audience-grid,
  .resource-links,
  .facts-grid,
  .layer-grid,
  .automation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-list li,
  .agent-section,
  .boundary-section {
    grid-template-columns: 1fr;
  }

  .workflow-list li::before {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-header {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .brand em {
    display: none;
  }

  .site-actions {
    gap: 5px;
  }

  .icon-button {
    min-width: 36px;
    padding: 0 8px;
  }

  .hero {
    min-height: 560px;
    padding: 102px 16px 50px;
  }

  .hero::before {
    background:
      linear-gradient(180deg, rgba(247, 250, 246, 0.99) 0%, rgba(247, 250, 246, 0.96) 54%, rgba(247, 250, 246, 0.82) 100%),
      url("/assets/larkcli-hero-background.png") 63% 44px / auto 500px no-repeat,
      #f7faf6;
  }

  .hero h1 {
    font-size: clamp(36px, 10.5vw, 46px);
    line-height: 1.13;
  }

  .hero-lede {
    font-size: 16px;
    line-height: 1.72;
    margin-top: 20px;
  }

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

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .section {
    padding: 54px 16px;
  }

  .intro-band {
    padding-top: 38px;
  }

  .capability-grid,
  .audience-grid,
  .resource-links,
  .facts-grid,
  .layer-grid,
  .automation-grid {
    grid-template-columns: 1fr;
  }

  .capability-card,
  .facts-grid article,
  .layer-grid article,
  .automation-grid article {
    min-height: 0;
  }

  .workflow-list li {
    padding: 14px;
  }

  .toast-stack {
    left: 14px;
    right: 14px;
  }
}
