/* Todo — one stylesheet.
   A calm desk-tool look: paper-grey ground with a slight green bias, ink
   text, project colours doing the identifying. Light and dark both defined
   at token level; components only ever use the tokens. */

:root {
    --ground:   #f4f5f2;
    --card:     #ffffff;
    --sunk:     #eceee9;
    --ink:      #21261f;
    --ink-2:    #5a6156;
    --ink-3:    #8a9184;
    --line:     rgba(40, 52, 36, 0.14);
    --line-soft:rgba(40, 52, 36, 0.07);
    --accent:   #2f6b3f;
    --accent-2: #24552f;
    --red:      #b3261e;
    --red-soft: #fbeae9;
    --ok-soft:  #e6f2e8;
    --shadow:   0 1px 2px rgba(30, 40, 25, .05), 0 8px 22px -12px rgba(30, 40, 25, .18);
    --r:        10px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ground:   #171a15;
        --card:     #21251e;
        --sunk:     #12140f;
        --ink:      #e8ebe4;
        --ink-2:    #a8b0a0;
        --ink-3:    #7a8272;
        --line:     rgba(220, 235, 210, 0.14);
        --line-soft:rgba(220, 235, 210, 0.07);
        --accent:   #7fbf8e;
        --accent-2: #9fd3ab;
        --red:      #ff8d85;
        --red-soft: #3a221f;
        --ok-soft:  #223526;
        --shadow:   0 1px 2px rgba(0,0,0,.4), 0 8px 22px -12px rgba(0,0,0,.5);
    }
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    overflow-x: clip;
}

a { color: inherit; }

h1 { font-size: 1.45rem; margin: 0 0 .2rem; letter-spacing: -.01em; }
h2 { font-size: 1.02rem; margin: 0 0 .7rem; }
h2 .count { font-weight: 400; color: var(--ink-3); font-size: .85rem; margin-left: .4rem; }
.red { color: var(--red); }
.muted { color: var(--ink-2); }
.small { font-size: .8rem; }

/* ------------------------------------------------------------------ nav */
.nav {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 10;
}
.nav-inner {
    max-width: 1060px; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: center; gap: 4px;
    overflow-x: auto; min-height: 52px;
}
.brand { font-weight: 700; text-decoration: none; margin-right: 10px; color: var(--accent); white-space: nowrap; }
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-links a, .nav-side a {
    text-decoration: none; color: var(--ink-2);
    padding: 6px 10px; border-radius: 7px; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px; font-size: .92rem;
}
.nav-links a:hover, .nav-side a:hover { background: var(--sunk); color: var(--ink); }
.nav-links a.on, .nav-side a.on { background: var(--sunk); color: var(--ink); font-weight: 600; }
.nav-side { display: flex; align-items: center; gap: 2px; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.big { width: 13px; height: 13px; margin-right: 8px; }

/* ----------------------------------------------------------------- page */
.wrap { max-width: 1060px; margin: 0 auto; padding: 26px 16px 70px; }
.page-head { margin-bottom: 20px; }
.page-head p { margin: .2rem 0 0; }
.block { margin-top: 30px; }

.flash {
    padding: 10px 14px; border-radius: var(--r); margin-bottom: 18px;
    background: var(--ok-soft); border: 1px solid var(--line);
}
.flash.error { background: var(--red-soft); color: var(--red); }

.foot {
    max-width: 1060px; margin: 0 auto; padding: 14px 16px 30px;
    color: var(--ink-3); font-size: .8rem; border-top: 1px solid var(--line-soft);
}

/* ---------------------------------------------------------------- cards */
.cards {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    margin-bottom: 8px;
}
.card {
    background: var(--card); border: 1px solid var(--line);
    border-left: 4px solid var(--accent, var(--line));
    border-left-color: var(--accent);
    border-radius: var(--r); padding: 14px 16px;
    text-decoration: none; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 6px;
}
.card:hover { border-color: var(--ink-3); border-left-color: var(--accent); }
.card-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.card-stats { display: flex; gap: 14px; font-size: .9rem; color: var(--ink-2); }
.card-stats b { font-size: 1.05rem; color: var(--ink); }
.card-stats .red b { color: var(--red); }
.card-meta { font-size: .8rem; color: var(--ink-3); }
.card-new {
    border-style: dashed; border-left-width: 1px; box-shadow: none;
    justify-content: center; gap: 8px;
}
.card-new input { width: 100%; }

/* ---------------------------------------------------------------- lists */
.list { display: flex; flex-direction: column; }
.item {
    display: flex; align-items: center; gap: 6px 9px; flex-wrap: wrap;
    padding: 8px 10px; border-bottom: 1px solid var(--line-soft);
    background: var(--card);
}
/* On a narrow screen the badges drop to a second line rather than
   stretching the page sideways. */
.item .item-title { flex: 1 1 12rem; }
.item:first-child { border-radius: var(--r) var(--r) 0 0; }
.item:last-child { border-radius: 0 0 var(--r) var(--r); border-bottom: 0; }
.item:only-child { border-radius: var(--r); }
.list .item:first-child { border-top: 1px solid var(--line-soft); }
.item.done .item-title { text-decoration: line-through; color: var(--ink-3); }
.item-title { flex: 1; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.item-title:hover { text-decoration: underline; }

.tick {
    width: 21px; height: 21px; border-radius: 6px; flex: none;
    border: 1.6px solid var(--ink-3); background: transparent;
    cursor: pointer; color: transparent; font-size: 13px; line-height: 1;
    display: grid; place-content: center; padding: 0;
}
.tick:hover { border-color: var(--accent); }
.tick.ticked { background: var(--accent); border-color: var(--accent); color: var(--card); }

.badge {
    font-size: .72rem; padding: 1.5px 8px; border-radius: 99px;
    background: var(--sunk); color: var(--ink-2); white-space: nowrap;
}
.badge.p1 { background: var(--red-soft); color: var(--red); font-weight: 600; }
.badge.p3 { opacity: .8; }
.badge.ok { background: var(--ok-soft); color: var(--accent-2); font-weight: 600; }
.badge.bell { background: transparent; padding: 0; }

.chip {
    font-size: .74rem; text-decoration: none; white-space: nowrap;
    padding: 1.5px 8px; border-radius: 99px;
    background: color-mix(in srgb, var(--chip, #888) 14%, transparent);
    color: var(--chip, var(--ink-2)); font-weight: 600;
}

.due { font-size: .82rem; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due.overdue { color: var(--red); font-weight: 600; }

.done-fold { margin-top: 14px; }
.done-fold summary { cursor: pointer; color: var(--ink-2); font-size: .9rem; padding: 4px 0; }

/* -------------------------------------------------------------- columns */
.columns { display: grid; grid-template-columns: 1.2fr .8fr; gap: 34px; align-items: start; }
@media (max-width: 860px) { .columns { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- forms */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 8px; padding: 7px 10px; max-width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 1px;
}
textarea { width: 100%; resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; color: var(--ink-2); }
label > input, label > select { color: var(--ink); }

.btn {
    background: var(--accent); color: var(--ground);
    border: 1px solid var(--accent); border-radius: 8px;
    padding: 7px 16px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); text-decoration: none; display: inline-block; }
.linky {
    background: none; border: 0; padding: 4px; cursor: pointer;
    color: var(--ink-2); font-size: .9rem;
}
.linky:hover { color: var(--ink); text-decoration: underline; }
.linky.danger { color: var(--red); }

.inline { display: inline; }
.row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; max-width: 620px; }

.quick-add {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--r); padding: 10px;
}
.quick-add input[name="title"] { flex: 1; min-width: 160px; border: 0; background: transparent; }
.quick-add input[type="date"], .quick-add select { font-size: .85rem; color: var(--ink-2); }

.log-add { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.log-add .row { justify-content: space-between; }

/* ------------------------------------------------------------------ log */
.loglist { display: flex; flex-direction: column; gap: 2px; }
.logrow {
    /* Flex, not grid: some rows carry a project chip, some a delete button,
       and flex lets the optional pieces come and go without column games. */
    display: flex; gap: 6px 10px; align-items: flex-start; flex-wrap: wrap;
    padding: 9px 10px; border-bottom: 1px solid var(--line-soft);
    background: var(--card);
}
.logrow:first-child { border-radius: var(--r) var(--r) 0 0; border-top: 1px solid var(--line-soft); }
.logrow:last-child { border-radius: 0 0 var(--r) var(--r); border-bottom: 0; }
.logrow .chip { margin-top: 2px; }
.log-date { color: var(--ink-3); font-size: .82rem; white-space: nowrap; padding-top: 1px; flex: none; width: 76px; }
.log-body { overflow-wrap: anywhere; flex: 1 1 15rem; min-width: 0; }

/* ------------------------------------------------------------- settings */
.settings-form h2 { margin-top: 12px; }
pre {
    background: var(--sunk); border: 1px solid var(--line-soft); border-radius: 8px;
    padding: 10px 12px; overflow-x: auto; font-size: .8rem;
}
code { background: var(--sunk); padding: 1px 5px; border-radius: 5px; font-size: .86em; }
.table { border-collapse: collapse; width: 100%; background: var(--card); border-radius: var(--r); }
.table th, .table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table th { color: var(--ink-2); font-size: .8rem; font-weight: 600; }

.project-settings { margin-top: 40px; color: var(--ink-2); }
.project-settings summary { cursor: pointer; font-size: .9rem; }
.project-settings form { margin-top: 14px; }

/* ---------------------------------------------------------------- login */
.login-card {
    max-width: 360px; margin: 9vh auto 0;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 14px; padding: 30px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 8px;
}
.login-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.login-card h1 { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
    .card, .btn { transition: filter .12s ease, border-color .12s ease; }
}

/* --------------------------------------------------------------- people */
.ava {
    width: 26px; height: 26px; border-radius: 50%; flex: none;
    display: inline-grid; place-content: center;
    background: color-mix(in srgb, var(--tint, #888) 18%, transparent);
    color: var(--tint, var(--ink-2));
    font-size: .68rem; font-weight: 700; letter-spacing: .02em;
    text-decoration: none;
}
.ava.sm { width: 22px; height: 22px; font-size: .6rem; }

.invite-link {
    flex: 1 1 12rem; min-width: 0; font-size: .78rem; color: var(--ink-2);
    background: var(--sunk); border-color: var(--line-soft);
}

/* ----------------------------------------------------- workspace switcher */
.menu { position: relative; flex: none; }
.menu summary {
    list-style: none; cursor: pointer; white-space: nowrap;
    padding: 6px 10px; border-radius: 7px; font-weight: 600; font-size: .92rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--sunk); }
.menu[open] summary { background: var(--sunk); }
.menu-body {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
    min-width: 220px; padding: 6px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 10px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 2px;
}
.menu-body form button {
    width: 100%; text-align: left; background: none; border: 0;
    padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: .92rem;
}
.menu-body form button:hover { background: var(--sunk); }
.menu-new { display: flex; gap: 4px; border-top: 1px solid var(--line-soft); padding-top: 6px; margin-top: 4px; }
.menu-new input { flex: 1; min-width: 0; font-size: .85rem; padding: 5px 8px; }
.menu-new button { flex: none !important; width: auto !important; }

.block-first { margin-top: 4px; }

/* ---------------------------------------------------------------- landing
   The marketing page has its own register: deep-green bands top and bottom,
   Fraunces display type, the light sections between. Colours here are
   explicit — the hero is dark green in both themes, by design. */

.landing { --pine: #16311f; --pine-2: #1d3f28; --cream: #f7f6ef; }
.landing main { max-width: none; padding: 0; }

.landing h1, .landing h2 {
    font-family: Fraunces, Georgia, "Times New Roman", serif;
    font-weight: 650; letter-spacing: -.015em;
}

.eyebrow {
    font-size: .78rem; font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase; color: var(--accent); margin: 0 0 10px;
}

.band-inner { max-width: 1060px; margin: 0 auto; padding: 64px 20px; }

/* -------- hero: the dark band, nav included */
.hero { background: linear-gradient(168deg, var(--pine) 0%, var(--pine-2) 100%); color: var(--cream); }
.hero-nav {
    max-width: 1060px; margin: 0 auto; padding: 18px 20px 0;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.hero-brand { font-weight: 700; font-size: 1.08rem; text-decoration: none; color: var(--cream); }
.hero-nav-side { display: flex; align-items: center; gap: 14px; }
.hero-link { color: rgba(247, 246, 239, .85); text-decoration: none; font-size: .95rem; }
.hero-link:hover { color: var(--cream); text-decoration: underline; }

.btn-hero {
    display: inline-block; text-decoration: none; text-align: center;
    padding: 11px 26px; border-radius: 10px; font-weight: 650; font-size: 1rem;
    color: var(--cream); border: 1.5px solid rgba(247, 246, 239, .45);
}
.btn-hero:hover { border-color: var(--cream); }
.btn-hero.solid { background: var(--cream); border-color: var(--cream); color: var(--pine); }
.btn-hero.solid:hover { filter: brightness(.96); }
.btn-hero.sm { padding: 7px 16px; font-size: .9rem; border-radius: 8px; }
.btn-hero.lg { padding: 13px 32px; font-size: 1.08rem; }

.hero-inner {
    max-width: 1060px; margin: 0 auto; padding: 72px 20px 88px;
    display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
}
.hero-copy h1 {
    font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.08;
    margin: 0 0 18px; text-wrap: balance; color: var(--cream);
}
.hero-copy h1 em { font-style: italic; color: #a9d9b4; }
.hero-copy p { font-size: 1.1rem; line-height: 1.6; color: rgba(247, 246, 239, .82); max-width: 46ch; margin: 0 0 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { font-size: .82rem; color: rgba(247, 246, 239, .55); margin: 14px 0 0; }

/* the product card floating on the dark ground */
.mock-card {
    background: #ffffff; color: #21261f;
    border-radius: 14px; padding: 18px; max-width: 430px; margin-left: auto;
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .5), 0 4px 14px rgba(0, 0, 0, .25);
    transform: rotate(.8deg);
}
.mock-head { font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mock-dot { width: 11px; height: 11px; border-radius: 50%; }
.mock-row {
    display: flex; align-items: center; gap: 8px; padding: 8px 2px;
    border-top: 1px solid rgba(40, 52, 36, .08); font-size: .92rem;
}
.mock-row s { color: #8a9184; }
.mock-tick {
    width: 18px; height: 18px; border-radius: 5px; flex: none;
    border: 1.5px solid #8a9184; display: grid; place-content: center;
    font-size: 11px; color: transparent;
}
.mock-tick.done { background: #2f6b3f; border-color: #2f6b3f; color: #fff; }
.mock-badge {
    font-size: .68rem; padding: 1px 7px; border-radius: 99px;
    background: #fbeae9; color: #b3261e; font-weight: 600;
}
.mock-ava {
    width: 20px; height: 20px; border-radius: 50%; flex: none; margin-left: auto;
    display: grid; place-content: center; font-size: .58rem; font-weight: 700;
    background: color-mix(in srgb, var(--tint, #888) 18%, #fff);
    color: var(--tint, #5a6156);
}
.mock-row .mock-badge + .mock-ava, .mock-row s + .mock-ava { margin-left: auto; }
.mock-due { font-size: .78rem; color: #5a6156; white-space: nowrap; }
.mock-due.red { color: #b3261e; font-weight: 600; }
.mock-log {
    margin-top: 12px; padding: 10px 12px; background: #eef0ea;
    border-radius: 9px; font-size: .84rem; color: #5a6156; line-height: 1.5;
}
.mock-log b { display: block; color: #21261f; margin-bottom: 2px; }

/* -------- light bands */
.features { background: var(--card); border-bottom: 1px solid var(--line-soft); }
.features h2, .digest h2, .steps h2 {
    font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.15; margin: 0 0 30px;
}
.feature-grid {
    display: grid; gap: 26px 34px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.feature { border-top: 2px solid var(--line); padding-top: 16px; }
.feature-ico { display: inline-block; width: 26px; height: 26px; color: var(--accent); margin-bottom: 8px; }
.feature-ico svg { width: 100%; height: 100%; }
.feature b { display: block; margin-bottom: 4px; font-size: 1.02rem; }
.feature p { margin: 0; color: var(--ink-2); font-size: .93rem; line-height: 1.55; }

/* -------- digest band: the email is the pitch */
.digest { background: var(--ground); border-bottom: 1px solid var(--line-soft); }
.digest-inner { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; }
.digest-p { color: var(--ink-2); font-size: 1.02rem; line-height: 1.65; max-width: 44ch; margin: 0; }
.mail-mock {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow); overflow: hidden;
}
.mail-head {
    padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
    display: flex; flex-direction: column; gap: 3px; font-size: .86rem;
}
.mail-k {
    display: inline-block; width: 56px; color: var(--ink-3);
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
}
.mail-body {
    margin: 0; padding: 14px 16px 18px; border: 0; background: transparent;
    font: .8rem/1.65 ui-monospace, "Cascadia Mono", Consolas, monospace;
    color: var(--ink-2); overflow-x: auto;
}

/* -------- steps */
.steps { background: var(--card); border-bottom: 1px solid var(--line-soft); }
.step-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.step-n {
    display: inline-grid; place-content: center; width: 34px; height: 34px;
    border-radius: 50%; background: var(--accent); color: var(--card);
    font-weight: 700; margin-bottom: 10px;
}
.step b { display: block; margin-bottom: 3px; }
.step p { margin: 0; color: var(--ink-2); font-size: .93rem; }

/* -------- closing band */
.closer { background: linear-gradient(168deg, var(--pine-2) 0%, var(--pine) 100%); }
.closer-inner { text-align: center; padding-top: 76px; padding-bottom: 84px; }
.closer h2 {
    color: var(--cream); font-size: clamp(1.6rem, 3.4vw, 2.3rem);
    line-height: 1.18; margin: 0 0 28px; text-wrap: balance;
}

.landing-foot {
    background: var(--pine); color: rgba(247, 246, 239, .5);
    text-align: center; font-size: .84rem; padding: 0 20px 34px; margin: 0; border: 0;
}
.landing-foot a { color: rgba(247, 246, 239, .7); }

@media (max-width: 880px) {
    .hero-inner { grid-template-columns: 1fr; padding: 48px 20px 64px; gap: 40px; }
    .mock-card { margin: 0 auto; transform: none; }
    .digest-inner { grid-template-columns: 1fr; gap: 30px; }
    .step-row { grid-template-columns: 1fr; gap: 22px; }
    .band-inner { padding: 48px 20px; }
}
