:root {
    --ink: #1b1712;
    --ink-soft: #5c564c;
    --line: #d9d0c0;
    --paper: #f3eee3;
    --paper-2: #fffbf4;
    --teal: #0f6b56;
    --present-bar-clear: 3.4rem;
}

* {
    box-sizing: border-box;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 15.5px/1.4 Outfit, "Segoe UI", sans-serif;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    margin: 0;
    padding: 10px 16px;
    background: rgba(243, 238, 227, 0.94);
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}

.top-bar a {
    color: var(--teal);
    text-decoration: none;
}

.top-bar a:hover {
    text-decoration: underline;
}

.slide {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    padding: var(--present-bar-clear) 40px 28px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    overflow-y: auto;
}

.slide.splash {
    justify-content: center;
}

.slide:nth-child(even) {
    background: var(--paper-2);
}

.slide-tools {
    position: absolute;
    top: var(--present-bar-clear);
    right: 20px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.slide-tools button {
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    color: var(--ink);
    font: 560 12px Outfit, "Segoe UI", sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.slide-tools .copy-status:empty {
    display: none;
}

.slide-tools .copy-status {
    font-size: 11px;
    color: var(--teal);
    text-align: right;
    max-width: 16rem;
}

#slide-pos {
    font-variant-numeric: tabular-nums;
    color: var(--ink-soft);
    font-size: 13px;
}

.nav-hint {
    color: var(--ink-soft);
    font-size: 13px;
}

.mono {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.eyebrow {
    margin: 0;
    font-size: 12px;
    font-weight: 560;
    color: var(--teal);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    max-width: calc(100% - 11rem);
}

h1 {
    margin: 0;
    font-family: Fraunces, Georgia, serif;
    font-weight: 620;
    font-size: clamp(1.35rem, 2.8vw, 1.95rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    max-width: 34ch;
}

.lede,
.why {
    margin: 0;
    color: var(--ink-soft);
    max-width: 72ch;
}

.why {
    font-size: 14.5px;
}

.formula {
    margin: 0;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 1.02rem;
    color: var(--teal);
}

.big {
    margin: 0;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 1.75rem;
    font-weight: 650;
    letter-spacing: 0.04em;
}

ol.steps {
    margin: 0;
    padding: 8px 12px 8px 2em;
    max-width: 72ch;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 8px;
}

ol.steps li {
    margin: 0.42em 0;
}

ol.steps li::marker {
    color: var(--teal);
    font-weight: 650;
}

.htable {
    border-collapse: collapse;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 13px;
    max-width: 860px;
}

.htable th,
.htable td {
    border-bottom: 1px solid var(--line);
    padding: 3px 8px;
    text-align: left;
    white-space: nowrap;
}

.htable th {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-weight: 500;
}

.htable tr.is-test td {
    background: #f6e7c8;
}

.htable caption {
    caption-side: bottom;
    text-align: left;
    padding-top: 6px;
    font-family: Outfit, "Segoe UI", sans-serif;
    font-size: 13px;
    color: var(--ink-soft);
}

.fn {
    margin: 0;
    font-family: Fraunces, Georgia, serif;
    font-weight: 620;
    font-size: 1.15rem;
}

.code-grid,
.shot {
    display: grid;
    gap: 16px;
    align-items: start;
}

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

.shot {
    grid-template-columns: minmax(220px, 380px) 1fr;
}

.shot div {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.arg {
    margin: 0;
    max-width: 62ch;
    line-height: 1.45;
}

.steps-analysis {
    max-width: none;
    font-size: 14px;
    line-height: 1.45;
}

.shot img {
    display: block;
    width: 100%;
    max-height: 52vh;
    height: auto;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
}

.py,
.term-out {
    margin: 0;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 12.5px;
    line-height: 1.45;
    white-space: pre;
    overflow-x: auto;
}

.py {
    padding: 10px 12px;
    background: #f3f4f6;
    border-radius: 10px;
    color: #24312c;
}

.py-k {
    color: #128f78;
}

.terminal {
    max-width: 640px;
    padding: 12px;
    background: #1c2333;
    border-radius: 16px;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 2px 8px 10px;
}

.dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.terminal-name {
    margin-left: 6px;
    color: #d5dbe6;
    font-size: 13px;
}

.term-out {
    padding: 14px 16px;
    background: #ececec;
    color: #1c1c1c;
    border-radius: 8px;
}

.term-muted { color: #6b7280; }
.term-ok { color: #14915a; font-weight: 500; }

@media (max-width: 720px) {
    .slide {
        padding: calc(var(--present-bar-clear) + 2.2rem) 20px 36px;
    }

    .slide-tools {
        right: 12px;
    }

    .code-grid,
    .shot {
        grid-template-columns: 1fr;
    }
}

@media print {
    html {
        scroll-snap-type: none;
    }

    .top-bar {
        display: none;
    }

    .slide {
        min-height: 100vh;
        page-break-after: always;
        break-after: page;
        padding: 36px 40px;
    }

    .slide-tools {
        display: none;
    }
}
