/* =========================================================================
   Pinch — Website Design System
   Mirrors the app's DesignSystem.swift: same palette, Nunito type, springy feel.
   ========================================================================= */

/* ---- Fonts ---- */
@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/Nunito-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/Nunito-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/Nunito-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/Nunito-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

/* ---- Palette (from DesignSystem.swift) ---- */
:root {
  --cream:          #FAF7F2;
  --lavender:       #C9B8D8;
  --lavender-deep:  #7E6CA0;
  --lavender-light: #EDE6F5;
  --sage:           #8FAF7A;
  --sage-deep:      #578049;
  --sage-muted:     #D4E4CA;
  --den-bg:         #778064;
  --ink:            #2C2C2C;
  --ink-muted:      #6B6B6B;
  --white:          #FFFFFF;
  --danger:         #C77B6B;

  --radius:     16px;
  --radius-lg:  24px;
  --radius-xl:  32px;
  --shadow-card: 0 2px 4px rgba(44,44,44,0.06);
  --shadow-soft: 0 10px 30px rgba(44,44,44,0.08);
  --shadow-lift: 0 18px 50px rgba(44,44,44,0.12);

  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --maxw: 1120px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Nunito", -apple-system, system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---- Typography helpers ---- */
h1, h2, h3 { font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.eyebrow {
  display: inline-block;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lavender-deep);
  background: var(--lavender-light);
  padding: 7px 14px;
  border-radius: 999px;
}

/* ---- Layout ---- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.center { text-align: center; }

/* =========================================================================
   Buttons (PinchButtonStyle)
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  border: none;
  cursor: pointer;
  padding: 15px 26px;
  border-radius: var(--radius);
  transition: transform 0.25s var(--spring), box-shadow 0.25s ease, background 0.2s ease;
  will-change: transform;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--sage-deep);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(87,128,73,0.28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(87,128,73,0.34); }
.btn-secondary {
  background: var(--lavender-light);
  color: var(--ink);
}
.btn-secondary:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn-ghost { background: transparent; color: var(--ink-muted); box-shadow: none; }

/* =========================================================================
   Navbar
   ========================================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,247,242,0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(201,184,216,0.3);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.3rem; }
.brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: var(--shadow-card); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink-muted);
  padding: 9px 14px;
  border-radius: 11px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--ink); background: var(--lavender-light); }
.nav-links a.active { color: var(--sage-deep); }
.nav-links a.nav-cta { color: var(--white); margin-left: 6px; }
.nav-links a.nav-cta:hover { color: var(--white); background: var(--sage-deep); }
.nav-burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-burger span { display: block; width: 24px; height: 2.5px; background: var(--ink); border-radius: 2px; margin: 5px 0; transition: 0.3s; }

@media (max-width: 760px) {
  .nav-burger { display: block; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--cream);
    padding: 14px 18px 22px;
    border-bottom: 1px solid rgba(201,184,216,0.3);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: 0.25s var(--spring);
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 13px 14px; font-size: 1.05rem; }
  .nav-cta { margin: 6px 0 0; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero { position: relative; padding: 64px 0 40px; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  margin: 18px 0 18px;
}
.hero h1 .pop { color: var(--sage-deep); display: inline-block; }
.hero p.lead {
  font-size: 1.25rem;
  color: var(--ink-muted);
  font-weight: 600;
  max-width: 30ch;
  margin-bottom: 28px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-note { font-size: 0.9rem; color: var(--ink-muted); font-weight: 600; margin-top: 16px; }

/* Dragon stage — the den */
.den {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 120% at 50% 18%, #9aa886 0%, var(--den-bg) 60%, #5f6750 100%);
  box-shadow: var(--shadow-lift);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.den::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(60% 45% at 50% 100%, rgba(0,0,0,0.22), transparent 70%);
}
.den-dragon {
  width: 78%;
  z-index: 2;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,0.28));
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* floating sparkle dots in the den */
.den .spark { position: absolute; z-index: 1; border-radius: 50%; background: rgba(255,255,255,0.65); animation: rise 5s linear infinite; }

/* XP pill that floats on the den */
.den-xp {
  position: absolute;
  bottom: 18px; left: 18px; right: 18px;
  z-index: 3;
  background: rgba(255,255,255,0.92);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-card);
}
.den-xp .row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.den-xp .lvl { font-weight: 800; font-size: 1rem; }
.den-xp .streak { font-weight: 700; font-size: 0.85rem; color: var(--sage-deep); display: flex; align-items: center; gap: 5px; }
.xpbar { height: 12px; border-radius: 999px; background: var(--sage-muted); overflow: hidden; }
.xpbar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--sage), var(--sage-deep)); transition: width 1.4s var(--spring); }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-text { text-align: center; order: 2; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .den { max-width: 420px; margin: 0 auto; order: 1; }
}

/* Blobby pastel background shapes */
.blob { position: absolute; border-radius: 50%; filter: blur(36px); opacity: 0.5; z-index: 0; pointer-events: none; }
.blob.b1 { width: 360px; height: 360px; background: var(--lavender-light); top: -90px; right: -80px; }
.blob.b2 { width: 300px; height: 300px; background: var(--sage-muted); bottom: -120px; left: -90px; }
.blob.b3 { width: 220px; height: 220px; background: #f4e6d6; top: 40%; left: 45%; }

/* =========================================================================
   Feature cards
   ========================================================================= */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 44px; }
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(201,184,216,0.18);
  transition: transform 0.3s var(--spring), box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.card .ico {
  width: 58px; height: 58px;
  border-radius: 17px;
  display: grid; place-items: center;
  font-size: 1.7rem;
  margin-bottom: 18px;
}
.card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.card p { color: var(--ink-muted); font-weight: 600; }
.ico.sage { background: var(--sage-muted); }
.ico.lav  { background: var(--lavender-light); }
.ico.cream { background: #f3e9da; }

@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }

/* =========================================================================
   Growth / evolution strip
   ========================================================================= */
.grow {
  background: var(--lavender-light);
  border-radius: var(--radius-xl);
  padding: 56px 40px;
}
.grow h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-bottom: 10px; }
.grow .sub { color: var(--ink-muted); font-weight: 600; font-size: 1.1rem; max-width: 46ch; margin: 0 auto 44px; }
.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; align-items: end; }
.stage { text-align: center; }
.stage .pod {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.stage img { width: 100%; }
.stage.s1 .pod { transform: scale(0.82); }
.stage.s2 .pod { transform: scale(0.92); }
.stage .tag { font-weight: 800; font-size: 1.05rem; }
.stage .lvl { color: var(--lavender-deep); font-weight: 700; font-size: 0.9rem; }
.arrow { color: var(--lavender-deep); font-weight: 800; }
@media (max-width: 760px) { .stages { grid-template-columns: 1fr; gap: 18px; } .stage.s1 .pod, .stage.s2 .pod { transform: none; } }

/* =========================================================================
   Steps (how it works)
   ========================================================================= */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.step .num {
  counter-increment: step;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--sage-deep);
  color: var(--white);
  font-weight: 800;
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.step .num::before { content: counter(step); }
.step h3 { font-size: 1.2rem; margin-bottom: 6px; }
.step p { color: var(--ink-muted); font-weight: 600; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

/* =========================================================================
   Habit demo chip
   ========================================================================= */
.demo {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 26px;
  max-width: 440px;
  margin: 0 auto;
}
.demo .badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--lavender-light); color: var(--lavender-deep);
  font-weight: 800; font-size: 0.82rem;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}
.demo .q { font-size: 1.35rem; font-weight: 800; text-align: center; margin: 8px 0 20px; }
.demo .answers { display: flex; gap: 12px; }
.demo .answers .btn { flex: 1; }

/* =========================================================================
   CTA banner
   ========================================================================= */
.cta-banner {
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  border-radius: var(--radius-xl);
  padding: 64px 40px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.cta-banner h2 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 14px; }
.cta-banner p { font-weight: 600; font-size: 1.15rem; opacity: 0.92; margin-bottom: 28px; }
.cta-banner .btn-primary { background: var(--white); color: var(--sage-deep); box-shadow: 0 12px 30px rgba(0,0,0,0.18); }
.cta-banner .dragon-peek { width: 130px; margin: 0 auto 18px; animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 12px 16px rgba(0,0,0,0.2)); }

/* =========================================================================
   Footer
   ========================================================================= */
.footer { padding: 56px 0 40px; border-top: 1px solid rgba(201,184,216,0.3); }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
.footer .brand { margin-bottom: 12px; }
.footer .tag { color: var(--ink-muted); font-weight: 600; max-width: 32ch; }
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); margin-bottom: 12px; }
.footer-col a { display: block; font-weight: 700; color: var(--ink); padding: 5px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--sage-deep); }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(201,184,216,0.3); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--ink-muted); font-weight: 600; font-size: 0.9rem; }

/* =========================================================================
   Content pages (Privacy / Terms / Contact)
   ========================================================================= */
.page-hero { padding: 60px 0 30px; text-align: center; position: relative; }
.page-hero .eyebrow { margin-bottom: 16px; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 10px; }
.page-hero .meta { color: var(--ink-muted); font-weight: 600; }
.page-hero .mini-dragon { width: 96px; margin: 0 auto 8px; animation: bob 4s ease-in-out infinite; }

.doc {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 48px clamp(24px, 5vw, 60px);
  max-width: 820px;
  margin: 0 auto 80px;
}
.doc h2 {
  font-size: 1.5rem;
  margin: 38px 0 12px;
  scroll-margin-top: 90px;
}
.doc h2:first-child { margin-top: 0; }
.doc h3 { font-size: 1.15rem; margin: 22px 0 8px; color: var(--lavender-deep); }
.doc p, .doc li { color: #3d3d3d; font-weight: 500; margin-bottom: 12px; }
.doc ul, .doc ol { padding-left: 22px; margin-bottom: 16px; }
.doc li { margin-bottom: 8px; }
.doc strong { font-weight: 800; }
.doc a { color: var(--sage-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.doc .callout {
  background: var(--lavender-light);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 18px 0;
  font-weight: 600;
}
.toc {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 30px;
}
.toc h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); margin-bottom: 10px; }
.toc a { display: inline-block; margin: 4px 14px 4px 0; font-weight: 700; color: var(--sage-deep); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* =========================================================================
   Contact page
   ========================================================================= */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; max-width: 980px; margin: 0 auto 80px; align-items: start; }
.contact-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 40px;
}
.contact-card.mail { background: linear-gradient(150deg, var(--lavender-light), var(--white)); }
.contact-card h2 { font-size: 1.6rem; margin-bottom: 8px; }
.contact-card p { color: var(--ink-muted); font-weight: 600; margin-bottom: 22px; }
.mail-pill {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--white);
  border: 1.5px solid var(--lavender);
  border-radius: 999px;
  padding: 13px 20px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--sage-deep);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s var(--spring), box-shadow 0.25s;
}
.mail-pill:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--lavender);
  border-radius: 12px;
  padding: 13px 15px;
  transition: border 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 4px rgba(143,175,122,0.18); }
.field textarea { resize: vertical; min-height: 130px; }
.faq-item { border-bottom: 1px solid rgba(201,184,216,0.4); padding: 16px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary { font-weight: 800; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--lavender-deep); font-size: 1.4rem; transition: transform 0.25s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: 10px; color: var(--ink-muted); font-weight: 600; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   Scroll-reveal
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s var(--spring); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* rising sparkle keyframe */
@keyframes rise {
  0%   { transform: translateY(20px); opacity: 0; }
  20%  { opacity: 0.8; }
  100% { transform: translateY(-220px); opacity: 0; }
}
