/* Reset some default styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #eef5f1;
    --ink: #3d0e03;
    --link: #8c6c65;
    /* Didot on macOS, Bodoni MT on Windows/Office, Playfair Display as web fallback */
    /* --display: Didot, "Didot LT STD", "Times New Roman", serif; */
    --display:"Helvetica Neue", Helvetica, Arial, sans-serif;
    --text: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

html {
    /* Always reserve the scrollbar gutter so the centered header doesn't
       shift between short pages (about, artlab) and tall ones (research). */
    scrollbar-gutter: stable;
    overflow-y: scroll; /* fallback for browsers without scrollbar-gutter */
    background-color: var(--bg);
}

body {
    font-family: var(--text);
    line-height: 1.6;
    color: var(--ink);
    margin: 0;
    padding: 0;
    position: relative;
}

/* Paper grain on the page ground. Sits behind all content (z-index -1) so it
   textures the background only — images get their own lighter pass below. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.25;
    background-image: var(--grain);
}

/* Same grain at a lighter touch, laid over an image. */
.grain-img {
    position: relative;
    display: block;
}

.grain-img img {
    display: block;
    width: 100%;
    height: auto;
}

.grain-img::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.1;
    background-image: var(--grain);
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

strong {
    /* font-style: oblique; */
}

/* ---------- header / nav ---------- */

.site-header {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 20px 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px 24px;
    /* border-bottom: 1px solid rgba(61, 32, 3, 0.2); */
}

.site-title {
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 200;
    letter-spacing: 0.28em;
    color: var(--ink);
}

.site-title a {
    color: inherit;
}

.site-title a:hover {
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: 22px;
}

.site-nav a {
    font-family: var(--text);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: lowercase;
    color: var(--ink);
    padding-bottom: 2px;
}

.site-nav a:hover {
    text-decoration: none;
    border-bottom: 1px solid var(--ink);
}

.site-nav a[aria-current="page"] {
    border-bottom: 1px solid var(--ink);
}

/* ---------- content ---------- */

article {
    display: flex;
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
    gap: 5px;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: var(--display);
    text-transform: uppercase;
}

h1 {
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
}

/* Small, wide and quiet — the body copy carries the page, headings just label it. */
h2 {
    margin: 40px 0 18px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    opacity: 0.6;
}

h2:first-child {
    margin-top: 0;
}

h3 {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
}

article p {
    font-size: 1.05rem;
}

/* Sits at the end of the intro paragraph, so it needs weight to stand apart. */
.announce {
    font-weight: 700;
}

/* ---------- how it works ---------- */

.steps {
    /* The global reset zeroes list padding — put the marker indent back. */
    padding-left: 1.7em;
    margin: 0;
}

.steps li {
    font-size: 1.05rem;
    padding-left: 0.4em;
    margin-bottom: 12px;
}

.steps li:last-child {
    margin-bottom: 0;
}

/* Numbers quiet enough to guide without competing with the text. */
.steps li::marker {
    color: rgba(61, 14, 3, 0.45);
}

/* A quiet aside under a block — smaller, italic, dimmed. */
.note {
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.6;
    margin-top: 16px;
}

/* ---------- research entries ---------- */

.entry {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0 1.5rem;
    margin-bottom: 22px;
}

.entry-year {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    opacity: 0.55;
    padding-top: 0.4rem;
}

.entry-body {
    min-width: 0;
}

.entry-body .title {
    font-weight: 600;
}

.entry-body .meta {
    opacity: 0.75;
}

article img {
    max-width: 100%;
    height: auto;
}

.profile-container {
    display: flex;
    gap: 20px;
}

.profile-image {
    width: 30%;
    height: fit-content;
}

.profile-text {
    padding: 0 20px;
    flex: 1;
}

/* ---------- signup form ---------- */

.signup {
    max-width: 34em;
    margin-top: 8px;
}

/* Honeypot field — off-screen rather than display:none, since some bots skip
   inputs that are explicitly hidden. */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.field {
    margin-bottom: 20px;
}

.field-row {
    display: grid;
    /* State codes are two characters — the column only needs room for the arrow. */
    grid-template-columns: 1fr 5rem;
    gap: 18px;
}

.signup label,
.signup legend {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 6px;
}

.signup input[type="text"],
.signup input[type="email"],
.signup select,
.signup textarea {
    width: 100%;
    font-family: var(--text);
    font-size: 1rem;
    color: var(--ink);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(61, 14, 3, 0.25);
    border-radius: 0;
    padding: 6px 0;
    transition: border-color 0.15s ease;
}

.signup select {
    /* Normalize the native control so it matches the underlined text inputs. */
    appearance: none;
    padding-right: 18px;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                      linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: right 6px center, right 1px center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.signup input:focus,
.signup select:focus,
.signup textarea:focus {
    outline: none;
    border-bottom-color: var(--ink);
}

/* 10px more air under the question text than a typed field's label gets. */
.signup legend {
    margin-bottom: 16px;
}

.signup fieldset {
    border: none;
    margin-bottom: 22px;
}

.choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 15px;
}

.choices.inline {
    flex-direction: row;
    gap: 22px;
}

/* Options are set exactly like typed input text, so an answer you pick and an
   answer you type read the same. */
.choice {
    display: flex;
    align-items: baseline;
    gap: 9px;
    font-family: var(--text);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
    opacity: 1;
    margin-bottom: 0;
    cursor: pointer;
}

.choice input {
    accent-color: var(--ink);
    margin: 0;
    flex: none;
}

.hint {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-top: 4px;
}

.price {
    opacity: 0.55;
    font-size: 0.9rem;
    margin-left: 4px;
}

/* Which month a request made today is for. */
#target-month {
    margin-bottom: 18px;
}

/* Stripe buy button, revealed only when the chosen month has room. */
.pay {
    max-width: 34em;
    margin-top: 20px;
}

/* Takes the place of checkout when the month is full or not open yet. */
.waitlist {
    margin-top: 18px;
}

.form-status {
    font-size: 0.9rem;
    margin-top: 14px;
    min-height: 1.4em;
}

.form-status.is-error {
    color: #8a2f1c;
}

.form-status.is-error a {
    color: inherit;
    text-decoration: underline;
}

.form-status.is-thanks {
    font-size: 1.05rem;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(61, 14, 3, 0.25);
}

.signup button[disabled] {
    opacity: 0.5;
    cursor: default;
}

.signup button {
    font-family: var(--text);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bg);
    background: var(--ink);
    border: 1px solid var(--ink);
    padding: 12px 26px;
    margin-top: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

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

/* ---------- letter page (launch.html) ---------- */

/* No site header on that page, so the letter carries its own margins. */
.letter {
    max-width: 34em;
    margin: 0 auto;
    padding: 48px 20px 90px;
}

.back-link {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0.55;
    margin-bottom: 44px;
    transition: opacity 0.15s ease;
}

.back-link:hover {
    text-decoration: none;
    opacity: 1;
}

.letter p {
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.letter .signoff {
    margin-top: 32px;
    margin-bottom: 0;
}

.contact-icons {
    display: flex;
    gap: 16px;
    margin-top: 18px;
}

.contact-icons a {
    display: inline-flex;
    color: var(--ink);
    opacity: 0.65;
    transition: opacity 0.15s ease;
}

.contact-icons a:hover {
    text-decoration: none;
    opacity: 1;
}

.contact-icons svg {
    width: 20px;
    height: 20px;
    display: block;
}

@media (max-width: 768px) {
    .site-header {
        padding: 20px 15px 12px;
    }

    .site-nav {
        gap: 16px;
    }

    .profile-container {
        flex-direction: column;
        align-items: center;
    }

    .profile-image {
        width: 70%;
        max-width: 300px;
    }

    .profile-text {
        padding: 20px 0 0 0;
    }

    h1 {
        font-size: 1.25rem;
        text-align: center;
    }

    .entry {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .entry-year {
        padding-top: 0;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .contact-icons {
        justify-content: center;
    }

    article {
        padding: 0 15px;
        margin: 20px auto;
    }

    .steps {
        padding-left: 1.3em;
    }

    .steps li {
        font-size: 1rem;
        padding-left: 0.2em;
        margin-bottom: 14px;
    }

    .note {
        font-size: 0.85rem;
    }

    .letter {
        padding: 32px 15px 60px;
    }

    .back-link {
        margin-bottom: 32px;
    }
}
