/*
 * Home page.
 *
 * An editorial layout, deliberately unlike the application pages: this one is read once
 * by someone deciding whether to use the service, not used repeatedly by someone working.
 *
 * The palette is the three scoring bands. Nothing in it is decorative.
 *
 * No @import and no third-party host of any kind. The typefaces are declared in
 * tokens.css and served from assets/fonts/, so nobody outside is told who read this page.
 */

/* Palette, type system, reset, .btn, .wordmark, .eyebrow, .rule and .sr-only all come
   from tokens.css, which the application pages load too. Only what is specific to this
   page lives below. */

body.home {
    background: var(--paper);
}

.home h1,
.home h2,
.home h3 {
    line-height: 1.05;
}

/* No ".home a { color: inherit }" here. tokens.css already sets it on the bare element,
   and scoping it to a class raised its specificity above .btn - which silently painted
   the call-to-action's label in ink on an ink background. */

.measure {
    max-width: 62ch;
}

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

.hero {
    padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 5vw, 3.5rem);
}

/* No max-width: the three sentences are on their own rows, so the measure is set by the
   longest of them and a character limit here could only force a fourth line. */
.hero h1 {
    font-size: clamp(2.1rem, 1.1rem + 5.4vw, 4.75rem);
    margin-bottom: 1.4rem;
}

/* One row per sentence. Three claims, not a sentence that happens to wrap. */
.hero h1 span,
.hero h1 em {
    display: block;
}

.hero h1 em {
    font-style: normal;
    color: var(--promoter);
}

.hero-lede {
    font-size: clamp(1.08rem, 1rem + 0.4vw, 1.3rem);
    max-width: 52ch;
}

/* The interactive instrument ---------------------------------------------- */

.instrument {
    margin-top: clamp(2.5rem, 5vw, 3.75rem);
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 3px;
    background-image:
        linear-gradient(to right, rgba(16, 28, 38, .045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(16, 28, 38, .045) 1px, transparent 1px);
    background-size: 26px 26px;
    overflow: hidden;
}

.instrument-inner {
    padding: clamp(1.4rem, 3.5vw, 2.6rem);
}

.q {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(1.15rem, 1rem + 0.7vw, 1.6rem);
    letter-spacing: -0.015em;
    line-height: 1.25;
    margin: 0 0 1.6rem;
    max-width: 26ch;
}

.scale {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin: 0 0 0.65rem;
    padding: 0;
    list-style: none;
}

.scale button {
    width: 3.05rem;
    height: 3.05rem;
    flex: 0 0 auto;
    font-family: var(--mono);
    font-size: 0.95rem;
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--rule);
    border-radius: 50%;
    cursor: pointer;
    transition: background .18s, color .18s, border-color .18s, transform .18s;
}

.scale button:hover {
    border-color: var(--ink);
}

.scale button[data-band="detractor"].is-picked {
    background: var(--detractor);
    border-color: var(--detractor);
    color: #fff;
}

.scale button[data-band="passive"].is-picked {
    background: var(--passive);
    border-color: var(--passive);
    color: #fff;
}

.scale button[data-band="promoter"].is-picked {
    background: var(--promoter);
    border-color: var(--promoter);
    color: #fff;
}

.is-picked {
    transform: translateY(-3px);
}

.scale-ends {
    display: flex;
    justify-content: space-between;
    max-width: 37rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-soft);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.verdict {
    margin-top: 1.9rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--rule);
}

.verdict-idle {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--ink-soft);
}

.verdict-live[hidden] {
    display: none;
}

.verdict-line {
    font-family: var(--display);
    font-weight: 500;
    letter-spacing: -0.015em;
    font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
    margin: 0 0 1.3rem;
}

.verdict-line b {
    font-weight: 700;
}

.band-detractor {
    color: var(--detractor);
}

.band-passive {
    color: var(--passive);
}

.band-promoter {
    color: var(--promoter);
}

.tally {
    display: flex;
    height: 2.4rem;
    border-radius: 2px;
    overflow: hidden;
    background: var(--paper);
}

.tally span {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: #fff;
    transition: flex-basis .5s cubic-bezier(.4, 0, .2, 1);
    flex-grow: 0;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

.t-det { background: var(--detractor); }
.t-pas { background: var(--passive); }
.t-pro { background: var(--promoter); }

.tally-key {
    display: flex;
    gap: 1.4rem;
    flex-wrap: wrap;
    margin-top: 0.7rem;
    font-family: var(--mono);
    font-size: 0.73rem;
    color: var(--ink-soft);
}

.tally-key i {
    font-style: normal;
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    margin-right: 0.45rem;
}

/* Swatches as classes rather than style attributes: the CSP has no unsafe-inline,
   so an inline style attribute would simply not apply. */
.key-det { background: var(--detractor); }
.key-pas { background: var(--passive); }
.key-pro { background: var(--promoter); }

.maths {
    margin-top: 1.5rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    color: var(--ink-soft);
}

.maths strong {
    font-family: var(--display);
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.kept {
    margin-top: 1.4rem;
    padding: 0.9rem 1.05rem;
    background: var(--paper);
    border-radius: 2px;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.65;
    color: var(--ink-soft);
}

.kept b {
    color: var(--ink);
    font-weight: 500;
}

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

.section {
    padding-block: clamp(3.25rem, 7vw, 5.75rem);
}

.section h2 {
    font-size: clamp(1.75rem, 1.1rem + 2.4vw, 2.9rem);
    max-width: 20ch;
    margin-bottom: 1.2rem;
}

.section-lede {
    max-width: 62ch;
}

.section-lede-flush {
    margin: 0;
}

/* Bands ------------------------------------------------------------------- */

.bands {
    display: grid;
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
    border-radius: 3px;
    margin-top: 2.6rem;
    overflow: hidden;
}

@media (min-width: 56rem) {
    .bands {
        grid-template-columns: repeat(3, 1fr);
    }
}

.band {
    background: var(--card);
    padding: 1.5rem 1.4rem 1.7rem;
}

.band-range {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
}

.band h3 {
    font-size: 1.45rem;
    margin: 0.55rem 0 0.6rem;
}

.band p {
    margin: 0;
    font-size: 0.96rem;
    color: var(--ink-soft);
}

.band-bar {
    height: 4px;
    margin-top: 1.4rem;
    border-radius: 2px;
}

.band--detractor .band-range { color: var(--detractor); }
.band--detractor .band-bar { background: var(--detractor); }
.band--passive .band-range { color: var(--passive); }
.band--passive .band-bar { background: var(--passive); }
.band--promoter .band-range { color: var(--promoter); }
.band--promoter .band-bar { background: var(--promoter); }

.formula {
    margin-top: 2.6rem;
    padding: clamp(1.5rem, 4vw, 2.4rem);
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: var(--card);
}

.formula-eq {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: -0.03em;
    font-size: clamp(1.35rem, 0.9rem + 2vw, 2.35rem);
    line-height: 1.25;
    margin: 0;
}

.formula-note {
    margin: 1.1rem 0 0;
    font-size: 0.96rem;
    color: var(--ink-soft);
    max-width: 56ch;
}

/* Steps ------------------------------------------------------------------- */

.steps {
    margin-top: 2.8rem;
    counter-reset: step;
    display: grid;
    gap: 0;
}

.step {
    display: grid;
    gap: 0.35rem 1.9rem;
    padding-block: 1.75rem;
    border-top: 1px solid var(--rule);
    align-items: start;
}

.step:last-child {
    border-bottom: 1px solid var(--rule);
}

@media (min-width: 52rem) {
    .step {
        grid-template-columns: 3.5rem 20rem 1fr;
    }
}

.step-n {
    counter-increment: step;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--ink-soft);
    padding-top: 0.3rem;
}

.step-n::before {
    content: counter(step, decimal-leading-zero);
}

.step h3 {
    font-size: 1.22rem;
    letter-spacing: -0.015em;
}

.step p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.98rem;
    max-width: 50ch;
}

.step .who {
    display: inline-block;
    margin-top: 0.55rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    border: 1px solid var(--rule);
    border-radius: 2px;
    padding: 0.2em 0.55em;
}

.step pre {
    margin: 0.9rem 0 0;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.75;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 2px;
    padding: 0.85rem 1rem;
    color: var(--ink-soft);

    /* pre-wrap, not pre: the JSON lines are short and keep their shape, while the list
       of ten language names wraps instead of being clipped at the edge of the block. */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (min-width: 52rem) {
    .step pre {
        margin-top: 0;
    }
}

.step pre b {
    color: var(--ink);
    font-weight: 500;
}

/* Anonymity --------------------------------------------------------------- */

.privacy {
    background: var(--ink);
    color: var(--paper);
}

.privacy h2 {
    color: #fff;
}

.privacy .section-lede {
    color: #B9C7C7;
}

.privacy .eyebrow {
    color: #7E9494;
}

.never {
    list-style: none;
    padding: 0;
    margin: 2.4rem 0 0;
    display: grid;
    gap: 0.55rem;
    font-family: var(--mono);
    font-size: 0.92rem;
}

@media (min-width: 48rem) {
    .never {
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem 2.5rem;
    }
}

.never li {
    display: flex;
    gap: 0.85rem;
    align-items: baseline;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.never li s {
    text-decoration-color: var(--detractor);
    text-decoration-thickness: 2px;
    color: #8FA3A3;
}

.never li::before {
    content: "\00d7";
    color: var(--detractor);
    font-size: 1rem;
    line-height: 1;
}

.kept-list {
    margin-top: 2.6rem;
    padding-top: 1.8rem;
    border-top: 1px solid rgba(255, 255, 255, .16);
    font-family: var(--mono);
    font-size: 0.92rem;
    color: #B9C7C7;
    max-width: 60ch;
}

.kept-list b {
    color: #fff;
    font-weight: 500;
}

.thresholds {
    display: grid;
    gap: 1.6rem;
    margin-top: 2.6rem;
}

@media (min-width: 48rem) {
    .thresholds {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

.threshold {
    border-left: 2px solid var(--promoter);
    padding-left: 1.2rem;
}

.threshold h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 0.4rem;
}

.threshold p {
    margin: 0;
    color: #B9C7C7;
    font-size: 0.95rem;
}

/* Close and footer -------------------------------------------------------- */

.close-grid {
    display: grid;
    gap: 2rem;
    align-items: end;
}

@media (min-width: 52rem) {
    .close-grid {
        grid-template-columns: 1fr auto;
    }
}

.close-grid h2 {
    margin-bottom: 0.9rem;
}

.close-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.home footer {
    padding-block: 2.2rem 3rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-soft);
}

.home footer div {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* :not(.btn) is not needed today - the footer has no buttons - but the rule would
   outrank .btn the moment one was added, and it would be invisible. */
.home footer a:not(.btn) {
    color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
    .home *, .home *::before, .home *::after {
        transition: none !important;
        animation: none !important;
    }

    .is-picked {
        transform: none;
    }
}
