/* habitbead.app — one stylesheet for every page. The colours are the app's own tokens
   (src/theme/colors.ts), light and dark; the font is the system's, as in the app.
   Light by default; dark only when the header's toggle has put data-theme="dark" on <html>. */

:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --fill: #e9e9ee;
  --text: #111111;
  --text-2: #6c6c70;
  --text-3: #aeaeb2;
  --separator: #e3e3e8;
  --accent: #22b573;
  --accent-text: #1e9e63;
  --accent-tint: #e5f6ee;
  --accent-ring: #7fd6a8;
  /* Filled buttons: the accent a step darker in light, so white text reads. */
  --button: #1e9e63;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.06);
  --phone-shadow: 0 30px 80px rgb(0 0 0 / 0.18);
  /* The theme toggle shows the sun in dark and the moon in light. */
  --sun: none;
  --moon: block;
  --radius: 24px;
  --max: 1080px;
  color-scheme: light;
}

/* Dark: only by the header's toggle — the device's own setting is not read (2026-10-08). */
:root[data-theme="dark"] {
  --bg: #000000;
  --card: #1c1c1e;
  --fill: #2c2c2e;
  --text: #ffffff;
  --text-2: #98989f;
  --text-3: #636366;
  --separator: #2c2c2e;
  --accent-text: #3dd68c;
  --accent-tint: #1d2e28;
  --accent-ring: #2f7a55;
  --button: #22b573;
  --shadow: none;
  --phone-shadow: 0 30px 80px rgb(34 181 115 / 0.14);
  --sun: block;
  --moon: none;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 100;
  background: var(--card);
  padding: 8px 14px;
  border-radius: 10px;
}

/* ——— Header ——— */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.site-nav .button {
  color: var(--on-accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--separator);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .sun {
  display: var(--sun);
}

.theme-toggle .moon {
  display: var(--moon);
}

@media (max-width: 640px) {
  .site-nav .nav-link {
    display: none;
  }
}

/* ——— Buttons ——— */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--button);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 16px;
  border: 0;
}

.button:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.button.small {
  min-height: 36px;
  padding: 0 16px;
  font-size: 15px;
}

.button.secondary {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

.store-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 22px 8px 18px;
  border-radius: 16px;
  background: var(--text);
  color: var(--bg);
}

.store-button:hover {
  text-decoration: none;
}

.store-button svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.store-button span {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store-button small {
  font-size: 12px;
  opacity: 0.8;
}

.store-button strong {
  font-size: 19px;
  font-weight: 600;
}

.store-button[aria-disabled="true"] {
  cursor: default;
}

/* ——— Hero ——— */

.hero {
  padding: 64px 0 48px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 18px;
}

h1,
h2,
h3 {
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.lead {
  font-size: clamp(18px, 2vw, 21px);
  color: var(--text-2);
  margin: 20px 0 30px;
  max-width: 34em;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.cta-note {
  color: var(--text-2);
  font-size: 14px;
  margin: 14px 0 0;
}

@media (max-width: 860px) {
  .hero {
    padding-top: 40px;
  }

  .hero .wrap {
    grid-template-columns: 1fr;
  }
}

/* ——— Phone: the Home capture (hero-home-*.webp, scripts/site-images.py) in a frame ——— */

.phone {
  --bezel: 10px;
  --screen-radius: 44px;
  width: min(320px, 86vw);
  margin: 0 auto;
  padding: var(--bezel);
  border-radius: calc(var(--screen-radius) + var(--bezel));
  background: #1c1c1e;
  box-shadow: var(--phone-shadow), inset 0 0 0 1.5px #48484a;
}

.phone img {
  width: 100%;
  height: auto;
  border-radius: var(--screen-radius);
  background: #f2f2f7;
}

/* ——— Sections ——— */

section {
  padding: 56px 0;
}

.section-head {
  max-width: 640px;
  margin: 0 auto 36px;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
}

.section-head p {
  color: var(--text-2);
  font-size: 18px;
  margin: 14px 0 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-top: 14px;
}

.card p {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 16px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-tint);
  color: var(--accent-text);
}

.feature-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.9;
}

.steps {
  counter-reset: step;
}

.steps .card h3::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 16px;
}

.steps .card h3 {
  margin-top: 0;
}

/* Privacy band */

.privacy-band .card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 40px;
  align-items: center;
}

.privacy-band h2 {
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 800;
}

.privacy-band p {
  font-size: 17px;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-weight: 500;
}

.checklist li::before {
  content: "";
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center / 14px no-repeat;
  margin-top: 1px;
}

@media (max-width: 760px) {
  .privacy-band .card {
    grid-template-columns: 1fr;
    padding: 28px 24px;
  }
}

/* Pro table */

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}

.plan h3 {
  font-size: 22px;
  margin: 0;
}

.plan .price {
  color: var(--text-2);
  margin: 6px 0 18px;
  font-size: 15px;
}

.plan ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.plan li {
  display: flex;
  gap: 10px;
}

.plan li::before {
  content: "•";
  color: var(--text-3);
  font-weight: 800;
}

.plan.pro {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.plan.pro li::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 5px;
  background: var(--accent-text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
  letter-spacing: 0;
}

.fine {
  max-width: 760px;
  margin: 18px auto 0;
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
}

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

/* FAQ */

.faq {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.faq details {
  background: var(--card);
  border-radius: 18px;
  padding: 0 22px;
  box-shadow: var(--shadow);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 28px 18px 0;
  font-weight: 600;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 24px;
  font-weight: 400;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  margin: 0 0 18px;
  color: var(--text-2);
}

/* Download band */

.download .card {
  text-align: center;
  padding: 48px 24px;
}

.download img {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  margin: 0 auto 18px;
}

.download h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
}

.download p {
  color: var(--text-2);
  margin: 12px 0 26px;
}

/* ——— Documents (privacy, terms, support) ——— */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}

.doc h1 {
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 800;
}

.doc .updated {
  color: var(--text-2);
  margin: 10px 0 28px;
}

.doc h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 36px 0 10px;
}

.doc p,
.doc li {
  color: var(--text);
}

.doc ul {
  padding-left: 22px;
}

.doc li {
  margin: 6px 0;
}

.doc .summary {
  background: var(--accent-tint);
  border-radius: 18px;
  padding: 18px 20px;
}

.doc a {
  overflow-wrap: anywhere;
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 32px;
}

.contact-card p {
  margin: 4px 0 0;
  color: var(--text-2);
}

/* ——— Footer ——— */

.site-footer {
  border-top: 1px solid var(--separator);
  padding: 36px 0 48px;
  color: var(--text-2);
  font-size: 15px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  justify-content: space-between;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.site-footer a {
  color: var(--text-2);
}

.site-footer a:hover {
  color: var(--text);
}

.not-found {
  text-align: center;
  padding: 96px 20px;
}

.not-found h1 {
  font-size: 48px;
  font-weight: 800;
}

.not-found p {
  color: var(--text-2);
  margin: 12px 0 28px;
}
