/* MakeZPL site styles — shared by every static page. Cached once, no framework. */

:root {
  --bg: #e9e7e2;
  --panel: #f6f5f2;
  --sunk: #dedbd4;
  --edge: #d8d5cf;
  --ink: #26241f;
  --muted: #5f5c55;
  --accent: #0e6b63;
  --accent-ink: #0a4f49;
  --accent-soft: #dfeceb;
  --warn-soft: #f6eed9;
  --warn-ink: #7a5406;
  --btn-ink: #fff;
  --shadow: 0 1px 2px rgba(38, 36, 31, .06);
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16150f;
    --panel: #201e18;
    --sunk: #12110c;
    --edge: #35322a;
    --ink: #ece9e1;
    --muted: #a29d92;
    --accent: #4fc2b6;
    --accent-ink: #7ad6cb;
    --accent-soft: #1d2f2c;
    --warn-soft: #2e2716;
    --warn-ink: #e0c584;
    --btn-ink: #10201e;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 16px;
  z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }

/* ---------- header ---------- */

.site-head {
  border-bottom: 1px solid var(--edge);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 5;
}
.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 62px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 13px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand span { color: var(--accent); }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: 14.5px; flex-wrap: wrap; }
.site-nav a:not(.btn) { color: var(--muted); text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

@media (max-width: 720px) {
  .site-head .wrap { min-height: 0; padding-top: 10px; padding-bottom: 10px; }
  .site-nav { margin-left: 0; gap: 14px; font-size: 14px; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--btn-ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 19px;
  border-radius: 4px;
  border: 1px solid var(--accent);
}
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--edge); }
.btn-sm { font-size: 14px; padding: 7px 14px; }

/* ---------- headings & type ---------- */

h1 { margin: 0 0 18px; font-size: clamp(32px, 5vw, 50px); line-height: 1.08; letter-spacing: -.02em; }
h2 { margin: 0 0 12px; font-size: clamp(23px, 3vw, 30px); letter-spacing: -.015em; }
h3 { margin: 0 0 6px; font-size: 17.5px; }
h4 { margin: 0 0 4px; font-size: 15px; letter-spacing: .02em; }

.kicker {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.lede { font-size: 19px; color: var(--muted); max-width: 62ch; }
.section-lede { color: var(--muted); max-width: 66ch; margin: 0 0 30px; }

main p { max-width: 72ch; }
main li { max-width: 70ch; }

/* ---------- layout blocks ---------- */

section { padding: 54px 0; border-top: 1px solid var(--edge); }
section:first-of-type { border-top: 0; }
.hero { padding: 60px 0 48px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }

.card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card p + p { margin-top: 10px; }

a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { border-color: var(--accent); }
a.card h3 { color: var(--accent-ink); }
a.card h3::after { content: " →"; font-weight: 400; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 26px 0 0; }
.cta small { color: var(--muted); font-size: 14px; }

.facts {
  display: flex; flex-wrap: wrap; gap: 8px 26px;
  margin: 32px 0 0; padding: 0; list-style: none;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
}
.facts li::before { content: "▪ "; color: var(--accent); }

/* ---------- figures & diagrams ---------- */

figure { margin: 36px 0; }
figure img, figure svg { display: block; width: 100%; height: auto; }
figure img {
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--panel);
}
figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); max-width: 72ch; }

.diagram {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: 18px;
}

/* Diagram ink, driven by the theme. */
.d-bg { fill: var(--panel); }
.d-paper { fill: var(--sunk); }
.d-ink { fill: var(--ink); }
.d-line { stroke: var(--ink); fill: none; }
.d-edge { stroke: var(--edge); fill: none; }
.d-accent { fill: var(--accent); }
.d-accent-s { stroke: var(--accent); fill: none; }
.d-muted { fill: var(--muted); }
.d-muted-s { stroke: var(--muted); fill: none; }
.d-label { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.d-code { font-family: var(--mono); font-size: 12px; fill: var(--accent-ink); }
.d-title { font-family: var(--sans); font-size: 13px; font-weight: 600; fill: var(--ink); }

/* ---------- code ---------- */

code {
  font-family: var(--mono);
  font-size: .92em;
  background: var(--accent-soft);
  padding: 1px 5px;
  border-radius: 3px;
  overflow-wrap: break-word;
}
pre {
  background: var(--sunk);
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
}
pre code { background: none; padding: 0; font-size: inherit; }

.snippet { margin: 0 0 24px; }
.snippet header {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline;
  padding: 0 0 8px;
}
.snippet header h3 { margin: 0; }
.snippet header .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.snippet header .meta::before { content: "· "; }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; margin: 0 0 8px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 520px; }
caption { text-align: left; color: var(--muted); font-size: 14px; padding-bottom: 10px; }
th, td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--edge); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
tbody th { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); white-space: nowrap; }
td code, th code { white-space: nowrap; }
.num { font-family: var(--mono); font-size: 14px; }

/* ---------- misc blocks ---------- */

ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }
ol.steps > li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 16px; max-width: none; }
ol.steps > li::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--mono); font-size: 14px; color: var(--accent);
  border: 1px solid var(--edge); border-radius: 50%;
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--panel);
}
ol.steps p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
ol.steps pre { margin-top: 10px; }

details { border-bottom: 1px solid var(--edge); padding: 15px 0; }
details summary {
  cursor: pointer; font-weight: 600; font-size: 17px;
  list-style: none; display: flex; gap: 12px; align-items: baseline;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; color: var(--accent); font-family: var(--mono); }
details[open] summary::before { content: "–"; }
details p { margin: 10px 0 0 24px; color: var(--muted); font-size: 15.5px; }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 15px 20px;
  border-radius: 0 4px 4px 0;
  margin: 24px 0;
}
.callout.warn { border-left-color: var(--warn-ink); background: var(--warn-soft); }
.callout p { margin: 0; font-size: 15px; }
.callout p + p { margin-top: 8px; }

.breadcrumb {
  font-size: 13.5px;
  color: var(--muted);
  padding: 14px 0 0;
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/ "; color: var(--edge); margin-right: 8px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

.closer { text-align: center; }
.closer .section-lede { margin-inline: auto; }
.closer .cta { justify-content: center; }

.tocard { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.tocard li { margin: 0; max-width: none; }
.tocard a { display: block; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 5px; background: var(--panel); text-decoration: none; }
.tocard a:hover { border-color: var(--accent); }
.tocard strong { display: block; color: var(--ink); font-size: 15px; }
.tocard span { color: var(--muted); font-size: 13.5px; }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--edge);
  background: var(--panel);
  padding: 40px 0 30px;
  font-size: 14.5px;
  color: var(--muted);
  margin-top: 40px;
}
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 26px; }
.foot-cols h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin: 0 0 10px; font-weight: 600;
}
.foot-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.foot-cols a { color: var(--ink); text-decoration: none; font-size: 14.5px; }
.foot-cols a:hover { color: var(--accent-ink); text-decoration: underline; }
.foot-base { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--edge); font-size: 13px; line-height: 1.55; }
.foot-base p { margin: 0 0 6px; max-width: 90ch; }

/* ---------- hero animation ---------- */

.hero-demo { background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; padding: 14px; box-shadow: var(--shadow); }
.hero-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; }
@media (max-width: 900px) { .hero-split { grid-template-columns: 1fr; gap: 28px; } }

/* Elements draw in as the matching ZPL line "types". One 12s loop. */
.anim-in { opacity: 0; animation: fade-in .45s ease-out forwards; }
.anim-grow { transform-origin: left center; transform: scaleX(0); animation: grow-x .5s ease-out forwards; }
.anim-code { opacity: 0; animation: fade-in .3s ease-out forwards; }
@keyframes fade-in { to { opacity: 1; } }
@keyframes grow-x { to { transform: scaleX(1); } }

/* The caret owns its own animation, so it must not also carry .anim-code. */
.caret { opacity: 0; animation: blink 1.06s infinite both; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .anim-in, .anim-grow, .anim-code, .caret {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
