/* ==========================================================================
   Solvaya Concept E: The Roast
   Personality-driven styles
   ========================================================================== */

/* -- Google Fonts Import -- */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Inter:ital,opsz,wght@0,14..32,400..700;1,14..32,400..700&display=swap');

/* -- CSS Custom Properties (Theme Tokens) -- */
:root {
  /* Light mode palette */
  --color-bg: #FFFBF5;
  --color-surface: #FFF0E6;
  --color-surface-alt: #FFF5ED;
  --color-accent: #FF6B6B;
  --color-accent-hover: #E55A5A;
  --color-secondary: #FFD93D;
  --color-secondary-soft: #FFF3B0;
  --color-success: #4ECDC4;
  --color-text: #2D1B35;
  --color-text-muted: #6B5E78;
  --color-text-inverse: #F8F5F0;
  --color-border: #E8DDD4;
  --color-highlight: rgba(255, 217, 61, 0.35);
  --color-pink-underline: rgba(255, 107, 107, 0.3);
  --color-card-bg: #FFFFFF;
  --color-sticky-note: #FFF9E6;
  --color-speech-bubble: #FFFBF5;
  --color-torn-paper: #FFFBF5;
  --color-ota-bg: #FFF5F5;
  --color-surface-dark: #3D2B48;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(45, 27, 53, 0.08);
  --shadow-md: 0 4px 12px rgba(45, 27, 53, 0.1);
  --shadow-lg: 0 8px 30px rgba(45, 27, 53, 0.12);
  --shadow-sticky: 2px 3px 10px rgba(45, 27, 53, 0.15);
}

/* Dark mode overrides */
.dark {
  --color-bg: #1A0E1F;
  --color-surface: #2D1B35;
  --color-surface-alt: #26182E;
  --color-accent: #FF8A65;
  --color-accent-hover: #FF7043;
  --color-secondary: #FFD93D;
  --color-secondary-soft: #3D3520;
  --color-success: #4ECDC4;
  --color-text: #F8F5F0;
  --color-text-muted: #B8B0C8;
  --color-text-inverse: #2D1B35;
  --color-border: #3D2B48;
  --color-highlight: rgba(255, 217, 61, 0.2);
  --color-pink-underline: rgba(255, 138, 101, 0.3);
  --color-card-bg: #2D1B35;
  --color-sticky-note: #2D2018;
  --color-speech-bubble: #2D1B35;
  --color-torn-paper: #2D1B35;
  --color-ota-bg: #2D1B28;
  --color-surface-dark: #3D2B48;
}

/* -- Base Reset & Typography -- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: background-color var(--transition-slow), color var(--transition-slow);
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }

/* -- Font Families -- */
.font-display {
  font-family: 'Fredoka', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.font-body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* -- Headline Highlight Effect -- */
.highlight {
  background-image: linear-gradient(120deg, var(--color-highlight) 0%, var(--color-highlight) 100%);
  background-repeat: no-repeat;
  background-size: 100% 0.35em;
  background-position: 0 85%;
  transition: background-size var(--transition-normal);
}
.highlight:hover {
  background-size: 100% 70%;
}

.highlight-pink {
  background-image: linear-gradient(120deg, var(--color-pink-underline) 0%, var(--color-pink-underline) 100%);
  background-repeat: no-repeat;
  background-size: 100% 0.15em;
  background-position: 0 95%;
  transition: background-size var(--transition-normal);
}
.highlight-pink:hover {
  background-size: 100% 50%;
}

/* -- Navigation -- */
.nav-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
}
.nav-scrolled {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.nav-link {
  position: relative;
  transition: color var(--transition-fast);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  border-radius: 2px;
  transition: width var(--transition-normal);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* -- Buttons -- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background-color: var(--color-accent);
  color: white;
  font-family: 'Fredoka', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
  border: none;
  border-radius: 1rem 0.5rem 1rem 0.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}
.btn-primary:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px) rotate(-1deg);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}
.btn-primary:active {
  transform: translateY(0) rotate(0deg);
}

.dark .btn-primary {
  box-shadow: 0 4px 15px rgba(255, 138, 101, 0.3);
}
.dark .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(255, 138, 101, 0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background-color: var(--color-surface);
  color: var(--color-text);
  font-family: 'Fredoka', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
  border: 2px solid var(--color-border);
  border-radius: 1rem 0.5rem 1rem 0.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
}
.btn-secondary:active {
  transform: translateY(0);
}

/* -- Sticky Note Style -- */
.sticky-note {
  background: var(--color-sticky-note);
  padding: 1.5rem;
  border-radius: 2px 16px 2px 16px;
  box-shadow: var(--shadow-sticky);
  position: relative;
  transform: rotate(-0.8deg);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.sticky-note:nth-child(odd) {
  transform: rotate(0.6deg);
}
.sticky-note:hover {
  transform: rotate(0deg) scale(1.02);
  box-shadow: var(--shadow-lg);
}
.sticky-note::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  width: 20px;
  height: 20px;
  background: var(--color-accent);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.15);
}

/* -- Speech Bubble -- */
.speech-bubble {
  background: var(--color-speech-bubble);
  border: 2px solid var(--color-border);
  border-radius: 1.5rem 1.5rem 1.5rem 0.25rem;
  padding: 1.25rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 2rem;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 14px solid var(--color-border);
}
.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -9px;
  left: calc(2rem + 2px);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 11px solid var(--color-speech-bubble);
  z-index: 2;
}

.speech-bubble-right {
  border-radius: 1.5rem 1.5rem 0.25rem 1.5rem;
}
.speech-bubble-right::after {
  left: auto;
  right: 2rem;
}
.speech-bubble-right::before {
  left: auto;
  right: calc(2rem + 2px);
}

/* -- Torn Paper Edge -- */
.torn-paper {
  position: relative;
  background: var(--color-torn-paper);
}
.torn-paper::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 40px;
  background: inherit;
  clip-path: polygon(
    0% 0%, 2% 25%, 5% 10%, 8% 30%, 12% 5%, 15% 25%, 18% 0%, 22% 35%, 25% 10%, 28% 25%, 32% 5%, 35% 30%, 38% 0%,
    42% 25%, 45% 10%, 48% 35%, 52% 0%, 55% 25%, 58% 5%, 62% 30%, 65% 10%, 68% 25%, 72% 0%, 75% 35%, 78% 10%,
    82% 25%, 85% 5%, 88% 30%, 92% 0%, 95% 25%, 98% 10%, 100% 35%
  );
}

/* -- OTA Warning Banner -- */
.ota-warning {
  background: var(--color-ota-bg);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 1rem 1rem 0;
  padding: 1.25rem 1.5rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.ota-warning::before {
  content: '!';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: var(--color-accent);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
}

/* -- Chat Bubble (for testimonials) -- */
.chat-bubble {
  background: var(--color-card-bg);
  border-radius: 1.25rem 1.25rem 1.25rem 0.25rem;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  max-width: 600px;
}
.chat-bubble::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 2rem;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 14px solid var(--color-card-bg);
}

.chat-bubble-right {
  border-radius: 1.25rem 1.25rem 0.25rem 1.25rem;
  margin-left: auto;
}
.chat-bubble-right::after {
  left: auto;
  right: 2rem;
}

/* -- Doodle Accents -- */
.doodle-arrow {
  display: inline-block;
  width: 40px;
  height: 40px;
  stroke: var(--color-accent);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.doodle-star {
  display: inline-block;
  stroke: var(--color-secondary);
  stroke-width: 2;
  fill: var(--color-secondary);
  fill-opacity: 0.3;
}

.doodle-squiggle {
  height: 8px;
  width: 100%;
  stroke: var(--color-accent);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  opacity: 0.6;
}

/* -- Price Tag -- */
.price-tag {
  display: inline-block;
  background: var(--color-accent);
  color: white;
  padding: 0.375rem 1rem;
  border-radius: 0.5rem 1rem 1rem 0.5rem;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  position: relative;
}
.price-tag::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 10px;
  background: var(--color-accent-hover);
  border-radius: 2px 0 0 2px;
}

/* -- Bar Chart (CSS Graph) -- */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 2rem;
  height: 200px;
  padding: 1rem 0;
}
.bar {
  width: 80px;
  border-radius: 8px 8px 2px 2px;
  position: relative;
  transition: height 1s ease-out;
}
.bar-label {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  font-family: 'Fredoka', sans-serif;
}
.bar-value {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
}

/* -- Accordion / FAQ -- */
.accordion-trigger {
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
}
.accordion-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}
.accordion-content.open {
  max-height: 1000px;
  opacity: 1;
}
.accordion-chevron {
  transition: transform var(--transition-normal);
}
.accordion-chevron.open {
  transform: rotate(180deg);
}

/* -- Pricing Card -- */
.pricing-card {
  background: var(--color-card-bg);
  border: 2px solid var(--color-accent);
  border-radius: 2rem 2rem 1rem 2rem;
  padding: 2.5rem;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 0 0 4px var(--color-bg), 0 0 0 6px var(--color-accent);
  position: relative;
  text-align: center;
}
.pricing-card::before {
  content: 'the plan';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-secondary);
  color: var(--color-text-inverse);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 1rem;
  border-radius: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* -- Form Styles -- */
.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--color-card-bg);
  border: 2px solid var(--color-border);
  border-radius: 0.75rem 0.75rem 0.75rem 0.25rem;
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  color: var(--color-text);
}
.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}
.dark .form-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 138, 101, 0.15);
}
.form-input::placeholder {
  color: var(--color-text-muted);
  font-style: italic;
}

.form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--color-card-bg);
  border: 2px solid var(--color-border);
  border-radius: 0.75rem 0.75rem 0.75rem 0.25rem;
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  color: var(--color-text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236B5E78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--color-card-bg);
  border: 2px solid var(--color-border);
  border-radius: 0.75rem 0.75rem 0.75rem 0.25rem;
  font-size: 1rem;
  resize: vertical;
  min-height: 140px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  color: var(--color-text);
  line-height: 1.6;
}
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}
.form-textarea::placeholder {
  color: var(--color-text-muted);
  font-style: italic;
}

/* -- Annual Toggle -- */
.toggle-track {
  width: 56px;
  height: 30px;
  background: var(--color-border);
  border-radius: 15px;
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}
.toggle-track.active {
  background: var(--color-success);
}
.toggle-thumb {
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.toggle-track.active .toggle-thumb {
  transform: translateX(26px);
}

/* -- Scroll Animations -- */
.animate-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-bounce-in {
  opacity: 0;
  transform: scale(0.85) translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.animate-bounce-in.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Stagger animation delays for stacked items */
.stagger-1 { transition-delay: 0ms; }
.stagger-2 { transition-delay: 100ms; }
.stagger-3 { transition-delay: 200ms; }
.stagger-4 { transition-delay: 300ms; }
.stagger-5 { transition-delay: 400ms; }

/* -- Roast Stack Effect -- */
.roast-card {
  position: sticky;
  top: 80px;
  margin-bottom: 0;
}
.roast-card + .roast-card {
  margin-top: 1rem;
}

/* -- Section Transitions -- */
.section-divider {
  height: 4px;
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--color-accent) 0px,
    var(--color-accent) 8px,
    transparent 8px,
    transparent 16px
  );
  opacity: 0.5;
}

/* -- Footer -- */
.footer-doodle {
  position: relative;
}
.footer-doodle::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--color-bg);
  clip-path: polygon(
    0% 100%, 0% 60%, 5% 30%, 10% 70%, 15% 20%, 20% 50%, 25% 35%, 30% 65%, 35% 25%, 40% 55%,
    45% 15%, 50% 40%, 55% 28%, 60% 60%, 65% 22%, 70% 48%, 75% 32%, 80% 55%, 85% 18%, 90% 45%,
    95% 30%, 100% 50%, 100% 100%
  );
}

/* -- Mobile Menu -- */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.mobile-menu.open {
  max-height: 400px;
}

/* -- Dark Mode Toggle (Sun/Moon) -- */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.theme-toggle:hover {
  border-color: var(--color-accent);
  transform: rotate(15deg);
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.5s ease, opacity 0.3s ease;
  position: absolute;
}
.theme-toggle .sun-icon { opacity: 0; transform: rotate(90deg) scale(0.5); }
.theme-toggle .moon-icon { opacity: 1; transform: rotate(0) scale(1); }
.dark .theme-toggle .sun-icon { opacity: 1; transform: rotate(0) scale(1); }
.dark .theme-toggle .moon-icon { opacity: 0; transform: rotate(-90deg) scale(0.5); }

/* -- Error / Success States -- */
.form-error {
  color: var(--color-accent);
  font-size: 0.825rem;
  margin-top: 0.25rem;
  font-weight: 500;
}
.form-success-message {
  text-align: center;
  padding: 3rem 2rem;
}
.form-success-message h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.75rem;
  color: var(--color-success);
  margin-bottom: 1rem;
}

/* -- Responsive Helpers -- */
@media (max-width: 640px) {
  .pricing-card {
    padding: 1.5rem;
    border-radius: 1.5rem 1.5rem 0.75rem 1.5rem;
  }
  .bar-chart {
    gap: 1rem;
    height: 160px;
  }
  .bar {
    width: 60px;
  }
  .btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
}

/* -- Scroll Progress Bar -- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-secondary));
  z-index: 100;
  transition: width 0.1s ease;
}

/* -- Hero Section Specific -- */
.hero-overline {
  display: inline-block;
  background: var(--color-secondary-soft);
  color: var(--color-text);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  letter-spacing: 0.02em;
}

/* -- Checkmark Bullet -- */
.check-bullet {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.check-bullet::before {
  content: '';
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  background: var(--color-success);
  border-radius: 6px 6px 6px 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
