/* ============================================================
   Habits with Lui — shared styles
   Palette taken directly from the app's light-mode tokens.
   ============================================================ */

:root {
  --paper: #FCF3F0;        /* background 252,243,240 */
  --card: #EBD1C0;         /* card 235,209,192 */
  --alt: #E8D6CE;          /* alt surface 232,214,206 */
  --ink: #784623;          /* primary ink 120,70,35 */
  --text2: #5F5C58;        /* secondary text */
  --blush: #DA9691;        /* pink buttons */
  --blush-deep: #C97F79;   /* darker blush for hover / contrast */
  --gold: #C39637;         /* streak gold */
  --blue: #8CA8BC;         /* blue accent */
  --border: #CDC3B6;
  --error: #C3695A;

  /* habit group colors */
  --terracotta: #BE7350;
  --rose: #BC828A;
  --sage: #789169;
  --cornflower: #829BB2;
  --lavender: #9B8AAC;
  --honey: #C3A050;
  --teal: #649890;
  --coral: #CD8770;
  --slate: #7D849B;
  --olive: #918E58;

  /* mood dots */
  --m-gray: #A59E96; --m-brick: #C36455; --m-coral: #CD8764;
  --m-amber: #C8A555; --m-sage: #73946C; --m-teal: #5F9891; --m-sky: #6E9BB9;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(120, 70, 35, .10);
  --shadow-soft: 0 4px 14px rgba(120, 70, 35, .08);
  --max: 1040px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Karla', 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* watercolor-paper grain over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.47 0 0 0 0 0.27 0 0 0 0 0.14 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}

main, header.site, footer.site { position: relative; z-index: 1; }

h1, h2, h3, .display {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 80, "WONK" 0;
  font-weight: 560;
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2.3rem, 5.4vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.18rem; }

p { margin: 0 0 1em; color: var(--text2); }
p.lead { font-size: 1.15rem; }
a { color: var(--ink); text-decoration-color: var(--blush); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--blush-deep); }

.eyebrow {
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--terracotta);
  margin-bottom: .9em;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
header.site {
  padding: 18px 0;
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wordmark {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.3rem;
  text-decoration: none; color: var(--ink);
}
.wordmark img { width: 34px; height: 34px; }
nav.main { display: flex; gap: 26px; flex-wrap: wrap; }
nav.main a { text-decoration: none; font-weight: 700; font-size: .95rem; color: var(--ink); }
nav.main a:hover { color: var(--blush-deep); }

/* ---------- sections + dashed divider (echo of the in-app progress line) ---------- */
section { padding: 72px 0; }
.divider {
  max-width: var(--max); margin: 0 auto; padding: 0 24px;
}
.divider hr {
  border: none;
  border-top: 2px dashed var(--border);
  margin: 0;
}

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-block;
  background: var(--blush);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-family: 'Karla', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .01em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--blush-deep); transform: translateY(-1px); color: #fff; }
.btn.secondary {
  background: transparent; color: var(--ink);
  border: 2px solid var(--border); box-shadow: none;
}
.btn.secondary:hover { border-color: var(--ink); background: rgba(235,209,192,.35); }

form.waitlist { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
form.waitlist input[type="email"] {
  flex: 1 1 240px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 13px 20px;
  font-family: 'Karla', sans-serif;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
}
form.waitlist input[type="email"]:focus { border-color: var(--blue); }
.form-note { font-size: .85rem; color: var(--text2); margin-top: 10px; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 80px; }
.hero .wrap {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: 48px; align-items: center;
}
.hero-art { position: relative; text-align: center; }
.hero-art .sticker-img {
  width: min(320px, 80%);
  filter: drop-shadow(0 14px 24px rgba(120,70,35,.18));
  animation: float 5s ease-in-out infinite;
}
.hero-art .swatch-row { margin-top: 26px; display: flex; justify-content: center; gap: 10px; }
.dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }

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

/* ---------- cards ---------- */
.card {
  background: rgba(235, 209, 192, .45);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

.step-chip {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.15rem; color: #fff;
  margin-bottom: 14px;
}

/* ---------- interactive demo ---------- */
.demo-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: stretch; }

.todo { list-style: none; margin: 0 0 18px; padding: 0; }
.todo li { margin-bottom: 10px; }
.todo label {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  transition: background .2s ease;
}
.todo input { position: absolute; opacity: 0; }
.todo .box {
  width: 24px; height: 24px; flex: none;
  border: 2px solid var(--ink);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff;
  transition: background .15s ease;
}
.todo .box svg { opacity: 0; transform: scale(.5); transition: all .18s ease; }
.todo input:checked + .box { background: var(--sage); border-color: var(--sage); }
.todo input:checked + .box svg { opacity: 1; transform: scale(1); }
.todo input:checked ~ .txt { color: var(--text2); text-decoration: line-through; text-decoration-color: var(--border); }
.todo input:focus-visible + .box { outline: 3px solid var(--blue); outline-offset: 2px; }

.progress-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: var(--alt);
  border: 1px dashed var(--border);
  overflow: hidden;
}
.progress-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: linear-gradient(90deg, var(--blush), var(--gold));
  border-radius: 999px;
  transition: width .5s cubic-bezier(.2,.8,.3,1);
}
.progress-caption { font-size: .85rem; color: var(--text2); margin-top: 8px; }

.scene {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-height: 280px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 115%, rgba(120,145,105,.55), rgba(120,145,105,0) 60%),
    radial-gradient(90% 60% at 80% 0%, rgba(252,243,240,.9), rgba(252,243,240,0) 70%),
    linear-gradient(180deg, #DCE7EE 0%, #EEE6DC 58%, #DCE3CF 100%);
}
.scene::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.02' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E");
}
.scene .hint {
  position: absolute; inset: auto 0 14px 0;
  text-align: center; font-size: .85rem; color: var(--text2);
  pointer-events: none;
}
.sticker {
  position: absolute;
  width: 84px; height: 84px;
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(0 6px 10px rgba(120,70,35,.25));
  z-index: 3;
  transition: transform .15s ease;
}
.sticker:active { cursor: grabbing; transform: scale(1.08); }
.sticker.pop { animation: pop .55s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop {
  0% { transform: scale(0) rotate(-20deg); }
  100% { transform: scale(1) rotate(0); }
}
.tray {
  margin-top: 18px;
  position: relative;
  min-height: 104px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: .9rem;
  background: var(--paper);
}

/* ---------- reward worlds ---------- */
.worlds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.world {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-height: 220px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex; align-items: flex-end;
}
.world .label {
  position: relative; z-index: 2;
  margin: 14px; padding: 7px 14px;
  background: rgba(252,243,240,.92);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .85rem; font-weight: 800; color: var(--ink);
}
.world::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.014 0.02' numOctaves='3' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E");
}
.world.meadow { background: linear-gradient(170deg, #E9EFF2 0%, #DFE7D2 45%, #B9C9A4 100%); }
.world.dusk   { background: linear-gradient(170deg, #D9DEE9 0%, #C9BFD3 50%, #BC828A 100%); }
.world.shore  { background: linear-gradient(170deg, #E3ECF1 0%, #C8DAE3 55%, #E8D6CE 100%); }

/* ---------- mood strip ---------- */
.mood-strip { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 8px; }
.mood-strip span { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ---------- footer ---------- */
footer.site {
  margin-top: 40px;
  padding: 46px 0 56px;
  background: var(--alt);
  border-top: 1px solid var(--border);
}
footer.site .wrap { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
footer.site nav { display: flex; flex-direction: column; gap: 8px; }
footer.site a { text-decoration: none; font-weight: 700; font-size: .95rem; }
footer.site .fineprint { font-size: .85rem; color: var(--text2); margin-top: 14px; }

/* ---------- inner pages ---------- */
.page-head { padding: 48px 0 8px; }
.prose { max-width: 720px; }
.prose h2 { margin-top: 1.8em; font-size: 1.4rem; }
.prose ul { color: var(--text2); padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero .wrap, .demo-grid, .grid-3, .grid-2, .worlds { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
  .hero-art { order: -1; }
  .hero-art .sticker-img { width: min(220px, 60%); }
  section { padding: 52px 0; }
  nav.main { gap: 16px; font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
