:root {
  --bg: #f4f0e6;
  --surface: #fffdf8;
  --surface-2: #ebe5d6;
  --plate: #ffffff;
  --text: #1f2328;
  --muted: #5b6168;
  --border: #d9d1bf;
  --accent: #c2410c;
  --accent-soft: #fde7d9;
  --green: #15803d;
  --screen: #0b1020;
  --shadow: 0 1px 2px rgba(31, 35, 40, .06), 0 8px 24px rgba(31, 35, 40, .06);
  --radius: 14px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151b;
    --surface: #1a1f27;
    --surface-2: #232a34;
    --plate: #f3f1ec;
    --text: #e8e6e1;
    --muted: #a3a9b2;
    --border: #2e3642;
    --accent: #fb923c;
    --accent-soft: #3a2416;
    --green: #4ade80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #12151b;
  --surface: #1a1f27;
  --surface-2: #232a34;
  --plate: #f3f1ec;
  --text: #e8e6e1;
  --muted: #a3a9b2;
  --border: #2e3642;
  --accent: #fb923c;
  --accent-soft: #3a2416;
  --green: #4ade80;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

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

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

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

code, .mono { font-family: var(--mono); font-size: .92em; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-family: var(--mono); font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 18px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.lang {
  font-family: var(--mono); font-size: 13px; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.lang:hover { border-color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding-top: 56px; padding-bottom: 32px; }
.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; margin: 0 0 18px; letter-spacing: -.02em; max-width: 18ch; }
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 62ch; margin: 0 0 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px;
  font-weight: 600; text-decoration: none; border: 1px solid var(--border); color: var(--text); background: var(--surface);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #1a1206; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #1a1206; } }
.btn:hover { text-decoration: none; filter: brightness(1.05); }

.hero-figure {
  margin: 40px 0 0; background: var(--plate); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow); padding: 20px; overflow: hidden;
}
.hero-figure img { max-width: 960px; width: 100%; height: auto; margin: 0 auto; }
.hero-figure figcaption { color: #5b6168; font-size: 14px; text-align: center; margin-top: 8px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 45%), 1fr)); gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; }
.stats li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stats b { display: block; font-family: var(--mono); font-size: 26px; line-height: 1.2; }
.stats span { color: var(--muted); font-size: 14px; }

/* ---------- sections ---------- */
section { padding: 56px 0; border-top: 1px solid var(--border); }
h2 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.2; margin: 0 0 10px; letter-spacing: -.01em; }
h3 { font-size: 20px; margin: 0 0 6px; line-height: 1.3; }
.section-lead { color: var(--muted); max-width: 70ch; margin: 0 0 30px; }

.grid { display: grid; gap: 18px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.card .media { background: var(--plate); aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; padding: 10px; overflow: hidden; }
.card .media img { max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.card .media.screen { background: var(--screen); padding: 0; }
.card .media.screen img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.card .media.photo { padding: 0; }
.card .media.photo img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card p { margin: 0; color: var(--muted); }
.card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.card .more { margin-top: auto; padding-top: 8px; font-weight: 600; text-decoration: none; }
.card .more:hover { text-decoration: underline; }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); align-self: flex-start;
}

/* module strip */
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(160px, 45%), 1fr)); gap: 12px; }
.module { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); }
.module img { background: var(--plate); aspect-ratio: 3 / 2; width: 100%; object-fit: contain; padding: 6px; }
.module div { padding: 8px 12px 10px; font-size: 14px; }
.module b { display: block; font-size: 15px; }
.module span { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.module:hover { border-color: var(--accent); }

/* table */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 560px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.addr { font-family: var(--mono); white-space: nowrap; }

/* screenshot strip */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 12px; margin: 0 0 18px; }
.shots figure { margin: 0; background: var(--screen); border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.shots img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; image-rendering: pixelated; }
.shots figcaption { font-size: 13px; color: #c9ced6; padding: 6px 10px; font-family: var(--mono); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 22px 34px; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.timeline time { font-family: var(--mono); font-size: 13px; color: var(--accent); display: block; }
.timeline b { display: block; }
.timeline p { margin: 2px 0 0; color: var(--muted); }

.note {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 14px 18px; color: var(--muted); font-size: 15px; margin-top: 22px;
}

footer { border-top: 1px solid var(--border); padding: 32px 0 48px; color: var(--muted); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .lang { margin-left: auto; }
  .hero { padding-top: 36px; }
  section { padding: 40px 0; }
  .hero-figure { padding: 10px; }
}

.shots.apps { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
