/* ==========================================================================
   Dhondooo Applications — Unified Overview & Documentation Stylesheet
   App: FIRE Tracker (fire-tracker)
   Full theme switcher support (Signature, Obsidian, Paper, Terminal)
   Zero-build, mobile-responsive, zero telemetry.
   ========================================================================== */

:root {
  /* Default: App Signature Theme */
  --bg: #090d16;
  --surface: #111726;
  --surface-hover: #192238;
  --surface-subtle: #0d1322;
  --border: #1e293b;
  --border-light: #334155;
  --fg: #f1f5f9;
  --muted: #94a3b8;
  --dim: #64748b;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-soft: rgba(249, 115, 22, 0.15);
  --rule: #1e293b;
  --card: #111726;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.6);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

/* ==========================================================================
   THEME VARIATIONS
   ========================================================================== */
body[data-theme="signature"] {
  --bg: #06080e;
  --surface: #0f1422;
  --surface-hover: rgba(255, 255, 255, 0.08);
  --surface-subtle: rgba(255, 255, 255, 0.03);
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-soft: rgba(249, 115, 22, 0.15);
  --fg: #ffffff;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.12);
  --card: #0f1422;
}

body[data-theme="obsidian"] {
  --bg: #05070a;
  --surface: #0a0e14;
  --surface-hover: #131a24;
  --surface-subtle: #080b10;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --fg: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --card: #0a0e14;
}

body[data-theme="paper"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --surface-subtle: #f8fafc;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-soft: rgba(2, 132, 199, 0.12);
  --fg: #0f172a;
  --muted: #475569;
  --dim: #94a3b8;
  --border: #e2e8f0;
  --card: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.1);
}

body[data-theme="terminal"] {
  --bg: #070a0d;
  --surface: #0c1015;
  --surface-hover: #131922;
  --surface-subtle: #090c0f;
  --accent: #22c55e;
  --accent-hover: #16a34a;
  --accent-soft: rgba(34, 197, 94, 0.15);
  --fg: #dcfce7;
  --muted: #86efac;
  --border: #166534;
  --card: #0c1015;
  --font-sans: 'JetBrains Mono', monospace;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

/* ==========================================================================
   Store Legal Pages Compatibility
   ========================================================================== */
body:not(.landing-page) {
  padding: 2.5rem 1.25rem 4rem;
}

body:not(.landing-page) main {
  max-width: 44rem;
  margin: 0 auto;
}

body:not(.landing-page) h1 {
  margin: 0 0 0.4rem;
  font-size: 2rem;
  line-height: 1.2;
}

/* ==========================================================================
   Header Masthead
   ========================================================================== */
.app-masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.masthead-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--fg);
}

.app-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--muted);
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.app-nav a {
  color: var(--muted);
}

.app-nav a:hover {
  color: var(--fg);
}

.nav-portal {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--fg) !important;
}

.auth-pill {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: none;
}

body.is-unlocked .auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid #22c55e;
  color: #22c55e;
}

/* ==========================================================================
   Hero Section & App Preview Showcase
   ========================================================================== */
.hero-section {
  max-width: 1200px;
  margin: 3rem auto 4.5rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 3.5rem;
  align-items: center;
}

.hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.hero-headline {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 2rem;
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--fg);
}

.hero-mockup-wrap {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border-radius: 36px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.hero-mockup-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ==========================================================================
   Core Screens Showcase Section
   ========================================================================== */
.screens-section {
  max-width: 1200px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
}

.section-head {
  margin-bottom: 2.5rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.section-desc {
  font-size: 1rem;
  color: var(--muted);
  margin: 0;
  max-width: 40rem;
}

.screens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.screen-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.screen-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.screen-preview-frame {
  width: 100%;
  height: 480px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-preview-frame svg {
  width: 100%;
  height: 100%;
}

.screen-card-info h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.screen-card-info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ==========================================================================
   Design System & Interactive Switcher Section
   ========================================================================== */
.design-section {
  max-width: 1200px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
}

.theme-switcher-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 2.5rem;
  flex-wrap: wrap;
}

.theme-tab-btn {
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.theme-tab-btn:hover {
  border-color: var(--accent);
  color: var(--fg);
}

.theme-tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.design-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.2s ease;
}

.design-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.design-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

.design-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.palette-bar {
  display: flex;
  gap: 0.5rem;
}

.palette-chip {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.btn-apply-theme {
  margin-top: auto;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--fg);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-apply-theme:hover {
  border-color: var(--accent);
}

/* ==========================================================================
   Specs & Features Sections
   ========================================================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4.5rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.65rem;
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.specs-section {
  max-width: 1200px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.spec-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.spec-key {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
}

.spec-val {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}

/* ==========================================================================
   Support & Footer
   ========================================================================== */
.support-section {
  max-width: 1200px;
  margin: 0 auto 5rem;
  padding: 2.5rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.support-section h2 {
  margin: 0 0 0.5rem;
}

.support-section p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.contact-pill {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.app-colophon {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  background: var(--surface);
}

.colophon-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.colophon-links {
  display: flex;
  gap: 1.25rem;
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */
@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .hero-headline {
    font-size: 2.15rem;
  }
  .masthead-container {
    flex-wrap: wrap;
  }
  .app-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
}
