/* Chetely website styles. All colours live in :root. */
/* Fonts are self-hosted (SIL Open Font License, see /assets/fonts). */
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/assets/fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #1b1a18;
  --bg-raised: #23211e;
  --surface: #2a2824;
  --surface-2: #322f2b;
  --line: rgba(241, 235, 221, 0.09);
  --line-strong: rgba(241, 235, 221, 0.16);
  --text: #f1ebdd;
  --muted: #b9b09f;
  --faint: #8c8475;
  --accent: #a3d9b1;          /* soft sage from the logo */
  --accent-strong: #c2ead0;
  --accent-ink: #13241a;
  --accent-wash: rgba(163, 217, 177, 0.10);
  --todo-bg: rgba(240, 196, 110, 0.16);
  --todo-text: #f3d08a;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -24px rgba(0, 0, 0, 0.6);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --max: 1080px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(241, 235, 221, 0.05), transparent 60%),
    radial-gradient(700px 420px at -10% 10%, rgba(163, 217, 177, 0.05), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }

/* Header */
.site-header { padding: 22px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.nav { display: flex; gap: 22px; font-size: 15px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); }
@media (max-width: 560px) { .nav { gap: 16px; font-size: 14px; } .nav .hide-sm { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  font: 600 16px/1 var(--font-body); border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn[aria-disabled="true"] { background: var(--surface); color: var(--muted); border-color: var(--line); cursor: default; }
.btn[aria-disabled="true"]:active { transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-block { width: 100%; }

/* Hero */
.hero { padding: 56px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--accent-wash); color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.hero h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(44px, 6.4vw, 72px); line-height: 1.02; letter-spacing: -0.025em; margin: 18px 0 18px; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 400; }
.hero .lede { color: var(--muted); font-size: 19px; max-width: 34ch; margin: 0 0 30px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cta-note { color: var(--faint); font-size: 14px; margin-top: 14px; }
@media (max-width: 860px) {
  .hero { padding: 24px 0 56px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 44px; }
  .hero .lede { font-size: 18px; }
}

/* Phone-ish preview card */
.preview { position: relative; justify-self: center; width: 100%; max-width: 360px; }
.preview::before { content: ""; position: absolute; inset: 10% -8% -6% -8%; background: radial-gradient(closest-side, rgba(163, 217, 177, 0.16), transparent); filter: blur(10px); z-index: 0; }
.phone { position: relative; z-index: 1; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 40px; padding: 18px 16px 22px; box-shadow: var(--shadow); }
.phone-top { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 14px; color: var(--faint); font-size: 13px; }
.phone-top b { color: var(--text); font-family: var(--font-display); font-weight: 500; font-size: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 10px; }
.group-row { display: flex; justify-content: space-between; align-items: center; }
.group-name { font-weight: 700; font-size: 16px; }
.streak { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent); font-size: 15px; }
.streak svg { width: 16px; height: 16px; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; margin: 12px 0 10px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 80%; background: var(--accent); border-radius: 99px; }
.meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; }
.avatars { display: flex; }
.avatars i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -6px; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; color: var(--accent-ink); }
.avatars i:first-child { margin-left: 0; }
.habit { display: flex; align-items: center; gap: 12px; }
.habit .tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.habit .tick.done { background: var(--accent); border-color: var(--accent); }
.habit .tick svg { width: 16px; height: 16px; color: var(--accent-ink); }
.habit small { display: block; color: var(--faint); font-size: 12px; }
.habit .label { font-weight: 600; font-size: 15px; line-height: 1.3; }
.nudge { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.nudge b { color: var(--text); }

/* Sections */
section.block { padding: 72px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 620px; margin-bottom: 40px; }
.section-head h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(30px, 4vw, 42px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 12px; }
.section-head p { color: var(--muted); margin: 0; }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.feature { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; }
.feature .icon { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; margin-bottom: 18px; }
.feature .icon svg { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 8px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--muted); font-size: 16px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } .feature { padding: 24px; } section.block { padding: 56px 0; } }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--line); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--accent); font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.steps h3 { margin: 0 0 6px; font-size: 17px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.plan { border-radius: var(--radius-lg); padding: 28px; border: 1px solid var(--line); background: var(--bg-raised); }
.plan.plus { border-color: rgba(163, 217, 177, 0.35); background: linear-gradient(180deg, rgba(163, 217, 177, 0.07), transparent 70%), var(--bg-raised); }
.plan h3 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 500; font-size: 26px; }
.plan .price { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.plan .price b { color: var(--text); font-size: 18px; }
.plan ul { margin: 0; padding: 0; list-style: none; }
.plan li { padding: 8px 0 8px 28px; position: relative; color: var(--muted); font-size: 15px; border-top: 1px solid var(--line); }
.plan li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.fineprint { color: var(--faint); font-size: 13px; margin-top: 16px; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }

.closing { text-align: center; padding: 88px 0; border-top: 1px solid var(--line); }
.closing h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(32px, 4.6vw, 48px); letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 14px; }
.closing p { color: var(--muted); margin: 0 auto 28px; max-width: 40ch; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--faint); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* Invite page */
.invite { padding: 32px 0 72px; }
.invite-card { max-width: 480px; margin: 0 auto; text-align: center; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 32px; padding: 40px 28px 32px; box-shadow: var(--shadow); }
.invite-card img.app-icon { width: 76px; height: 76px; border-radius: 20px; margin: 0 auto 20px; }
.invite-card h1 { font-family: var(--font-display); font-weight: 500; font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 10px; }
.invite-card .sub { color: var(--muted); margin: 0 0 26px; }
.code-label { color: var(--faint); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.code {
  font-family: var(--font-mono); font-weight: 600; font-size: clamp(34px, 11vw, 52px); letter-spacing: 0.16em;
  padding: 18px 12px 18px calc(12px + 0.16em); border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--line-strong);
  color: var(--text); word-break: break-all; line-height: 1.1;
}
.copy { margin: 12px auto 28px; background: none; border: 0; color: var(--accent); font: 600 15px var(--font-body); cursor: pointer; padding: 8px 12px; border-radius: 10px; display: inline-flex; gap: 8px; align-items: center; }
.copy:hover { color: var(--accent-strong); }
.copy svg { width: 18px; height: 18px; }
.btn-stack { display: grid; gap: 12px; }
.howto { text-align: left; margin: 28px 0 0; padding: 20px 20px 4px; border-radius: var(--radius); background: var(--surface); }
.howto h2 { font-size: 15px; margin: 0 0 10px; }
.howto ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.howto li { margin-bottom: 8px; }
.invalid .code { display: none; }

/* Legal and text pages */
.doc { padding: 24px 0 80px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(36px, 5vw, 52px); letter-spacing: -0.02em; line-height: 1.08; margin: 16px 0 8px; }
.doc .updated { color: var(--faint); font-size: 14px; margin: 0 0 32px; }
.doc h2 { font-family: var(--font-display); font-weight: 500; font-size: 26px; letter-spacing: -0.01em; margin: 48px 0 12px; scroll-margin-top: 20px; }
.doc h3 { font-size: 17px; margin: 28px 0 8px; }
.doc p, .doc li { color: #ddd6c7; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc strong { color: var(--text); }
.summary { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 0 0 8px; }
.summary h2 { margin-top: 0; font-size: 20px; }
.summary ul { margin: 0; }
.toc { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; margin: 24px 0 8px; }
.toc p { margin: 0 0 8px; color: var(--faint); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.toc ol { margin: 0; columns: 2; column-gap: 32px; font-size: 15px; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--text); }
@media (max-width: 560px) { .toc ol { columns: 1; } }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--text); background: var(--bg-raised); font-weight: 700; font-size: 14px; }
td { color: #ddd6c7; }
tr:last-child td { border-bottom: 0; }
mark.todo { background: var(--todo-bg); color: var(--todo-text); padding: 1px 6px; border-radius: 6px; font-weight: 600; font-size: 0.92em; }
.faq details { border-top: 1px solid var(--line); padding: 16px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 10px 0 0; }

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