/* level11.app — Design System
   Warm, grounded aesthetic matching the level ll iOS app.
   Espresso dark + cream light + copper accents.
*/

:root {
  /* Backgrounds */
  --bg: #FAF8F4;
  --hero-bg: #1C1208;
  --hero-bg-light: #2A1E12;

  /* Brand */
  --accent: #C4622A;
  --accent-hover: #D4722A;
  --accent-highlight: #D49060;
  --calm: #9E8B7C;

  /* Level colors */
  --level-green: #4CAF72;
  --level-teal: #2E9186;
  --level-orange: #C4863C;
  --level-warm: #C47A5A;
  --level-magenta: #A83B56;
  --level-mauve: #8B4268;

  /* Substance category colors */
  --cat-alcohol: #FFB347;
  --cat-stimulant: #FF6B6B;
  --cat-depressant: #4ECDC4;
  --cat-psychedelic: #9B59B6;
  --cat-dissociative: #3498DB;
  --cat-entactogen: #E91E63;
  --cat-opioid: #607D8B;
  --cat-cannabinoid: #7CB342;

  /* Text */
  --text: #1C1208;
  --text-secondary: #6B5D4F;
  --text-muted: #9E8B7C;
  --text-on-dark: rgba(255,255,255,0.92);
  --text-on-dark-muted: rgba(255,255,255,0.60);

  /* Tokens */
  --card-radius: 16px;
  --hero-radius: 32px;
  --chip-radius: 10px;
  --card-padding: 16px;
  --screen-padding: 16px;
  --shadow: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --border: rgba(28,18,8,0.08);

  /* Smooth scroll */
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  :root {
    --screen-padding: 24px;
  }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* Layout */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--screen-padding);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  background: var(--hero-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand .nav-logo {
  height: 28px;
  width: auto;
  border-radius: 4px;
}

.navbar-brand .brand-name {
  font-weight: 700;
  font-size: 17px;
  color: var(--text-on-dark);
  letter-spacing: 0.3px;
  text-transform: lowercase;
}

.navbar-brand .nav-wordmark {
  height: 60px;
  width: auto;
}

.navbar-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.navbar-nav a {
  color: var(--text-on-dark-muted);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: var(--chip-radius);
  transition: color 200ms, background 200ms;
}

.navbar-nav a:hover {
  color: var(--text-on-dark);
  background: rgba(255,255,255,0.08);
}

/* Mobile hamburger */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}

.nav-toggle-logo {
  height: 28px;
  width: auto;
  border-radius: 4px;
  display: block;
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 640px) {
  .navbar-toggle { display: block; }
  .navbar-brand .nav-logo { display: none; }
  .navbar-toggle.open .nav-toggle-logo { transform: rotate(90deg); }
  .navbar-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--hero-bg);
    flex-direction: column;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease, padding 300ms ease;
  }
  .navbar-nav.open {
    max-height: 300px;
    padding: 8px 16px 16px;
  }
  .navbar-nav a {
    padding: 12px 16px;
    font-size: 15px;
    width: 100%;
  }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  background: var(--hero-bg);
  background-image: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(196,98,42,0.12) 0%, transparent 70%);
  padding: 60px 0 70px;
  text-align: center;
  overflow: hidden;
}

.hero .container {
  max-width: 720px;
}

/* Two-bar brand logo */
.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.hero-word {
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700;
  color: var(--text-on-dark-muted);
  letter-spacing: 6px;
  text-transform: lowercase;
}

.hero-bars {
  display: flex;
  gap: 12px;
}

.hero-bar {
  width: 10px;
  height: 72px;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--accent), var(--accent-highlight));
}

.hero-bar:nth-child(2) {
  background: linear-gradient(180deg, var(--accent-highlight), var(--accent));
}

.hero-slogan {
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 500;
  color: var(--text-on-dark-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.slogan-accent {
  color: var(--accent);
  font-weight: 600;
}

.hero-logo {
  width: min(320px, 60vw);
  margin: 0 auto 24px;
}

.hero-app-icon {
  width: min(140px, 30vw);
  margin: 0 auto 24px;
  border-radius: var(--hero-radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.hero-title {
  font-size: clamp(42px, 6vw, 64px);
  font-weight: 800;
  color: var(--text-on-dark);
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 16px;
  text-transform: lowercase;
}

.hero-subtitle {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--text-on-dark-muted);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.55;
}

/* 11-segment indicator */
.level-indicator {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-bottom: 36px;
}

.level-segment {
  width: 28px;
  height: 8px;
  border-radius: 4px;
  opacity: 0.25;
  animation: segmentPulse 3s ease-in-out infinite;
}

.level-segment.active {
  opacity: 1;
}

.level-segment:nth-child(1),
.level-segment:nth-child(2) { background: var(--level-green); animation-delay: 0s; }
.level-segment:nth-child(3),
.level-segment:nth-child(4) { background: var(--level-green); animation-delay: 0.15s; }
.level-segment:nth-child(5),
.level-segment:nth-child(6) { background: var(--level-orange); animation-delay: 0.3s; }
.level-segment:nth-child(7),
.level-segment:nth-child(8) { background: var(--level-warm); animation-delay: 0.45s; }
.level-segment:nth-child(9) { background: var(--level-magenta); animation-delay: 0.6s; }
.level-segment:nth-child(10) { background: var(--level-mauve); animation-delay: 0.7s; }
.level-segment:nth-child(11) { background: var(--level-mauve); animation-delay: 0.8s; }

@keyframes segmentPulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* Hero CTA */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform 160ms, background 160ms, opacity 160ms;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(196,98,42,0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.10);
  color: var(--text-on-dark);
  border: 1px solid rgba(255,255,255,0.15);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.15);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

/* ============================================
   SECTION HEADERS (iOS-style accent bar)
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.section-header .accent-bar {
  width: 4px;
  height: 18px;
  border-radius: 2px;
  flex-shrink: 0;
}

.section-header h2 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.brand-keep {
  text-transform: none;
  letter-spacing: normal;
}

.accent-copper .accent-bar { background: var(--accent); }
.accent-copper h2 { color: var(--accent); }

.accent-teal .accent-bar { background: var(--level-teal); }
.accent-teal h2 { color: var(--level-teal); }

.accent-green .accent-bar { background: var(--level-green); }
.accent-green h2 { color: var(--level-green); }

.accent-calm .accent-bar { background: var(--calm); }
.accent-calm h2 { color: var(--calm); }

/* Dark variant */
.on-dark .section-header h2 { color: var(--text-on-dark-muted); }

/* ============================================
   FEATURES SECTION
   ============================================ */
.features-section {
  padding: 72px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 200ms, box-shadow 200ms;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(196,98,42,0.18);
}

.feature-card:hover .feature-icon svg {
  transform: scale(1.15);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 16px;
}

.hero-logo-img {
  width: min(520px, 78vw);
  height: auto;
  margin: 0 auto;
  animation: heroFloat 7s ease-in-out infinite;
  filter: drop-shadow(0 12px 32px rgba(196,98,42,0.25));
}

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

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================
   HOW IT WORKS
   ============================================ */
.how-section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px 32px;
  counter-reset: step;
}

@media (min-width: 1024px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--hero-bg);
  color: var(--accent);
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 0 0 0 rgba(196,98,42,0.3);
  transition: box-shadow 250ms, transform 250ms;
}

.step:hover .step-number {
  box-shadow: 0 0 0 6px rgba(196,98,42,0.15);
  transform: scale(1.08);
}

.step h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Step connector line */
@media (min-width: 768px) {
  .steps { position: relative; }
  .step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 24px;
    left: calc(50% + 32px);
    width: calc(100% - 64px);
    height: 2px;
    background: var(--border);
  }
}

/* ============================================
   CTA SECTION (dark)
   ============================================ */
.cta-section {
  background: var(--hero-bg);
  background-image: radial-gradient(ellipse 70% 80% at 50% 100%, rgba(196,98,42,0.10) 0%, transparent 70%);
  padding: 64px 0;
  text-align: center;
}

.cta-section h2 {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 800;
  color: var(--text-on-dark);
  margin-bottom: 12px;
}

.cta-section p {
  color: var(--text-on-dark-muted);
  margin-bottom: 28px;
  font-size: 16px;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--hero-bg);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 32px 0;
}

.footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: var(--text-on-dark-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 200ms;
}

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

.footer-info {
  color: var(--text-on-dark-muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.footer-info .sep { opacity: 0.4; }

.footer-info a {
  color: var(--text-on-dark-muted);
  transition: color 200ms;
}

.footer-info a:hover { color: var(--text-on-dark); }

.footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-social a {
  color: var(--text-on-dark-muted);
  transition: color 200ms;
  display: flex;
  align-items: center;
}

.footer-social a:hover { color: var(--text-on-dark); }

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@media (max-width: 640px) {
  .footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   PAGE HEADER (for subpages)
   ============================================ */
.page-header {
  background: var(--hero-bg);
  background-image: radial-gradient(ellipse 60% 80% at 0% 50%, rgba(196,98,42,0.10) 0%, transparent 70%);
  padding: 48px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.page-header h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--text-on-dark);
  text-transform: lowercase;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-on-dark-muted);
  font-size: 16px;
  max-width: 560px;
}

/* ============================================
   CONTENT SECTIONS (privacy, support, disclaimer)
   ============================================ */
.content-section {
  padding: 48px 0;
}

.content-section .container {
  max-width: 720px;
}

.content-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.content-card h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.content-card p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 10px;
}

.content-card p:last-child { margin-bottom: 0; }

.content-card ul {
  padding-left: 0;
  margin: 0;
}

.content-card li {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
  padding: 6px 0 6px 20px;
  position: relative;
}

.content-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-highlight);
}

.content-card a:not(.btn-testflight-outline):not(.btn-testflight) {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}

.content-card a:not(.btn-testflight-outline):not(.btn-testflight):hover {
  border-bottom-color: var(--accent);
}

.content-card .note {
  color: var(--text-muted);
  font-size: 13px;
}

.content-card strong {
  color: var(--text);
  font-weight: 650;
}

/* ============================================
   SUBSTANCE CARDS
   ============================================ */
.substance-intro {
  max-width: 640px;
  margin-bottom: 32px;
}

.substance-intro p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.disclaimer-banner {
  background: rgba(196,98,42,0.08);
  border: 1px solid rgba(196,98,42,0.20);
  border-radius: var(--card-radius);
  padding: 16px 20px;
  margin-bottom: 32px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.disclaimer-banner .icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.disclaimer-banner p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

/* Category filters */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.category-chip {
  padding: 8px 16px;
  border-radius: var(--chip-radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: opacity 200ms, transform 160ms, border-color 200ms;
  color: #fff;
}

.category-chip:hover { transform: translateY(-1px); }
.category-chip.active { border-color: var(--text); }
.category-chip.dimmed { opacity: 0.35; }

.chip-all { background: var(--hero-bg); color: var(--text-on-dark); }
.chip-alcohol { background: var(--cat-alcohol); color: #1C1208; }
.chip-stimulant { background: var(--cat-stimulant); }
.chip-depressant { background: var(--cat-depressant); color: #1C1208; }
.chip-psychedelic { background: var(--cat-psychedelic); }
.chip-dissociative { background: var(--cat-dissociative); }
.chip-entactogen { background: var(--cat-entactogen); }
.chip-opioid { background: var(--cat-opioid); }
.chip-cannabinoid { background: var(--cat-cannabinoid); color: #1C1208; }

/* Substance grid */
.substance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.substance-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 200ms, box-shadow 200ms;
}

.substance-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(196,98,42,0.15);
}

.substance-card-header {
  padding: 20px 20px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
}

.substance-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.substance-card-header h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 2px;
}

.substance-card-header .short-name {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.substance-card-header .category-label {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

.substance-description {
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.substance-details {
  display: none;
  border-top: 1px solid var(--border);
  padding: 16px 20px 20px;
}

.substance-card.expanded .substance-details {
  display: block;
}

.substance-card.expanded .expand-icon {
  transform: rotate(180deg);
}

.expand-icon {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 14px;
  transition: transform 200ms;
  flex-shrink: 0;
  align-self: center;
}

.detail-group {
  margin-bottom: 16px;
}

.detail-group:last-child { margin-bottom: 0; }

.detail-group h4 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}

.detail-row .label { color: var(--text-secondary); }
.detail-row .value { font-weight: 600; color: var(--text); }

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tag {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(28,18,8,0.05);
  color: var(--text-secondary);
}

.risk-list, .safer-list {
  padding-left: 0;
}

.risk-list li, .safer-list li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 3px 0 3px 18px;
  position: relative;
}

.risk-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--level-magenta);
}

.safer-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--level-green);
}

/* ============================================
   DISCLAIMER PAGE
   ============================================ */
.disclaimer-block {
  margin-bottom: 8px;
}

.disclaimer-block p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }

.hidden { display: none !important; }

/* ============================================
   BETA SIGNUP FORM
   ============================================ */
.beta-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
}

.form-group .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -2px;
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(28,18,8,0.15);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 200ms, box-shadow 200ms;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196,98,42,0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239E8B7C' fill='none' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-required::after {
  content: " *";
  color: var(--accent);
}

/* TestFlight CTA */
.btn-testflight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  text-decoration: none;
  color: var(--text-on-dark);
  background: var(--hero-bg);
  transition: opacity 200ms;
}
.btn-testflight:hover {
  opacity: 0.85;
}
.btn-testflight:active {
  opacity: 0.7;
}
.btn-testflight-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  text-decoration: none;
  color: var(--hero-bg);
  background: #fff;
  border: 2px solid var(--hero-bg);
  transition: opacity 200ms;
}
.btn-testflight-outline:hover { opacity: 0.75; }
.btn-testflight-outline:active { opacity: 0.6; }

.install-steps { margin-top: 32px; }
.install-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.install-step:last-child { margin-bottom: 0; }
.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--hero-bg);
  color: var(--text-on-dark);
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-content { flex: 1; }
.step-content h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.step-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.step-content p:last-child { margin-bottom: 0; }

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background 160ms, transform 160ms;
  margin-top: 4px;
}

.btn-submit:hover { background: var(--accent-hover); }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-success {
  display: none;
  text-align: center;
  padding: 32px 20px;
}

.form-success.show { display: block; }

.form-success .check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--level-green);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.form-success h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-success p {
  color: var(--text-secondary);
  font-size: 15px;
}

.form-error {
  display: none;
  background: rgba(168,59,86,0.08);
  border: 1px solid rgba(168,59,86,0.20);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--level-magenta);
}

.form-error.show { display: block; }

/* ============================================
   LEVEL SCALE CARD
   ============================================ */
.level-scale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}

.level-scale-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 5px 0;
}

.level-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.level-num {
  font-weight: 800;
  color: var(--text);
  min-width: 18px;
}

/* ============================================
   OVERVIEW GRID
   ============================================ */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.overview-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.overview-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 10px;
}

.overview-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.overview-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Category pills */
.overview-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
  color: #fff;
}

/* ============================================
   DEEP DIVE ACCORDION
   ============================================ */
.deep-dive-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
}

.dd-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 150ms;
}

.dd-header:hover {
  background: rgba(28,18,8,0.02);
}

.dd-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.dd-title {
  flex: 1;
  min-width: 0;
}

.dd-title h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1px;
}

.dd-title p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.dd-chevron {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 200ms;
}

.deep-dive-card.open .dd-chevron {
  transform: rotate(180deg);
}

.dd-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
}

.deep-dive-card.open .dd-body {
  display: block;
  padding-top: 16px;
}

.dd-body p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
}

.dd-body p:last-child { margin-bottom: 0; }

.dd-body ul {
  padding-left: 0;
  margin: 0 0 10px;
}

.dd-body ul:last-child { margin-bottom: 0; }

.dd-body li {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  padding: 3px 0 3px 18px;
  position: relative;
}

.dd-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-highlight);
}

.dd-body li strong {
  color: var(--text);
  font-weight: 650;
}

.dd-body a {
  color: var(--accent);
  font-weight: 600;
}

.dd-numbered {
  padding-left: 0;
  counter-reset: dd-step;
  list-style: none;
}

.dd-numbered li {
  counter-increment: dd-step;
  padding-left: 24px;
}

.dd-numbered li::before {
  content: counter(dd-step) ".";
  position: absolute;
  left: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  top: 3px;
}

/* ============================================
   VERSION BADGE
   ============================================ */
.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(196,98,42,0.15);
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  border: 1px solid rgba(196,98,42,0.25);
}

.version-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

/* ============================================
   ACTIVE NAV LINK
   ============================================ */
.navbar-nav a.active {
  color: var(--text-on-dark);
  background: rgba(255,255,255,0.10);
}

/* ============================================
   MOBILE NAV ANIMATION
   ============================================ */
@media (max-width: 640px) {
  .navbar-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease, padding 300ms ease;
    display: flex;
    padding-top: 0;
    padding-bottom: 0;
  }
  .navbar-nav.open {
    max-height: 300px;
    padding-top: 8px;
    padding-bottom: 16px;
  }
}

/* ============================================
   FEATURE ICON SVG
   ============================================ */
.feature-icon svg {
  width: 22px;
  height: 22px;
  transition: transform 200ms ease;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================
   MOBILE ADJUSTMENTS
   ============================================ */
@media (max-width: 480px) {
  .hero { padding: 40px 0 50px; }
  .features-section, .how-section { padding: 48px 0; }
  .cta-section { padding: 48px 0; }
  .substance-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .level-segment { width: 22px; height: 6px; }
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
}

.reveal.revealed {
  animation: fadeSlideUp 500ms ease forwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}

/* ============================================
   HERO STATS ROW
   ============================================ */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  justify-content: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.hero-stat-num {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.hero-stat-label {
  font-size: 11px;
  color: var(--text-on-dark-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 600;
}

/* ============================================
   FEATURE CARD ACCENT BORDER
   ============================================ */
.feature-card {
  border-top: 3px solid transparent;
  transition: transform 200ms, box-shadow 200ms, border-color 250ms;
}

.feature-card:hover {
  border-top-color: var(--card-accent, var(--accent));
}

/* ============================================
   STEP CONNECTOR GRADIENT
   ============================================ */
@media (min-width: 768px) {
  .step:not(:last-child)::after {
    background: linear-gradient(90deg, rgba(196,98,42,0.4) 0%, rgba(196,98,42,0.05) 100%);
  }
}

/* ============================================
   SUBSTANCE COUNT BADGE
   ============================================ */
.substance-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
  letter-spacing: 0.3px;
}

/* ============================================
   LEVEL BAR VISUALIZATION (guide.html)
   ============================================ */
.level-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.level-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.level-bar-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  min-width: 20px;
  text-align: right;
}

.level-bar-track {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: rgba(28,18,8,0.06);
  overflow: hidden;
}

.level-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 600ms cubic-bezier(0.34, 1.12, 0.64, 1);
}

.level-bar-name {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 52px;
  font-weight: 500;
}

/* ============================================
   TESTFLIGHT STEP CONNECTOR
   ============================================ */
.step-flow-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0 4px;
  color: var(--accent);
  opacity: 0.55;
}

.step-flow-connector svg {
  width: 20px;
  height: 20px;
}

.step-flow-connector span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ============================================
   SUPPORT CATEGORY CARDS
   ============================================ */
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.support-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 200ms, box-shadow 200ms, border-color 200ms;
  border-top: 3px solid transparent;
}

.support-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-top-color: var(--card-accent, var(--accent));
}

.support-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.support-icon svg {
  width: 22px;
  height: 22px;
}

.support-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.support-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.email-cta-card {
  background: var(--hero-bg);
  background-image: radial-gradient(ellipse 70% 80% at 100% 50%, rgba(196,98,42,0.12) 0%, transparent 70%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--card-radius);
  padding: 28px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.email-cta-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-on-dark);
  margin-bottom: 4px;
}

.email-cta-card p {
  font-size: 14px;
  color: var(--text-on-dark-muted);
  line-height: 1.5;
  margin: 0;
  max-width: 420px;
}

.email-cta-card .btn-primary {
  flex-shrink: 0;
  white-space: nowrap;
}
