/* Ledgr — site styles. Colours mirror the app icon's greens. */

:root {
    --green-900: #0A4D36;
    --green-800: #0E5A40;
    --green-700: #1A6E50;
    --green-600: #2B946E;
    --green-500: #2FA272;
    --green-400: #45C98F;
    --green-200: #8EE3BC;
    --green-50:  #EEF8F3;

    --bg: #FBFCFB;
    --surface: #FFFFFF;
    --surface-2: #F3F6F4;
    --text: #0F1A15;
    --text-2: #4A5A52;
    --border: rgba(15, 26, 21, 0.08);
    --accent: var(--green-600);
    --accent-strong: var(--green-700);
    --red: #D9443B;
    --orange: #E08A1E;
    --blue: #2F7CE0;

    --radius: 22px;
    --shadow: 0 1px 2px rgba(10, 40, 28, .05), 0 12px 32px -12px rgba(10, 40, 28, .18);
    --max: 1120px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #07100C;
        --surface: #0F1A15;
        --surface-2: #14221B;
        --text: #EAF3EE;
        --text-2: #9DB0A6;
        --border: rgba(234, 243, 238, 0.09);
        --accent: var(--green-400);
        --accent-strong: var(--green-200);
        --green-50: #0F2219;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
    }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(100% - 40px, var(--max)); margin-inline: auto; }

.skip-link {
    position: absolute; left: -9999px; top: 8px;
    background: var(--surface); padding: 8px 14px; border-radius: 10px; z-index: 100;
}
.skip-link:focus { left: 8px; }

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

/* ---------- Header ---------- */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }

.nav { display: flex; align-items: center; gap: 26px; }
.nav a { color: var(--text-2); font-size: 15px; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: none; }
.nav .btn { color: #fff; }
@media (max-width: 720px) { .nav a:not(.btn) { display: none; } }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 22px; border-radius: 999px;
    font-weight: 600; font-size: 16px;
    background: var(--green-600); color: #fff;
    transition: transform .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; background: var(--green-700); transform: translateY(-1px); }
.btn-small { padding: 8px 16px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); }

.app-store {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 12px 22px 12px 18px; border-radius: 14px;
    background: #000; color: #fff; line-height: 1.1;
    transition: transform .15s ease;
}
.app-store:hover { text-decoration: none; transform: translateY(-1px); }
.app-store svg { width: 26px; height: 26px; fill: #fff; }
.app-store small { display: block; font-size: 11px; opacity: .85; }
.app-store strong { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
@media (prefers-color-scheme: dark) { .app-store { background: #fff; color: #000; } .app-store svg { fill: #000; } }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; padding: 72px 0 96px; }
.hero::before {
    content: ""; position: absolute; inset: -40% -10% auto auto; width: 900px; height: 900px;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--green-400) 28%, transparent), transparent);
    pointer-events: none;
}
.hero .container { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: center; }
@media (max-width: 900px) { .hero .container { grid-template-columns: minmax(0, 1fr); text-align: center; } .hero-actions { justify-content: center; } }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 999px;
    background: var(--green-50); color: var(--accent-strong);
    font-size: 13px; font-weight: 600; letter-spacing: .01em;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.025em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(42px, 6vw, 68px); font-weight: 800; margin-top: 18px; }
h1 .accent { color: var(--accent); }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--text-2); max-width: 34ch; margin: 20px 0 32px; }
@media (max-width: 900px) { .lede { margin-inline: auto; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--text-2); }

/* ---------- Phone mockup ---------- */

.phone {
    width: min(330px, 100%); margin-inline: auto; aspect-ratio: 9 / 19.2;
    border-radius: 54px; padding: 12px;
    background: linear-gradient(145deg, #2a2f2c, #0b0d0c);
    box-shadow: 0 40px 80px -30px rgba(10, 60, 40, .55), inset 0 0 0 2px rgba(255,255,255,.08);
    transform: rotate(-3deg);
}
.screen {
    position: relative; height: 100%; border-radius: 43px; overflow: hidden;
    background: #F2F4F3; color: #0F1A15; padding: 50px 16px 16px;
    font-size: 13px;
}
.screen::before { content: ""; position: absolute; top: 12px; left: 50%; translate: -50%; width: 100px; height: 28px; border-radius: 20px; background: #000; }
.screen h4 { margin: 4px 4px 2px; font-size: 26px; letter-spacing: -.02em; font-weight: 800; }
.screen .sub { margin: 0 4px 14px; color: #5d6b64; font-size: 12px; }

.safe {
    border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; color: #fff;
    background: linear-gradient(135deg, var(--green-600), var(--green-900));
}
.safe small { opacity: .8; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.safe b { display: block; font-size: 26px; letter-spacing: -.02em; margin-top: 2px; }

.group-label { margin: 12px 6px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #5d6b64; }
.bill-list { background: #fff; border-radius: 16px; overflow: hidden; }
.bill {
    display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center;
    padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,.06);
}
.bill:last-child { border-bottom: 0; }
.bill i { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-style: normal; font-size: 15px; }
.bill span { font-weight: 600; line-height: 1.2; }
.bill span em { display: block; font-style: normal; font-weight: 500; font-size: 11px; color: #5d6b64; }
.bill span em.late { color: var(--red); }
.bill b { font-variant-numeric: tabular-nums; }

/* ---------- Sections ---------- */

section { padding: 96px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head h2 { font-size: clamp(32px, 4.4vw, 48px); font-weight: 800; }
.section-head p { color: var(--text-2); font-size: 19px; margin: 16px 0 0; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.card h3 { font-size: 20px; margin: 18px 0 8px; letter-spacing: -.015em; }
.card p { margin: 0; color: var(--text-2); font-size: 16px; }

.tile {
    width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff;
}
.tile svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.t-green  { background: var(--green-600); }
.t-red    { background: var(--red); }
.t-orange { background: var(--orange); }
.t-blue   { background: var(--blue); }
.t-purple { background: #8A5CD6; }
.t-teal   { background: #1E9AA5; }
.t-pink   { background: #D6517E; }
.t-indigo { background: #5260D6; }
.t-gray   { background: #6B7A72; }

.alt { background: var(--surface-2); }

/* Split feature rows */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.split + .split { margin-top: 96px; }
.split.reverse > :first-child { order: 2; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); gap: 32px; } .split.reverse > :first-child { order: 0; } }
.split h2 { font-size: clamp(30px, 3.6vw, 40px); font-weight: 800; }
.split p { color: var(--text-2); font-size: 18px; }
.checks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks li::before {
    content: ""; flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
    background: var(--green-400) 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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-8.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: 28px;
    padding: 28px; box-shadow: var(--shadow);
}

/* Calendar panel */
.cal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.cal-head b { font-size: 20px; }
.cal-head span { color: var(--text-2); font-size: 14px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; font-size: 14px; }
.cal .dow { color: var(--text-2); font-size: 11px; font-weight: 700; text-transform: uppercase; padding-bottom: 4px; }
.cal .d { position: relative; padding: 10px 0 14px; border-radius: 12px; font-variant-numeric: tabular-nums; }
.cal .d.muted { opacity: .3; }
.cal .d.today { background: var(--green-600); color: #fff; font-weight: 700; }
.cal .d .dots { position: absolute; left: 0; right: 0; bottom: 5px; display: flex; justify-content: center; gap: 3px; }
.cal .d .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal .d .dots i.r { background: var(--red); }
.cal .d .dots i.o { background: var(--orange); }
.cal .d .dots i.b { background: var(--blue); }
.cal .d.today .dots i { background: #fff; }

/* Household panel */
.members { display: flex; margin-bottom: 20px; }
.members span {
    width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
    color: #fff; font-weight: 700; border: 3px solid var(--surface); margin-left: -10px;
}
.members span:first-child { margin-left: 0; }
.split-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.split-row:last-child { border-bottom: 0; }
.split-row b { font-variant-numeric: tabular-nums; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; margin: 6px 0 18px; }
.bar i { display: block; height: 100%; }
.invite {
    display: flex; gap: 8px; justify-content: center; margin-top: 18px;
    font: 700 22px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .1em;
}
.invite span { background: var(--surface-2); border-radius: 10px; padding: 12px 10px; }

/* Privacy band */
.privacy-band {
    background: linear-gradient(140deg, var(--green-700), var(--green-900));
    color: #EAF7F0; border-radius: 36px; padding: 64px;
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center;
}
.privacy-band h2 { font-size: clamp(30px, 3.6vw, 42px); font-weight: 800; color: #fff; }
.privacy-band p { color: #C3E6D5; font-size: 18px; }
.privacy-band a { color: #fff; text-decoration: underline; }
.privacy-band ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.privacy-band li {
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px; padding: 16px 18px; font-weight: 500;
}
.privacy-band li b { display: block; color: #fff; }
.privacy-band li span { color: #C3E6D5; font-size: 15px; font-weight: 400; }
@media (max-width: 900px) { .privacy-band { grid-template-columns: minmax(0, 1fr); padding: 40px 28px; border-radius: 28px; } }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    padding: 4px 22px; margin-bottom: 12px;
}
.faq summary {
    cursor: pointer; list-style: none; padding: 18px 28px 18px 0; position: relative;
    font-weight: 600; font-size: 18px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+"; position: absolute; right: 0; top: 50%; translate: 0 -50%;
    font-size: 24px; font-weight: 400; color: var(--text-2); transition: rotate .2s;
}
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { margin: 0 0 18px; color: var(--text-2); }

/* CTA */
.cta { text-align: center; }
.cta img { width: 112px; height: 112px; margin: 0 auto 28px; border-radius: 26px; box-shadow: 0 24px 48px -20px rgba(10,77,54,.6); }
.cta h2 { font-size: clamp(34px, 5vw, 54px); font-weight: 800; }
.cta p { color: var(--text-2); font-size: 19px; margin: 16px 0 32px; }

/* ---------- Legal / text pages ---------- */

.page { padding: 64px 0 96px; }
.prose { max-width: 720px; margin: 0 auto; }
.prose h1 { font-size: clamp(36px, 5vw, 52px); margin: 0 0 8px; }
.prose .updated { color: var(--text-2); margin: 0 0 40px; }
.prose h2 { font-size: 24px; margin: 44px 0 12px; letter-spacing: -.015em; }
.prose h3 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose .summary {
    background: var(--green-50); border-radius: 18px; padding: 20px 24px; margin-bottom: 32px;
}
.prose .summary p { margin: 0; color: var(--text); }

.support-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 32px 0 48px; }
@media (max-width: 640px) { .support-grid { grid-template-columns: 1fr; } }
.support-grid .card h3 { margin-top: 14px; }
.support-grid .card a.btn { margin-top: 18px; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); padding: 40px 0 56px; color: var(--text-2); font-size: 14px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 22px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }

/* ---------- Reveal-on-scroll ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Guide ---------- */

.guide { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 56px; align-items: start; }
.guide .prose { margin: 0; }
.guide section { padding: 0; scroll-margin-top: 88px; }
.toc { position: sticky; top: 96px; font-size: 15px; }
.toc-title { font-weight: 700; margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--text-2); }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
@media (max-width: 900px) {
    .guide { grid-template-columns: 1fr; gap: 24px; }
    .toc { position: static; background: var(--surface-2); border-radius: 18px; padding: 18px 20px; }
    .toc ol { border: 0; columns: 2; column-gap: 20px; }
    .toc a { padding: 4px 0; border: 0; margin: 0; }
}
@media (max-width: 480px) { .toc ol { columns: 1; } }

.prose ol.steps { list-style: none; counter-reset: step; padding: 0; }
.prose ol.steps li { counter-increment: step; position: relative; padding-left: 42px; margin-bottom: 14px; }
.prose ol.steps li::before {
    content: counter(step); position: absolute; left: 0; top: 0;
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: var(--green-600); color: #fff; font-size: 14px; font-weight: 700;
}
.prose .tip { background: var(--green-50); border-radius: 14px; padding: 14px 18px; color: var(--text); }
.prose em { font-style: normal; font-weight: 600; color: var(--text); }
.prose .phrases { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.prose .phrases li { background: var(--surface-2); border-radius: 999px; padding: 8px 16px; margin: 0; color: var(--text); font-weight: 500; }
.guide-help { margin-top: 56px; padding: 28px; border-radius: 22px; background: var(--surface-2); }
.guide-help h2 { margin-top: 0; }
.guide-help p { margin-bottom: 0; }
