/**
 * site.css
 * metermax.app: shared theme, header, footer, buttons and page layout used by every page.
 * Page-specific styles live in home.css (home page) and guide.css (help guides, FAQ, legal pages).
 * Light and dark follow the visitor's device.
 */

/* ============================================
   THEME
   ============================================ */

:root {
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-2: #e9f0ee;
  --ink: #14201c;
  --ink-soft: #4b5b55;
  --rule: #d5dfdb;
  --accent: #0f766e;
  --accent-ink: #0b5e57;
  --accent-strong: #0f3d36;
  --accent-bg: #dff1ee;
  --sun: #f7d33d;
  --sun-bg: #fff6d6;
  --sun-ink: #6b5200;
  --warn-bg: #fde8e8;
  --warn-ink: #9b1c1c;
  --on-dark: #ffffff;
  --on-dark-soft: #cfe7e1;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 61, 54, 0.06), 0 8px 24px rgba(15, 61, 54, 0.08);
  --wrap: 72rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1512;
    --surface: #12211d;
    --surface-2: #182b26;
    --ink: #e6efec;
    --ink-soft: #a7b8b2;
    --rule: #263833;
    --accent: #2bb3a3;
    --accent-ink: #5fd0c2;
    --accent-bg: #173630;
    --sun-bg: #332a0a;
    --sun-ink: #f7d33d;
    --warn-bg: #3a1717;
    --warn-ink: #f4a4a4;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

/* ============================================
   BASE
   ============================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.65 Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 40rem) { .wrap { padding: 0 24px; } }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--sun); color: #14201c; padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip-link:focus { left: 8px; }

/* ============================================
   HEADER
   ============================================ */

.site-header { background: var(--accent-strong); color: var(--on-dark); position: sticky; top: 0; z-index: 50; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--on-dark); text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }

.menu-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--on-dark); border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.site-nav { display: none; }
.site-nav.open {
  display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 68px;
  background: var(--accent-strong); padding: 8px 16px 20px; border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.site-nav a { color: var(--on-dark-soft); text-decoration: none; font-weight: 500; padding: 12px 4px; font-size: 1.05rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--on-dark); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--sun); }

@media (min-width: 56rem) {
  .menu-toggle { display: none; }
  .site-nav, .site-nav.open { display: flex; flex-direction: row; position: static; padding: 0; border: 0; gap: 22px; align-items: center; }
  .site-nav a { padding: 6px 0; font-size: 1rem; }
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 24px; border-radius: 999px;
  font-weight: 700; font-size: 1.05rem; text-decoration: none; border: 2px solid transparent; cursor: pointer;
}
.btn-sun { background: var(--sun); color: #14201c; }
.btn-sun:hover { background: #ffe066; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.45); color: var(--on-dark); }
.btn-ghost:hover { border-color: #fff; }
.btn-outline { border-color: var(--accent); color: var(--accent-ink); background: transparent; }

/* ============================================
   SHARED BLOCKS
   ============================================ */

.section { padding: 56px 0; }
.section-head { max-width: 44rem; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 10px; }
.section-head p { margin: 0; color: var(--ink-soft); font-size: 1.1rem; }
.eyebrow { display: inline-block; margin: 0 0 10px; color: var(--accent-ink); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.06em; text-transform: uppercase; }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }

/* A phone-shaped frame around app screenshots */
.phone {
  background: #0d1a17; border-radius: 34px; padding: 10px; box-shadow: 0 20px 50px rgba(15, 61, 54, 0.28);
  width: 100%; max-width: 280px; margin: 0 auto;
}
.phone img { border-radius: 26px; width: 100%; }

.note { border-radius: var(--radius-sm); padding: 14px 18px; margin: 18px 0; background: var(--accent-bg); }
.note strong:first-child { display: block; margin-bottom: 2px; }
.note-sun { background: var(--sun-bg); }
.note-sun strong:first-child { color: var(--sun-ink); }
.note-warn { background: var(--warn-bg); }
.note-warn strong:first-child { color: var(--warn-ink); }

/* ============================================
   FOOTER
   ============================================ */

.site-footer { background: var(--accent-strong); color: var(--on-dark-soft); margin-top: 64px; padding: 40px 0 32px; font-size: 0.95rem; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.site-footer h2 { color: var(--on-dark); font-size: 1rem; margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: var(--on-dark-soft); }
.site-footer a:hover { color: #fff; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 28px; padding-top: 18px; font-size: 0.88rem; }
.footer-legal p { margin: 4px 0; }

.notfound { padding: 64px 16px; text-align: center; }
.notfound h1 { font-size: 2.2rem; margin: 0 0 12px; }
