:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --ink: #111418;
  --muted: #5e636b;
  --rule: #e7e5df;
  --accent: #00a896;
  --accent-ink: #006b60;
  --device-bg: #0a0a1a;
  --radius: 2px;
  --max: 1080px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid rgba(0,168,150,0.35); }
a:hover { color: var(--accent); border-bottom-color: var(--accent); }
a.plain { border: 0; }

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

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 249, 246, 0.88);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.brand {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.01em;
  color: var(--ink);
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand .mark {
  color: var(--accent);
  font-size: 10px;
  transform: translateY(-1px);
}
.brand .sub {
  color: var(--muted);
  font-weight: 500;
  margin-left: 2px;
}
.site-header nav a {
  color: var(--muted);
  border: 0;
  margin-left: 20px;
  font-size: 14px;
}
.site-header nav a:hover { color: var(--ink); }
.site-header nav a.current { color: var(--ink); }
@media (max-width: 720px) {
  .site-header nav a { margin-left: 14px; font-size: 13px; }
  .site-header nav a.hide-sm { display: none; }
}

/* ---------- hero ---------- */
.hero {
  padding: 88px 0 56px;
  border-bottom: 1px solid var(--rule);
}
.hero.compact { padding: 56px 0 40px; }
.eyebrow {
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
h1 {
  font-size: clamp(38px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  font-weight: 650;
}
h1.small { font-size: clamp(30px, 4vw, 44px); }
.lede {
  max-width: 640px;
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 32px;
}
.cta { margin: 0; }
.btn {
  display: inline-block;
  padding: 10px 18px;
  margin-right: 8px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  background: transparent;
  transition: background 120ms ease, color 120ms ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* ---------- sections ---------- */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--rule);
}
.section.alt { background: var(--surface); }
h2 {
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  font-weight: 600;
}
h3 {
  font-size: 18px;
  margin: 0 0 12px;
  font-weight: 600;
}
.section-lede {
  max-width: 640px;
  color: var(--muted);
  margin: 0 0 32px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; gap: 32px; } }

ul.lined {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.lined li {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}
ul.lined li:last-child { border-bottom: 1px solid var(--rule); }
ul.lined strong { color: var(--ink); font-weight: 600; }

/* ---------- ecosystem grid (home) ---------- */
.eco-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 600px) {
  .eco-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .eco-grid { grid-template-columns: repeat(3, 1fr); }
}
.eco-card {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.eco-card .eco-thumb {
  aspect-ratio: 16 / 9;
  background: #0f1114;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 2px;
}
.eco-card .eco-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eco-card .eco-thumb.device {
  background: #0a0a1a;
  padding: 8px;
}
.eco-card .eco-thumb.device img {
  width: auto;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.section.alt .eco-card { background: var(--surface); }
.eco-card .eco-tag {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0;
}
.eco-card h3 { margin: 0; font-size: 18px; }
.eco-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.eco-card a.more {
  margin-top: auto;
  font-size: 13px;
  border: 0;
  padding-top: 4px;
}
.eco-card.engine {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ---------- screenshots gallery ---------- */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}
.shots figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.section.alt .shots figure { background: var(--bg); }
.shots img {
  width: 100%;
  height: auto;
  display: block;
}
.shots figcaption {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 14px 14px;
  border-top: 1px solid var(--rule);
}

/* compact variant for tiny device shots */
.shots.device figure {
  background: var(--device-bg);
  border: 1px solid #1e1e34;
  padding: 10px 10px 0;
  align-items: center;
}
.shots.device img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  max-width: 220px;
  margin: 0 auto;
}
.shots.device figcaption {
  width: 100%;
  background: var(--device-bg);
  color: #bdbdd6;
  border-top-color: #1e1e34;
}

/* ---------- tables ---------- */
.table-wrap {
  margin: 0 0 28px;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
td:first-child { color: var(--muted); }

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 7px;
  font: 500 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--ink);
  text-align: center;
}

/* ---------- callouts ---------- */
.tip {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 20px 22px;
  border-radius: var(--radius);
}
.tip h3 { margin-top: 0; color: var(--accent-ink); }
.tip p { margin: 0; color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- code ---------- */
pre {
  background: var(--ink);
  color: #f5f5f0;
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin: 0 0 12px;
}
pre code { background: transparent; padding: 0; color: inherit; }
code {
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(0, 168, 150, 0.10);
  color: var(--accent-ink);
  padding: 1px 6px;
  border-radius: 3px;
}

/* ---------- app-page metadata strip ---------- */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}
.meta strong { color: var(--ink); font-weight: 600; }

/* ---------- footer ---------- */
footer {
  padding: 48px 0 64px;
  color: var(--muted);
  font-size: 14px;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
footer p { margin: 0; }

/* ---------- clickable shots ---------- */
.shots figure img { cursor: zoom-in; transition: transform .15s ease; }
.shots figure img:hover { transform: translateY(-1px); }

/* ---------- lightbox ---------- */
.lb-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 12, 16, 0.88);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 100;
  cursor: zoom-out;
  animation: lb-fade .15s ease-out;
}
.lb-backdrop img {
  max-width: min(1400px, 100%);
  max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #0a0a1a;
}
.lb-backdrop.device img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  max-width: min(720px, 95%);
}
.lb-close {
  position: absolute; top: 16px; right: 20px;
  color: #fff;
  font-size: 28px; line-height: 1;
  text-decoration: none;
  opacity: 0.7;
}
.lb-close:hover { opacity: 1; }
@keyframes lb-fade { from { opacity: 0 } to { opacity: 1 } }

/* ---------- preview notice ---------- */
.preview-note {
  margin: 24px 0 0;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 14px;
  color: var(--muted);
  max-width: 640px;
}
.preview-note strong { color: var(--ink); }

/* ---------- essence infographic ---------- */
.essence-svg {
  margin: 28px 0 8px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow-x: auto;
}
.essence-svg svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 720px;
  max-width: 960px;
  margin: 0 auto;
}
