/* ==========================================================================
   QuitNowPath Landing Page Styles
   Art Direction: product-performs (Emerald & Obsidian Palette)
   Strict compliance with anti-slop house rules (0 gradients, 0 shadows at rest,
   no hairline dividers, tabular numbers for quantitative figures).
   ========================================================================== */

:root {
  --hue: 154;
  --sat: 12%;
  
  /* Palette: Dark (Default) */
  --bg-dark: #0A0D0B;
  --bg: #111613;
  --bg-elevated: #171E1A;
  --bg-subtle: #1E2822;
  --text: #E5ECE7;
  --text-muted: #9CAAA2;
  --text-dim: #92A298;
  --primary: #18B574;
  --primary-fg: #0A0D0B;
  --primary-hover: #22CC84;
  --primary-glow: #28CF85;
  --primary-subtle: rgba(24, 181, 116, 0.12);
  --danger: #F26666;
  --danger-subtle: rgba(242, 102, 102, 0.12);
  --warning: #D99B26;
  --border: #222B25;
  --border-focus: #18B574;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Space scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --header-height: 4.75rem;
  --content-max: 72rem;
  --margin-gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-full: 9999px;
}

[data-theme="light"] {
  --bg-dark: #F0F4F2;
  --bg: #FFFFFF;
  --bg-elevated: #E4EBE7;
  --bg-subtle: #D8E2DC;
  --text: #131A15;
  --text-muted: #4F5E55;
  --text-dim: #55665D;
  --primary: #0E8353;
  --primary-fg: #FFFFFF;
  --primary-hover: #0B6B43;
  --primary-glow: #139E65;
  --primary-subtle: rgba(14, 131, 83, 0.10);
  --danger: #B8281B;
  --danger-subtle: rgba(184, 40, 27, 0.10);
  --warning: #B7791F;
  --border: #D0DBD4;
  --border-focus: #0E8353;
}

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

html {
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg-dark);
  color-scheme: dark light;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
  text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg-dark);
}

/* Accessibility: Focus Visible */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Tabular figures for all quantitative readings */
.tabular {
  font-variant-numeric: tabular-nums;
}

p {
  max-width: 58ch;
}

/* Top Navigation Bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-dark);
  border-bottom: 2px solid var(--bg-elevated);
}

.nav-container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: var(--space-4) var(--margin-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  display: inline-block;
  animation: pulseDot 3s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.8; }
}

.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

@media (min-width: 52em) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 150ms ease;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Theme Switcher Button */
.btn-theme {
  background: var(--bg-elevated);
  border: 0;
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease;
}

.btn-theme:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

/* Button Component */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  border: 0;
  cursor: pointer;
  transition: background 160ms ease, transform 120ms ease, color 160ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-fg);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-elevated);
  color: var(--text);
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

/* Returning user prompt */
.active-plan-banner {
  background-color: var(--primary-subtle);
  color: var(--text);
  padding: var(--space-2) var(--margin-gutter);
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
}

.active-plan-banner a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  margin-inline-start: var(--space-2);
}

/* Main Layout */
main {
  flex: 1;
}

.section {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: var(--space-16) var(--margin-gutter);
  scroll-margin-top: var(--space-4);
}

@media (min-width: 48em) {
  .section {
    padding: var(--space-20) var(--margin-gutter);
  }
}

/* Headings: strictly 2 lines or fewer at all widths */
h1, h2, h3 {
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.15;
  text-wrap: balance;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2rem, 3.8vw + 0.25rem, 3.25rem);
  font-weight: 800;
  margin-bottom: var(--space-5);
}

h2 {
  font-size: clamp(1.5rem, 2.5vw + 0.25rem, 2.25rem);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

h3 {
  font-size: clamp(1.125rem, 1.5vw + 0.2rem, 1.375rem);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

/* Hero Section */
.hero-section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-16);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  align-items: start;
}

@media (min-width: 58em) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
  }
}

.hero-copy {
  display: flex;
  flex-direction: column;
}

.hero-sub {
  font-size: clamp(1.0625rem, 1.2vw + 0.5rem, 1.25rem);
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-6);
  max-width: 36ch;
}

.hero-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.hero-point {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 500;
}

.hero-point-check {
  color: var(--primary);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.hero-note {
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-top: var(--space-3);
}

/* Interactive Simulator (The Live Thing) */
.simulator-card[data-ui] {
  background-color: var(--bg);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  min-width: 300px;
  min-height: 480px;
}

@media (min-width: 40em) {
  .simulator-card[data-ui] {
    padding: var(--space-8);
  }
}

.sim-header {
  margin-bottom: var(--space-6);
}

.sim-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-1);
}

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

/* Stepper & Selectors inside Simulator */
.sim-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.sim-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sim-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.sim-value-badge {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 700;
}

.sim-habit-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.sim-habit-btn {
  background-color: var(--bg-elevated);
  border: 0;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  text-align: center;
}

.sim-habit-btn.is-active {
  background-color: var(--primary);
  color: var(--primary-fg);
}

.sim-stepper-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sim-stepper-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--bg-elevated);
  border: 0;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms ease;
}

.sim-stepper-btn:hover {
  background-color: var(--bg-subtle);
}

.sim-range {
  flex: 1;
  accent-color: var(--primary);
  height: 8px;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

/* SVG Curve visualization */
.sim-chart-wrap {
  background-color: var(--bg-dark);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}

.sim-svg {
  width: 100%;
  height: 120px;
  display: block;
}

.sim-svg-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-top: var(--space-3);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.legend-dot--red {
  background-color: var(--danger);
}

.legend-dot--green {
  background-color: var(--primary);
}

/* Projected metrics */
.sim-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.sim-metric-box {
  background-color: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: left;
}

.sim-metric-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: var(--space-1);
}

.sim-metric-val {
  font-size: clamp(1.125rem, 1.8vw + 0.25rem, 1.5rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.sim-metric-val.is-green {
  color: var(--primary);
}

.sim-action-btn {
  width: 100%;
}

/* Product Performs: Interface Fragments (data-ui) */
.features-section {
  background-color: var(--bg-dark);
}

.section-head {
  max-width: 60ch;
  margin-bottom: var(--space-12);
}

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

.capabilities-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 54em) {
  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }
}

.capability-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.capability-text h3 {
  margin-bottom: var(--space-2);
}

.capability-text p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Real UI fragments marked data-ui */
.ui-fragment[data-ui] {
  background-color: var(--bg);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 300px;
  min-height: 220px;
  justify-content: center;
}

/* Pacing fragment */
.pacing-meter {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pacing-status-pill {
  align-self: flex-start;
  background-color: var(--primary-subtle);
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
}

.pacing-countdown {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.pacing-subtext {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* SOS Breathing Orb fragment */
.sos-orb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
  padding-block: var(--space-2);
}

.breathing-orb {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  animation: breatheCycle 12s infinite ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-fg);
  font-weight: 800;
  font-size: 0.875rem;
}

@keyframes breatheCycle {
  0%, 100% {
    transform: scale(0.85);
  }
  33% {
    transform: scale(1.15);
  }
  66% {
    transform: scale(1.15);
  }
}

.sos-instruction {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.sos-tag {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Progress Ring fragment */
.ring-fragment {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.ring-visual {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.ring-svg {
  transform: rotate(-90deg);
  width: 90px;
  height: 90px;
}

.ring-bg-circle {
  stroke: var(--bg-elevated);
  stroke-width: 8;
  fill: none;
}

.ring-fg-circle {
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 226;
  stroke-dashoffset: 75;
}

.ring-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
}

.ring-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.ring-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.ring-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Dampening formula fragment */
.formula-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.formula-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  background-color: var(--bg-elevated);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.formula-val-bad {
  color: var(--danger);
  font-weight: 700;
}

.formula-val-good {
  color: var(--primary);
  font-weight: 700;
}

/* The Science Section */
.science-section {
  background-color: var(--bg);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

@media (min-width: 48em) {
  .science-section {
    padding: var(--space-12);
  }
}

.science-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-top: var(--space-6);
}

@media (min-width: 50em) {
  .science-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
  }
}

.science-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.science-col p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.comparison-box {
  background-color: var(--bg-dark);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.comp-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.comp-icon-bad {
  color: var(--danger);
  flex-shrink: 0;
  display: inline-flex;
  margin-top: 3px;
}

.comp-icon-good {
  color: var(--primary);
  flex-shrink: 0;
  display: inline-flex;
  margin-top: 3px;
}

.comp-content strong {
  display: block;
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.comp-content p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* FAQ Section using Native Details Accordion */
.faq-section {
  max-width: 54rem;
  margin-inline: auto;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

details.faq-item {
  background-color: var(--bg);
  border-radius: var(--radius-md);
  overflow: hidden;
}

details.faq-item summary {
  padding: var(--space-5) var(--space-6);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

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

details.faq-item summary::after {
  content: "+";
  font-size: 1.375rem;
  color: var(--primary);
  font-weight: 700;
  transition: transform 180ms ease;
}

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

.faq-answer {
  padding: 0 var(--space-6) var(--space-5) var(--space-6);
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 58ch;
}

/* Final Call To Action */
.cta-section {
  text-align: center;
  padding-block: var(--space-20);
}

.cta-box {
  background-color: var(--bg);
  border-radius: var(--radius-lg);
  padding: var(--space-12) var(--margin-gutter);
  max-width: 48rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
}

.cta-box p {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 40ch;
}

/* Footer */
.site-footer {
  background-color: var(--bg-dark);
  border-top: 2px solid var(--bg-elevated);
  padding-block: var(--space-12);
}

.footer-content {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--margin-gutter);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

@media (min-width: 48em) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-desc {
  font-size: 0.875rem;
  color: var(--text-dim);
  max-width: 32ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  list-style: none;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 150ms ease;
}

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

.footer-credits {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding-top: var(--space-6);
}

/* Legal Pages (/privacidad.html & /terminos.html) */
.legal-section {
  max-width: 52rem;
  margin-inline: auto;
  padding: var(--space-12) var(--margin-gutter) var(--space-20);
}

.legal-card {
  background-color: var(--bg);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

@media (min-width: 48em) {
  .legal-card {
    padding: var(--space-12);
  }
}

.legal-updated {
  font-size: 0.875rem;
  color: var(--text-dim);
}

.legal-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.legal-block h2 {
  font-size: clamp(1.25rem, 2vw + 0.25rem, 1.5rem);
  margin-bottom: 0;
}

.legal-block p,
.legal-block li {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 58ch;
}

.legal-list {
  padding-inline-start: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.legal-notice {
  background-color: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.legal-notice p {
  color: var(--text);
  font-weight: 500;
}

/* Motion & Animation: Staggered entrance for sections */
@media (prefers-reduced-motion: no-preference) {
  .animate-rise {
    animation: riseIn 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  
  .delay-1 { animation-delay: 80ms; }
  .delay-2 { animation-delay: 160ms; }
  .delay-3 { animation-delay: 240ms; }

  @keyframes riseIn {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .interactive-glow {
    transition: transform 200ms ease;
  }
  .interactive-glow:hover {
    transform: translateY(-2px);
  }
}
