/* MediMemo landing page.
 *
 * Themes follow the app's convention: dark is the default token set on :root;
 * light overrides it under :root[data-theme="light"] and under
 * @media (prefers-color-scheme: light) :root:not([data-theme="dark"]).
 * Keep those two light blocks identical. app/theme-init.js sets data-theme
 * from the shared `medimemo_theme` key before first paint.
 * Use tokens, never raw colours, outside the token blocks (the fixed
 * medicine colours .med-a/.med-b/.med-c are the one exception).
 */

:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(31, 41, 55, 0.8);
  --tint-rgb: 255, 255, 255;           /* subtle overlays and borders */
  --border-subtle: rgba(var(--tint-rgb), 0.07);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-strong: #ffffff;              /* headings and key figures */

  --primary: #6366f1;                  /* button fill (white text on it) */
  --primary-hover: #4f46e5;
  --primary-rgb: 99, 102, 241;
  --accent: #818cf8;                   /* primary-coloured text and icons */
  --accent-glow: rgba(129, 140, 248, 0.15);
  --purple: #a855f7;

  --success: #10b981;
  --success-rgb: 16, 185, 129;
  --warning: #f59e0b;
  --warning-rgb: 245, 158, 11;
  --danger: #f43f5e;
  --danger-rgb: 244, 63, 94;
  --info: #0ea5e9;
  --info-rgb: 14, 165, 233;

  --gradient-text: linear-gradient(135deg, #a855f7 0%, #818cf8 50%, #38bdf8 100%);
  --glow-opacity: 0.25;
  --surface-footer: rgba(11, 15, 25, 0.8);
  --surface-toast: rgba(17, 24, 39, 0.94);
  --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --shadow-toast: 0 10px 25px rgba(0, 0, 0, 0.5);

  --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-outfit: 'Outfit', var(--font-stack);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg-main: #f4f6fb;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: rgba(241, 245, 249, 0.95);
  --tint-rgb: 15, 23, 42;
  --border-subtle: rgba(15, 23, 42, 0.12);
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --text-strong: #0b1220;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-rgb: 79, 70, 229;
  --accent: #4f46e5;
  --accent-glow: rgba(79, 70, 229, 0.1);
  --purple: #7e22ce;
  --success: #047857;
  --success-rgb: 4, 120, 87;
  --warning: #b45309;
  --warning-rgb: 180, 83, 9;
  --danger: #e11d48;
  --danger-rgb: 225, 29, 72;
  --info: #0369a1;
  --info-rgb: 3, 105, 161;
  --gradient-text: linear-gradient(135deg, #7e22ce 0%, #4f46e5 50%, #0369a1 100%);
  --glow-opacity: 0.12;
  --surface-footer: rgba(255, 255, 255, 0.7);
  --surface-toast: rgba(255, 255, 255, 0.97);
  --shadow-premium: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
  --shadow-toast: 0 10px 25px rgba(15, 23, 42, 0.18);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-main: #f4f6fb;
    --bg-card: rgba(255, 255, 255, 0.88);
    --bg-card-hover: rgba(241, 245, 249, 0.95);
    --tint-rgb: 15, 23, 42;
    --border-subtle: rgba(15, 23, 42, 0.12);
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --text-strong: #0b1220;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-rgb: 79, 70, 229;
    --accent: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.1);
    --purple: #7e22ce;
    --success: #047857;
    --success-rgb: 4, 120, 87;
    --warning: #b45309;
    --warning-rgb: 180, 83, 9;
    --danger: #e11d48;
    --danger-rgb: 225, 29, 72;
    --info: #0369a1;
    --info-rgb: 3, 105, 161;
    --gradient-text: linear-gradient(135deg, #7e22ce 0%, #4f46e5 50%, #0369a1 100%);
    --glow-opacity: 0.12;
    --surface-footer: rgba(255, 255, 255, 0.7);
    --surface-toast: rgba(255, 255, 255, 0.97);
    --shadow-premium: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
    --shadow-toast: 0 10px 25px rgba(15, 23, 42, 0.18);
    color-scheme: light;
  }
}

/* --- Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  /* Anchor jumps land below the fixed header */
  scroll-padding-top: 6.5rem;
}

body {
  font-family: var(--font-stack);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

main:focus { outline: none; }

h1, h2, h3, h4 {
  font-family: var(--font-outfit);
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

ul { list-style: none; }

/* Visible keyboard focus everywhere (mouse clicks don't show it) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

/* --- Utilities --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.icon-warning { color: var(--warning); }
.icon-success { color: var(--success); }

/* Fixed medicine colours, shared by the hero preview and the demo */
.med-a { background: #6366f1; }
.med-b { background: #f59e0b; }
.med-c { background: #ec4899; }

/* --- Buttons --- */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  border: none;
  font-family: var(--font-outfit);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.3);
}

.btn-secondary {
  background: rgba(var(--tint-rgb), 0.04);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

@media (hover: hover) {
  .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(var(--primary-rgb), 0.4);
  }

  .btn-secondary:hover {
    background: rgba(var(--tint-rgb), 0.08);
    border-color: rgba(var(--tint-rgb), 0.2);
    transform: translateY(-2px);
  }
}

.btn-lg {
  padding: 0.9rem 1.75rem;
  font-size: 1.05rem;
}

.btn-primary svg, .btn-secondary svg { width: 18px; height: 18px; }

/* --- Badge --- */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  margin-bottom: 1.5rem;
}

.badge-pill svg { width: 16px; height: 16px; }

/* --- Header --- */
.header {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 1200px;
  z-index: 100;
  border-radius: var(--radius-md);
  padding: 0.6rem 1.5rem;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  font-family: var(--font-outfit);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 28px;
  height: 28px;
  stroke-width: 2.5;
  color: var(--accent);
}

.nav-menu {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}

@media (hover: hover) {
  .nav-link:hover { color: var(--text-strong); }
}

.nav-btn-app { padding: 0.6rem 1.25rem; }

.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-strong);
  cursor: pointer;
  /* 44x44 tap target around the 24px icon */
  min-width: 44px;
  min-height: 44px;
  margin-right: -10px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.toggle-icon { display: inline-flex; }
.mobile-nav-toggle[aria-expanded="true"] .toggle-icon-open,
.mobile-nav-toggle:not([aria-expanded="true"]) .toggle-icon-close { display: none; }

.mobile-menu {
  display: none;
  position: fixed;
  top: 5.5rem;
  left: 4%;
  width: 92%;
  z-index: 99;
  flex-direction: column;
  padding: 1rem 1.5rem 1.5rem;
  border-radius: var(--radius-md);
}

.mobile-menu.active { display: flex; }

.mobile-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-family: var(--font-outfit);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-strong);
  border-bottom: 1px solid rgba(var(--tint-rgb), 0.06);
}

.mobile-btn-app { margin-top: 1rem; }

/* --- Hero --- */
.hero-section {
  position: relative;
  padding: 9rem 0 5rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-bg-glows {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  opacity: var(--glow-opacity);
}

.glow-1 { top: -10%; left: 20%; width: 400px; height: 400px; background: var(--primary); }
.glow-2 { top: 40%; right: 10%; width: 450px; height: 450px; background: var(--purple); }

.hero-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.12;
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 580px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
}

.hero-stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-outfit);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-strong);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Decorative hero preview */
.hero-visual {
  display: flex;
  justify-content: center;
  position: relative;
}

.mockup-container {
  width: 100%;
  max-width: 360px;
  padding: 1.5rem;
}

.animate-float { animation: float 6s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.mockup-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.mockup-dots { display: flex; gap: 0.35rem; }

.mockup-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(var(--tint-rgb), 0.2);
}

.mockup-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.mockup-widget-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.mockup-widget {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  box-shadow: none;
}

.mockup-widget svg { flex-shrink: 0; }

.mockup-widget-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mockup-widget-text .label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.mockup-widget-text .value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-strong);
}

.mockup-list-title {
  font-family: var(--font-outfit);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.mockup-pill-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  box-shadow: none;
}

.pill-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.color-indicator {
  width: 4px;
  height: 28px;
  border-radius: 99px;
  flex-shrink: 0;
}

.pill-details { display: flex; flex-direction: column; min-width: 0; }

.pill-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-strong);
}

.pill-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pill-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.pill-badge svg { width: 12px; height: 12px; }

.pill-badge.taken {
  background: rgba(var(--success-rgb), 0.12);
  color: var(--success);
  border: 1px solid rgba(var(--success-rgb), 0.25);
}

/* A status, not a button: outlined and muted */
.pill-badge.due {
  color: var(--text-muted);
  border: 1px dashed rgba(var(--tint-rgb), 0.25);
}

/* --- Sections --- */
.section { padding: 7rem 0; }

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.section-title {
  font-size: 2.5rem;
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* --- Live demo --- */
.simulator-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  padding: 2.5rem;
  gap: 3rem;
}

.simulator-card-panel, .simulator-analytics-panel { min-width: 0; }

.panel-header-title {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.panel-header-title svg { color: var(--accent); flex-shrink: 0; }

.panel-header-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.sim-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sim-dose-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  box-shadow: none;
  transition: background 0.3s, border-color 0.3s;
}

.sim-dose-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 10rem;
}

.sim-indicator {
  width: 4px;
  height: 32px;
  border-radius: 99px;
  flex-shrink: 0;
}

.sim-details { min-width: 0; }

.sim-details h4 {
  font-size: 1rem;
  font-weight: 700;
}

.sim-details p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sim-btn {
  min-width: 9.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.sim-btn-icon { display: inline-flex; }
.sim-btn-icon svg { width: 16px; height: 16px; }
.sim-btn[aria-pressed="true"] .sim-btn-icon-add,
.sim-btn:not([aria-pressed="true"]) .sim-btn-icon-done { display: none; }

.sim-dose-card.taken {
  border-color: rgba(var(--success-rgb), 0.3);
  background: rgba(var(--success-rgb), 0.05);
}

/* Taken: still a button (tap again to undo), styled as a status */
.sim-dose-card.taken .sim-btn {
  background: rgba(var(--success-rgb), 0.12);
  color: var(--success);
  box-shadow: inset 0 0 0 1px rgba(var(--success-rgb), 0.3);
}

@media (hover: hover) {
  .sim-dose-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(var(--tint-rgb), 0.12);
  }
  .sim-dose-card.taken .sim-btn:hover {
    background: rgba(var(--success-rgb), 0.18);
    transform: none;
  }
}

.sim-reset {
  margin-top: 1.5rem;
  width: 100%;
}

.simulator-analytics-panel {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: none;
}

.sim-metrics-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
}

.radial-container {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto;
}

.radial-progress {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.radial-progress circle {
  fill: none;
  stroke-width: 8;
}

.radial-progress circle.bg { stroke: rgba(var(--tint-rgb), 0.08); }

.radial-progress circle.fg {
  stroke: var(--accent);
  stroke-dasharray: 251.2; /* 2 * PI * r (r=40) */
  stroke-dashoffset: 251.2;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.4s;
}

.radial-progress circle.fg.complete { stroke: var(--success); }

.radial-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.radial-text .percent {
  font-family: var(--font-outfit);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.1;
  white-space: nowrap;
}

.radial-text .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.sim-kpi-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.sim-kpi-card {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.sim-kpi-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sim-kpi-card .value {
  font-family: var(--font-outfit);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-strong);
  white-space: nowrap;
}

.mini-chart-container {
  padding: 1rem;
  box-shadow: none;
}

.mini-chart-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

#trend-indicator {
  font-weight: 600;
  white-space: nowrap;
}

#trend-indicator.complete { color: var(--success); }

.mini-chart-canvas {
  width: 100%;
  height: 64px;
}

.mini-svg-line {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid {
  stroke: rgba(var(--tint-rgb), 0.08);
  stroke-dasharray: 4;
  vector-effect: non-scaling-stroke;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.chart-stop-top { stop-color: var(--accent); stop-opacity: 0.3; }
.chart-stop-bottom { stop-color: var(--accent); stop-opacity: 0; }

#chart-line-path, #chart-area-path {
  transition: d 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Demo toast */
.sim-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translate(-50%, calc(100% + 2rem));
  width: max-content;
  max-width: calc(100vw - 32px);
  background: var(--surface-toast);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--success-rgb), 0.35);
  padding: 0.8rem 1.25rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  z-index: 1000;
  box-shadow: var(--shadow-toast);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.sim-toast.active { transform: translate(-50%, 0); }

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--success);
}

.toast-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-strong);
}

/* --- Features / install cards --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}

.feature-card {
  padding: 2rem;
  box-shadow: none;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}

@media (hover: hover) {
  .feature-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(var(--primary-rgb), 0.25);
    transform: translateY(-4px);
  }
}

.feature-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.feature-icon-wrapper svg { width: 24px; height: 24px; }

.feature-icon-wrapper.purple { background: rgba(168, 85, 247, 0.14); color: var(--purple); }
.feature-icon-wrapper.green  { background: rgba(var(--success-rgb), 0.14); color: var(--success); }
.feature-icon-wrapper.amber  { background: rgba(var(--warning-rgb), 0.14); color: var(--warning); }
.feature-icon-wrapper.blue   { background: rgba(var(--info-rgb), 0.14); color: var(--info); }
.feature-icon-wrapper.red    { background: rgba(var(--danger-rgb), 0.12); color: var(--danger); }
.feature-icon-wrapper.sky    { background: var(--accent-glow); color: var(--accent); }

.feature-title {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

.feature-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.feature-desc strong { color: var(--text-main); }

/* Guide cards and the "who makes it" text: links inside copy */
.feature-title a { color: inherit; text-decoration: underline; text-decoration-color: rgba(var(--primary-rgb), 0.6); text-underline-offset: 0.2em; }
.about-text a { color: var(--accent); text-decoration: underline; }

.feature-note {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

/* --- Screenshots --- */
.screens-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.screen-card {
  padding: 0.75rem;
  overflow: hidden;
  box-shadow: none;
}

.screen-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.screen-card figcaption {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.85rem 0 0.35rem;
}

/* --- Privacy --- */
.privacy-container {
  text-align: center;
  padding: 4.5rem 3rem;
  max-width: 1000px;
  margin: 0 auto;
  border-color: rgba(var(--success-rgb), 0.3);
  background: radial-gradient(circle at center, rgba(var(--success-rgb), 0.06) 0%, transparent 80%), var(--bg-card);
}

.privacy-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(var(--success-rgb), 0.12);
  color: var(--success);
  border: 1px solid rgba(var(--success-rgb), 0.3);
  margin-bottom: 1.5rem;
}

.privacy-icon-badge svg { width: 32px; height: 32px; }

.privacy-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 3rem;
}

.privacy-points-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.privacy-point {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.privacy-point svg {
  width: 24px;
  height: 24px;
  color: var(--success);
  margin-bottom: 1rem;
}

.privacy-point h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.privacy-point p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 260px;
}

/* --- FAQ --- */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: none;
  transition: border-color 0.3s;
}

.faq-item[open] { border-color: rgba(var(--primary-rgb), 0.3); }

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item summary:focus-visible { outline-offset: -2px; }

.faq-item p {
  padding: 0 1.5rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.faq-item strong { color: var(--text-main); }

.faq-item a {
  color: var(--accent);
  text-decoration: underline;
}

/* --- Call to action --- */
.cta-section { padding-bottom: 6rem; }

.cta-container {
  padding: 4.5rem 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.1) 0%, transparent 60%), var(--bg-card);
}

.cta-logo-icon {
  width: 56px;
  height: 56px;
  color: var(--accent);
  margin-bottom: 1.5rem;
  stroke-width: 2;
}

.cta-title {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.cta-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2rem;
}

.cta-disclaimer {
  margin-top: 1.75rem;
  max-width: 480px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Legal pages (privacy.html) --- */
/* Same header, hero glow, privacy card and footer as the landing page; the
   policy itself is a narrow column of cards. */
.legal-column { max-width: 820px; }

.legal-hero {
  position: relative;
  padding: 9rem 0 3rem;
  text-align: center;
}

.legal-hero .section-subtitle { max-width: 640px; margin: 0 auto; }

/* The hero is short here, so fade the glow out instead of clipping it in a line */
.legal-hero .hero-bg-glows {
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.legal-updated {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legal-body { padding: 0 0 6rem; }

.legal-summary {
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
}

.legal-point-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.legal-section {
  padding: 2rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: none;
}

.legal-section h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.legal-section h2 svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

.legal-section p,
.legal-section li {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.legal-section p + p,
.legal-section p + ul { margin-top: 0.85rem; }

.legal-section li {
  position: relative;
  padding: 0.3rem 0 0.3rem 1.4rem;
}

.legal-section li::before {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: 0.95rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.legal-section strong { color: var(--text-main); }

.legal-section a {
  color: var(--accent);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

/* Anchors (#disclaimer from the app and the footer) land below the fixed header */
.legal-section { scroll-margin-top: 6.5rem; }

.footer-link[aria-current="page"] { color: var(--text-strong); }

@media (max-width: 600px) {
  .legal-hero { padding: 7.5rem 0 2rem; }
  .legal-summary { padding: 2rem 1.25rem; }
  .legal-section { padding: 1.5rem 1.25rem; }
  .legal-section h2 { font-size: 1.15rem; }
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0;
  background: var(--surface-footer);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 440px;
  min-width: 0;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-outfit);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-strong);
}

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

.footer-disclaimer a {
  color: inherit;
  text-decoration: underline;
  display: inline-block;
  padding: 0.35rem 0;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.25rem;
  min-width: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 1.25rem;
  min-width: 0;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (hover: hover) {
  .footer-link:hover { color: var(--text-strong); }
}

.theme-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(var(--tint-rgb), 0.04);
}

.theme-option {
  min-height: 36px;
  padding: 0 0.9rem;
  border: none;
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.theme-option[aria-pressed="true"] {
  background: var(--bg-card-hover);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}

/* --- Responsive --- */
@media (max-width: 968px) {
  .hero-section { min-height: 0; }

  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-ctas, .hero-stats { justify-content: center; }

  .simulator-layout {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 2rem;
  }

  .privacy-points-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .privacy-point p { max-width: 360px; }
}

@media (max-width: 768px) {
  .nav-menu, .nav-actions { display: none; }
  .mobile-nav-toggle { display: inline-flex; }

  .section { padding: 4.5rem 0; }

  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }

  .footer-left { align-items: center; }
  .footer-right { align-items: center; }
  .footer-links { justify-content: center; }
}

@media (max-width: 600px) {
  .container { padding: 0 1rem; }

  .header { padding: 0.4rem 1rem; }

  .hero-section { padding: 7.5rem 0 3rem; }
  .hero-title { font-size: 2.4rem; }
  .hero-desc { font-size: 1.05rem; margin-bottom: 2rem; }
  .hero-ctas { margin-bottom: 2.5rem; }
  .hero-ctas a { flex: 1 1 100%; }

  /* The demo right below shows the same thing, and the real app is in the screenshots */
  .hero-visual { display: none; }

  .section-header { margin-bottom: 2.5rem; }
  .section-title { font-size: 1.9rem; }

  .simulator-layout { padding: 1rem; }
  .simulator-analytics-panel { padding: 1.25rem; }

  .sim-btn { flex: 1 0 100%; }

  /* Phone screenshots in a swipeable row; the next one peeks in from the edge */
  .screens-grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 -1rem;
    padding: 0 1rem 0.5rem;
    scrollbar-width: none;
  }
  .screens-grid::-webkit-scrollbar { display: none; }
  .screen-card {
    flex: 0 0 72%;
    scroll-snap-align: center;
  }

  .privacy-container { padding: 3rem 1.25rem; }
  .cta-container { padding: 3rem 1.25rem; }
  .cta-title { font-size: 1.9rem; }
  .cta-container .btn-lg { width: 100%; }

  .feature-card { padding: 1.5rem; }
}

@media (max-width: 480px) {
  .sim-metrics-grid { grid-template-columns: 1fr; }
  .sim-kpi-stack { flex-direction: row; }
  .sim-kpi-card { flex: 1 1 0; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
