/* wrapper-proof */
/* Journalr.com — playful doodle theme with Jotto mascot */

:root {
  --bg: #fff4e6;
  --bg-alt: #ffe8d1;
  --ink: #2b3a67;
  --ink-soft: #4a5a87;
  --sunshine: #ffd93d;
  --coral: #ff6b6b;
  --mint: #95e1d3;
  --lavender: #c8b6ff;
  --paper: #fffaf2;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --radius: 18px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 700; }
h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; }
h3 { font-size: 1.35rem; font-weight: 600; }

a { color: inherit; text-decoration: none; }

em { font-style: italic; color: var(--coral); }

/* Background doodles */
.bg-doodles { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.drift { position: absolute; width: 40px; height: 40px; opacity: 0.5; animation: drift 20s linear infinite; }
.drift-1 { top: 10%; left: 5%; animation-duration: 25s; }
.drift-2 { top: 25%; right: 8%; animation-duration: 30s; animation-delay: -5s; }
.drift-3 { top: 55%; left: 3%; animation-duration: 22s; animation-delay: -10s; }
.drift-4 { top: 75%; right: 5%; animation-duration: 28s; animation-delay: -7s; }
.drift-5 { top: 40%; right: 15%; animation-duration: 35s; animation-delay: -15s; }

@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(20px, -30px) rotate(90deg); }
  50%  { transform: translate(-15px, 20px) rotate(180deg); }
  75%  { transform: translate(25px, 15px) rotate(270deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}

/* Jotto animations */
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-8px) rotate(1deg); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-2deg) scale(1); }
  50%      { transform: rotate(2deg) scale(1.05); }
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(255, 244, 230, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.4rem;
}

.brand-jotto {
  width: 36px;
  height: 44px;
  animation: bob 4s ease-in-out infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
}

.nav-links a {
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:not(.btn):hover { color: var(--coral); }

.nav-signin { color: var(--ink-soft); }

.hamburger {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--ink);
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}

.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.btn-primary { background: var(--coral); color: #fff; }
.btn-ghost   { background: var(--paper); color: var(--ink); }
.btn-sm      { padding: 0.55rem 1.1rem; font-size: 0.9rem; box-shadow: 3px 3px 0 var(--ink); }
.btn-lg      { padding: 1.1rem 2.2rem; font-size: 1.15rem; }
.btn-block   { width: 100%; }

/* HERO */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 5rem 2.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-text h1 { margin-bottom: 1.5rem; }
.squiggle-wrap { position: relative; display: inline-block; }
.squiggle {
  position: absolute;
  left: 0;
  bottom: -14px;
  width: 100%;
  height: 16px;
}

.lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin-bottom: 2rem;
  max-width: 500px;
}

.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }

.hero-note { color: var(--ink-soft); font-size: 0.95rem; }
.tick { color: var(--mint); font-weight: 700; }

.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 340px;
}

.hero-jotto {
  width: 240px;
  height: 280px;
  animation: bob 4s ease-in-out infinite;
}

.speech-bubble {
  position: absolute;
  top: 10%;
  right: 5%;
  width: 200px;
  transform: rotate(4deg);
}
.bubble-svg { width: 100%; display: block; }
.bubble-text {
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  font-family: 'Caveat', cursive;
  font-size: 1.25rem;
  color: var(--ink);
  text-align: center;
}

/* Dividers */
.divider {
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
}

/* Sections */
.section {
  position: relative;
  z-index: 1;
  padding: 5rem 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-alt {
  max-width: none;
  background: var(--bg-alt);
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}
.section-alt > * { max-width: 1200px; margin-left: auto; margin-right: auto; }

.section-head { text-align: center; margin-bottom: 3.5rem; }

.eyebrow {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  color: var(--coral);
  margin-bottom: 0.5rem;
}

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  color: var(--accent, var(--ink));
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card h3, .feature-card p { color: var(--ink); }
.feature-card p { color: var(--ink-soft); margin-top: 0.5rem; }

.feature-card:hover {
  transform: translate(-3px, -3px) rotate(0deg) !important;
  box-shadow: var(--shadow-lg);
}

.feature-doodle { width: 56px; height: 56px; margin-bottom: 1rem; }

.tilt-l { transform: rotate(-1deg); }
.tilt-r { transform: rotate(1deg); }

/* How it works */
.steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 1rem;
  align-items: start;
}
.step {
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
}
.step-num {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sunshine);
  border: 3px solid var(--ink);
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-jotto { width: 130px; height: 130px; margin: 0.5rem auto 1rem; display: block; }
.step h3 { margin-bottom: 0.5rem; }
.step p { color: var(--ink-soft); }

.step-arrow {
  width: 80px;
  height: 40px;
  align-self: center;
  margin-top: 80px;
}

/* Testimonials */
.testi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.testi {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  position: relative;
}
.testi.featured { background: var(--mint); }
.testi-jotto {
  position: absolute;
  top: -25px;
  right: 15px;
  width: 60px;
  height: 75px;
  transform: rotate(12deg);
}
.stars { color: var(--coral); font-size: 1.2rem; margin-bottom: 0.75rem; letter-spacing: 2px; }
.testi p { font-size: 1.05rem; margin-bottom: 1.25rem; }
.testi-author { display: flex; align-items: center; gap: 0.75rem; }
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--ink);
}
.testi-author span { display: block; font-size: 0.85rem; color: var(--ink-soft); }

/* Pricing */
.billing-toggle {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.billing-label {
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.2s;
}
.billing-label.active { color: var(--ink); }
.billing-label em { font-family: 'Caveat', cursive; color: var(--coral); font-size: 1.05rem; margin-left: 0.25rem; }

.toggle {
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: var(--paper);
  border: 3px solid var(--ink);
  position: relative;
  cursor: pointer;
  padding: 0;
}
.toggle-dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--coral);
  transition: left 0.2s;
}
.toggle.on .toggle-dot { left: 28px; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 2rem;
  align-items: start;
}

.price-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 2.25rem 1.75rem;
  box-shadow: var(--shadow);
  position: relative;
}
.price-card.featured {
  background: var(--sunshine);
  transform: rotate(0deg) scale(1.03);
  box-shadow: var(--shadow-lg);
}
.price-card h3 { margin-bottom: 0.75rem; }
.price { display: flex; align-items: baseline; gap: 0.35rem; margin-bottom: 0.5rem; }
.amount { font-family: 'Fraunces', serif; font-size: 2.5rem; font-weight: 700; }
.per { color: var(--ink-soft); }
.price-desc { color: var(--ink-soft); margin-bottom: 1.5rem; }
.price-card ul { list-style: none; margin-bottom: 1.75rem; }
.price-card li { padding: 0.4rem 0; border-bottom: 1px dashed rgba(43, 58, 103, 0.2); }
.price-card li:last-child { border-bottom: none; }

.crown-jotto {
  position: absolute;
  top: -55px;
  right: 15px;
  width: 80px;
  height: 110px;
  transform: rotate(8deg);
  animation: bob 4s ease-in-out infinite;
}

.badge {
  position: absolute;
  top: -14px;
  left: 20px;
  background: var(--coral);
  color: #fff;
  padding: 0.3rem 0.9rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  transform: rotate(-3deg);
}

/* FAQ */
.faq-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  text-align: left;
}
.faq-jotto { width: 100px; height: 120px; flex-shrink: 0; }

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.faq-item {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.faq-item summary {
  padding: 1.15rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item:hover summary { background: var(--bg-alt); }
.plus {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sunshine);
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.faq-item[open] .plus { transform: rotate(45deg); background: var(--coral); color: #fff; }
.faq-body {
  padding: 0 1.5rem 1.25rem;
  color: var(--ink-soft);
}

/* Final CTA */
.cta-section {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 5rem 2.5rem;
  max-width: 700px;
  margin: 0 auto;
}
.cta-jotto {
  width: 160px;
  height: 160px;
  margin: 0 auto 1rem;
  animation: bob 3s ease-in-out infinite;
}
.cta-section h2 { margin-bottom: 1rem; }
.cta-section p { color: var(--ink-soft); font-size: 1.15rem; margin-bottom: 2rem; }
.cta-section .btn { margin-bottom: 1rem; }
.book { display: inline-block; animation: bob 3s ease-in-out infinite; }

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  background: var(--ink);
  color: #fff4e6;
  padding: 4rem 2.5rem 2rem;
  margin-top: 3rem;
}
.footer-main {
  max-width: 1200px;
  margin: 0 auto 2.5rem;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
}
.footer-brand { display: flex; flex-direction: column; gap: 0.75rem; }
.sleep-jotto { width: 110px; height: 90px; }
.footer-tag { font-family: 'Caveat', cursive; font-size: 1.3rem; color: var(--sunshine); }

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.footer-cols h4 { font-family: 'Inter', sans-serif; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1rem; color: var(--sunshine); }
.footer-cols ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-cols a { opacity: 0.8; transition: opacity 0.2s, color 0.2s; }
.footer-cols a:hover { opacity: 1; color: var(--coral); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px dashed rgba(255, 244, 230, 0.3);
  font-size: 0.9rem;
  opacity: 0.75;
  text-align: center;
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s, transform 0.7s; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Confetti pieces */
.confetti-piece {
  position: fixed;
  width: 16px;
  height: 16px;
  pointer-events: none;
  z-index: 999;
}

/* Responsive */
@media (max-width: 860px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 2rem;
    gap: 0.5rem;
    background: var(--bg);
    border-bottom: 3px solid var(--ink);
  }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }

  .hero { grid-template-columns: 1fr; text-align: center; padding: 3rem 1.25rem; }
  .hero-ctas { justify-content: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .speech-bubble { display: none; }

  .section, .cta-section { padding: 3.5rem 1.25rem; }
  .section-alt { padding-left: 1.25rem; padding-right: 1.25rem; }

  .steps { grid-template-columns: 1fr; }
  .step-arrow { transform: rotate(90deg); margin: 0 auto; }

  .faq-head { flex-direction: column; text-align: center; gap: 1rem; }

  .footer-main { grid-template-columns: 1fr; gap: 2rem; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}
