/* V2X2MAP project page — minimalist dark/light theme tuned for legibility on
   both desktop and phone. No framework. */

:root {
  --bg:     #0e1116;
  --panel:  #161b22;
  --panel2: #1b2129;
  --line:   #30363d;
  --text:   #e6edf3;
  --dim:    #8b949e;
  --accent: #58a6ff;
  --accent2:#3fb950;
  --warn:   #f0883e;
  --max:    920px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:     #fafbfc;
    --panel:  #ffffff;
    --panel2: #f6f8fa;
    --line:   #d0d7de;
    --text:   #1f2328;
    --dim:    #59636e;
    --accent: #0969da;
    --accent2:#1f883d;
    --warn:   #bc4c00;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 0.92em ui-monospace, "SF Mono", Menlo, Consolas, monospace;
       background: var(--panel2); padding: 1px 5px; border-radius: 4px; }

section, header, footer { padding: 56px 24px; }
section, footer { max-width: var(--max); margin: 0 auto; }

h1 { font-size: 2.6rem; margin: 0 0 16px; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; margin: 0 0 16px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
.lede { font-size: 1.15rem; color: var(--text); }

/* -- nav ------------------------------------------------------------------- */
.hero { background: linear-gradient(180deg, var(--panel) 0, var(--bg) 100%);
        border-bottom: 1px solid var(--line); padding-bottom: 80px; }
.hero nav {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; gap: 22px;
  padding: 18px 0; flex-wrap: wrap;
}
.hero nav a { color: var(--dim); font-size: 14px; }
.hero nav a:hover { color: var(--text); text-decoration: none; }
.hero nav .brand { font-weight: 700; color: var(--text); margin-right: auto;
                   font-size: 18px; letter-spacing: -0.02em; }
.hero nav .ghost { border: 1px solid var(--line); padding: 6px 12px; border-radius: 8px; }

.hero-inner { max-width: var(--max); margin: 0 auto; padding-top: 30px; }

.cta { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }
.cta a {
  display: inline-block; padding: 11px 20px; border-radius: 8px;
  font-weight: 600; font-size: 14px;
}
.cta .primary { background: var(--accent); color: #fff; }
.cta .secondary { border: 1px solid var(--line); color: var(--text); }
.cta a:hover { text-decoration: none; opacity: 0.92; }

/* -- ad bar ---------------------------------------------------------------- */
.amzbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 24px;
  padding: 14px 16px;
}
.amzbar-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.amzbar-thumb {
  flex: 0 0 auto;
  width: 96px; height: 96px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.amzbar-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.amzbar-text { flex: 1 1 240px; min-width: 220px; }
.amzbar-title { font-weight: 700; }
.amzbar-sub { color: var(--dim); font-size: 13px; }
.amzbar-cta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.amzbar-cta a {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  padding: 9px 14px; border-radius: 7px; font-weight: 600; font-size: 14px;
}
.amzbar-cta a.alt {
  background: transparent; color: var(--accent);
  border: 1px solid var(--line); padding: 7px 10px; font-size: 12px;
}
.amzbar-cta a:hover { text-decoration: none; opacity: 0.9; }
.amzbar-cta .flag { font-size: 16px; line-height: 1; }
.amzbar-arrow { opacity: 0.7; font-size: 12px; }
.amzbar .disclosure { color: var(--dim); margin: 10px 0 0; }
.amzbar .disclosure code { font-size: 11px; }

/* AliExpress alternative — same layout, sub-emphasised CTA + brand colour */
.amzbar-alt { margin-top: 12px; background: var(--panel2); }
.amzbar-alt .amzbar-cta a {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.amzbar-alt .amzbar-cta a:hover { border-color: #e62e04; color: #e62e04; }

/* -- install steps --------------------------------------------------------- */
.install-way { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.badge-recommended {
  display: inline-block; background: var(--accent2); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}
.setup-steps {
  list-style: none; padding: 0; margin: 20px 0 0;
  display: flex; flex-direction: column; gap: 28px;
}
.setup-step { display: flex; flex-direction: column; gap: 8px; }
.step-head { display: flex; align-items: center; gap: 12px; }
.step-num {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.setup-step p { margin: 0 0 8px; color: var(--dim); font-size: 14px; }
.step-img-link { display: block; }
.step-img {
  max-width: 640px; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  transition: box-shadow 0.15s;
}
.step-img:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.install-manual {
  margin-top: 28px; padding: 14px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.install-manual summary {
  cursor: pointer; font-weight: 600; color: var(--dim); font-size: 14px;
}
.install-manual summary:hover { color: var(--text); }
.install-manual ol { margin: 14px 0 0; }
.install-manual p { margin: 10px 0 0; color: var(--dim); font-size: 14px; }

/* -- feature grid ---------------------------------------------------------- */
.feature-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.feature-grid li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
}
.feature-grid h3 { color: var(--accent); }
.feature-grid p { margin: 0; color: var(--dim); font-size: 14px; }

/* -- ascii diagram --------------------------------------------------------- */
.ascii {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px;
  overflow-x: auto;
  font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace;
  color: var(--dim);
}

/* -- lists & code ---------------------------------------------------------- */
ol, ul { padding-left: 22px; }
ol li, ul li { margin: 8px 0; }

footer {
  border-top: 1px solid var(--line);
  color: var(--dim); font-size: 13px;
  text-align: center; padding: 28px 24px;
}

/* -- screenshot gallery ---------------------------------------------------- */
.screenshot-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 24px;
}
.screenshot-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.screenshot-card img {
  width: 240px;
  height: auto;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
.screenshot-card figcaption {
  font-size: 13px;
  color: var(--dim);
  text-align: center;
}

/* -- clickable product boxes ----------------------------------------------- */
.amzbar-clickable {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.amzbar-clickable:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.amzbar-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* -- footer links ---------------------------------------------------------- */
.footer-links {
  margin-bottom: 12px;
}
.footer-links a {
  font-weight: 600;
  font-size: 14px;
}
/* ── SVG diagram ─────────────────────────────────────────────────────────────────── */
#architecture svg text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
