/* ============================================================
   Solvaya — Concept E: The Roast
   Design System & Personality Styles
   ============================================================ */

/* -------- CSS Custom Properties -------- */
:root {
  /* Dark mode (default) */
  --color-bg: #1A0E1F;
  --color-surface: #2D1B35;
  --color-surface-alt: #3A2545;
  --color-accent: #FF6B6B;
  --color-accent-hover: #FF5252;
  --color-secondary: #FFD93D;
  --color-secondary-hover: #FFC107;
  --color-success: #4ECDC4;
  --color-text: #F8F5F0;
  --color-text-muted: #B8B0C8;
  --color-text-dim: #8A7FA0;
  --color-border: #3D2A48;
  --color-highlight: rgba(255, 107, 107, 0.15);
  --color-highlight-yellow: rgba(255, 217, 61, 0.25);

  /* Spacing */
  --section-pad: clamp(4rem, 10vw, 8rem);
  --container-max: 1200px;
  --container-narrow: 800px;
}

.light {
  --color-bg: #FFFBF5;
  --color-surface: #FFF0E6;
  --color-surface-alt: #FFE8D6;
  --color-accent: #FF6B6B;
  --color-accent-hover: #FF5252;
  --color-secondary: #FFD93D;
  --color-secondary-hover: #FFC107;
  --color-success: #4ECDC4;
  --color-text: #2D1B35;
  --color-text-muted: #6B5B7B;
  --color-text-dim: #9A8AAA;
  --color-border: #E8D5C8;
  --color-highlight: rgba(255, 107, 107, 0.1);
  --color-highlight-yellow: rgba(255, 217, 61, 0.3);
}

/* -------- Base -------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* -------- Typography -------- */
.font-display {
  font-family: 'Fredoka One', 'Bangers', cursive;
  letter-spacing: 0.01em;
}

.font-hand {
  font-family: 'Caveat', 'Patrick Hand', cursive;
}

/* Highlighter effect */
.highlight-yellow {
  background: linear-gradient(180deg, transparent 60%, var(--color-highlight-yellow) 60%);
  display: inline;
  padding: 0 0.15em;
}

.highlight-coral {
  background: linear-gradient(180deg, transparent 60%, var(--color-highlight) 60%);
  display: inline;
  padding: 0 0.15em;
}

/* Underline swoosh */
.underline-swoosh {
  text-decoration: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='8'%3E%3Cpath d='M0 6 Q25 0 50 6 T100 6' fill='none' stroke='%23FF6B6B' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: bottom -2px center;
  background-size: 100% 8px;
  padding-bottom: 4px;
}

/* -------- Doodle SVG elements -------- */
.doodle-star {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
}

.doodle-arrow {
  display: inline-block;
  width: 2em;
  height: 1em;
}

/* -------- Speech Bubble -------- */
.speech-bubble {
  position: relative;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 1rem;
  padding: 1.25rem;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
}

.speech-bubble--left::after {
  left: -16px;
  top: 20px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 16px solid var(--color-surface);
  filter: drop-shadow(-1px 0 0 var(--color-border));
}

.speech-bubble--right::after {
  right: -16px;
  top: 20px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid var(--color-surface);
  filter: drop-shadow(1px 0 0 var(--color-border));
}

/* -------- Sticky Note -------- */
.sticky-note {
  background: var(--color-secondary);
  color: #2D1B35;
  padding: 1.25rem;
  border-radius: 2px;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.15),
    0 1px 2px rgba(0,0,0,0.1);
  transform: rotate(-1deg);
  position: relative;
}

.sticky-note:nth-child(even) {
  transform: rotate(1.5deg);
}

.sticky-note:nth-child(3n) {
  transform: rotate(-0.5deg);
}

.sticky-note::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 10px;
  background: rgba(0,0,0,0.05);
  border-radius: 0 0 50% 50%;
}

.sticky-note.dark-sticky {
  background: var(--color-surface-alt);
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

/* -------- Torn Paper Edge -------- */
.torn-edge {
  position: relative;
}

.torn-edge::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 20px;
  background:
    radial-gradient(6px at 10% 100%, transparent 50%, var(--color-bg) 50%),
    radial-gradient(8px at 20% 100%, var(--color-bg) 50%, transparent 50%),
    radial-gradient(5px at 35% 100%, transparent 50%, var(--color-bg) 50%),
    radial-gradient(7px at 50% 100%, var(--color-bg) 50%, transparent 50%),
    radial-gradient(6px at 65% 100%, transparent 50%, var(--color-bg) 50%),
    radial-gradient(9px at 80% 100%, var(--color-bg) 50%, transparent 50%),
    radial-gradient(5px at 92% 100%, transparent 50%, var(--color-bg) 50%);
  background-size: 100% 20px;
}

/* -------- Warning Banner -------- */
.warning-banner {
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 107, 107, 0.08),
    rgba(255, 107, 107, 0.08) 20px,
    rgba(255, 107, 107, 0.15) 20px,
    rgba(255, 107, 107, 0.15) 40px
  );
  border-left: 4px solid var(--color-accent);
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1.25rem;
}

/* -------- Hand-drawn border -------- */
.border-doodle {
  border: 3px solid var(--color-border);
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
}

/* -------- Button styles -------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: var(--color-accent);
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 1.125rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 14px rgba(255, 107, 107, 0.35);
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.45);
  background: var(--color-accent-hover);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: transparent;
  color: var(--color-accent);
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  border-radius: 999px;
  border: 2px solid var(--color-accent);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: var(--color-highlight);
}

/* -------- Roast Cards (sticky stacking) -------- */
.roast-card {
  position: sticky;
  top: 80px;
  min-height: 200px;
  display: flex;
  align-items: center;
  z-index: 1;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.roast-card:nth-child(1) { z-index: 5; }
.roast-card:nth-child(2) { z-index: 4; }
.roast-card:nth-child(3) { z-index: 3; }
.roast-card:nth-child(4) { z-index: 2; }
.roast-card:nth-child(5) { z-index: 1; }

/* -------- Accordion -------- */
.accordion-item {
  border: 2px solid var(--color-border);
  border-radius: 1rem;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.accordion-item.active {
  border-color: var(--color-accent);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  border: none;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s ease;
}

.accordion-trigger:hover {
  background: var(--color-surface-alt);
}

.accordion-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(45deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.accordion-item.active .accordion-content {
  max-height: 600px;
}

.accordion-body {
  padding: 0 1.5rem 1.5rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* -------- Price toggle -------- */
.toggle-track {
  position: relative;
  width: 56px;
  height: 28px;
  background: var(--color-border);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle-track.active {
  background: var(--color-accent);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.toggle-track.active .toggle-thumb {
  transform: translateX(28px);
}

/* -------- Bounce-in animation -------- */
@keyframes bounceIn {
  0% { opacity: 0; transform: translateY(30px) scale(0.96); }
  50% { opacity: 1; transform: translateY(-4px) scale(1.02); }
  70% { transform: translateY(2px) scale(0.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 107, 107, 0.3); }
  50% { box-shadow: 0 0 20px rgba(255, 107, 107, 0.6); }
}

.bounce-in {
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.wiggle-hover:hover {
  animation: wiggle 0.4s ease;
}

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

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* -------- Scroll-triggered fade-up (reveal) -------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* -------- Hero bar chart -------- */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  height: 240px;
  padding: 0 1rem;
}

.bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  border-radius: 8px 8px 0 0;
  transition: height 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  min-width: 80px;
}

.bar-label {
  position: absolute;
  bottom: -2rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.bar-value {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
}

/* -------- Comparison bar (pricing page) -------- */
.compare-bar {
  position: relative;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
}

.compare-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 1s ease;
}

/* -------- Custom scrollbar -------- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-dim);
}

/* -------- Mobile nav -------- */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--color-surface);
  border-left: 2px solid var(--color-border);
  padding: 5rem 1.5rem 2rem;
  transition: right 0.3s ease;
  z-index: 50;
}

.mobile-nav.open {
  right: 0;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 49;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* -------- Torn edge section divider (SVG) -------- */
.section-divider {
  display: block;
  width: 100%;
  height: 40px;
  fill: var(--color-bg);
}

/* -------- Contact form -------- */
.form-field {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 0.75rem;
  color: var(--color-text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
  outline: none;
}

.form-field:focus {
  border-color: var(--color-accent);
}

.form-field::placeholder {
  color: var(--color-text-dim);
  font-style: italic;
}

select.form-field {
  appearance: none;
  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' fill='none' stroke='%23B8B0C8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

textarea.form-field {
  min-height: 150px;
  resize: vertical;
}

/* -------- Page transition overlay -------- */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.page-transition.active {
  opacity: 1;
}

/* -------- Active nav link -------- */
.nav-link {
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* -------- Success state -------- */
.success-state {
  text-align: center;
  padding: 3rem 2rem;
}

.success-state .checkmark {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background: var(--color-success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------- Responsive tweaks -------- */
@media (max-width: 640px) {
  .bar-chart {
    height: 180px;
    gap: 0.75rem;
  }

  .bar {
    min-width: 60px;
  }

  .roast-card {
    top: 60px;
    min-height: 160px;
  }
}

/* -------- Print -------- */
@media print {
  .no-print { display: none !important; }
}
