:root {
  --ink: #0f1c21;
  --body: #33474d;
  --muted: #63777d;
  --line: #e0e6e1;
  --paper: #fbfbf8;
  --surface: #ffffff;
  --accent: #0d5c55;
  --accent-ink: #08443f;
  --accent-soft: #e8f2ef;
  --gold: #a9713a;
  --danger: #a9382c;
  --radius: 14px;
  --wrap: 1120px;
  --shadow: 0 1px 2px rgba(15, 28, 33, .05), 0 12px 32px -18px rgba(15, 28, 33, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

section[id], h3[id] { scroll-margin-top: 84px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.022em;
  margin: 0 0 .5em;
  font-weight: 650;
}

h1 { font-size: clamp(2.15rem, 4.6vw, 3.5rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.65rem, 2.9vw, 2.35rem); }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }

code {
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: .88em;
  background: #eef2ee;
  border-radius: 5px;
  padding: .1em .35em;
  color: #1c3b3a;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* Grid and flex children default to min-width:auto, which lets long code lines
   widen the page instead of scrolling inside their own container. */
.two-col > *, .grid-3 > *, .case-grid > *, .limits-grid > *, .shot-pair > *, .footer-inner > * { min-width: 0; }
pre { max-width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 20;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 8px;
  text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(251, 251, 248, .86);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: .95rem;
}
.brand-text { font-weight: 640; letter-spacing: -.01em; }

.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a {
  color: var(--body); text-decoration: none; font-size: .9rem; padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; border: 1px solid transparent;
  font-size: .95rem; font-weight: 600; text-decoration: none; line-height: 1.2;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -12px rgba(13, 92, 85, .9); }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #bcc9c3; color: var(--ink); }
.btn-sm { padding: 9px 14px; font-size: .88rem; }
.is-disabled { opacity: .55; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero {
  padding: 72px 0 0;
  background:
    radial-gradient(900px 380px at 78% -8%, #e3efe9 0%, rgba(227, 239, 233, 0) 68%),
    radial-gradient(700px 300px at 4% 0%, #f2efe4 0%, rgba(242, 239, 228, 0) 70%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 48px; align-items: start; }
.eyebrow {
  font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 14px;
}
.hero h1 { margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 1.06rem; max-width: 56ch; color: #3d5157; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 16px; }
.hero-note { font-size: .85rem; color: var(--muted); max-width: 54ch; }

.hero-shot { margin: 0; }
.hero-shot img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); background: #eef1ec;
}
.hero-shot figcaption { font-size: .8rem; color: var(--muted); margin-top: 10px; }

.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  list-style: none; margin: 56px 0 0; padding: 26px 0 34px;
  border-top: 1px solid var(--line);
}
.stat-strip li { display: flex; flex-direction: column; gap: 2px; }
.stat-strip strong { font-size: 1.9rem; color: var(--ink); letter-spacing: -.03em; }
.stat-strip span { font-size: .85rem; color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: 84px 0; }
.section-tint { background: #f4f6f2; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-lede { max-width: 70ch; color: #3d5157; margin-bottom: 36px; }

.two-col { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: start; }
.two-col-wide { grid-template-columns: 1fr 1fr; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}

.list { margin: 0; padding-left: 1.1em; }
.list li { margin-bottom: .65rem; }
.list li::marker { color: var(--accent); }
.list-check { list-style: none; padding-left: 0; }
.list-check li { position: relative; padding-left: 26px; }
.list-check li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 700;
}
.list-dot { list-style: none; padding-left: 0; }
.list-dot li { position: relative; padding-left: 18px; }
.list-dot li::before {
  content: ""; position: absolute; left: 2px; top: .62em;
  width: 6px; height: 6px; border-radius: 50%; background: #b8c9c3;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card-flat { box-shadow: none; background: transparent; }
.card .num {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 8px; margin-bottom: 12px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: .8rem; font-weight: 700;
}
.card h3, .card h4 { margin-bottom: .45rem; }
.card p { font-size: .93rem; margin: 0; }

.h3-tight { margin-bottom: .8rem; }
.h3-space { margin-top: 44px; }

/* ---------- architecture and flows ---------- */
.arch {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  padding: 16px 18px; margin-bottom: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.arch-label {
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.arch-chip {
  display: inline-flex; flex-direction: column; gap: 2px;
  padding: 8px 12px; border-radius: 9px;
  background: #f4f7f3; border: 1px solid #e2e9e2;
  font-size: .85rem; font-weight: 650; color: var(--ink);
}
.arch-chip span { font-size: .72rem; font-weight: 400; color: var(--muted); }
.arch-chip-strong { background: var(--accent-soft); border-color: #c9e0d8; }
.arch-chip-store { background: #f7f4ec; border-color: #e7dfcd; }
.arch-arrow { color: #9fb2ab; }
.arch-note { flex: 1 1 260px; font-size: .78rem; color: var(--muted); }

.flows { display: grid; gap: 14px; }
.flow {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px;
}
.flow h3 { font-size: .98rem; margin-bottom: 14px; }
.flow-steps { display: flex; flex-wrap: wrap; gap: 22px; list-style: none; margin: 0; padding: 0; }
.flow-steps li {
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
  padding: 9px 12px; border-radius: 9px;
  background: #f6f8f4; border: 1px solid #e4eae5;
}
.flow-steps li strong { font-size: .82rem; font-weight: 650; color: var(--ink); }
.flow-steps li span { font-size: .72rem; color: var(--muted); }
.flow-steps li + li::before {
  content: "→"; position: absolute; left: -17px; top: 50%;
  transform: translateY(-50%); color: #9fb2ab; font-size: .8rem;
}

/* ---------- video ---------- */
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 6px 0 30px; }
.video h3 { font-size: 1rem; margin-bottom: 10px; }
.video-frame {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: #0f1c21;
}
.video-frame iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }

/* ---------- disclosure ---------- */
.disclosure {
  margin: 26px 0 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px;
}
.disclosure summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; cursor: pointer; font-weight: 650; color: var(--ink);
  list-style: none;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.disclosure[open] summary::after { content: "−"; }
.disclosure-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.disclosure-body > p:first-child { margin-top: 14px; }

/* ---------- screenshots ---------- */
.shot { margin: 0 0 22px; }
.shot img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); background: #eef1ec;
}
.shot figcaption { font-size: .82rem; color: var(--muted); margin-top: 10px; }
.shot-pair { display: grid; grid-template-columns: .62fr 1fr; gap: 22px; align-items: start; }

/* ---------- code ---------- */
.code-block {
  margin: 26px 0 10px; border-radius: 12px; overflow: hidden;
  border: 1px solid #1e3034; background: #0f1c21;
}
.code-head {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline;
  padding: 10px 16px; background: #14262b; border-bottom: 1px solid #22383d;
  font-size: .76rem; color: #9fb6b2;
}
.code-head code { background: transparent; color: #d6e6e1; padding: 0; font-size: .78rem; }
.code-block pre { margin: 0; padding: 16px; overflow-x: auto; }
.code-block pre code {
  background: transparent; color: #dbe9e4; padding: 0;
  font-size: .82rem; line-height: 1.6;
  /* Wrap instead of clipping: commands stay copy-pasteable and readable on any width. */
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.code-block.tight { margin-top: 12px; }
.code-block.tight pre code { font-size: .78rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
thead th {
  text-align: left; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  padding: 14px 18px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody th, tbody td { padding: 14px 18px; border-bottom: 1px solid #eef1ec; vertical-align: top; text-align: left; }
tbody th { color: var(--ink); font-weight: 620; width: 22%; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.table-compact { font-size: .88rem; }
.table-compact td { padding: 10px 16px; }
.table-compact thead th { padding: 12px 16px; }

/* ---------- cases ---------- */
.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.case {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.case header { margin-bottom: 14px; }
.case h3 { margin: .5rem 0 0; }
.tag {
  display: inline-block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 700; padding: 3px 8px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.tag-fail { background: #fdeceb; color: var(--danger); }
.case p { font-size: .92rem; }
.kv { margin: 0; font-size: .86rem; }
.kv > div { display: grid; grid-template-columns: 78px 1fr; gap: 10px; padding: 6px 0; border-top: 1px dashed #e9eeea; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; color: var(--body); overflow-wrap: anywhere; }

/* ---------- limitations ---------- */
.limits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.limits-grid h3 { margin-bottom: .7rem; }
.callout {
  margin-top: 32px; padding: 18px 22px; border-radius: 12px;
  background: #fbf3e6; border: 1px solid #eddcc1; color: #6b4a1d; font-size: .92rem;
}

.micro { font-size: .82rem; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; background: var(--paper); }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-brand { font-weight: 650; color: var(--ink); margin-bottom: 4px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; align-content: start; font-size: .9rem; }

/* ---------- mobile contents menu ---------- */
.mobile-nav { display: none; position: relative; margin-left: auto; }
.mobile-nav summary {
  list-style: none; cursor: pointer; font-size: .88rem; color: var(--body);
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary::after { content: " ▾"; color: var(--muted); }
.mobile-nav[open] summary::after { content: " ▴"; }
.mobile-nav nav {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 15;
  width: 232px; max-width: calc(100vw - 36px); display: grid; gap: 2px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px -20px rgba(15, 28, 33, .5);
}
.mobile-nav nav a { padding: 8px 10px; border-radius: 7px; text-decoration: none; font-size: .92rem; color: var(--body); }
.mobile-nav nav a:hover { background: #f1f5f1; color: var(--accent-ink); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 34px; }
  .hero { padding-top: 52px; }
  .two-col, .two-col-wide { grid-template-columns: 1fr; gap: 32px; }
  .grid-3, .case-grid { grid-template-columns: 1fr; }
  .limits-grid { grid-template-columns: 1fr; gap: 28px; }
  .shot-pair { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .flow-steps { flex-direction: column; gap: 18px; }
  .flow-steps li + li::before { content: "↓"; left: 50%; top: -14px; transform: translateX(-50%); }
  .stat-strip { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .site-nav { display: none; }
  .mobile-nav { display: block; }
  .nav-cta { margin-left: 0; }
}

@media (max-width: 640px) {
  .arch { flex-direction: column; align-items: stretch; }
  .arch-arrow { align-self: center; transform: rotate(90deg); }
  .arch-chip { width: 100%; }
}

@media (max-width: 560px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; row-gap: 10px; }
  .brand { flex: 1 1 100%; }
  .mobile-nav { margin-left: 0; }
  .nav-cta { margin-left: auto; }
  .wrap { padding: 0 18px; }
  .section { padding: 60px 0; }
  .hero { padding-top: 40px; }
  .brand-text { font-size: .95rem; }
  .stat-strip strong { font-size: 1.55rem; }
  .kv > div { grid-template-columns: 1fr; gap: 2px; }
  .code-head { font-size: .72rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .site-header, .site-footer, .hero-actions, .skip-link { display: none; }
  body { background: #fff; }
  .section, .section-tint { padding: 24px 0; background: #fff; }
  a { color: #000; text-decoration: underline; }
}
