/* ==========================================================================
   Online GPS Camera — shared stylesheet
   Light theme only. No dark-mode rules anywhere in this file by design.
   ========================================================================== */

:root {
  /* Topographic / instrument palette — grounded in the outdoor/GPS subject,
     not a generic SaaS blue-and-card kit. */
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f2f4f1;
  --border: #dde3de;
  --ink: #17231f;
  --ink-muted: #51625b;
  --ink-faint: #7c8a83;

  --primary: #0e6e5c;
  --primary-dark: #0a5548;
  --primary-tint: #e6f2ef;

  --accent: #c1440e;
  --accent-dark: #9c360b;
  --accent-tint: #fbeae2;

  --success: #1e7a44;
  --success-tint: #e8f5ec;
  --warning: #a8660a;
  --warning-tint: #fbf1de;
  --danger: #b23b3b;
  --danger-tint: #fbeaea;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(23, 35, 31, 0.06), 0 4px 14px rgba(23, 35, 31, 0.06);

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.wrap { width: 92%; max-width: var(--max-width); margin: 0 auto; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex: 0 0 auto;
}
.main-nav { display: flex; gap: 4px; align-items: center; }
.main-nav a {
  color: var(--ink-muted);
  font-size: 14.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.main-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  width: 40px; height: 40px; font-size: 18px; color: var(--ink); cursor: pointer;
}
@media (max-width: 760px) {
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 60px; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 8px; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px; }
  .nav-toggle { display: block; }
}

/* ---------- Intro strip (no big marketing hero — tool comes first) ---------- */
.intro {
  padding: 28px 0 18px;
}
.intro h1 {
  font-size: clamp(24px, 4.4vw, 34px);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.hero-banner {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: var(--radius-sm, 10px);
  margin: 4px 0 16px;
}
.intro p {
  color: var(--ink-muted);
  max-width: 62ch;
  margin: 0;
  font-size: 15.5px;
}

/* ---------- Tool section ---------- */
.tool-section { padding: 8px 0 32px; }
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 860px) {
  .tool-grid { grid-template-columns: 1fr; }
}

.camera-card, .gps-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.camera-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #10201b;
  overflow: hidden;
}
@media (min-width: 620px) { .camera-stage { aspect-ratio: 4 / 3; } }

#cameraVideo, #resultCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
#resultCanvas { object-fit: contain; background: #10201b; display: none; }
.camera-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: #cfe3dc; text-align: center; padding: 24px;
  background: linear-gradient(180deg, #14271f, #0d1a15);
}
.camera-placeholder .big-icon { font-size: 34px; }
.camera-placeholder p { margin: 0; font-size: 13.5px; max-width: 32ch; color: #b9cec5; }

.camera-controls {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 14px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.capture-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent);
  border: 4px solid var(--accent-tint);
  box-shadow: 0 0 0 2px var(--accent);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.capture-btn:hover { background: var(--accent-dark); }
.capture-btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

.post-capture-actions {
  display: none;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.post-capture-actions.visible { display: flex; }

.btn {
  font: inherit;
  font-weight: 700;
  font-size: 14.5px;
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  line-height: 1;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- GPS readout panel ---------- */
.gps-card { padding: 16px; }
.gps-card h2 { font-size: 15px; margin: 0 0 4px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-muted);
  margin-bottom: 12px;
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); }
.status-pill.ok { background: var(--success-tint); color: var(--success); }
.status-pill.ok .dot { background: var(--success); }
.status-pill.warn { background: var(--warning-tint); color: var(--warning); }
.status-pill.warn .dot { background: var(--warning); }
.status-pill.error { background: var(--danger-tint); color: var(--danger); }
.status-pill.error .dot { background: var(--danger); }

.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.readout-full { margin-bottom: 12px; }
.readout {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}
.readout .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-faint); }
.readout .value { font-family: var(--font-mono); font-size: 14px; color: var(--ink); word-break: break-all; margin-top: 2px; }

.field-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--border); }
.field-row:first-of-type { border-top: none; }
.field-row span { font-size: 13.5px; color: var(--ink); }
.switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background .15s; pointer-events: none; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; pointer-events: none; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track + .thumb { transform: translateX(16px); }

.select-row { margin-top: 12px; }
.select-row label { font-size: 12.5px; font-weight: 700; color: var(--ink-muted); display: block; margin-bottom: 5px; }
.select-row select, .select-row input[type=range] { width: 100%; }
select {
  font: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}

.help-note {
  font-size: 12.5px; color: var(--ink-muted);
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-top: 12px;
}
.help-note strong { color: var(--ink); }

/* ---------- Generic content sections ---------- */
.section { padding: 40px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section h2 {
  font-size: clamp(20px, 3vw, 26px);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.section .lede { color: var(--ink-muted); max-width: 70ch; margin: 0 0 24px; }
.section h3 { font-size: 17px; margin: 22px 0 8px; }
.section p { color: var(--ink); max-width: 74ch; }
.section p.muted { color: var(--ink-muted); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 760px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.feature-card, .info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.feature-card .num { font-family: var(--font-mono); font-size: 12px; color: var(--primary); font-weight: 700; }
.feature-card h3 { margin: 6px 0 4px; font-size: 15.5px; }
.feature-card p { font-size: 13.5px; color: var(--ink-muted); margin: 0; }

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; max-width: 74ch; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 18px 40px;
  border-left: 2px solid var(--border);
  margin-left: 15px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute; left: -15px; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps li strong { display: block; margin-bottom: 2px; }
.steps li span { color: var(--ink-muted); font-size: 14.5px; }

.usecase-list { columns: 2; column-gap: 24px; max-width: 74ch; padding: 0; margin: 0; list-style: none; }
.usecase-list li { break-inside: avoid; padding: 6px 0 6px 22px; position: relative; font-size: 14.5px; }
.usecase-list li::before { content: "\2713"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
@media (max-width: 620px) { .usecase-list { columns: 1; } }

table.compat { width: 100%; border-collapse: collapse; max-width: 74ch; font-size: 14.5px; }
table.compat th, table.compat td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
table.compat th { color: var(--ink-muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 78ch; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-item summary {
  cursor: pointer; list-style: none;
  padding: 15px 4px; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 20px; color: var(--primary); flex: 0 0 auto; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: 0 0 16px; color: var(--ink-muted); font-size: 14.5px; max-width: 72ch; }

/* ---------- Troubleshooting ---------- */
.trouble-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; background: var(--surface); }
.trouble-item h3 { margin: 0 0 6px; font-size: 15px; }
.trouble-item p { margin: 0; font-size: 14px; color: var(--ink-muted); }

/* ---------- Notice / alert boxes ---------- */
.notice { border-radius: var(--radius); padding: 13px 15px; font-size: 14px; margin: 14px 0; max-width: 74ch; }
.notice-info { background: var(--primary-tint); color: var(--primary-dark); }
.notice-warn { background: var(--warning-tint); color: var(--warning); }
.notice-error { background: var(--danger-tint); color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ---------- Ad placeholder slots ---------- */
.ad-slot {
  max-width: var(--max-width); margin: 24px auto; width: 92%;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-faint);
  font-size: 12px;
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}

/* ---------- Legal pages / simple article layout ---------- */
.article { padding: 36px 0 56px; }
.article .wrap { max-width: 800px; }
.article h1 { font-size: 28px; margin: 0 0 6px; }
.article .updated { color: var(--ink-faint); font-size: 13px; margin-bottom: 28px; }
.article h2 { font-size: 19px; margin: 26px 0 8px; }
.article p, .article li { color: var(--ink); font-size: 15px; }
.article ul { padding-left: 22px; }

/* ---------- Contact form ---------- */
.contact-form { max-width: 520px; }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 5px; }
.form-field input, .form-field textarea {
  width: 100%; font: inherit; font-size: 14.5px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
.form-field textarea { min-height: 120px; resize: vertical; }

/* ---------- 404 ---------- */
.notfound { padding: 80px 0; text-align: center; }
.notfound .code { font-family: var(--font-mono); font-size: 14px; color: var(--primary); font-weight: 700; letter-spacing: .05em; }
.notfound h1 { font-size: 26px; margin: 8px 0 10px; }
.notfound p { color: var(--ink-muted); max-width: 50ch; margin: 0 auto 22px; }
.notfound .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- More tools ---------- */
.tool-link-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink);
}
.tool-link-card:hover { border-color: var(--primary); text-decoration: none; }
.tool-link-card .eyebrow { font-size: 12px; color: var(--primary); font-weight: 700; }
.tool-link-card h3 { margin: 4px 0; font-size: 15px; color: var(--ink); }
.tool-link-card p { margin: 0; font-size: 13px; color: var(--ink-muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 34px 0 22px; margin-top: 20px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.footer-brand p { color: var(--ink-muted); font-size: 13.5px; max-width: 42ch; margin: 8px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: var(--ink-muted); font-size: 14px; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 16px; color: var(--ink-faint); font-size: 12.5px; }

/* ---------- Cookie consent ---------- */
.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(23,35,31,.08);
  padding: 14px 16px; display: none;
  align-items: center; gap: 14px; flex-wrap: wrap;
}
.cookie-bar.visible { display: flex; }
.cookie-bar p { margin: 0; font-size: 13px; color: var(--ink-muted); flex: 1; min-width: 220px; }
