:root {
    --bg: #fbfaf7;
    --surface: #fefdfb;
    --text: #111111;
    --hairline: #e6e1d8;
    --focus: #1a73e8;
    --maxw: 760px;
    --text-width: 68ch;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 18px/1.6 ui-sans-serif, system-ui, -apple-system,
        "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    text-decoration: none;
}

/* =========================
   Layout
   ========================= */

.page {
    position: relative;
    min-height: 100vh;
    background: var(--bg);
    overflow-x: clip;
}

.wrap {
    position: relative;
    z-index: 1;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 56px 20px 72px;
}

header {
    margin-bottom: 34px;
}

h1 {
    margin: 0 0 30px;
    font-size: clamp(48px, 8vw, 100px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.02;
    max-width: 18ch;
}

h2 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

p {
    margin: 12px 0;
    max-width: var(--text-width);
}

ul {
    margin: 12px 0 0;
    padding-left: 20px;
    max-width: 72ch;
}

li {
    margin: 8px 0;
}

section {
    margin-top: 32px;
}

.hero-cta {
    margin: 14px 0 0;
    font-weight: 600;
}

.cta-note {
    font-weight: 400;
    color: #444;
}

/* =========================
   Form
   ========================= */

form {
    margin-top: 12px;
}

.form-card {
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 22px 18px;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.field {
    margin: 18px 0;
}

.field:first-child {
    margin-top: 0;
}

.field:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

input[type="email"],
input[type="text"],
textarea {
    width: 100%;
    font-size: 16px;
    padding: 10px 12px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    font-family: inherit;
    background: #ffffff;
    color: var(--text);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.grid-checks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px 24px;
    padding-top: 6px;
}

.grid-checks label {
    font-weight: 400;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.45;
    cursor: pointer;
}

.grid-checks input[type="checkbox"],
.grid-checks input[type="radio"] {
    width: auto;
    margin-top: 3px;
    flex-shrink: 0;
}

.actions {
    margin-top: 20px;
}

button {
    background: var(--text);
    color: var(--bg);
    border: 1px solid var(--text);
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 650;
    cursor: pointer;
}

button:hover {
    opacity: 0.92;
}

footer {
    margin-top: 44px;
    padding-top: 18px;
}

@media (min-width: 720px) {
    .form-card {
        padding: 26px 22px;
    }

    .grid-checks {
        grid-template-columns: 1fr 1fr;
    }
}

fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-inline-size: 0;
    /* avoids weird Firefox sizing */
}

legend {
    padding: 0;
    margin-bottom: 6px;
    font-weight: 600;
}

/* =========================
   Sidebar margin images
   ========================= */

.page::before,
.page::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(44vw, 560px);
    pointer-events: none;
    z-index: 0;
    background-repeat: no-repeat;
    background-size: 170%;
    opacity: 0.12;
    filter: none;
    transform-origin: center;
}

/* Left: anchor near the top */
.landing-page .page::before {
    left: 0;
    background-image: url("/assets/margins/galois.1.png");
    background-position: 50% 6%;
    transform: rotate(-2deg) translateX(-10px);

    -webkit-mask-image: linear-gradient(to right,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 0.85) 55%,
            rgba(0, 0, 0, 0.35) 70%,
            rgba(0, 0, 0, 0) 82%);
    mask-image: linear-gradient(to right,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 0.85) 55%,
            rgba(0, 0, 0, 0.35) 70%,
            rgba(0, 0, 0, 0) 82%);
}

/* Right: anchor around the middle */
.landing-page .page::after {
    right: 0;
    background-image: url("/assets/margins/galois.2.png");
    background-position: 50% 35%;
    transform: rotate(2deg) translateX(10px);

    -webkit-mask-image: linear-gradient(to left,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 0.85) 55%,
            rgba(0, 0, 0, 0.35) 70%,
            rgba(0, 0, 0, 0) 82%);
    mask-image: linear-gradient(to left,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 0.85) 55%,
            rgba(0, 0, 0, 0.35) 70%,
            rgba(0, 0, 0, 0) 82%);
}

@media (max-width: 1600px) {

    .page::before,
    .page::after {
        width: min(34vw, 460px);
    }
}

@media (max-width: 1350px) {

    .page::before,
    .page::after {
        display: none;
    }
}

/* =========================
   Quote block (Vision)
   ========================= */

.vision-quote {
    margin: 14px 0;
    padding-left: 14px;
    border-left: 2px solid var(--hairline);
    max-width: var(--text-width);
}

.vision-quote p {
    margin: 0;
}

.vision-quote footer {
    margin-top: 0px;
}

/* =========================
   Breadcrumbs
   ========================= */

.breadcrumbs {
    font-size: 16px;
    color: #555;
    margin-bottom: 18px;
    max-width: var(--text-width);
}

.breadcrumbs a {
    color: inherit;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .sep {
    margin: 0 6px;
    color: #aaa;
}

/* .breadcrumbs .current {
    color: #222;
} */

.breadcrumb-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    line-height: 1;
}

.breadcrumb-icon svg {
    width: 48px;
    height: 48px;
    vertical-align: middle;
    display: inline-block;
    opacity: 1;
}

/* Preserve KaTeX spacing semantics */
.katex,
.katex * {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

.katex .mbin {
    margin: 0 0.1667em;
}

.katex .mrel {
    margin: 0 0.2778em;
}

.katex .mpunct {
    margin-right: 0.1667em;
}

/* DO NOT override KaTeX baseline math */
.katex {
    font-size: 1em;
    vertical-align: baseline;
    /* restore correct baseline handling */
}

/* Allow KaTeX to control its own internal line boxes */
.katex * {
    line-height: inherit;
}

/* KaTeX builds vertical lists for accents; keep them from inheriting weird alignment */
.katex .vlist {
    vertical-align: 0 !important;
}