/*
 * lauriesartain.com: one stylesheet for the home page, /about and the workshop handout.
 * The explainers (/datacenters and /research/prompt, gpu, checks) keep their own designs.
 *
 * Shared with the Basis Play system: Fraunces for display, Archivo for text, paper and ink
 * neutrals. Cobalt marks anything you can click. Orange is only ever a small mark, never text:
 * it is 2.8:1 on paper.
 */

:root {
    /* Color */
    --paper: #f4f1ea;
    --paper-2: #ebe6db;      /* alternate sections */
    --surface: #fbfaf6;      /* cards, fields and code on paper */
    --ink: #16130f;          /* 16.4:1 on paper */
    --ink-2: #4a453d;        /* 8.4:1, body copy */
    --ink-3: #6b655b;        /* 5.1:1, meta and labels */
    --rule: #d9d2c4;
    --cobalt: #1a36c4;       /* 7.9:1 */
    --cobalt-dark: #13289a;
    --cobalt-tint: rgba(26, 54, 196, 0.08);
    --orange: #ff5a1f;
    --green: #1e6b3f;
    --green-tint: rgba(30, 107, 63, 0.08);
    --red: #a8251c;
    --red-tint: rgba(168, 37, 28, 0.07);

    /* Type: 1.25 scale on a 17px body. --t-2 is for tiny labels only. */
    --display: "Fraunces", Georgia, "Times New Roman", serif;
    --text: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --t-2: 0.8125rem;  /* 13 */
    --t-1: 0.875rem;   /* 14 */
    --t0: 1.0625rem;   /* 17 */
    --t1: 1.3125rem;   /* 21 */
    --t2: 1.625rem;    /* 26 */
    --t3: 2.0625rem;   /* 33 */
    --t4: 2.5625rem;   /* 41 */
    --t5: 3.1875rem;   /* 51 */
    --t6: 4rem;        /* 64 */

    /* Space: 4px steps */
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 24px;
    --s6: 32px;
    --s7: 48px;
    --s8: 64px;
    --s9: 96px;
    --s10: 128px;

    --page: 1200px;
    --measure: 68ch;
    --gutter: clamp(24px, 5vw, 64px);
    --radius: 4px;
    --nav-h: 64px;
}

/* ---------- Base ---------- */

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

* { margin: 0; padding: 0; }

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

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    background: var(--paper);
    color: var(--ink);
    font: 400 var(--t0)/1.6 var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }

a {
    color: var(--cobalt);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(26, 54, 196, 0.35);
    overflow-wrap: anywhere;
}

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

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

strong { font-weight: 600; color: var(--ink); }

::selection { background: rgba(26, 54, 196, 0.16); }

[hidden] { display: none !important; }

/* Outlined cobalt button: project links and the handout's ask button. */
.project-link,
.ask-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s2) var(--s4);
    font: 600 var(--t-1)/1.2 var(--text);
    color: var(--cobalt);
    background: transparent;
    border: 1px solid var(--cobalt);
    border-radius: var(--radius);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}

.project-link:hover,
.ask-btn:hover { background: var(--cobalt); color: var(--paper); }

.project-link svg { width: 14px; height: 14px; flex: none; }

/* ---------- Site navigation ---------- */

nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s5);
    min-height: var(--nav-h);
    padding: var(--s3) max(var(--gutter), calc((100% - var(--page)) / 2));
    background: rgba(244, 241, 234, 0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
}

.logo {
    font: 500 var(--t1)/1 var(--display);
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

.nav-links { display: flex; align-items: center; gap: var(--s6); }

.nav-links a {
    font: 500 var(--t-1)/1 var(--text);
    color: var(--ink-2);
    text-decoration: none;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

.nav-links a.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--s2) var(--s3);
    color: var(--cobalt);
    border: 1px solid var(--cobalt);
    border-radius: var(--radius);
}

.nav-links a.nav-cta:hover { background: var(--cobalt); color: var(--paper); }

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    cursor: pointer;
}

.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .i-close { display: none; }

@media (max-width: 768px) {
    nav { padding: var(--s3) var(--s5); }
    .nav-links { gap: var(--s5); }
}

/* Pages with a menu toggle fold their links into a panel under the bar. The home
   nav's links stop fitting on one line a little above 850px, hence 860. */
@media (max-width: 860px) {
    .nav-toggle { display: inline-flex; }
    .nav-toggle ~ .nav-links { display: none; }

    nav.open .nav-toggle .i-open { display: none; }
    nav.open .nav-toggle .i-close { display: inline; }

    nav.open .nav-toggle ~ .nav-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--s5);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: var(--s5) 0 var(--s6);
        padding-left: inherit;
        padding-right: inherit;
        background: var(--paper);
        border-bottom: 1px solid var(--rule);
        box-shadow: 0 16px 24px rgba(22, 19, 15, 0.06);
    }

    nav.open .nav-links a { font-size: var(--t0); }
}

@media (max-width: 360px) {
    nav { padding: var(--s3) var(--s4); }
    .logo { font-size: var(--t0); }
    .nav-links { gap: var(--s3); }
}

/* ---------- Home ---------- */

.hero { padding: var(--s9) var(--gutter) var(--s8); }

.hero-wrapper {
    max-width: var(--page);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--s9);
    align-items: start;
}

.hero h1 {
    font: italic 300 clamp(2.5rem, 5.2vw, var(--t6))/1.04 var(--display);
    letter-spacing: -0.02em;
    margin-bottom: var(--s6);
    text-wrap: balance;
}

.hero-description {
    font-size: var(--t1);
    line-height: 1.55;
    color: var(--ink-2);
    max-width: 34em;
}

.cred-row {
    margin-top: var(--s7);
    max-width: 34em;
    border-top: 1px solid var(--ink);
}

.cred {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s1) var(--s4);
    padding: var(--s3) 0;
    border-bottom: 1px solid var(--rule);
}

.cred-title { font-weight: 500; color: var(--ink); }
.cred-org { font-size: var(--t-1); color: var(--ink-3); }

.hero-image img {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1;
    height: auto;
    object-fit: cover;
    object-position: center top;
    border-radius: 50%;
    mix-blend-mode: multiply;   /* the photo's white backdrop takes on the paper */
}

.hero-stats {
    max-width: var(--page);
    margin: var(--s8) auto 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--ink);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: var(--s1);
    padding: var(--s5) var(--s5) 0 0;
}

.stat + .stat { padding-left: var(--s5); border-left: 1px solid var(--rule); }

.stat-value {
    font: 400 clamp(var(--t3), 4vw, var(--t5))/1.05 var(--display);
    font-variant-numeric: lining-nums;
    letter-spacing: -0.02em;
    color: var(--ink);
    white-space: nowrap;
}

.stat-label { font-size: var(--t-1); line-height: 1.4; color: var(--ink-3); }

/* Sections pad in to the page width, so their content lines up without an inner wrapper. */
body > section:not(.hero),
body > footer { padding: var(--s9) max(var(--gutter), calc((100% - var(--page)) / 2)); }

body > section { scroll-margin-top: var(--nav-h); }

#community { background: var(--paper-2); }

.section-header { margin-bottom: var(--s7); }

.section-label {
    font: 600 var(--t-1)/1.2 var(--text);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: var(--s3);
}

.section-title {
    font: 400 clamp(2.125rem, 4vw, var(--t4))/1.1 var(--display);
    letter-spacing: -0.015em;
}

/* Projects: entries divided by rules, not boxed. */
.projects-grid { border-bottom: 1px solid var(--rule); }

.project-card {
    padding: var(--s7) 0;
    border-top: 1px solid var(--rule);
}

.project-card:first-child { border-top-color: var(--ink); }

.project-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--s2) var(--s5);
    margin-bottom: var(--s4);
}

.project-year {
    order: -1;
    font: 600 var(--t-1)/1.4 var(--text);
    color: var(--ink);
}

.project-tags { display: flex; flex-wrap: wrap; }

.tag { font: 400 var(--t-1)/1.4 var(--text); color: var(--ink-3); }
.tag + .tag::before { content: "·"; margin: 0 0.5em; color: var(--ink-3); }

.project-title {
    font: 400 var(--t3)/1.15 var(--display);
    letter-spacing: -0.015em;
}

.project-dek {
    margin-top: var(--s1);
    font: italic 300 var(--t1)/1.35 var(--display);
    color: var(--ink-2);
}

/* The placement line: the one place orange appears, as a small square. */
.project-subtitle {
    margin: var(--s3) 0 var(--s6);
    font: 500 var(--t-1)/1.5 var(--text);
    color: var(--ink-2);
}

.project-subtitle::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: var(--s2);
    vertical-align: 1px;
    background: var(--orange);
}

.project-content-wrapper { display: flex; gap: var(--s7); align-items: flex-start; }

.project-images { flex: 0 0 36%; }

.project-images img { width: 100%; height: auto; border-radius: var(--radius); }

.project-text { flex: 1; min-width: 0; }

.project-description { color: var(--ink-2); max-width: var(--measure); }

.project-description p + p { margin-top: var(--s4); }

.project-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--s4) var(--s6);
    margin-top: var(--s6);
}

.project-credits { display: flex; flex-direction: column; gap: var(--s1); }

.project-team,
.project-stack { font-size: var(--t-1); color: var(--ink-3); }

.project-links { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* Community */
.community-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s6);
}

.community-item { padding-top: var(--s4); border-top: 1px solid var(--ink); }

.community-item h3 {
    font: 500 var(--t1)/1.3 var(--display);
    margin-bottom: var(--s2);
}

.community-item h3 a { color: var(--ink); text-decoration: none; }
.community-item h3 a:hover { color: var(--cobalt); }

.community-item p { color: var(--ink-2); }

/* Background */
.about-text { max-width: 36em; }

.about-text p {
    font: 300 var(--t1)/1.6 var(--display);
    color: var(--ink-2);
}

.about-text p + p { margin-top: var(--s5); }

/* Footer */
body > footer { padding-bottom: var(--s7); border-top: 1px solid var(--rule); }

.footer-cta {
    font: italic 300 clamp(2.125rem, 4vw, var(--t4))/1.1 var(--display);
    letter-spacing: -0.015em;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s4) var(--s6);
    margin-top: var(--s6);
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
}

.footer-links a:hover { color: var(--cobalt); }
.footer-links svg { width: 18px; height: 18px; }

.footer-note { margin-top: var(--s7); font-size: var(--t-1); color: var(--ink-3); }

@media (max-width: 900px) {
    .hero { padding-top: var(--s8); }
    .hero-wrapper { grid-template-columns: 1fr; gap: var(--s7); }
    .hero-image img { max-width: 200px; }
    .project-content-wrapper { flex-direction: column; gap: var(--s5); }
    .project-images { flex: none; width: 100%; }
    .community-grid { grid-template-columns: 1fr; gap: var(--s5); }
}

@media (max-width: 600px) {
    body > section:not(.hero) { padding-block: var(--s8); }
    body > footer { padding-top: var(--s8); }
    .hero-stats { grid-template-columns: 1fr; }
    .stat,
    .stat + .stat {
        flex-direction: row;
        align-items: baseline;
        gap: var(--s4);
        padding: var(--s4) 0;
        border-left: 0;
        border-bottom: 1px solid var(--rule);
    }
    .stat-value { flex: 0 0 6.5rem; font-size: var(--t3); }
    .hero-description { font-size: var(--t0); }
    .project-footer { flex-direction: column; align-items: flex-start; }
}

/* ---------- The handout (/alysia) and /about ---------- */

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 var(--s5) var(--s9); }

header.masthead { padding: var(--s9) 0 var(--s6); border-bottom: 1px solid var(--ink); }

header.masthead h1 {
    font: italic 300 clamp(2.5rem, 6vw, var(--t5))/1.05 var(--display);
    letter-spacing: -0.02em;
    margin-bottom: var(--s3);
    text-wrap: balance;
}

header.masthead .sub { color: var(--ink-2); }

.wrap h2 {
    font: 400 clamp(1.75rem, 4vw, var(--t3))/1.15 var(--display);
    letter-spacing: -0.015em;
    margin: var(--s8) 0 var(--s4);
    padding-top: var(--s5);
    border-top: 1px solid var(--rule);
}

header.masthead + h2,
.section-head + h2 { border-top: 0; padding-top: 0; margin-top: var(--s6); }

.wrap h3 { font: 500 var(--t1)/1.3 var(--display); margin: var(--s6) 0 var(--s2); }

.wrap p { margin: 0 0 var(--s4); }

.wrap ol,
.wrap ul { margin: 0 0 var(--s4); padding-left: 1.3em; }

.wrap li { margin-bottom: var(--s2); }
.wrap li::marker { color: var(--ink-3); }

.wrap em { color: var(--ink); }

code {
    font: 0.88em/1.4 var(--mono);
    background: var(--paper-2);
    color: var(--ink);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    overflow-wrap: anywhere;
}

.code-block { position: relative; margin: 0 0 var(--s3); }

pre {
    font: 14px/1.7 var(--mono);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--cobalt);
    border-radius: var(--radius);
    padding: var(--s4) 4.5rem var(--s4) var(--s4);
    white-space: pre-wrap;
    word-break: break-word;
}

pre code { font: inherit; background: none; padding: 0; border-radius: 0; color: inherit; }

/* The handout's terminal commands keep their lines; long ones scroll. */
.handout pre { white-space: pre; word-break: normal; overflow-x: auto; }
.handout pre.prewrap { white-space: pre-wrap; word-break: break-word; }

.copy-btn {
    position: absolute;
    top: var(--s2);
    right: var(--s2);
    padding: 6px var(--s3);
    font: 600 var(--t-2)/1 var(--text);
    color: var(--ink-2);
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    cursor: pointer;
}

.copy-btn:hover { color: var(--cobalt); border-color: var(--cobalt); }
.copy-btn.copied { color: var(--cobalt); border-color: var(--cobalt); }

.wrap footer {
    margin-top: var(--s8);
    padding-top: var(--s5);
    border-top: 1px solid var(--rule);
    font-size: var(--t-1);
    color: var(--ink-3);
}

.wrap footer p { margin-bottom: var(--s2); }

/* The handout (/alysia) */
.note,
.success,
.warn {
    margin: 0 0 var(--s5);
    padding: var(--s4) var(--s5);
    border: 1px solid var(--rule);
    border-left-width: 3px;
    border-radius: var(--radius);
}

.note > p,
.success > p,
.warn > p { margin: var(--s2) 0; }

.note > :first-child,
.success > :first-child,
.warn > :first-child { margin-top: 0; }

.note > :last-child,
.success > :last-child,
.warn > :last-child { margin-bottom: 0; }

.note { background: var(--surface); border-left-color: var(--cobalt); color: var(--ink-2); }
.note strong { display: block; margin-bottom: var(--s1); }

.success { background: var(--green-tint); border-color: rgba(30, 107, 63, 0.25); border-left-color: var(--green); color: var(--ink); }
.success strong { color: var(--green); }

.warn { background: var(--red-tint); border-color: rgba(168, 37, 28, 0.22); border-left-color: var(--red); color: var(--ink); }
.warn strong { color: var(--red); }

.step {
    margin: var(--s7) 0 0;
    font: 600 var(--t-1)/1.2 var(--text);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cobalt);
}

.wrap .step + h3 { margin-top: var(--s1); }

.os-toggle { display: flex; flex-wrap: wrap; gap: var(--s4); margin: var(--s5) 0 var(--s4); }

.os-btn {
    flex: 1 1 45%;
    min-width: 200px;
    min-height: 64px;
    padding: var(--s4) var(--s5);
    font: 600 var(--t1)/1.2 var(--text);
    color: var(--ink);
    background: var(--surface);
    border: 2px solid var(--rule);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.os-btn:hover { border-color: var(--cobalt); }
.os-btn.active { color: var(--cobalt); background: var(--cobalt-tint); border-color: var(--cobalt); }

.ask-line { margin-top: var(--s2); font-size: var(--t-1); color: var(--ink-3); }

.os-tag {
    display: inline-block;
    margin-right: var(--s2);
    padding: 2px 7px;
    font: 600 var(--t-2)/1.4 var(--text);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cobalt);
    background: var(--cobalt-tint);
    border-radius: 3px;
    vertical-align: middle;
}

/* Both versions show until a button is pressed. */
[data-os="mac"] .os-win { display: none; }
[data-os="win"] .os-mac { display: none; }

table { width: 100%; border-collapse: collapse; margin: 0 0 var(--s5); font-size: var(--t0); }
th, td { text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--rule); }
th { font: 600 var(--t-2)/1.3 var(--text); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); border-bottom-color: var(--ink); }
td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
th.num { text-align: right; }

.prompt-box {
    position: relative;
    margin: 0 0 var(--s4);
    padding: var(--s4) var(--s5);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

.prompt-box .label {
    display: block;
    margin-bottom: var(--s2);
    padding-right: 3.5rem;
    font: 600 var(--t-2)/1.3 var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cobalt);
}

.section-head { margin: var(--s9) 0 var(--s6); padding-top: var(--s6); border-top: 2px solid var(--ink); }

.section-head .section-kicker {
    display: block;
    margin-bottom: var(--s2);
    font: 600 var(--t-1)/1.2 var(--text);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cobalt);
}

.wrap .section-head h2 { margin: 0 0 var(--s2); padding: 0; border: 0; font-size: clamp(2.125rem, 5vw, var(--t4)); }
.section-head .section-sub { margin: 0; color: var(--ink-2); }

.agenda { list-style: none; }
.wrap .agenda { padding-left: 0; }
.agenda li { display: flex; gap: var(--s4); }
.agenda .t { flex: 0 0 3rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--cobalt); }

/* /about */
.about-headshot { width: 160px; height: 160px; object-fit: cover; border-radius: 50%; margin: var(--s6) 0 var(--s5); mix-blend-mode: multiply; }

.about-links { display: flex; flex-wrap: wrap; gap: var(--s5); margin-top: var(--s5); }

@media (max-width: 768px) {
    header.masthead { padding-top: var(--s8); }
    pre { font-size: 13px; padding-right: 4rem; }
    .os-btn { flex-basis: 100%; }
}
