:root {
  color-scheme: dark light;
  --bg: #07080A;
  --panel: #101216;
  --line: #21252C;
  --ink: #E9EAEC;
  --muted: #858C97;
  --dim: #555B65;
  --accent: #FFAA00;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --lattice: rgba(233,234,236,.055);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F4F2; --panel: #FFFFFF; --line: #DEDED9;
    --ink: #14161A; --muted: #5C626B; --dim: #9AA0A8; --accent: #9A5B00;
    --lattice: rgba(20,22,26,.07);
  }
}
:root[data-theme="dark"] {
  --bg: #07080A; --panel: #101216; --line: #21252C;
  --ink: #E9EAEC; --muted: #858C97; --dim: #555B65; --accent: #FFAA00;
  --lattice: rgba(233,234,236,.055);
}
:root[data-theme="light"] {
  --bg: #F4F4F2; --panel: #FFFFFF; --line: #DEDED9;
  --ink: #14161A; --muted: #5C626B; --dim: #9AA0A8; --accent: #9A5B00;
  --lattice: rgba(20,22,26,.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  /* The page stands on the same lattice the face is drawn on: a 2px dot on a
     9px pitch, the geometry of a 260px fenix scaled up. */
  background-image: radial-gradient(var(--lattice) 1px, transparent 1.15px);
  background-size: 9px 9px;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 1.5rem; }

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

/* ---- masthead ---- */
header.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: var(--mono); font-weight: 600; font-size: .95rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  text-decoration: none;
}
.wordmark span { color: var(--accent); }
nav.top a {
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  text-decoration: none; margin-left: 1.3rem; letter-spacing: .04em;
}
nav.top a:hover { color: var(--ink); }

/* ---- hero ---- */
.hero {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 3.5rem;
  align-items: center; padding: 5rem 0 4.5rem;
}
.eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 1.1rem;
}
h1 {
  margin: 0 0 1.1rem; font-size: clamp(2.1rem, 5.2vw, 3.3rem);
  line-height: 1.08; letter-spacing: -.025em; font-weight: 640;
  text-wrap: balance;
}
.lede { margin: 0 0 1.9rem; font-size: 1.08rem; color: var(--muted); max-width: 46ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.btn {
  display: inline-block; font-family: var(--mono); font-size: .84rem;
  letter-spacing: .04em; text-decoration: none; padding: .8rem 1.4rem;
  border-radius: 3px; border: 1px solid transparent;
  /* <button> defaults to an arrow, unlike <a>. The checkout button is a
     <button> and the rest are links, so without this the two read as
     different kinds of control. */
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #10120E; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--muted); }
.price-note { font-family: var(--mono); font-size: .78rem; color: var(--dim); }

.hero-face { display: flex; justify-content: center; }
/* The hero is the SDK's product render with the face composited into
   its screen, shown at roughly half its 713px width. `pixelated`
   would nearest-neighbour that downscale, jagging the case and
   dropping scan rows; the flat theme tiles below still want it. */
.hero-face img { width: 100%; max-width: 380px; height: auto; }

/* The home page sells two faces, so its hero column carries both. They
   overlap by a strap's width and sit on opposite sides of the centre line,
   which reads as a pair rather than as two pasted cut-outs. No rotation:
   these are dot matrices, and any angle resamples them to mush. */
.hero-pair { display: flex; align-items: center; justify-content: center; }
.hero-pair a { display: block; line-height: 0; }
.hero-pair img { width: 100%; height: auto; }
.hero-pair a:first-child { width: 57%; transform: translateY(-5%); }
.hero-pair a:last-child  { width: 57%; margin-left: -15%; transform: translateY(5%); }

/* ---- sections ---- */
section { padding: 4rem 0; border-top: 1px solid var(--line); }
h2 {
  margin: 0 0 .5rem; font-size: 1.5rem; letter-spacing: -.015em;
  font-weight: 620; text-wrap: balance;
}
.sub { margin: 0 0 2.2rem; color: var(--muted); max-width: 60ch; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.6rem; }
.feature h3 {
  margin: 0 0 .4rem; font-size: .95rem; font-weight: 620;
  font-family: var(--mono); letter-spacing: .01em;
}
.feature p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---- theme gallery ---- */
.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.2rem; }
.theme { display: flex; flex-direction: column; gap: .55rem; align-items: center; }
.theme img { width: 100%; height: auto; image-rendering: pixelated; }
.theme span {
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  letter-spacing: .08em; text-transform: uppercase;
}

/* ---- free vs unlocked ---- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 1.6rem;
}
.card.paid { border-color: var(--accent); }
.card h3 {
  margin: 0 0 .25rem; font-family: var(--mono); font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.card.paid h3 { color: var(--accent); }
.card .amount { font-size: 1.9rem; font-weight: 640; letter-spacing: -.02em; margin: 0 0 1.1rem; }
.card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.card li { font-size: .92rem; color: var(--muted); padding-left: 1.4rem; position: relative; }
.card li::before {
  content: ""; position: absolute; left: 0; top: .5em;
  width: 6px; height: 6px; background: var(--dim);
}
.card.paid li::before { background: var(--accent); }

/* ---- how ---- */
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 1.4rem; }
ol.steps li { counter-increment: step; padding-left: 3rem; position: relative; }
ol.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  font-family: var(--mono); font-size: .8rem; color: var(--accent);
  border: 1px solid var(--line); border-radius: 3px; padding: .15rem .45rem;
}
ol.steps strong { display: block; font-weight: 620; margin-bottom: .15rem; }
ol.steps span { color: var(--muted); font-size: .92rem; }

/* ---- devices ---- */
.devices {
  font-family: var(--mono); font-size: .84rem; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.devices code {
  border: 1px solid var(--line); border-radius: 3px;
  padding: .25rem .6rem; color: var(--ink); background: var(--panel);
}

/* ---- faq ---- */
details {
  border-bottom: 1px solid var(--line); padding: 1.05rem 0;
}
details summary {
  cursor: pointer; font-weight: 560; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font-family: var(--mono); color: var(--accent); }
details[open] summary::after { content: "\2212"; }
details p { margin: .8rem 0 0; color: var(--muted); font-size: .94rem; max-width: 68ch; }

/* ---- footer ---- */
footer {
  border-top: 1px solid var(--line); padding: 2.5rem 0 4rem;
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between;
  font-family: var(--mono); font-size: .76rem; color: var(--dim);
}
footer a { color: var(--muted); text-decoration: none; margin-right: 1.2rem; }
footer a:hover { color: var(--ink); }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding: 3rem 0; }
  .hero-face { order: -1; }
  .hero-pair { order: -1; }
  .compare { grid-template-columns: 1fr; }
  nav.top a { margin-left: .9rem; }
}

/* --- label and pictogram legend ------------------------------------------ */

.legend-h {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent);
  margin: 2.4rem 0 .6rem;
}

.marks {
  list-style: none; margin: 1.2rem 0 0; padding: 0;
  display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.marks li {
  display: flex; align-items: center; gap: .85rem;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: .85rem 1rem;
}
.marks code {
  font-family: var(--mono); font-size: .8rem; color: var(--accent);
  letter-spacing: .06em;
}
.marks li > span:last-child { color: var(--muted); font-size: .88rem; }

.mark-cell { display: block; flex: 0 0 auto; }
.mark { display: block; height: 34px; width: auto; }
.mark .on  { fill: var(--ink); }
.mark .off { fill: var(--ink); opacity: .12; }

.legend-tables { margin-top: .5rem; }
table.legend {
  width: 100%; border-collapse: collapse; font-size: .9rem;
}
table.legend th {
  text-align: left; font-family: var(--mono); font-weight: 600;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim); padding: .5rem .8rem; border-bottom: 1px solid var(--line);
}
table.legend td {
  padding: .5rem .8rem; border-bottom: 1px solid var(--line);
  color: var(--muted);
}
table.legend td:first-child { width: 7.5rem; }
table.legend code {
  font-family: var(--mono); font-size: .84rem; color: var(--ink);
  letter-spacing: .06em;
}
table.legend tr:last-child td { border-bottom: 0; }

@media (max-width: 560px) {
  table.legend td:first-child { width: 5.5rem; }
  table.legend { font-size: .84rem; }
}

.cap-note {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim);
}
