/* ── Hertz & Health — Main Stylesheet ───────────────────────────────────────
   Palette sourced directly from the Android app's Kotlin color definitions.
   Light mode = default; dark mode applied via [data-theme="dark"].
   System preference respected via JS before first paint.
──────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
  /* Light mode */
  --bg-screen:      #D6E4F0;
  --bg-card:        #EAF2F8;
  --card-border:    #5A8FBF;
  --deep-blue:      #1E3A5F;
  --muted-slate:    #5B7A99;
  --btn-blue:       #5A9BDB;
  --btn-blue-dk:    #2E6CA8;
  --btn-red:        #D32E3E;
  --btn-red-dk:     #8A1822;
  --btn-green:      #4FBF6B;
  --btn-green-dk:   #2F8F45;
  --btn-orange:     #E8932E;
  --btn-orange-dk:  #B46010;
  --circle-blue:    #7AB8E0;
  --circle-blue-dk: #4B8FC4;
  --nav-inactive:   #8FA8C0;
  --status-fine:    #4FBF6B;
  --status-caution: #E8C13E;
  --status-warning: #E8932E;
  --status-critical:#D32E3E;
  --neon-blue:      #00A8FF;

  /* Derived UI tokens */
  --text-primary:   var(--deep-blue);
  --text-secondary: var(--muted-slate);
  --text-on-btn:    #ffffff;
  --nav-bg:         var(--bg-card);
  --nav-border:     var(--card-border);
  --shadow:         0 2px 16px rgba(30, 58, 95, 0.10);
  --shadow-card:    0 4px 24px rgba(30, 58, 95, 0.13);
  --radius:         12px;
  --radius-sm:      8px;
  --radius-pill:    999px;
}

[data-theme="dark"] {
  --bg-screen:      #0E1A2A;
  --bg-card:        #18293E;
  --card-border:    #3A5A7D;
  --deep-blue:      #DCE8F5;
  --muted-slate:    #8DA6C0;
  --btn-blue:       #4A7FB5;
  --btn-blue-dk:    #21527F;
  --btn-red:        #B83644;
  --btn-red-dk:     #7A1620;
  --btn-green:      #3E9E57;
  --btn-green-dk:   #2A7A3B;
  --btn-orange:     #C97F1A;
  --btn-orange-dk:  #8F4C0C;
  --circle-blue:    #3E6E96;
  --circle-blue-dk: #2E5775;
  --nav-inactive:   #5E7790;
  --status-fine:    #45A85E;
  --status-caution: #C9A93C;
  --status-warning: #C97F1A;
  --status-critical:#B83644;
  --neon-blue:      #5DD4FB;

  --text-primary:   var(--deep-blue);
  --text-secondary: var(--muted-slate);
  --nav-bg:         var(--bg-card);
  --shadow:         0 2px 16px rgba(0, 0, 0, 0.35);
  --shadow-card:    0 4px 24px rgba(0, 0, 0, 0.40);
}

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background-color: var(--bg-screen);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: var(--btn-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--neon-blue); }

img { max-width: 100%; display: block; }

/* ── Typography ────────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem);  letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem;    font-weight: 600; }

p  { color: var(--text-secondary); font-size: 1rem; }

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-content {
  padding-top: 5rem; /* clears fixed nav */
  min-height: calc(100vh - 64px);
}

/* ── Navigation ────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav-logo-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--btn-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-screen);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme toggle */
.theme-toggle {
  background: var(--bg-screen);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  width: 48px;
  height: 26px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--btn-blue);
  transition: transform 0.2s ease;
}

[data-theme="dark"] .theme-toggle::after {
  transform: translateX(22px);
  background: var(--neon-blue);
}

.theme-toggle-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  user-select: none;
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.2s;
}

.nav-mobile {
  display: none;
  position: fixed;
  top: 64px;
  left: 0; right: 0;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  padding: 1rem 1.5rem;
  z-index: 99;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-mobile.open { display: flex; }

.nav-mobile a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.nav-mobile a:hover,
.nav-mobile a.active {
  color: var(--text-primary);
  background: var(--bg-screen);
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--btn-blue);
  color: #fff;
}
.btn-primary:hover {
  background: var(--btn-blue-dk);
  color: #fff;
  box-shadow: 0 4px 16px rgba(90, 155, 219, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--btn-blue);
  border: 1.5px solid var(--btn-blue);
}
.btn-outline:hover {
  background: var(--btn-blue);
  color: #fff;
}

.btn-green {
  background: var(--btn-green);
  color: #fff;
}
.btn-green:hover {
  background: var(--btn-green-dk);
  color: #fff;
}

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
}

.badge-latest {
  background: var(--status-fine);
  color: #fff;
}

.badge-version {
  background: var(--bg-screen);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

/* ── Section headers ───────────────────────────────────────────────────────── */
.section-header {
  margin-bottom: 2.5rem;
}

.section-header .eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--btn-blue);
  display: block;
  margin-bottom: 0.5rem;
}

/* ── Divider ───────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 2rem 0;
  opacity: 0.4;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--card-border);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--text-primary); }

.footer-copy {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links, .nav-right .theme-toggle-label { display: none; }
  .nav-hamburger { display: flex; }
  .page-content { padding-top: 4.5rem; }
}

/* ── Reduced motion ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
