:root {
    --bg: #F5F6FB;
    --fg: #14172B;
    --muted: #474D68;
    --card: #FFFFFF;
    --line: #D5DAEE;
    --brand: #4B5FE3;
    --brand-hover: #3A4DD0;
    --accent: #3447C4;
    --chip: #E7EAFB;
    --field: #F5F6FB;
    --field-line: #AEB5D3;
    --danger: #B3261E;
    --invalid-bg: #FDF3F2;
    --ok: #1B6B3D;
    --note-bg: #FFF4DB;
    --note-fg: #5B3B00;
    --bad-bg: #FDECEA;
    --bad-fg: #7A1A14;
    --shadow: 0 1px 2px rgba(20, 23, 43, 0.06), 0 14px 36px rgba(20, 23, 43, 0.09);
    /* The diagram is a dark panel in both themes, with its own colors. */
    --panel: #12163F;
    --panel-2: #1B2160;
    --panel-line: #6272E8;
    --panel-text: #FFFFFF;
    --panel-muted: #C5CBF3;
    --panel-glow: #9AA7F7;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0A0D22;
        --fg: #F1F2FB;
        --muted: #B6BCDD;
        --card: #141940;
        --line: #2B3274;
        --accent: #A5B0F8;
        --chip: #1D2358;
        --field: #0D1130;
        --field-line: #4A53A0;
        --danger: #FF9C93;
        --invalid-bg: #2A1517;
        --ok: #7DDBA0;
        --note-bg: #3A2F10;
        --note-fg: #FFDFA0;
        --bad-bg: #3F1B1A;
        --bad-fg: #FFB4AB;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 36px rgba(0, 0, 0, 0.45);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0A0D22;
    --fg: #F1F2FB;
    --muted: #B6BCDD;
    --card: #141940;
    --line: #2B3274;
    --accent: #A5B0F8;
    --chip: #1D2358;
    --field: #0D1130;
    --field-line: #4A53A0;
    --danger: #FF9C93;
    --invalid-bg: #2A1517;
    --ok: #7DDBA0;
    --note-bg: #3A2F10;
    --note-fg: #FFDFA0;
    --bad-bg: #3F1B1A;
    --bad-fg: #FFB4AB;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 36px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--fg);
    background: var(--bg);
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.page {
    max-width: 1120px;
    margin: 0 auto;
    padding-block: 28px 40px;
    display: flex;
    flex-direction: column;
    gap: 72px;
}

.top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}

.wordmark {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1;
    color: var(--fg);
    text-decoration: none;
}

.wordmark svg {
    display: inline-block;
    vertical-align: -0.02em;
    margin: 0 0.02em;
}

.wordmark .header__logo path:nth-of-type(1),
.wordmark .header__logo path:nth-of-type(3),
.wordmark .header__logo path:nth-of-type(4) {
    fill: currentColor;
}

.wordmark .o-ring {
    stroke: var(--brand);
}

.wordmark .o-bar {
    fill: var(--brand);
}

.done[hidden],
form[hidden] {
    display: none;
}

.right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.lang {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--line);
}

.lang a {
    color: var(--muted);
    text-decoration: none;
    padding: 6px 2px;
}

.lang a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.lang a[aria-current="true"] {
    color: var(--fg);
    text-decoration: none;
    border-bottom: 2px solid var(--brand);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
}

.badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: var(--brand);
}

/* Hero */
.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 44px 64px;
}

.hero-copy {
    flex: 1 1 420px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 8px;
}

.hero-art {
    flex: 1 1 400px;
    min-width: 0;
    max-width: 520px;
    margin-inline: auto;
}

.tag {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

h1 {
    margin: 0;
    max-width: 20ch;
    font-size: clamp(2rem, 4.6vw, 3.25rem);
    font-weight: 800;
    line-height: 1.07;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.lede {
    margin: 0;
    max-width: 56ch;
    font-size: 1.125rem;
    color: var(--muted);
}

.cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    min-height: 52px;
    padding: 0 26px;
    border-radius: 10px;
    background: var(--brand);
    color: #FFFFFF;
    font-weight: 700;
    text-decoration: none;
}

.cta:hover {
    background: var(--brand-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--panel-glow);
    outline-offset: 2px;
}

/* Diagram */
figure {
    margin: 0;
}

.art {
    background: var(--panel);
    border-radius: 20px;
    padding: 22px 20px 18px;
    box-shadow: var(--shadow);
    color: var(--panel-text);
}

.art svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

.art figcaption {
    margin-top: 12px;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--panel-muted);
}

.d-cap {
    font: 700 13px var(--font);
    letter-spacing: 0.08em;
    fill: var(--panel-muted);
}

.d-slip {
    fill: var(--panel-2);
    stroke: var(--panel-line);
    stroke-width: 1.5;
}

.d-head {
    fill: var(--panel-glow);
}

.d-row {
    fill: var(--panel-muted);
    fill-opacity: 0.45;
}

.d-flow {
    fill: none;
    stroke: var(--panel-line);
    stroke-width: 2;
}

.d-dot {
    fill: var(--panel-glow);
}

.d-hub {
    fill: var(--brand);
}

.d-hub-t {
    font: 800 22px var(--font);
    fill: #FFFFFF;
}

.d-hub-s {
    font: 500 15px var(--font);
    fill: #FFFFFF;
}

.d-group {
    fill: var(--panel-2);
    stroke: var(--panel-line);
    stroke-width: 1.5;
}

.d-group.first {
    stroke: var(--panel-glow);
    stroke-width: 2.5;
}

.d-badge {
    fill: var(--panel-glow);
}

.d-badge-t {
    font: 800 18px var(--font);
    fill: var(--panel);
}

.d-title {
    font: 700 19px var(--font);
    fill: #FFFFFF;
}

.d-sub {
    font: 500 14px var(--font);
    fill: var(--panel-muted);
}

.d-note {
    font: 500 14px var(--font);
    fill: var(--panel-muted);
}

.d-arrow {
    fill: none;
    stroke: var(--panel-glow);
    stroke-width: 2;
}

.d-head-fill {
    fill: var(--panel-glow);
}

/* Strengths */
.section-title {
    margin: 0 0 24px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

.strengths {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 32px 36px;
}

.strengths li {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.icon {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--chip);
    color: var(--accent);
}

.strengths b {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
}

.strengths span {
    color: var(--muted);
}

/* Sign-up band */
.band {
    scroll-margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 32px 56px;
    padding: 36px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.band-copy {
    flex: 1 1 260px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.band-copy h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.15;
}

.band-copy p {
    margin: 0;
    color: var(--muted);
}

.band-form {
    flex: 2 1 460px;
    min-width: 0;
}

form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.span {
    grid-column: 1 / -1;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
}

input[type="text"],
input[type="tel"],
input[type="email"] {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    font: inherit;
    font-size: 1rem;
    color: var(--fg);
    background: var(--field);
    border: 1px solid var(--field-line);
    border-radius: 10px;
}

input::placeholder {
    color: var(--muted);
    opacity: 0.8;
}

input:focus-visible {
    border-color: var(--brand);
}

input[aria-invalid="true"] {
    border-color: var(--danger);
    background: var(--invalid-bg);
}

.err {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--danger);
}

.err:empty {
    display: none;
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

button.go {
    min-height: 52px;
    padding: 0 28px;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: #FFFFFF;
    background: var(--brand);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

button.go:hover {
    background: var(--brand-hover);
}

button.go[disabled] {
    opacity: 0.65;
    cursor: progress;
}

.go-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
}

.fine {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted);
}

.status {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    background: var(--note-bg);
    color: var(--note-fg);
}

.status:empty {
    display: none;
}

.status.bad {
    background: var(--bad-bg);
    color: var(--bad-fg);
}

.done {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-block: 8px;
}

.done svg {
    color: var(--ok);
}

.done h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
}

.done p {
    margin: 0;
    color: var(--muted);
}

.foot {
    font-size: 0.8125rem;
    color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {

    button.go,
    .cta {
        transition: background-color 0.15s ease;
    }
}