/* Public home page (visitor at `/`) — a long landing page: hero with the
   sign-in card, then the problem, the three pillars, a worked example, use
   cases, a comparison, getting started, FAQ and a closing call to action.
   Chrome, card and form come from public.css. Mobile first. */

/* ── Background: a turning star field (starfield.js) under the three-body
      figure eight (three_body.js), in DOM order. Fixed: it stays behind the
      whole scroll. ── */
.home-sky {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* three_body.js sets left/top/width/height to the eight's bounding box. */
.home-orbit { inset: auto; opacity: 0.75; }

/* Everything else sits above the canvas. */
.public-header,
.public-footer,
.home-main {
    position: relative;
    z-index: 1;
}

.public-nav { display: flex; gap: 0.5rem; }
.public-nav-link--quiet { border-color: transparent; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* The trails pass under the cards: a near-opaque night tint keeps text crisp.
   No backdrop-filter — over an animated canvas the blur is recomputed every
   frame, which was the page's single biggest cost. */
.home-auth,
.home-card,
.home-pillar,
.home-run-step,
.home-table-wrap,
.home-faq details {
    background: color-mix(in srgb, var(--bg-2) 90%, transparent);
}

/* Footer: the values on the left, the orbit's caption bottom right. */
.public-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    max-width: 72rem;
    width: 100%;
    margin: 0 auto;
    text-align: left;
}

.home-orbit-caption {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    color: var(--text-muted);
    font-style: italic;
    text-decoration: none;
}

.home-orbit-caption:hover { color: var(--text); text-decoration: underline; }

.home-caption-dots { display: inline-flex; gap: 0.2rem; }

.home-caption-dots i {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--accent-human);
}

.home-caption-dots i:nth-child(2) { background: var(--accent-machine); }
.home-caption-dots i:nth-child(3) { background: var(--accent-vivant); }

.home-main {
    flex: 1;
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1rem 1.25rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 4.5rem;
}

/* ── Hero ── */
.home-hero {
    display: grid;
    gap: 1.75rem;
}

@media (min-width: 900px) {
    .home-hero {
        min-height: calc(100vh - 9rem);
        min-height: calc(100dvh - 9rem);
        align-items: center;
        column-gap: 5rem;
        grid-template-columns: minmax(0, 1.25fr) minmax(20rem, 0.85fr);
    }
}

.home-kicker {
    margin: 0 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-title {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(1.75rem, 1.1rem + 3vw, 3.25rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.01em;
    max-width: 18ch;
}

.home-lead {
    margin: 1rem 0 0;
    color: var(--text-muted);
    font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
    max-width: 38rem;
}

.home-ctas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    margin-top: 1.75rem;
}

.home-ctas--center { justify-content: center; }

.home-cta { width: auto; padding: 0 1.75rem; }

.home-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 44px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.home-cta-link:hover { color: var(--text-strong); text-decoration: underline; }

/* ── Sections ── */
.home-section { scroll-margin-top: 1.5rem; }

.home-h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(1.4rem, 1.05rem + 1.6vw, 2.25rem);
    font-weight: 700;
    line-height: 1.18;
    max-width: 34ch;
}

.home-section-lead {
    margin: 1rem 0 0;
    color: var(--text-muted);
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.1rem);
    max-width: 44rem;
}

/* Shared card: problem and use-case grids. */
.home-problems,
.home-uses {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

@media (min-width: 720px) {
    .home-problems { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home-uses     { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
    .home-uses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.home-card {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.home-card h3 {
    margin: 0.75rem 0 0.4rem;
    color: var(--text-strong);
    font-size: 1.05rem;
}

.home-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.925rem;
}

.home-card-icon {
    font-size: 1.4rem;
    color: var(--danger-text);
}

.home-card-icon--machine { color: var(--machine-text); }

/* ── The three pillars ── */
.home-pillars {
    margin-top: 2rem;
    display: grid;
    gap: 1rem;
}

@media (min-width: 900px) {
    .home-pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.home-pillar {
    padding: 1.5rem 1.4rem;
    border: 1px solid var(--border);
    border-top: 3px solid var(--pillar-accent);
    border-radius: 0.75rem;
}


/* "Human / Machine / Earth": the body a pillar answers to, in its pole's colour.
   Shared by the pillars and the three-bodies section. */
.home-pillar--human,   .home-body--human   { --pillar-accent: var(--accent-human);   --pillar-text: var(--human-text); }
.home-pillar--machine, .home-body--machine { --pillar-accent: var(--accent-machine); --pillar-text: var(--machine-text); }
.home-pillar--vivant,  .home-body--vivant  { --pillar-accent: var(--accent-vivant);  --pillar-text: var(--vivant-text); }

.home-body-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--pillar-text);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.home-body-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: var(--pillar-accent);
}

.home-pillar h3 {
    margin: 0.9rem 0 0.5rem;
    color: var(--text-strong);
    font-size: 1.2rem;
    line-height: 1.25;
}

.home-pillar > p {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
}

.home-checks {
    list-style: none;
    margin: 1.1rem 0 0;
    padding: 1rem 0 0;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 0.6rem;
}

.home-checks li {
    position: relative;
    padding-left: 1.4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.home-checks li::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: 0.35rem;
    width: 0.55rem;
    height: 0.3rem;
    border-left: 2px solid var(--pillar-accent);
    border-bottom: 2px solid var(--pillar-accent);
    transform: rotate(-45deg);
}

.home-checks em { color: var(--text); }

/* ── Worked example: a mock run, one step per pole ── */
.home-example-section {
    display: grid;
    gap: 2rem;
}

@media (min-width: 900px) {
    .home-example-section {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        column-gap: 4rem;
        align-items: center;
    }
}

.home-run {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.home-run-step {
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--step-accent, var(--border-strong));
    border-radius: 0.6rem;
}

.home-run-step--tool     { --step-accent: var(--accent-machine); }
.home-run-step--approval { --step-accent: var(--accent-human); border-color: var(--human-border); }
.home-run-step--cost     { --step-accent: var(--accent-vivant); }

.home-run-who {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-run-step--tool .home-run-who     { color: var(--machine-text); }
.home-run-step--approval .home-run-who { color: var(--human-text); }
.home-run-step--cost .home-run-who     { color: var(--vivant-text); }

.home-run-step p {
    margin: 0.35rem 0 0;
    color: var(--text);
    font-size: 0.95rem;
}

.home-run-step q { color: var(--text-strong); font-style: italic; }
.home-run-step strong { color: var(--text-strong); }

.home-run-note {
    display: block;
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.825rem;
}

.home-run-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.home-fake-btn {
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.45rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.home-fake-btn--chosen {
    border-color: var(--accent-human);
    background: var(--accent-human);
    color: var(--on-human);
}

/* ── Comparison ── */
.home-table-wrap {
    margin-top: 2rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow-x: auto;
}

.home-table {
    width: 100%;
    min-width: 36rem;
    border-collapse: collapse;
    font-size: 0.925rem;
}

.home-table th,
.home-table td {
    padding: 0.85rem 1.1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.home-table tbody tr:last-child > * { border-bottom: none; }

.home-table thead th {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-table thead th:last-child { color: var(--human-text); }

.home-table tbody th {
    color: var(--text-strong);
    font-weight: 600;
    width: 30%;
}

.home-table td { color: var(--text-muted); }
.home-table td:last-child { color: var(--text-strong); }

/* ── Getting started ── */
.home-start {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 720px) {
    .home-start { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.home-start-n {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--human-border);
    border-radius: 999px;
    background: var(--human-soft);
    color: var(--human-text);
    font-weight: 700;
}

.home-start h3 {
    margin: 0.8rem 0 0.3rem;
    color: var(--text-strong);
    font-size: 1.05rem;
}

.home-start p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.925rem;
}

/* ── FAQ ── */
.home-faq {
    margin-top: 2rem;
    display: grid;
    gap: 0.6rem;
    max-width: 48rem;
}

.home-faq details {
    border: 1px solid var(--border);
    border-radius: 0.6rem;
}

.home-faq summary {
    min-height: 44px;
    padding: 0.85rem 1.1rem;
    color: var(--text-strong);
    font-weight: 600;
    cursor: pointer;
}

.home-faq details p {
    margin: 0;
    padding: 0 1.1rem 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ── Why three bodies ── */
.home-bodies-list {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 720px) {
    .home-bodies-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.home-body {
    padding-left: 1rem;
    border-left: 2px solid var(--pillar-accent);
}

.home-body h3 {
    margin: 0.5rem 0 0.3rem;
    color: var(--text-strong);
    font-size: 1.1rem;
}

.home-body p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.home-bodies-coda {
    margin: 2rem 0 0;
    max-width: 44rem;
    color: var(--text);
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.1rem);
    font-style: italic;
}

/* ── Closing call to action ── */
.home-final {
    padding: 3rem 1.25rem;
    border: 1px solid var(--human-border);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--bg-2) 88%, var(--accent-human) 4%);
    text-align: center;
}

.home-final .home-h2,
.home-final .home-section-lead { margin-left: auto; margin-right: auto; }

/* On a phone the two answers stack under their question, so the HiGGiNS
   column is never scrolled out of view. */
@media (max-width: 639px) {
    .home-table { min-width: 0; }
    .home-table thead { display: none; }
    .home-table tr,
    .home-table th,
    .home-table td,
    .home-table tbody th { display: block; width: auto; }
    .home-table tbody tr { padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border); }
    .home-table tbody tr:last-child { border-bottom: none; }
    .home-table tbody th,
    .home-table td { padding: 0; border: none; }
    .home-table td { margin-top: 0.5rem; }
    .home-table td::before {
        content: attr(data-label);
        display: block;
        color: var(--text-muted);
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }
    .home-table td:last-child::before { color: var(--human-text); }
}
