:root {
  color-scheme: light;
  --paper: #f8efcf;
  --paper-dark: #eadfae;
  --ink: #111111;
  --green: #47cb39;
  --green-deep: #2d8f29;
  --acid: #d8ff33;
  --muted: #314128;
  --red: #ff6f3f;
  --line: 3px solid #111111;
  --shadow: 8px 8px 0 #111111;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 20%, rgba(92, 255, 69, 0.24), transparent 22%),
    radial-gradient(circle at 88% 12%, rgba(255, 111, 63, 0.18), transparent 16%),
    linear-gradient(180deg, #fff7de 0%, #f7efcf 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle, rgba(17, 17, 17, 0.11) 1px, transparent 1.4px) 0 0 / 12px 12px,
    linear-gradient(90deg, rgba(17, 17, 17, 0.05) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(17, 17, 17, 0.05) 1px, transparent 1px) 0 0 / 48px 48px;
  opacity: 0.45;
  pointer-events: none;
}

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

.docs-shell {
  position: relative;
  padding-bottom: 2rem;
}

.noise {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(17, 17, 17, 0.08) 0.7px, transparent 0.7px);
  background-size: 10px 10px;
  opacity: 0.18;
  pointer-events: none;
}

.docs-topbar,
.docs-hero,
.docs-section,
.docs-footer {
  width: min(1180px, calc(100% - 1.2rem));
  margin: 0 auto;
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.3rem;
  background: rgba(248, 239, 207, 0.94);
  border: var(--line);
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

.brand,
.nav {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 0.75rem;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 3.95rem;
  padding: 0.22rem;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 1.2rem;
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--green);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: scale(1.08);
  transform-origin: center;
  mix-blend-mode: screen;
}

.brand-copy strong,
.eyebrow,
.panel-cap,
.api-method,
.chip,
.nav,
code,
pre {
  font-family: "IBM Plex Mono", monospace;
}

.brand-copy {
  display: grid;
  gap: 0.15rem;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.9rem;
}

.nav {
  gap: 0.7rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a {
  padding: 0.3rem 0.45rem;
  border: 2px solid transparent;
}

.nav a:hover {
  background: var(--acid);
  border-color: var(--ink);
}

.docs-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  align-items: start;
  padding: 1.3rem 0 1rem;
}

.hero-card,
.snapshot-card,
.docs-panel,
.api-card,
.flow-card,
.note-card {
  border: var(--line);
  box-shadow: var(--shadow);
  background: #fff9e8;
}

.hero-card,
.snapshot-card,
.docs-panel,
.note-card {
  padding: 1.2rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.55rem;
  background: var(--acid);
  border: 2px solid var(--ink);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.docs-hero h1,
.docs-section h2 {
  margin: 0;
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.06em;
  text-transform: uppercase;
}

.docs-hero h1 {
  font-size: clamp(3rem, 10vw, 6rem);
  max-width: 8ch;
}

.lede,
.section-copy,
.hero-card p,
.snapshot-card p,
.docs-panel p,
.note-card p,
.api-card p,
.flow-card p,
li {
  color: var(--muted);
  line-height: 1.65;
}

.actions,
.actions-stack,
.chips,
.api-grid,
.flow-grid,
.docs-grid,
.note-grid,
.faq-list {
  display: grid;
  gap: 1rem;
}

.actions {
  grid-template-columns: repeat(3, max-content);
  margin-top: 1.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0 1.1rem;
  border: var(--line);
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 700;
  text-transform: uppercase;
}

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

.button.secondary {
  background: #fffdf4;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.8);
}

.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.snapshot-card {
  background:
    linear-gradient(145deg, rgba(92, 255, 69, 0.18) 0%, rgba(255, 255, 255, 0.82) 100%),
    #fff9e8;
}

.snapshot-card h3,
.api-card h3,
.flow-card h3,
.docs-panel h3,
.note-card h3 {
  margin: 0.75rem 0 0.55rem;
  font-size: 1.2rem;
  line-height: 1.08;
  text-transform: uppercase;
}

.chips {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.chip,
.panel-cap,
.api-method {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 0.35rem 0.55rem;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chip {
  border: 2px solid var(--ink);
  background: #fffdf4;
}

.docs-section {
  padding: 1rem 0 2rem;
}

.docs-section h2 {
  font-size: clamp(2.25rem, 6vw, 4.4rem);
  max-width: 10ch;
}

.section-head {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.section-copy {
  max-width: 60ch;
  margin: 0;
}

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

.docs-panel ul,
.flow-card ul,
.note-card ul {
  margin: 0;
  padding-left: 1.15rem;
}

.docs-panel li + li,
.flow-card li + li,
.note-card li + li {
  margin-top: 0.55rem;
}

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

.api-card {
  padding: 1.2rem;
  background: #fff9e8;
}

.panel-cap {
  background: var(--ink);
  color: #fff8de;
}

.api-method {
  margin-top: 0.8rem;
  border: 2px solid var(--ink);
  background: var(--acid);
}

pre {
  margin: 0.8rem 0 0;
  padding: 0.9rem;
  overflow-x: auto;
  border: var(--line);
  background: #fffdf4;
  font-size: 0.78rem;
  line-height: 1.55;
}

code {
  overflow-wrap: anywhere;
}

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

.faq-list {
  grid-template-columns: 1fr;
}

.faq-item {
  border: var(--line);
  box-shadow: var(--shadow);
  background: #fff9e8;
}

.faq-item[open] {
  background:
    linear-gradient(145deg, rgba(92, 255, 69, 0.12) 0%, rgba(255, 255, 255, 0.9) 100%),
    #fff9e8;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.2rem;
  cursor: pointer;
  list-style: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--ink);
  background: var(--acid);
  font-size: 1.1rem;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 1.2rem 1.2rem;
  border-top: 2px solid rgba(17, 17, 17, 0.12);
}

.faq-answer p {
  margin: 0.95rem 0 0;
}

.flow-card {
  padding: 1.1rem;
  background:
    linear-gradient(145deg, rgba(92, 255, 69, 0.14) 0%, rgba(255, 255, 255, 0.82) 100%),
    #fff9e8;
}

.note-card.warning {
  background:
    linear-gradient(145deg, rgba(255, 111, 63, 0.16) 0%, rgba(255, 255, 255, 0.8) 100%),
    #fff9e8;
}

.docs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: var(--line);
  box-shadow: var(--shadow);
  background: #fff9e8;
  margin-top: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-links a {
  padding: 0.3rem 0.5rem;
  border: 2px solid transparent;
}

.footer-links a:hover {
  background: var(--acid);
  border-color: var(--ink);
}

@media (max-width: 1080px) {
  .docs-hero,
  .docs-grid,
  .api-grid,
  .flow-grid,
  .note-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .docs-topbar,
  .docs-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .actions,
  .chips {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .docs-topbar,
  .docs-hero,
  .docs-section,
  .docs-footer {
    width: min(100% - 1rem, 1180px);
  }

  .brand-mark {
    width: 4.7rem;
    height: 3.35rem;
    padding: 0.18rem;
    border-radius: 0.95rem;
  }

  .docs-hero h1 {
    font-size: clamp(2.3rem, 12vw, 3.4rem);
  }

  .docs-section h2 {
    font-size: clamp(2rem, 9vw, 3.1rem);
  }

  .hero-card,
  .snapshot-card,
  .docs-panel,
  .api-card,
  .flow-card,
  .note-card {
    padding: 1rem;
  }
}
