/* Colours follow the app icon: a teal tile, a navy camera body and an
   amber lens. */
:root {
  --brand: #1a9c87;
  --brand-strong: #127564;
  --brand-soft: #e2f4f0;
  --navy: #0c1822;
  --navy-2: #13263a;
  --amber: #f2b33d;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f4;
  --text: #102030;
  --muted: #566573;
  --border: #dbe3e7;
  --ok: #18804a;
  --ok-soft: #e5f4ea;
  --warn: #9a6200;
  --warn-soft: #fff4dc;
  --bad: #c62828;
  --bad-soft: #fdecec;
  --shadow: 0 1px 2px rgba(12, 24, 34, 0.04), 0 4px 16px rgba(12, 24, 34, 0.06);
  --shadow-lg: 0 2px 6px rgba(12, 24, 34, 0.08), 0 24px 48px -12px rgba(12, 24, 34, 0.35);
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #3cc7ae;
    --brand-strong: #6fdcc8;
    --brand-soft: #123631;
    --bg: #0a131b;
    --surface: #111e2a;
    --surface-2: #172736;
    --text: #e6edf2;
    --muted: #97a6b3;
    --border: #233546;
    --ok: #5fcf8b;
    --ok-soft: #10301f;
    --warn: #f2bd55;
    --warn-soft: #33270f;
    --bad: #ff7b72;
    --bad-soft: #3a1717;
    --shadow: none;
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-strong); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.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 { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* Top bar */
.topbar { background: var(--navy); color: #fff; position: relative; z-index: 2; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-mark { width: 36px; height: 36px; flex: none; border-radius: 9px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; letter-spacing: -0.01em; }
.brand-text span { font-size: 12px; color: rgba(255, 255, 255, 0.62); }
.topbar-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: #d8f6ef;
  background: rgba(60, 199, 174, 0.14); border: 1px solid rgba(60, 199, 174, 0.35);
  padding: 5px 12px 5px 9px; border-radius: 999px; white-space: nowrap;
}
.topbar-tag svg { width: 16px; height: 16px; fill: #3cc7ae; }

main { flex: 1; }

/* Home hero */
.hero-band {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 420px at 85% 10%, rgba(47, 183, 160, 0.35), transparent 60%),
    radial-gradient(600px 360px at 0% 100%, rgba(242, 179, 61, 0.12), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
}
.hero-band::before {
  /* faint map grid */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 40%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent);
}
.hero-grid { position: relative; display: grid; gap: 40px; padding-top: 44px; padding-bottom: 56px; }
.hero { max-width: 600px; }
.hero-eyebrow {
  display: inline-block; margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--amber);
}
.hero h1 { font-size: clamp(32px, 7vw, 52px); line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 16px; }
.lead { font-size: 18px; color: rgba(255, 255, 255, 0.78); margin: 0 0 28px; }

.code-form {
  display: flex; gap: 8px; padding: 8px; border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.code-form input {
  flex: 1; min-width: 0; font: 600 21px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 14px 12px; border-radius: 12px; border: 0; background: transparent; color: var(--text);
}
.code-form input::placeholder { color: var(--muted); opacity: 0.55; }
.code-form input:focus { outline: none; }
.code-form:focus-within { box-shadow: var(--shadow-lg), 0 0 0 3px rgba(60, 199, 174, 0.55); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 16px/1 var(--font); border-radius: 12px; border: 1.5px solid transparent;
  padding: 0 22px; min-height: 52px; cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn-primary { background: linear-gradient(180deg, #22b39a, #15876f); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset; }
.btn-primary:hover { background: linear-gradient(180deg, #1fa58e, #127564); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); min-height: 40px; font-size: 14px; padding: 0 14px; }
.btn-secondary:hover { border-color: var(--brand); }
.hint { font-size: 14px; color: rgba(255, 255, 255, 0.62); margin: 14px 0 0; }
.hint .mono { color: #fff; }
.form-error {
  color: #fff; background: rgba(229, 57, 44, 0.22); border: 1px solid rgba(255, 123, 114, 0.5);
  font-size: 14px; margin: 12px 0 0; font-weight: 500; padding: 8px 12px; border-radius: 10px;
}

.trust { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.trust li { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, 0.86); }
.trust svg { width: 18px; height: 18px; fill: #3cc7ae; flex: none; }

/* Sample photo showing where the code is */
.sample { margin: 0; justify-self: center; width: 100%; max-width: 420px; }
.sample-photo {
  position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 3.3;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, 0.12); transform: rotate(1.5deg);
}
.sample-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sample-stamp {
  position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 10px; align-items: stretch;
  padding: 8px; border-radius: 10px; background: rgba(8, 14, 20, 0.72); color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.sample-map { flex: none; width: 66px; border-radius: 6px; overflow: hidden; }
.sample-map svg { width: 100%; height: 100%; display: block; }
.sample-lines { display: flex; flex-direction: column; min-width: 0; font-size: 11px; line-height: 1.45; }
.sample-lines strong { font-size: 12.5px; }
.sample-lines span { color: rgba(255, 255, 255, 0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sample-code {
  align-self: flex-start; margin-top: 2px; padding: 1px 6px; border-radius: 5px; color: #fff !important;
  font-weight: 700; box-shadow: 0 0 0 2px var(--amber); background: rgba(242, 179, 61, 0.22);
  animation: glow 2.4s ease-in-out infinite;
}
@keyframes glow { 50% { box-shadow: 0 0 0 2px var(--amber), 0 0 18px 2px rgba(242, 179, 61, 0.55); } }
.sample figcaption {
  display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 18px;
  font-size: 14px; color: rgba(255, 255, 255, 0.72);
}
.pointer { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(242, 179, 61, 0.25); }

/* How it works */
.section-title { font-size: 24px; letter-spacing: -0.015em; margin: 56px 0 20px; }
.how { list-style: none; padding: 0; margin: 0 0 64px; display: grid; gap: 16px; }
.how li {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.how-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px;
  background: linear-gradient(145deg, #74e8d3, #1a9c87 60%, #127564);
  box-shadow: 0 6px 14px -6px rgba(18, 117, 100, 0.7);
}
.how-icon svg { width: 24px; height: 24px; fill: #fff; }
.how-step { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-strong); margin-bottom: 4px; }
.how h3 { font-size: 18px; margin: 0 0 6px; letter-spacing: -0.01em; }
.how p { margin: 0; color: var(--muted); font-size: 15px; }

/* Result */
#result { padding-top: 28px; padding-bottom: 48px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500;
  text-decoration: none; margin-bottom: 16px;
}
.back svg { width: 18px; height: 18px; fill: currentColor; }
.back:hover { text-decoration: underline; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-strong); }
.code-title { font-size: clamp(28px, 7vw, 40px); margin: 2px 0 18px; letter-spacing: 0.04em; overflow-wrap: anywhere; }

.verdict {
  display: flex; gap: 14px; align-items: flex-start; border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px; border: 1px solid transparent; box-shadow: var(--shadow);
}
.verdict:empty { display: none; }
.verdict h2 { margin: 0 0 2px; font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; }
.verdict p { margin: 0; }
.verdict .btn { margin-top: 10px; }
.verdict-icon { flex: none; width: 34px; height: 34px; }
.verdict.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); border-left: 5px solid var(--ok); }
.verdict.ok .verdict-icon { fill: var(--ok); }
.verdict.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); border-left: 5px solid var(--bad); }
.verdict.bad .verdict-icon { fill: var(--bad); }
.verdict.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); border-left: 5px solid var(--warn); }
.verdict.warn .verdict-icon { fill: var(--warn); }
.verdict.info { background: var(--surface); border-color: var(--border); }
.verdict.info .verdict-icon { fill: var(--muted); }

.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0;
}
.grid .card { margin-bottom: 0; }
.card h2 { font-size: 17px; margin: 0 0 14px; letter-spacing: -0.01em; }
.card > p { margin: 0 0 12px; }

.facts { margin: 0; display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: 12px 16px; }
.facts dt { color: var(--muted); font-size: 14px; padding-top: 1px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.facts dd .sub { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.facts.small dd { font-size: 13px; font-family: var(--mono); font-weight: 400; }
.facts.small dt { font-size: 13px; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks .icon { flex: none; width: 24px; height: 24px; margin-top: 1px; }
.checks .ok .icon { fill: var(--ok); }
.checks .bad .icon { fill: var(--bad); }
.checks .warn .icon { fill: var(--warn); }
.checks .info .icon, .checks .wait .icon { fill: var(--muted); }
.checks .title { font-weight: 600; display: block; }
.checks .detail { font-size: 14px; color: var(--muted); display: block; overflow-wrap: anywhere; }
.checks .btn { margin-top: 8px; }
.spin { animation: spin 1s linear infinite; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin, .sample-code { animation: none; } }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed var(--border); border-radius: 14px; padding: 28px 16px; text-align: center;
  cursor: pointer; color: var(--muted); background: var(--surface-2); transition: border-color 0.15s, background 0.15s;
}
.drop svg { width: 30px; height: 30px; fill: var(--brand); }
.drop strong { color: var(--brand-strong); }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }

.file-result { margin-top: 14px; border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.file-result .verdict-icon { width: 26px; height: 26px; flex: none; }
.file-result p { margin: 2px 0 0; font-size: 14px; }
.file-result.ok { background: var(--ok-soft); }
.file-result.ok .verdict-icon { fill: var(--ok); }
.file-result.bad { background: var(--warn-soft); }
.file-result.bad .verdict-icon { fill: var(--warn); }
.file-result.info { background: var(--surface-2); }
.file-result.info .verdict-icon { fill: var(--muted); }
.file-result .name { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.limits ul { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.limits li { color: var(--muted); font-size: 15px; }
.limits li strong { color: var(--text); }

.tech summary { cursor: pointer; font-weight: 600; font-size: 16px; }
.tech[open] summary { margin-bottom: 14px; }
.downloads { margin: 14px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.downloads a { font-size: 14px; }

.skeleton { background: var(--surface-2); border-radius: 8px; height: 14px; margin: 8px 0; }

/* Footer */
.footer { background: var(--navy); color: rgba(255, 255, 255, 0.7); padding: 32px 0 36px; font-size: 14px; }
.footer a { color: #8fe3d3; }
.footer-inner { display: grid; gap: 18px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { border-radius: 8px; flex: none; }
.footer-brand div { display: flex; flex-direction: column; line-height: 1.25; }
.footer-brand strong { color: #fff; font-size: 15px; }
.footer-brand span { font-size: 13px; }
.footer-text p { margin: 0 0 6px; }
.noscript { padding: 16px; }

@media (max-width: 479px) {
  .topbar-tag { font-size: 0; gap: 0; padding: 6px; }
  .topbar-tag svg { width: 18px; height: 18px; }
  .code-form { flex-direction: column; }
  .code-form input { text-align: center; }
  .btn-primary { width: 100%; }
}

@media (min-width: 720px) {
  .how { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: 1.15fr 1fr; align-items: start; }
  .card { padding: 24px; }
  .facts { grid-template-columns: 140px 1fr; }
  .footer-inner { grid-template-columns: auto 1fr; gap: 40px; align-items: start; }
}

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; align-items: center; padding-top: 72px; padding-bottom: 88px; }
  .sample { justify-self: end; }
  #result { padding-top: 40px; }
}
