/* ==========================================================================
   Rumblings — Modern Design System
   Medical-Grade Privacy, Organic Botanical Elegance, Unified Typography
   ========================================================================== */

:root {
  /* Default Color Palette — Warm Roasted Espresso Dark Mode (Default when no preference is available) */
  --bg-primary: #120F0D;
  --bg-surface: #1C1714;
  --bg-surface-elevated: #251E1A;
  --bg-subtle: #201A16;
  --bg-subtle-hover: #2B231E;

  --border-subtle: #2D241E;
  --border-medium: #403229;
  --border-active: #B67344;

  --text-primary: #F7F2EC;
  --text-secondary: #B8ABA0;
  --text-tertiary: #84756A;
  --text-inverse: #120F0D;

  --accent-primary: #B67344;
  --accent-hover: #C98251;
  --accent-vibrant: #DB915F;
  --accent-soft: #2B1C13;
  --accent-soft-hover: #3A261A;
  --accent-glow: rgba(182, 115, 68, 0.25);

  /* Clinical Transit Spectrum */
  --slow-ink: #FBBF24;
  --slow-bg: #2C200E;
  --slow-border: #604618;
  --slow-dot: #F59E0B;

  --optimal-ink: #34D399;
  --optimal-bg: #102619;
  --optimal-border: #1B4C30;
  --optimal-dot: #10B981;

  --rapid-ink: #FB923C;
  --rapid-bg: #30170A;
  --rapid-border: #6E3214;
  --rapid-dot: #F97316;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout & Spacing */
  --container-max: 72rem;
  --container-prose: 44rem;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.55);
  --shadow-phone: 0 24px 60px -12px rgba(0, 0, 0, 0.8);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Automatic System Light Preference */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-primary: #F8FAF7;
    --bg-surface: #FFFFFF;
    --bg-surface-elevated: #FFFFFF;
    --bg-subtle: #EFF3EE;
    --bg-subtle-hover: #E4ECE2;

    --border-subtle: #E2E8E0;
    --border-medium: #CAD5C8;
    --border-active: #2D6A4F;

    --text-primary: #121914;
    --text-secondary: #435047;
    --text-tertiary: #6E7E73;
    --text-inverse: #FFFFFF;

    --accent-primary: #1F5E3B;
    --accent-hover: #16462C;
    --accent-vibrant: #2D8A58;
    --accent-soft: #E5F6EC;
    --accent-soft-hover: #D3EFE0;
    --accent-glow: rgba(45, 138, 88, 0.14);

    --slow-ink: #B45309;
    --slow-bg: #FEF3C7;
    --slow-border: #FCD34D;
    --slow-dot: #D97706;

    --optimal-ink: #15803D;
    --optimal-bg: #DCFCE7;
    --optimal-border: #86EFAC;
    --optimal-dot: #16A34A;

    --rapid-ink: #C2410C;
    --rapid-bg: #FFEDD5;
    --rapid-border: #FDBA74;
    --rapid-dot: #EA580C;

    --shadow-sm: 0 1px 3px rgba(18, 25, 20, 0.05), 0 1px 2px rgba(18, 25, 20, 0.04);
    --shadow-md: 0 4px 12px rgba(18, 25, 20, 0.06), 0 2px 4px rgba(18, 25, 20, 0.03);
    --shadow-lg: 0 12px 32px rgba(18, 25, 20, 0.08), 0 4px 8px rgba(18, 25, 20, 0.03);
    --shadow-phone: 0 24px 60px -12px rgba(27, 67, 50, 0.16), 0 12px 24px -6px rgba(18, 25, 20, 0.08);
  }
}

/* Explicit Dark Theme override */
:root[data-theme="dark"] {
  --bg-primary: #120F0D;
  --bg-surface: #1C1714;
  --bg-surface-elevated: #251E1A;
  --bg-subtle: #201A16;
  --bg-subtle-hover: #2B231E;

  --border-subtle: #2D241E;
  --border-medium: #403229;
  --border-active: #B67344;

  --text-primary: #F7F2EC;
  --text-secondary: #B8ABA0;
  --text-tertiary: #84756A;
  --text-inverse: #120F0D;

  --accent-primary: #B67344;
  --accent-hover: #C98251;
  --accent-vibrant: #DB915F;
  --accent-soft: #2B1C13;
  --accent-soft-hover: #3A261A;
  --accent-glow: rgba(182, 115, 68, 0.25);

  --slow-ink: #FBBF24;
  --slow-bg: #2C200E;
  --slow-border: #604618;
  --slow-dot: #F59E0B;

  --optimal-ink: #34D399;
  --optimal-bg: #102619;
  --optimal-border: #1B4C30;
  --optimal-dot: #10B981;

  --rapid-ink: #FB923C;
  --rapid-bg: #30170A;
  --rapid-border: #6E3214;
  --rapid-dot: #F97316;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.55);
  --shadow-phone: 0 24px 60px -12px rgba(0, 0, 0, 0.8);
}

:root[data-theme="light"] {
  --bg-primary: #F8FAF7;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #FFFFFF;
  --bg-subtle: #EFF3EE;
  --bg-subtle-hover: #E4ECE2;

  --border-subtle: #E2E8E0;
  --border-medium: #CAD5C8;
  --border-active: #2D6A4F;

  --text-primary: #121914;
  --text-secondary: #435047;
  --text-tertiary: #6E7E73;
  --text-inverse: #FFFFFF;

  --accent-primary: #1F5E3B;
  --accent-hover: #16462C;
  --accent-vibrant: #2D8A58;
  --accent-soft: #E5F6EC;
  --accent-soft-hover: #D3EFE0;
  --accent-glow: rgba(45, 138, 88, 0.14);

  --slow-ink: #B45309;
  --slow-bg: #FEF3C7;
  --slow-border: #FCD34D;
  --slow-dot: #D97706;

  --optimal-ink: #15803D;
  --optimal-bg: #DCFCE7;
  --optimal-border: #86EFAC;
  --optimal-dot: #16A34A;

  --rapid-ink: #C2410C;
  --rapid-bg: #FFEDD5;
  --rapid-border: #FDBA74;
  --rapid-dot: #EA580C;

  --shadow-sm: 0 1px 3px rgba(18, 25, 20, 0.05), 0 1px 2px rgba(18, 25, 20, 0.04);
  --shadow-md: 0 4px 12px rgba(18, 25, 20, 0.06), 0 2px 4px rgba(18, 25, 20, 0.03);
  --shadow-lg: 0 12px 32px rgba(18, 25, 20, 0.08), 0 4px 8px rgba(18, 25, 20, 0.03);
  --shadow-phone: 0 24px 60px -12px rgba(27, 67, 50, 0.16), 0 12px 24px -6px rgba(18, 25, 20, 0.08);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

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

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* Accessibility Focus */
:focus-visible {
  outline: 2px solid var(--accent-vibrant);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Containers */
.wrap {
  width: min(100% - 2.5rem, var(--container-max));
  margin-inline: auto;
}

.wrap-prose {
  width: min(100%, var(--container-prose));
}

/* Headings & Typography */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.35rem, 1.3rem + 3.8vw, 3.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.6rem, 1.15rem + 1.6vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1.15rem;
}

p:last-child {
  margin-bottom: 0;
}

.lede {
  font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.35rem);
  line-height: 1.55;
  color: var(--text-secondary);
}

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1.5px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

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

/* Badges and Tags */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  width: fit-content;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-vibrant);
  animation: pulse-dot 2.5s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.65; }
}

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 0.6rem;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent-primary);
  color: var(--text-inverse);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  box-shadow: 0 2px 8px var(--accent-glow);
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--text-inverse);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  border: 1px solid var(--border-medium);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo-wrap {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.brand:hover .brand-logo-wrap {
  transform: scale(1.05);
}

.brand-logo-wrap img, .brand-logo-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

/* Theme Switcher Toggle */
.theme-toggle-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.theme-icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   Hero Section & Interactive Android Mockup
   ========================================================================== */

.hero-section {
  padding: clamp(2.5rem, 1.8rem + 3.5vw, 5.5rem) 0 clamp(2rem, 1.5rem + 2.5vw, 4.5rem);
}

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

@media (min-width: 58rem) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
  }
}

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

.hero-copy h1 {
  margin-top: 0.25rem;
}

.hero-cta-group {
  display: none;
}

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

.highlight-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.highlight-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

/* ---- Real Android Phone Mockup --------------------------------------------- */
.device-showcase {
  position: relative;
  display: flex;
  justify-content: center;
  perspective: 1000px;
}

.device-ambient-glow {
  position: absolute;
  width: 75%;
  height: 75%;
  top: 12%;
  left: 12.5%;
  background: radial-gradient(circle, var(--accent-glow) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(52px);
  z-index: 0;
  pointer-events: none;
}

.phone-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.phone-wrapper {
  position: relative;
  width: min(100%, 260px);
  margin: 0 auto;
}

/* Physical Hardware Buttons (Matte Obsidian Metal) */
.phone-button-power {
  position: absolute;
  right: -2px;
  top: 80px;
  width: 2.5px;
  height: 32px;
  background: #242426;
  border-radius: 0 2px 2px 0;
  box-shadow: 1px 0 2px rgba(0, 0, 0, 0.6);
  z-index: 0;
}

.phone-button-vol-up {
  position: absolute;
  left: -2px;
  top: 68px;
  width: 2.5px;
  height: 28px;
  background: #242426;
  border-radius: 2px 0 0 2px;
  box-shadow: -1px 0 2px rgba(0, 0, 0, 0.6);
  z-index: 0;
}

.phone-button-vol-down {
  position: absolute;
  left: -2px;
  top: 104px;
  width: 2.5px;
  height: 28px;
  background: #242426;
  border-radius: 2px 0 0 2px;
  box-shadow: -1px 0 2px rgba(0, 0, 0, 0.6);
  z-index: 0;
}

[data-theme="light"] .phone-button-power,
[data-theme="light"] .phone-button-vol-up,
[data-theme="light"] .phone-button-vol-down {
  background: #2c2c2e;
}

/* Phone Chassis — Modern Flagship Slim Matte Black Bezel */
.phone-body {
  position: relative;
  z-index: 1;
  background: #000000;
  border: 4px solid #151518;
  border-radius: 34px;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 2px #0a0a0c,
    0 20px 48px -10px rgba(0, 0, 0, 0.8),
    0 8px 18px -4px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transition: border-color var(--transition-medium), box-shadow var(--transition-medium);
}

[data-theme="light"] .phone-body {
  background: #000000;
  border-color: #1a1a1d;
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.22),
    0 0 0 2px #101012,
    0 22px 50px -10px rgba(0, 0, 0, 0.22),
    0 8px 18px -4px rgba(0, 0, 0, 0.12);
}

/* Top Ear Speaker Micro-Slit */
.phone-speaker {
  position: absolute;
  top: 2.5px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 2.5px;
  background: #050505;
  border-radius: 2px;
  z-index: 10;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.9);
}

/* Display Screen Wrapper */
.phone-screen {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  aspect-ratio: 1080 / 2424;
  background: #000;
  display: flex;
}

/* Front Camera Cutout */
.phone-camera-punch {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  background: #000000;
  border-radius: 50%;
  z-index: 12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 2px #000;
  pointer-events: none;
}

.camera-lens {
  position: absolute;
  top: 1.5px;
  left: 1.5px;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.6);
  filter: blur(0.3px);
}

/* Real App Screenshot */
.phone-screenshot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 28px;
  transition: opacity 0.2s ease-in-out;
}

/* Screen Glass Glare Sheen */
.phone-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 28%, transparent 45%);
  z-index: 5;
  border-radius: 28px;
}

/* Carousel Navigation Dots */
.carousel-dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  z-index: 2;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--border-medium);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-dot:hover {
  background: var(--text-tertiary);
  transform: scale(1.2);
}

.carousel-dot.active {
  width: 22px;
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ==========================================================================
   Section Common
   ========================================================================== */

section {
  padding: clamp(3rem, 2rem + 3vw, 5.5rem) 0;
  border-top: 1px solid var(--border-subtle);
}

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

.section-header p {
  margin-top: 0.5rem;
}

/* ==========================================================================
   The Bristol Stool Scale Explorer — Clinical Precision Design
   ========================================================================== */

/* ==========================================================================
   The Bristol Stool Scale Explorer — Medical Sleek Design
   ========================================================================== */

.scale-section {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  padding: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0 3.5rem;
}

/* 1. Seven Clinical Type Cards */
.scale-cards-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 56rem) {
  .scale-cards-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.65rem;
    padding: 0.35rem 0.25rem 0.85rem;
    margin-bottom: 1.25rem;
    scrollbar-width: none;
  }

  .scale-cards-grid::-webkit-scrollbar {
    display: none;
  }

  .type-card {
    flex: 0 0 115px;
    min-width: 115px;
    scroll-snap-align: center;
    padding: 0.75rem 0.5rem 0.85rem;
  }
}

.type-card {
  appearance: none;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 0.85rem 0.6rem 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  cursor: pointer;
  position: relative;
  color: inherit;
  font-family: var(--font-sans);
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

/* Strictly no ::before pseudo-element to prevent double borders */

.type-card:hover {
  background: var(--bg-subtle);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.type-card.active {
  background: var(--bg-surface-elevated);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.4);
}

.type-card.active[data-zone="slow"] {
  border: 1.5px solid #D97706;
}

.type-card.active[data-zone="optimal"] {
  border: 1.5px solid #10B981;
}

.type-card.active[data-zone="rapid"] {
  border: 1.5px solid #EA580C;
}

/* Card Header */
.type-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 0.15rem;
  min-height: 1.25rem;
}

.type-card-num {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
}

.type-card.active .type-card-num {
  color: var(--text-primary);
}

.type-target-badge {
  font-family: var(--font-sans);
  font-size: 0.5625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

:root[data-theme="dark"] .type-target-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.35);
}

/* Card Visual Pedestal Stage */
.type-card-stage {
  position: relative;
  width: 100%;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.15rem 0;
}

.type-card-pedestal {
  position: absolute;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.pedestal-optimal {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
}

.type-card-stage img,
.type-card-stage svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
  transition: transform 0.2s ease;
}

.type-card:hover .type-card-stage img,
.type-card:hover .type-card-stage svg {
  transform: scale(1.05);
}

/* Card Footer */
.type-card-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
}

.type-card-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  white-space: nowrap;
}

.type-card-tag {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}

.tag-slow {
  background: var(--slow-bg);
  color: var(--slow-ink);
}

.tag-optimal {
  background: var(--optimal-bg);
  color: var(--optimal-ink);
}

.tag-ideal {
  background: rgba(16, 185, 129, 0.18);
  color: #10B981;
  font-weight: 700;
}

:root[data-theme="dark"] .tag-ideal {
  color: #34D399;
  background: rgba(52, 211, 153, 0.18);
}

.tag-rapid {
  background: var(--rapid-bg);
  color: var(--rapid-ink);
}

/* 3. Clinical Reference Console Panel */
.scale-detail-panel {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
}

/* Speech Bubble Pointer Arrow aligned with selected card above */
.detail-panel-arrow {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  border-left: 1px solid var(--border-subtle);
  border-right: none;
  border-bottom: none;
  transform: translateX(-50%) rotate(45deg);
  border-top-left-radius: 2px;
  transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 3;
}

.detail-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.detail-lead {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.detail-type-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0.4rem 0.85rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.detail-lead-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
  padding: 0;
}

.detail-tags-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.detail-status-tag {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0;
  margin: 0;
  line-height: 1.3;
}

.detail-rumblings-target {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.16);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: inline-flex;
  align-items: center;
}

:root[data-theme="dark"] .detail-rumblings-target {
  color: #34D399;
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.35);
}

.detail-grid-body {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 52rem) {
  .detail-grid-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.detail-text-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.detail-field-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.detail-description,
.detail-guidance {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.detail-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: border-color var(--transition-fast);
}

.metric-label {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.metric-value {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.metric-hint {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-tertiary);
}

/* ==========================================================================
   How It Works (3 Pillars)
   ========================================================================== */

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-top: 2rem;
}

@media (min-width: 52rem) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-index {
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
}

.step-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon-badge svg {
  width: 20px;
  height: 20px;
}

.step-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.step-card p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.step-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   The Privacy Pledge (Clean, Human & Dignified)
   ========================================================================== */

.privacy-pledge {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-top: 2.25rem;
}

.pledge-header {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.25rem 2.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pledge-header-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pledge-header-title svg {
  color: var(--accent-primary);
}

.pledge-header-badge {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pledge-list {
  display: flex;
  flex-direction: column;
}

.pledge-row {
  display: grid;
  grid-template-columns: 14rem 1fr auto;
  gap: 2rem;
  padding: 1.75rem 2.25rem;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  transition: background var(--transition-fast);
}

.pledge-row:last-child {
  border-bottom: none;
}

.pledge-row:hover {
  background: var(--bg-subtle);
}

.pledge-lead {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pledge-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-primary);
}

.pledge-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.pledge-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.25;
}

.pledge-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
}

.pledge-body {
  min-width: 0;
}

.pledge-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.pledge-status {
  flex-shrink: 0;
}

.pledge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.pledge-tag.tag-safe {
  background: rgba(30, 158, 94, 0.1);
  color: var(--badge-optimal-text);
  border: 1px solid rgba(30, 158, 94, 0.25);
}

.pledge-tag.tag-info {
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .pledge-tag.tag-info {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

.pledge-tag.tag-prohibited {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

[data-theme="dark"] .pledge-tag.tag-prohibited {
  color: #f87171;
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
}

.pledge-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  padding: 1.35rem 2.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.pledge-footer-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: opacity var(--transition-fast);
}

.pledge-footer-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

@media (max-width: 56rem) {
  .pledge-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.5rem;
  }
  .pledge-status {
    margin-top: 0.25rem;
  }
}

/* ==========================================================================
   Product Status & Medical Disclaimer
   ========================================================================== */

.status-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 1.5rem + 2vw, 3.25rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.status-col h2 {
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.65rem);
  margin-top: 0.4rem;
  margin-bottom: 0.85rem;
  letter-spacing: -0.015em;
}

.status-col p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 0;
}

@media (min-width: 52rem) {
  .status-card {
    grid-template-columns: 1.15fr 1fr;
    gap: 3.5rem;
    align-items: start;
  }

  .status-col-notice {
    border-left: 1px solid var(--border-subtle);
    padding-left: 3.5rem;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

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

/* ==========================================================================
   Privacy Policy Page Styling
   ========================================================================== */

.policy-container {
  padding: 3rem 0 5rem;
}

.policy-header {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
}

.policy-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.policy-draft-notice {
  background: var(--slow-bg);
  border: 1px solid var(--slow-border);
  border-left: 4px solid var(--slow-ink);
  color: var(--slow-ink);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.policy-body h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.policy-body h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.policy-body ul {
  padding-left: 1.35rem;
  margin-bottom: 1.5rem;
}

.policy-body li {
  margin-bottom: 0.65rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.policy-body strong {
  color: var(--text-primary);
}

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

/* ==========================================================================
   Mobile Responsive Refinements
   ========================================================================== */

/* Tablet & Mobile (<= 56rem / 896px) */
@media (max-width: 56rem) {
  .pledge-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.5rem;
  }
  .pledge-status {
    margin-top: 0.25rem;
  }
}

/* Standard Mobile (<= 48rem / 768px) */
@media (max-width: 48rem) {
  .masthead {
    padding: 1rem 0;
  }

  .brand-logo-wrap {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 1.15rem;
  }

  .nav-link {
    min-height: 44px;
    padding: 0.4rem 0.65rem;
    font-size: 0.9375rem;
    display: inline-flex;
    align-items: center;
  }

  .theme-toggle-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.45rem 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .theme-toggle-btn .theme-label {
    display: none;
  }

  .hero-section {
    padding: 1.25rem 0 2.25rem;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
  }

  .hero-copy {
    display: contents;
  }

  .hero-copy h1 {
    order: 1;
    margin-top: 0;
    margin-bottom: 0.25rem;
  }

  .hero-copy .lede {
    order: 2;
    margin-bottom: 0;
    font-size: 1.0625rem;
    line-height: 1.5;
  }

  .device-showcase {
    order: 3;
    margin: 0.35rem 0 0.25rem;
  }

  .phone-wrapper {
    width: min(100%, 260px);
  }

  .hero-highlights {
    order: 4;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    margin-top: 0.5rem;
    padding-top: 1rem;
  }

  .scale-section {
    padding: 1.5rem 1.15rem 1.75rem;
    margin: 1.25rem 0 2.75rem;
    border-radius: var(--radius-lg);
  }

  .scale-detail-panel {
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  .detail-header-bar {
    margin-bottom: 1.25rem;
    padding-bottom: 1.15rem;
  }

  .detail-lead {
    gap: 0.85rem;
  }

  .detail-type-num {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1;
    width: auto;
    height: auto;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
  }

  .detail-title {
    font-size: 1.25rem;
  }

  .detail-tags-row {
    gap: 0.45rem;
    margin-top: 0.25rem;
  }

  .detail-grid-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .detail-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .metric-card {
    padding: 0.85rem 0.85rem;
  }

  .steps-grid {
    gap: 1rem;
    margin-top: 1.75rem;
  }

  .step-card {
    padding: 1.5rem 1.25rem;
  }

  .pledge-header,
  .pledge-footer {
    padding: 1.15rem 1.25rem;
  }

  .pledge-row {
    padding: 1.35rem 1.25rem;
  }

  .status-card {
    padding: 1.75rem 1.35rem;
    gap: 2rem;
  }

  footer {
    padding: 2.5rem 0 3.5rem;
    gap: 1.5rem;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
  }

  .footer-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0;
  }
}

/* Compact Mobile (<= 40rem / 640px) */
@media (max-width: 40rem) {
  .masthead {
    gap: 0.75rem;
  }

  .brand {
    gap: 0.5rem;
  }
}

/* Narrow Phone (<= 32rem / 512px) */
@media (max-width: 32rem) {
  .wrap {
    width: min(100% - 1.5rem, var(--container-max));
  }

  .brand-name {
    font-size: 1.0625rem;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta-group .btn-primary,
  .hero-cta-group .btn-secondary {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .scale-detail-panel {
    padding: 1.25rem 1rem;
  }

  .detail-lead {
    align-items: flex-start;
    gap: 0.65rem;
  }

  .detail-title {
    font-size: 1.125rem;
  }

  .detail-status-tag,
  .detail-rumblings-target {
    font-size: 0.6875rem;
    padding: 0.25rem 0.6rem;
  }

  .detail-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .metric-card {
    padding: 0.75rem 0.65rem;
  }

  .metric-label {
    font-size: 0.5625rem;
  }

  .metric-value {
    font-size: 0.9375rem;
  }

  .metric-hint {
    font-size: 0.65rem;
  }

  .pledge-header,
  .pledge-footer {
    padding: 0.95rem 1rem;
  }

  .pledge-row {
    padding: 1.15rem 1rem;
  }

  .pledge-desc {
    font-size: 0.875rem;
  }

  .status-card {
    padding: 1.5rem 1.15rem;
  }
}

/* Ultra-Compact Phone (<= 22rem / 352px) */
@media (max-width: 22rem) {
  .wrap {
    width: min(100% - 1rem, var(--container-max));
  }

  .detail-metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* Logo variant switching for Light / Dark themes */
.logo-light { display: block; }
.logo-dark { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}

:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

:root[data-theme="light"] .logo-light { display: block; }
:root[data-theme="light"] .logo-dark { display: none; }
