/* HabitBloom home. Layout concept: a garden bed — the growth grid is the page's spine; every
   section is a row you tend, from seed (how it works) to bloom (Premium). System fonts only
   (SF Pro / SF Pro Rounded on Apple devices), matching the app; the site's CSP allows no
   external fonts or inline styles. */
:root {
  --bg: #F2F7EC;          /* pale leaf */
  --surface: #FFFFFF;
  --surface-2: #E7F0DE;   /* soft tile */
  --ink: #132219;         /* deep garden */
  --ink-2: #46574B;
  --line: #D6E2CB;
  --leaf: #3F7D05;        /* accent that reads on light */
  --lime: #B8F35A;
  --mint: #7FE0B0;
  --forest: #183A2A;
  --on-forest: #EEF6E7;
  --tile-before: #E3ECDA;
  --tile-empty: #D3E4C3;
  --tile-leaf: #5CA318;
  --tile-bloom: #3F7D05;
  --glow: #FFFFFF;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --step--1: 0.875rem; --step-0: 1.0625rem; --step-1: 1.25rem; --step-2: 1.6rem; --step-3: clamp(1.9rem, 4.2vw, 2.6rem); --step-4: clamp(2.5rem, 7vw, 4.4rem);
  --radius: 22px;
  --tile: 13px;
  --gap: 4px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F2219; --surface: #15301F; --surface-2: #1B3A27; --ink: #EEF6E7; --ink-2: #A9BEAB; --line: #26452F;
    --leaf: #B8F35A; --forest: #0B1A12; --on-forest: #EEF6E7;
    --tile-before: #183424; --tile-empty: #21432D; --tile-leaf: #93D44B; --tile-bloom: #B8F35A; --glow: #F4FFE4;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F2219; --surface: #15301F; --surface-2: #1B3A27; --ink: #EEF6E7; --ink-2: #A9BEAB; --line: #26452F;
  --leaf: #B8F35A; --forest: #0B1A12; --on-forest: #EEF6E7;
  --tile-before: #183424; --tile-empty: #21432D; --tile-leaf: #93D44B; --tile-bloom: #B8F35A; --glow: #F4FFE4;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--step-0)/1.6 var(--font); padding-inline: 20px; }
a { color: var(--leaf); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--leaf); outline-offset: 3px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1120px; margin-inline: auto; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; text-wrap: balance; margin: 0; letter-spacing: -0.015em; }
h2 { font-size: var(--step-3); font-weight: 800; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0; }
.lede { font-size: var(--step-1); color: var(--ink-2); max-width: 34em; }
.eyebrow { font-size: var(--step--1); font-weight: 700; color: var(--leaf); letter-spacing: 0.02em; }
section { padding-block: clamp(56px, 9vw, 104px); }
.section-head { display: grid; gap: 12px; max-width: 640px; margin-bottom: 40px; }

/* Bloom mark */
.mark { width: 34px; height: 34px; flex: none; }
.mark .p1 { fill: var(--tile-bloom); } .mark .p2 { fill: var(--mint); } .mark .p3 { fill: var(--glow); }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 1.45rem/1 var(--font-display); letter-spacing: -0.02em; }
.brand b { color: var(--leaf); font-weight: 800; }
.top nav { display: flex; gap: 22px; flex-wrap: wrap; }
.top nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.top nav a:hover { color: var(--leaf); }

/* Buttons */
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.store { display: inline-flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 14px; text-decoration: none; font-weight: 700; }
.store small { display: block; font-weight: 500; font-size: 0.75rem; opacity: 0.8; line-height: 1.1; }
.store span { line-height: 1.2; }
.ghost { color: var(--ink); font-weight: 700; text-decoration: none; padding: 12px 6px; }
.ghost:hover { color: var(--leaf); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: center; padding-block: clamp(32px, 6vw, 72px) clamp(56px, 8vw, 96px); }
.hero h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.03em; }
.hero h1 em { font-style: normal; color: var(--leaf); }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 4px 0 0; list-style: none; color: var(--ink-2); font-size: var(--step--1); font-weight: 600; }
.facts li { display: flex; gap: 6px; align-items: center; }
.facts li::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--tile-leaf); }

/* Habit card demo */
.habit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 16px; min-width: 0; box-shadow: 0 24px 60px -28px rgba(19, 34, 25, 0.35); }
.habit-row { display: flex; align-items: center; gap: 14px; }
.habit-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; color: var(--leaf); flex: none; }
.habit-name { display: grid; gap: 2px; min-width: 0; flex: 1; }
.habit-name strong { font-size: 1.1rem; }
.habit-name span { color: var(--ink-2); font-size: var(--step--1); }
.check { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--leaf); cursor: pointer; flex: none; transition: background 0.2s, color 0.2s, transform 0.15s; }
.check:hover { transform: scale(1.05); }
.check svg { width: 24px; height: 24px; }
#checkin { position: absolute; opacity: 0; width: 1px; height: 1px; }
#checkin:focus-visible + .habit-row .check { outline: 3px solid var(--leaf); outline-offset: 3px; }
.after { display: none; }
.habit:has(#checkin:checked) .check { background: var(--tile-bloom); color: var(--forest); }
.habit:has(#checkin:checked) .before-text { display: none; }
.habit:has(#checkin:checked) .after { display: inline; }
.habit:has(#checkin:checked) #today-tile { background: var(--tile-bloom); box-shadow: inset 0 0 0 3px var(--tile-bloom), inset 0 0 0 5px var(--glow); }
.demo-note { font-size: var(--step--1); color: var(--ink-2); }
.demo-note strong { color: var(--ink); }

.grid-scroll { overflow-x: auto; padding-bottom: 2px; }
.months { display: grid; grid-template-columns: repeat(20, var(--tile)); column-gap: var(--gap); font-size: 0.72rem; color: var(--ink-2); font-weight: 600; height: 1.3em; width: max-content; margin-left: auto; }
.months span { white-space: nowrap; }
.tiles { display: flex; gap: var(--gap); width: max-content; margin-left: auto; }
.col { display: grid; grid-template-rows: repeat(7, var(--tile)); gap: var(--gap); }
.t { display: block; width: var(--tile); height: var(--tile); border-radius: 4px; position: relative; }
.t.before { background: var(--tile-before); }
.t.empty { background: var(--tile-empty); }
.t.leaf { background: var(--tile-leaf); }
.t.bloom { background: var(--tile-bloom); box-shadow: inset 0 0 0 4px var(--tile-bloom), inset 0 0 0 6px var(--glow); }
.t.seed { background: var(--tile-empty); }
.t.seed::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--tile-leaf); }
.t.rest { background: var(--tile-empty); }
.t.rest::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1.5px solid var(--ink-2); }
.t.today { box-shadow: 0 0 0 2px var(--leaf); }
.t.future { visibility: hidden; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .t { width: 11px; height: 11px; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 0; margin: 0; list-style: none; counter-reset: step; }
.steps li { display: grid; gap: 10px; align-content: start; padding-top: 18px; border-top: 2px solid var(--ink); counter-increment: step; }
.steps li::before { content: counter(step); font: 800 var(--step-2)/1 var(--font-display); color: var(--leaf); }
.steps p { color: var(--ink-2); }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.feature p { color: var(--ink-2); font-size: 0.98rem; }
.feature .tag { justify-self: start; font-size: 0.75rem; font-weight: 700; color: var(--leaf); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }
.feature.wide { grid-column: span 2; }
.mini-strip { display: flex; gap: 6px; }
.mini-strip .t { width: 22px; height: 22px; border-radius: 7px; }

/* Challenges band */
.band { background: var(--forest); color: var(--on-forest); border-radius: 32px; padding: clamp(28px, 5vw, 56px); display: grid; gap: 32px; }
.band .eyebrow { color: var(--lime); }
.band .lede { color: rgba(238, 246, 231, 0.78); }
.challenges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.challenge { background: rgba(238, 246, 231, 0.06); border: 1px solid rgba(238, 246, 231, 0.14); border-radius: 20px; padding: 20px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.challenge .when { font-size: 0.8rem; font-weight: 700; color: var(--mint); }
.challenge p { color: rgba(238, 246, 231, 0.78); font-size: 0.98rem; }
.mission { border-top: 1px dashed rgba(238, 246, 231, 0.25); padding-top: 12px; font-size: 0.92rem; }
.mission b { display: block; color: var(--lime); font-size: 0.78rem; letter-spacing: 0.02em; }
.dots { display: flex; gap: 5px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(238, 246, 231, 0.16); }
.dots i.on { background: var(--lime); }
.dots i.next { background: transparent; box-shadow: inset 0 0 0 2px var(--lime); }

/* Kind by design */
.kind { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 6vw, 72px); align-items: start; }
.rules { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.rules li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.rules li:first-child { border-top: 1px solid var(--line); }
.rules .t { margin-top: 4px; width: 22px; height: 22px; border-radius: 7px; }
.rules .t.rest::after, .rules .t.seed::after { inset: 5px; }
.rules p { color: var(--ink-2); }
.rules strong { display: block; color: var(--ink); }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 880px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: grid; gap: 14px; align-content: start; }
.plan.premium { border: 2px solid var(--leaf); }
.price { font: 800 var(--step-3)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.price small { font: 600 var(--step--1) var(--font); color: var(--ink-2); }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.plan li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; }
.plan li::before { content: ""; width: 12px; height: 12px; margin-top: 7px; border-radius: 4px; background: var(--tile-leaf); }
.plan.premium li::before { background: var(--tile-bloom); box-shadow: inset 0 0 0 2px var(--tile-bloom), inset 0 0 0 3.5px var(--glow); }
.fine { font-size: var(--step--1); color: var(--ink-2); max-width: 46em; margin-top: 20px; }

/* Privacy + FAQ + support */
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.panel p { color: var(--ink-2); }
.email { font-weight: 700; color: var(--ink); user-select: all; word-break: break-all; }
.faq { display: grid; gap: 0; max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); padding-block: 4px; }
.faq summary { cursor: pointer; padding-block: 16px; font-weight: 700; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 700 1.3rem/1 var(--font-display); color: var(--leaf); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); padding-bottom: 16px; max-width: 62ch; }

/* Footer */
footer { border-top: 1px solid var(--line); padding-block: 32px 48px; display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; color: var(--ink-2); font-size: var(--step--1); }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--ink-2); }

@media (max-width: 900px) {
  .hero, .kind { grid-template-columns: minmax(0, 1fr); }
  .features, .challenges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --tile: 11px; --gap: 3px; }
  .steps, .features, .challenges, .plans, .two { grid-template-columns: minmax(0, 1fr); }
  .feature.wide { grid-column: auto; }
  .top nav { display: none; }
  .hero .lede { font-size: var(--step-0); }
}

/* Month label columns (generated) */
.months .c2 { grid-column-start: 3; }
.months .c6 { grid-column-start: 7; }
.months .c11 { grid-column-start: 12; }
.months .c15 { grid-column-start: 16; }
