@font-face {
    font-family: "Archivo";
    src: url("../fonts/archivo-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-style: normal;
    font-display: swap;
}

:root {
    --plate: #F3F5F8;
    --ink: #14213D;
    --ink-hover: #22325A;
    --muted: #56627A;
    --rule: #C9D1DC;
    --brass: #A87A2A;
    --wash: #E6EAF0;
    --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
    --measure: 42rem;
    --gutter: clamp(1.25rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--plate);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.125rem;
    font-stretch: 100%;
    line-height: 1.6;
}

main { flex: 1; }

::selection { background: #E8D9B8; }

h1, h2, h3 {
    margin: 0;
    font-stretch: 125%;
    line-height: 1.15;
    text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5vw, 3rem); font-weight: 650; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.3125rem; font-weight: 600; }

p { margin: 0; text-wrap: pretty; }

a {
    color: inherit;
    text-decoration-line: underline;
    text-decoration-color: var(--brass);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
}

a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }

[id] { scroll-margin-top: 1.5rem; }

code {
    font-family: var(--mono);
    font-size: 0.875em;
    background: var(--wash);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    overflow-wrap: anywhere;
}

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 10;
    padding: 0.5rem 1rem;
    background: var(--ink);
    color: var(--plate);
}

.skip-link:focus { top: 1rem; }

/* Masthead */

.masthead { border-bottom: 1px solid var(--rule); }

.masthead-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 2rem;
    padding-block: 1.1rem;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.3125rem;
    font-stretch: 125%;
    font-weight: 650;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.mark { flex: none; color: var(--ink); }

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 1rem;
}

.nav a { display: inline-block; padding-block: 0.25rem; border-bottom: 2px solid transparent; text-decoration: none; }
.nav a:hover { border-bottom-color: var(--rule); }
.nav a[aria-current="page"] { border-bottom-color: var(--brass); }

/* Hero */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: center;
    gap: 2rem 4rem;
    padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 5rem);
}

.hero-title { font-size: clamp(2.25rem, 5.2vw, 4rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1; }

.lead { max-width: 34em; margin-top: 1.25rem; font-size: clamp(1.1875rem, 2.2vw, 1.3125rem); line-height: 1.5; }

.hero-fit { margin-top: 1rem; color: var(--muted); font-size: 1rem; }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 2rem; }

.hero-note { color: var(--muted); font-size: 1rem; }

.button {
    display: inline-block;
    padding: 0.85rem 1.4rem;
    border-radius: 3px;
    background: var(--ink);
    color: var(--plate);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
}

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

.hero-figure { justify-self: end; width: 100%; max-width: 30rem; }

/* Orrery */

.orrery { display: block; width: 100%; height: auto; }
.orrery-scale line { stroke: var(--ink); stroke-opacity: 0.28; stroke-width: 1; }
.orbit { fill: none; }
.orbit-open { stroke: var(--rule); stroke-width: 1.25; stroke-dasharray: 2 6; }
.orbit-campaign { stroke: var(--brass); stroke-width: 1.5; }
.body-open { fill: var(--plate); stroke: var(--muted); stroke-opacity: 0.6; stroke-width: 1.25; }
.core { fill: var(--ink); }
.core-label { fill: var(--plate); font-size: 12px; font-weight: 600; }
.planet { fill: var(--brass); }

.planet-label {
    fill: var(--ink);
    font-size: 16px;
    font-stretch: 125%;
    font-weight: 650;
    paint-order: stroke;
    stroke: var(--plate);
    stroke-width: 6px;
    stroke-linejoin: round;
}

.orbiter { transform-box: view-box; transform-origin: 240px 240px; }

@media (prefers-reduced-motion: no-preference) {
    .orbiter { animation: orbit-settle 1.8s cubic-bezier(0.22, 0.8, 0.3, 1) 0.2s both; }
    .planet-label { animation: label-in 0.5s ease-out 1.7s both; }
}

@keyframes orbit-settle {
    from { transform: rotate(-160deg); }
    to { transform: rotate(0deg); }
}

@keyframes label-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Home sections, heading left and content right */

.section {
    display: grid;
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: 1.25rem 4rem;
    padding-bottom: clamp(3rem, 7vw, 5rem);
}

.section::before {
    content: "";
    grid-column: 1 / -1;
    height: 1px;
    margin-bottom: clamp(1.25rem, 4vw, 2.75rem);
    background: var(--rule);
}

.features { margin: 0; }

.features > div {
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: 0.25rem 2rem;
    padding-block: 1.1rem;
    border-top: 1px solid var(--rule);
}

.features > div:first-child { padding-top: 0; border-top: 0; }
.features dt { font-stretch: 112.5%; font-weight: 600; }
.features dd { max-width: 38em; margin: 0; color: var(--muted); }

/* Long-form text */

.prose { max-width: var(--measure); }

/* Zero specificity reset so the flow spacing below still applies to lists */
.prose :where(ul, ol) { margin-block: 0; padding-left: 1.25rem; }

.prose :where(p, ul, ol, figure, section, h2, h3, div) + :where(p, ul, ol, figure, section, h2, h3, div) { margin-top: 1rem; }
.prose * + h2 { margin-top: 3rem; }
.prose * + h3 { margin-top: 2.25rem; }
.prose * + section { margin-top: 3.5rem; }
.prose h2 + *, .prose h3 + * { margin-top: 0.75rem; }

.prose li + li { margin-top: 0.35rem; }

.prose .steps { padding-left: 0; list-style: none; counter-reset: step; }

.prose .steps li {
    position: relative;
    min-height: 1.9rem;
    padding-left: 2.75rem;
    counter-increment: step;
}

.prose .steps li + li { margin-top: 0.9rem; }

/* Circled step numbers echo the orbiting bodies */
.prose .steps li::before {
    content: counter(step);
    position: absolute;
    top: -0.05rem;
    left: 0;
    display: grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border: 1.5px solid var(--brass);
    border-radius: 50%;
    font-size: 0.875rem;
    font-stretch: 125%;
    font-weight: 650;
}

.figure { margin: 1.5rem 0 0; }
.figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--rule); background: #fff; }
.figure figcaption { margin-top: 0.6rem; color: var(--muted); font-size: 0.9375rem; }

/* Inner pages */

.page { padding-block: clamp(3rem, 7vw, 5rem); }
.page-head { max-width: 46rem; margin-bottom: clamp(2rem, 5vw, 3rem); }
.page-head .lead { margin-top: 1rem; }
.page-foot { max-width: var(--measure); margin-top: 3rem; color: var(--muted); }

.columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 2rem 4rem;
    max-width: 56rem;
    margin-top: 3rem;
}

.columns h2 { padding-bottom: 0.6rem; border-bottom: 1px solid var(--rule); font-size: 1.3125rem; }
.columns ul { margin: 0.9rem 0 0; padding: 0; list-style: none; }
.columns li + li { margin-top: 0.4rem; }

.contact { max-width: 46rem; margin: 0; }

.contact > div {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: 1rem;
    align-items: baseline;
    padding-block: 1.1rem;
    border-top: 1px solid var(--rule);
}

.contact > div:last-child { border-bottom: 1px solid var(--rule); }
.contact dt { color: var(--muted); }
.contact dd { margin: 0; }
.contact-email { font-size: clamp(1.3125rem, 3vw, 1.5rem); font-stretch: 125%; font-weight: 600; overflow-wrap: anywhere; }

/* Documentation */

.docs {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 0 4rem;
    padding-block: clamp(3rem, 7vw, 5rem);
}

.docs-head { grid-column: 1 / -1; }
.docs-toc { font-size: 1rem; }
.docs-toc ul { margin: 0; padding: 0; list-style: none; }
.docs-toc > ul { position: sticky; top: 1.5rem; padding-left: 1rem; border-left: 1px solid var(--rule); }
.docs-toc li { margin-block: 0.4rem; }
.docs-toc ul ul { margin-top: 0.4rem; padding-left: 0.9rem; color: var(--muted); font-size: 0.9375rem; }
.docs-toc a { text-decoration-line: none; }
.docs-toc a:hover { text-decoration-line: underline; }

/* Buying */

.hero-link { font-size: 1rem; font-weight: 600; }

.buy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
    gap: 2.5rem 4rem;
    align-items: start;
    max-width: 60rem;
}

.field + .field { margin-top: 1.75rem; }
.field label { display: block; font-stretch: 112.5%; font-weight: 600; }
.field-hint { margin-top: 0.2rem; color: var(--muted); font-size: 1rem; }

.field input {
    display: block;
    width: 100%;
    max-width: 28rem;
    margin-top: 0.6rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--muted);
    border-radius: 3px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.field input:focus-visible { outline-offset: 1px; }
.field input.input-validation-error { border-color: #A3341F; border-width: 2px; }
.field-error { display: block; margin-top: 0.4rem; color: #A3341F; font-size: 1rem; font-weight: 600; }
.field-error:empty { display: none; }
.buy-form .button { margin-top: 2rem; border: 0; cursor: pointer; font-family: inherit; }

.buy-summary { padding: 1.5rem; border-top: 3px solid var(--brass); background: var(--wash); }
.buy-summary h2 { font-size: 1.5rem; }
.buy-summary p { margin-top: 0.5rem; color: var(--muted); font-size: 1rem; }
.buy-summary ul { margin: 1rem 0 0; padding-left: 1.1rem; }
.buy-summary li + li { margin-top: 0.35rem; }
.buy-summary .buy-summary-note { margin-top: 1.25rem; }

.license-key {
    margin: 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--rule);
    border-left: 3px solid var(--brass);
    background: #fff;
    font-family: var(--mono);
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    user-select: all;
}

.downloads { margin: 0; }
.downloads > div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.25rem 1.5rem; padding-block: 0.8rem; border-top: 1px solid var(--rule); }
.downloads > div:last-child { border-bottom: 1px solid var(--rule); }
.downloads dt { color: var(--muted); }
.downloads dd { margin: 0; overflow-wrap: anywhere; }

/* Footer */

.footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9375rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 2rem; padding-block: 1.75rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.footer-note { flex-basis: 100%; font-size: 0.875rem; }

@media (max-width: 60rem) {
    .hero { grid-template-columns: minmax(0, 1fr); }
    .hero-figure { justify-self: start; max-width: 22rem; }
    .section { grid-template-columns: minmax(0, 1fr); }
    .docs { grid-template-columns: minmax(0, 1fr); }
    .docs-toc { margin-bottom: 2.5rem; }
    .docs-toc > ul { position: static; }
    .buy { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 40rem) {
    body { font-size: 1.0625rem; }
    .nav { gap: 0.25rem 1rem; font-size: 0.9375rem; }
    .features > div { grid-template-columns: minmax(0, 1fr); }
    .contact > div { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
    .downloads > div { grid-template-columns: minmax(0, 1fr); }
}
