/* ---- Marketing home page ----
   Everything here is prefixed `home-` and only loaded by home/index.php, so it
   can set its own scale without colliding with the app components in app.css
   (which owns the generic .hero / .card / .btn / .features names).

   Colours come from the app.css token block — no hex literals — so the page
   stays in step with the header and the rest of the product. */
.home {
    /* The page is designed at a 16px base; app.css sets the app-wide 13px. */
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);

    /* One swap point for the display face. Space Grotesk is the intended
       design font but it isn't self-hosted yet and the CSP blocks Google
       Fonts, so it falls through to the body stack until a @font-face lands. */
    --home-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --home-max: 1080px;
}

/* Baselines, not overrides. Wrapped in :where() so they carry zero specificity:
   a plain `.home h2 { margin: 0 }` would be (0,1,1) and beat every single-class
   component rule below it — which silently drops their margins, including the
   `margin: … auto` that centres a fixed-width block. */
:where(.home h1, .home h2, .home h3) {
    font-family: var(--home-display);
    color: var(--text-primary);
    line-height: 1.15;
    font-weight: 500;
    margin: 0;
}

:where(.home p) { margin: 0; }

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

.home-section {
    padding: 88px 0;
    /* Clear the sticky 56px header when jumped to via #features / #how. */
    scroll-margin-top: 56px;
}

/* Hairline between stacked sections — the top one goes without so it doesn't
   double up with the header's own border. */
.home-section--line { border-top: 1px solid var(--border-subtle); }

.home-center { text-align: center; }

.home-kicker {
    font-family: var(--home-display);
    color: var(--accent);
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.home h2 {
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -0.015em;
    margin-bottom: 16px;
}

.home-lede {
    max-width: 560px;
    color: var(--text-secondary);
    font-size: 16.5px;
}

.home-center .home-lede { margin: 0 auto; }

/* ---- Buttons ----
   app.css .btn is a fixed 36px control sized for dense app chrome; the landing
   page wants a larger, roomier button, so these are their own thing. */
.home-btn {
    display: inline-block;
    font-family: var(--home-display);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    padding: 11px 24px;
    border-radius: 8px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.home-btn:active { transform: scale(0.98); }

.home-btn--teal {
    background: var(--accent);
    color: var(--text-on-accent);
}

.home-btn--teal:hover { background: var(--accent-hover); }

.home-btn--ghost {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.home-btn--ghost:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* ---- Hero ---- */
.home-hero {
    position: relative;
    overflow: hidden;
    padding: 96px 0 72px;
    text-align: center;
}

/* Oversized watermark Z behind the copy. aria-hidden in the markup. */
.home-hero__z {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -54%);
    width: 720px;
    max-width: 140vw;
    opacity: 0.05;
    pointer-events: none;
}

.home-hero__content { position: relative; }

.home-hero h1 {
    font-size: clamp(40px, 6.5vw, 68px);
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.home-hero__sub {
    font-family: var(--home-display);
    color: var(--accent);
    font-size: clamp(15px, 2vw, 18px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.home-hero__lede {
    max-width: 520px;
    margin: 0 auto 34px;
    color: var(--text-secondary);
    font-size: 17px;
}

.home-hero__ctas {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---- Product mock: a still of the task board ---- */
.home-mock {
    max-width: 820px;
    margin: 64px auto 0;
    background: var(--surface-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 18px 18px 22px;
    text-align: left;
}

.home-mock__top {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px 14px;
}

.home-mock__dot {
    width: 9px;
    height: 9px;
    border-radius: var(--radius-pill);
    background: var(--border-strong);
}

.home-mock__url {
    margin-left: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

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

.home-mock__col {
    background: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px;
}

.home-mock__col h4 {
    font-family: var(--home-display);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.home-mock__count {
    color: var(--text-muted);
    letter-spacing: 0;
    font-family: inherit;
}

/* "Later" reads as the parked column, so its heading drops back. */
.home-mock__col--dim h4 { color: var(--text-muted); }

.home-mock__card {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 9px 11px;
    margin-bottom: 8px;
}

.home-mock__card:last-child { margin-bottom: 0; }

.home-mock__card p {
    font-size: 12.5px;
    color: var(--text-primary);
    line-height: 1.45;
}

.home-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    margin-bottom: 5px;
    background: var(--accent-dim);
    color: var(--accent);
}

/* Two supporting tag hues, both taken from the existing palette rather than
   introducing new ones. Decorative only — nothing keys off them. */
.home-tag--violet { background: #8B5CF61F; color: var(--signal-motion); }
.home-tag--amber { background: #F973161F; color: var(--ws-boredlisted); }

/* ---- Features ---- */
.home-feats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 52px;
}

.home-feat {
    background: var(--surface-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 30px 26px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.home-feat:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.home-feat__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.home-feat__icon svg {
    display: block;
    width: 22px;
    height: 22px;
    stroke: var(--accent);
}

.home-feat h3 { font-size: 19px; margin-bottom: 10px; }
.home-feat p { font-size: 14.5px; color: var(--text-secondary); }

/* ---- Steps ---- */
.home-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 56px;
}

.home-step { text-align: center; }

.home-step__num {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-pill);
    background: var(--accent-dim);
    color: var(--accent);
    font-family: var(--home-display);
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.home-step h3 { font-size: 18px; margin-bottom: 8px; }
.home-step p { font-size: 14.5px; color: var(--text-secondary); }
.home-step b { color: var(--text-primary); font-weight: 500; }

/* ---- Origin note ---- */
.home-origin {
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface-panel);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent);
    border-radius: 0 14px 14px 0;
    padding: 34px 38px;
}

.home-origin__k {
    font-family: var(--home-display);
    color: var(--text-primary);
    font-size: 18px;
    /* 600 is the heaviest weight app.css uses — the page's bold. */
    font-weight: 600;
    margin-bottom: 10px;
}

.home-origin p { color: var(--text-secondary); font-size: 15.5px; }

/* ---- Closing CTA ---- */
.home-cta {
    text-align: center;
    padding: 104px 0;
}

.home-cta h2 { font-size: clamp(30px, 4.5vw, 46px); }

.home-cta__sub {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 10px 0 32px;
}

.home-cta__sub b { color: var(--accent); font-weight: 500; }

/* ---- Scroll reveal (home.js adds .is-in) ---- */
.home-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.home-reveal.is-in {
    opacity: 1;
    transform: none;
}

/* ---- Logo draw-on ---- */
.home-hero__z path {
    stroke-dasharray: 240;
    stroke-dashoffset: 240;
    animation: home-draw 1.1s ease forwards 0.2s;
}

@keyframes home-draw {
    to { stroke-dashoffset: 0; }
}

/* app.css already kills transitions/animations under reduced motion; these
   two need explicit resets because they start from a hidden/offset state. */
@media (prefers-reduced-motion: reduce) {
    .home-reveal { opacity: 1; transform: none; }
    .home-feat:hover { transform: none; }
    .home-hero__z path { stroke-dasharray: none; stroke-dashoffset: 0; }
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
    .home-feats,
    .home-steps { grid-template-columns: 1fr; }

    .home-steps { gap: 32px; }
    .home-section { padding: 64px 0; }
    .home-hero { padding: 72px 0 56px; }
    .home-cta { padding: 72px 0; }
    .home-mock__cols { grid-template-columns: 1fr; }

    /* Two columns tell the Now/Next story; the third is just weight on mobile. */
    .home-mock__col--dim { display: none; }

    .home-origin { padding: 26px 24px; }
}
