@font-face {
    font-family: "GT Sectra";
    src: url("/fonts/GT-Sectra-Book.woff2") format("woff2");
    font-weight: 350; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "GT Sectra";
    src: url("/fonts/GT-Sectra-Book-Italic.woff2") format("woff2");
    font-weight: 350; font-style: italic; font-display: swap;
}
@font-face {
    font-family: "GT Sectra";
    src: url("/fonts/GT-Sectra-Bold.woff2") format("woff2");
    font-weight: 700; font-style: normal; font-display: swap;
}

@font-face {
    font-family: "GT Sectra Display";
    src: url("/fonts/GT-Sectra-Display-Medium.woff2") format("woff2");
    font-weight: 500; font-style: normal; font-display: swap;
}

@font-face {
    font-family: "GT Sectra stand-in Apple";
    src: local("Iowan Old Style"), local("Palatino"), local("Palatino Linotype");
    size-adjust: 96.7%;
    ascent-override: 101.3%;
    descent-override: 26.9%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "GT Sectra stand-in";
    src: local("Times New Roman"), local("Tinos"), local("Liberation Serif"),
         local("Nimbus Roman"), local("Thorndale AMT");
    size-adjust: 107.4%;
    ascent-override: 91.3%;
    descent-override: 24.2%;
    line-gap-override: 0%;
}

:root {
    --slate: #2B323B;
    --grey:  #D8DBDE;

    --bg:   var(--grey);
    --ink:  var(--slate);
    --pink: #B5176B;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: var(--slate); --ink: var(--grey); --pink: #FFB3C7;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: var(--slate); --ink: var(--grey); --pink: #FFB3C7;
    color-scheme: dark;
}

:root {
    --measure: 34rem;
    --wide: 52rem;
    
    --small: 1rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    padding: 0 20px 5rem;
    background: var(--bg);
    color: var(--ink);
    font-family: "GT Sectra", "GT Sectra stand-in Apple",
                 "GT Sectra stand-in", "Iowan Old Style",
                 "Palatino Linotype", Palatino, Times, serif;
    font-weight: 350;
    font-size: 20px;
    line-height: 32px;
    transition: background-color 140ms ease, color 140ms ease;
}
main { max-width: var(--measure); margin: 0 auto; }

.bar {
    max-width: var(--wide);
    margin: 0 auto;
    padding: 22px 0 0;
    display: flex;
    justify-content: flex-end;
}

.theme-toggle {
    position: relative;
    width: 40px; height: 20px;
    padding: 0; border: 0; cursor: pointer;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 28%, transparent);
    transition: background-color 140ms ease;
}
.theme-toggle::before {
    content: "";
    position: absolute; top: 3px; left: 2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--ink);
    transition: left 140ms ease;
}
.theme-toggle[aria-pressed="true"]::before { left: 22px; }
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

h1, h2 {
    font-family: "GT Sectra Display", "GT Sectra",
                 "GT Sectra stand-in Apple", "GT Sectra stand-in",
                 "Iowan Old Style", Palatino, Times, serif;
    font-weight: 500;
    color: inherit;
}
h1 {
    
    margin: 7vh 0 2.2rem;
    font-size: min(max(2.9rem, 11vw), 5.4rem);
    line-height: 0.86;
    letter-spacing: -0.035em;
}
h2 {
    
    scroll-margin-top: 2.5rem;
    font-size: 1.6rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 3.4rem 0 0.9rem;
}
p { margin: 0 0 1.4rem; }
em { font-style: italic; }
strong { font-weight: 700; }

a {
    color: inherit;
    text-decoration-line: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    text-decoration-color: color-mix(in srgb, var(--ink) 42%, transparent);
    transition: text-decoration-color 120ms ease, opacity 120ms ease;
}
a:hover {
    color: var(--pink);
    text-decoration-color: var(--pink);
}

ul { list-style: none; margin: 0 0 1.4rem; padding: 0; }

ul > li { margin: 0 0 0.5rem; padding-left: 1.1rem; position: relative; }

ul > li::before {
    content: "";
    position: absolute; left: 0; top: 0.97em;
    width: 0.55rem; height: 2px;
    background: color-mix(in srgb, var(--ink) 50%, transparent);
}

hr, .rule {
    border: 0;
    height: 1px;
    margin: 3rem 0;
    background: color-mix(in srgb, var(--ink) 28%, transparent);
}

.back { max-width: var(--measure); margin: 0 auto; }
.back a::before { content: "\2190\00a0"; }

blockquote {
    margin: 2rem 0;
    padding-left: 1.4rem;
    border-left: 2px solid color-mix(in srgb, var(--ink) 28%, transparent);
    
    font-style: italic;
}
blockquote p:last-child { margin-bottom: 0; }

sup {
    position: relative;
    line-height: 0;
    font-size: 0.75em;
}
.footnote-ref {
    font-size: inherit;
    padding: 0 0.12em;
    text-decoration: none;
}
.footnote-ref:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.footnote { margin-top: 4.5rem; }

.footnote hr { width: 5rem; margin: 0 0 1.8rem; }

.footnote > ol { list-style: none; margin: 0; padding-left: 0; }
.footnote > ol > li {
    position: relative;
    margin-bottom: 1.3rem;
    padding-left: 2.3rem;
    scroll-margin-top: 3rem;
}
.fn-back {
    position: absolute;
    left: 0;
    top: 0;
    text-decoration: none;
    color: color-mix(in srgb, var(--ink) 68%, transparent);
}
.fn-back:hover { color: var(--pink); }
.footnote ul { margin: 0.5rem 0 0.8rem; }
.footnote p { margin: 0 0 0.5rem; }
.footnote p:last-child { margin-bottom: 0; }

.footnote > ol > li:target {
    background: color-mix(in srgb, var(--ink) 9%, transparent);
    box-shadow: 0 0 0 0.45rem color-mix(in srgb, var(--ink) 9%, transparent);
}
.footnote > ol > li:target::marker { color: var(--ink); }

.fn-note { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 56rem) {
    .fn-note {
        display: block;
        position: absolute;
        top: 1.15rem;
        left: 50%;
        transform: translateX(-50%);
        width: 20rem;
        padding: 0.9rem 1.1rem 0.95rem;
        
        background: var(--bg);
        border: 1px solid color-mix(in srgb, var(--ink) 34%, transparent);
        box-shadow: 0 3px 12px color-mix(in srgb, var(--slate) 20%, transparent);
        font-size: var(--small);
        line-height: 1.5;
        letter-spacing: 0;
        text-align: left;
        vertical-align: baseline;
        z-index: 10;
        opacity: 0;
        pointer-events: none;
        transition: opacity 120ms ease;
    }
    .fn-note .fn-n {
        float: left;
        margin-right: 0.4em;
        font-size: 0.75em;
        vertical-align: super;
        color: color-mix(in srgb, var(--ink) 55%, transparent);
    }
    .fn-note .fn-p { display: block; }
    .fn-note .fn-p + .fn-p { margin-top: 0.5rem; }
    sup:hover > .fn-note,
    .footnote-ref:focus-visible + .fn-note { opacity: 1; }
}

body.error { min-height: 100vh; display: flex; flex-direction: column; }

body.error > * { width: 100%; }
body.error main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
body.error h1 { margin-top: 0; }

.foot {
    max-width: var(--measure);
    margin: 5rem auto 0;
    padding-top: 1.4rem;
    border-top: 1px solid color-mix(in srgb, var(--ink) 28%, transparent);
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.6rem;
    font-size: var(--small);
}

@media (max-width: 600px) {
    body { font-size: 19px; line-height: 30px; }
    h1 { margin-top: 5vh; }
    h2 { font-size: 1.4rem; }
}

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