/* Shared layout of every talk page under /talk/<slug>/ — each page holds only its content.
   Colors are tokens: the dark block at the bottom of this section is the whole dark mode. */
:root {
    color-scheme: light dark;
    --chrome: #1a2332;            /* nav, hero, slide deck, code boxes: dark in both themes */
    --accent: #18BC9C;
    --accent-glow: #20e4bc;
    --accent-dark: #0f9a7e;
    --bg: #ffffff;
    --surface: #f8fafb;
    --heading: #1a2332;
    --text: #2a2f3a;
    --text-secondary: #5a6270;
    --text-light: #8a919e;
    --border: #e3e8ec;
    --link: var(--accent-dark);
    --shadow: rgba(26,35,50,0.10);
    --frame-bg: #f7f9fb;
    --code-text: #d7e3ea;
}
@media (prefers-color-scheme: dark) {
    :root {
        --chrome: #0b111b;
        --bg: #111823;
        --surface: #182230;
        --heading: #e8eef5;
        --text: #d5dce5;
        --text-secondary: #a3adba;
        --text-light: #7c8796;
        --border: #263243;
        --link: var(--accent-glow);
        --shadow: rgba(0,0,0,0.45);
        --frame-bg: #161b22;
    }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    color: var(--text);
    line-height: 1.65;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
code { font-family: 'IBM Plex Mono', monospace; font-size: 0.9em; }

/* --- top bar --- */
.top-nav {
    background: var(--chrome);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.top-nav a.brand {
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    letter-spacing: -0.02em;
}
.top-nav a.brand:hover { color: var(--accent); }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

/* --- hero: eyebrow, title, lead, cover slide --- */
.hero {
    background: var(--chrome);
    position: relative;
    overflow: hidden;
    padding: 64px 24px 36px;
    color: #fff;
}
.hero::before {
    content: '';
    position: absolute;
    inset: -40% -20%;
    background: radial-gradient(ellipse at 25% 25%, rgba(24,188,156,0.14) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 80%, rgba(24,188,156,0.08) 0%, transparent 45%);
    pointer-events: none;
}
.hero-inner {
    position: relative;
    max-width: 992px;               /* = main's 1040px minus its padding: edges line up with the sections */
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 48px;
    align-items: center;
}
.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-glow);
    margin-bottom: 16px;
}
.hero h1 {
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 18px;
}
.hero p.lead { color: rgba(255,255,255,0.78); font-size: 1.05rem; max-width: 34em; }
/* before the recording is out, the hero shows the cover slide */
.hero-inner > img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.08);
}
/* the recording sits in the hero: a poster that talk.js swaps for the YouTube player on click */
.hero-inner:has(> .hero-video-wrap) { grid-template-columns: 1fr 1.35fr; gap: 40px; }
.hero-video {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.08);
}
.hero-video img { display: block; width: 100%; height: 100%; object-fit: cover; }
iframe.hero-video { width: 100%; height: auto; }
.hero-video .play {
    position: absolute;
    left: 50%; top: 50%;
    width: 76px; height: 54px;
    transform: translate(-50%, -50%);
    border-radius: 14px;
    background: rgba(15,22,32,0.82);
    transition: background 0.15s, transform 0.15s;
}
.hero-video .play::after {
    content: '';
    position: absolute;
    left: 31px; top: 15px;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
}
.hero-video:hover .play, .hero-video:focus-visible .play { background: var(--accent); transform: translate(-50%, -50%) scale(1.06); }
.hero-video:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.hero-video-meta { margin-top: 10px; font-size: 0.85rem; color: rgba(255,255,255,0.55); }
.hero-video-meta a { color: var(--accent-glow); text-decoration: none; font-weight: 700; white-space: nowrap; }
.hero .lead a { color: var(--accent-glow); }

/* --- other talks at the same conference (talk.js fills #conf-talks from TALKS) --- */
.conf-talks { background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px 24px; }
.conf-talks-inner { max-width: 992px; margin: 0 auto; }
/* a page may close with the strip instead: then it sits above the footer */
main + .conf-talks { margin-top: 56px; border-top: 1px solid var(--border); border-bottom: 0; }
/* where the left menu shows (same media query as .talk-menu) the strip just repeats it */
@media (min-width: 1520px) { .conf-talks { display: none; } }
.conf-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 10px;
}
.conf-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.conf-list a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.conf-list a:hover { border-color: var(--accent); box-shadow: 0 6px 18px var(--shadow); }
.conf-list a[aria-current] { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); cursor: default; }
.conf-meta { font-size: 0.78rem; font-weight: 700; color: var(--link); }
.conf-title { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 0.95rem; line-height: 1.3; color: var(--heading); }

/* --- left menu: all talks (talk.js builds .talk-menu from TALKS); only where the margin beside main fits it --- */
.talk-menu { display: none; }
@media (min-width: 1520px) {
    .talk-menu {
        display: flex;
        flex-direction: column;
        gap: 8px;
        position: fixed;
        top: 76px;
        left: 20px;
        width: 210px;
        max-height: calc(100vh - 96px);
        overflow-y: auto;
        padding: 14px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 10px 30px var(--shadow);
        z-index: 50;
    }
    .talk-menu .conf-label { margin-bottom: 2px; text-decoration: none; }
    .talk-menu .conf-label:hover { color: var(--link); }
    .talk-menu a:not(.conf-label) {
        display: flex;
        flex-direction: column;
        gap: 1px;
        padding: 8px 10px;
        border-radius: 8px;
        border: 1px solid transparent;
        text-decoration: none;
    }
    .talk-menu a:not(.conf-label):hover { border-color: var(--accent); background: var(--bg); }
    .talk-menu a[aria-current] { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); cursor: default; }
    .talk-menu .conf-meta { font-size: 0.72rem; }
    .talk-menu .conf-title { font-size: 0.84rem; }
}

/* --- the /talk/ index --- */
#all-talks section:first-child { padding-top: 28px; }
.talks-hero { display: block; }

#all-talks h2 { font-size: 1.15rem; margin-bottom: 12px; }
.talks-more { padding-top: 40px; color: var(--text-secondary); }
.talks-more a { font-weight: 700; }

/* --- sections --- */
main { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
section { padding: 56px 0 8px; }
/* the wiki sits right under the video: a click in a note plays it, so keep both on one screen */
main > section:first-child { padding-top: 28px; }
h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--heading);
    margin-bottom: 8px;
}
.section-sub { color: var(--text-secondary); margin-bottom: 24px; }

/* --- the three take-home cards --- */
.downloads {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 10px 28px var(--shadow);
}
.card .icon { font-size: 2rem; line-height: 1; }
.card h3 { font-family: 'Sora', sans-serif; font-size: 1.08rem; color: var(--heading); }
.card p { color: var(--text-secondary); font-size: 0.93rem; flex: 1; }
.card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-light);
}
.card .go { font-weight: 700; color: var(--link); font-size: 0.88rem; }
.card.featured { background: var(--chrome); border-color: var(--chrome); color: #fff; }
.card.featured h3 { color: #fff; }
.card.featured p { color: rgba(255,255,255,0.72); }
.card.featured .meta { color: rgba(255,255,255,0.5); }
.card.featured .go { color: var(--accent-glow); }
@media (prefers-color-scheme: dark) {
    .card.featured { background: #0f2a27; border-color: rgba(24,188,156,0.45); }
}

/* --- slide viewer (talk.js renders the PDF named in data-pdf) --- */
.deck {
    border-radius: 12px;
    overflow: hidden;
    background: var(--chrome);
    box-shadow: 0 12px 40px var(--shadow);
    outline: none;
}
.deck:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.stage { position: relative; aspect-ratio: 16 / 9; background: #000; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage .loading {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.6);
}
.stage .loading a { color: var(--accent-glow); }
.stage .nav {
    position: absolute; top: 0; bottom: 0;
    width: 16%;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,0);
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.stage .nav.prev { left: 0; }
.stage .nav.next { right: 0; }
.stage:hover .nav { color: rgba(255,255,255,0.55); }
.stage .nav:hover { color: #fff; background: linear-gradient(90deg, rgba(0,0,0,0.35), transparent); }
.stage .nav.next:hover { background: linear-gradient(270deg, rgba(0,0,0,0.35), transparent); }
.stage .nav:disabled { visibility: hidden; }
.deck-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px;
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
}
.deck-actions { display: flex; gap: 18px; }
.deck-actions a { color: var(--accent-glow); text-decoration: none; font-weight: 700; }
.thumbs {
    display: flex; gap: 8px;
    overflow-x: auto;
    padding: 0 16px 14px;
    scrollbar-width: thin;
}
.thumbs button {
    flex: 0 0 auto;
    width: 112px; aspect-ratio: 16 / 9;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    background: #000;
    opacity: 0.55;
    cursor: pointer;
    transition: opacity 0.15s, border-color 0.15s;
}
.thumbs button:hover { opacity: 0.9; }
.thumbs button.active { opacity: 1; border-color: var(--accent); }
.thumbs canvas { display: block; width: 100%; height: 100%; border-radius: 2px; }

/* --- live wiki (Quartz follows the same OS theme by itself) --- */
.wiki-frame {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px var(--shadow);
    background: var(--frame-bg);
}
.wiki-frame .bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--chrome);
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}
.wiki-frame .dots { display: flex; gap: 6px; }
.wiki-frame .dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.22); }
.wiki-frame .bar .url { flex: 1; font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiki-frame .bar a { color: var(--accent-glow); text-decoration: none; font-weight: 700; white-space: nowrap; }
.wiki-frame iframe { display: block; width: 100%; height: 640px; border: 0; }
/* a button in the bar can fold a panel open under it (talk.js toggles [hidden] through aria-controls) */
.wiki-frame .bar-toggle {
    margin-right: auto;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-glow);
    font: 700 0.85rem 'DM Sans', sans-serif;
    cursor: pointer;
}
.wiki-frame .bar-toggle::after { content: ' ▾'; }
.wiki-frame .bar-toggle[aria-expanded="true"]::after { content: ' ▴'; }
.wiki-frame .bar-toggle:hover { text-decoration: underline; }
.wiki-frame .bar-panel { padding: 20px 22px 22px; border-bottom: 1px solid var(--border); background: var(--surface); }
.wiki-frame .bar-panel .section-sub { margin-bottom: 16px; }

/* --- AI summary reader (talk.js draws every page of data-pdf, with its links clickable) --- */
/* fits under the sticky nav with its bar, so the whole reader is on screen at once */
.doc-pages {
    height: min(720px, calc(100vh - 56px - 44px - 40px));
    height: min(720px, calc(100svh - 56px - 44px - 40px));
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: #525659;
    outline: none;
}
.doc-pages:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }
.doc-pages .loading { margin: auto; color: rgba(255,255,255,0.75); }
.doc-pages .loading a { color: var(--accent-glow); }
.doc-page { position: relative; width: 100%; max-width: 820px; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.35); flex: 0 0 auto; }
.doc-page canvas { display: block; width: 100%; height: 100%; }
.doc-page .doc-link { position: absolute; z-index: 1; }
.doc-page .doc-error { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.doc-more {
    flex: 0 0 auto;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 10px 18px;
    font: 700 0.9rem 'DM Sans', sans-serif;
    cursor: pointer;
}
.doc-more:hover { background: var(--accent-dark); }
/* pdf.js text layer: invisible text over the canvas, for selection, Ctrl+F and screen readers */
.textLayer { position: absolute; inset: 0; overflow: hidden; line-height: 1; text-align: initial; text-size-adjust: none; -webkit-text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; }
.textLayer span, .textLayer br { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.textLayer ::selection { background: rgba(24,120,255,0.3); }

/* --- Obsidian installer (talk.js fills .code[data-zip]) --- */
.install {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.install .box {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 24px;
    background: var(--bg);
}
.install h3 { font-family: 'Sora', sans-serif; font-size: 1rem; color: var(--heading); margin-bottom: 8px; }
.install p, .install li { color: var(--text-secondary); font-size: 0.93rem; }
.install ol { padding-left: 1.2em; }
.code {
    position: relative;
    margin-top: 12px;
    background: var(--chrome);
    color: var(--code-text);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 14px 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.74rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 150px;
    overflow: auto;
}
@media (prefers-color-scheme: dark) {
    .code { border-color: var(--border); }
}
.copy-btn {
    margin-top: 12px;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 9px 16px;
    font: 700 0.86rem 'DM Sans', sans-serif;
    cursor: pointer;
    transition: background 0.15s;
}
.copy-btn:hover { background: var(--accent-dark); }

/* --- takeaways --- */
.takeaways { list-style: none; display: grid; gap: 12px; counter-reset: t; }
.takeaways li {
    counter-increment: t;
    position: relative;
    padding: 14px 18px 14px 58px;
    background: var(--surface);
    border-radius: 10px;
    font-weight: 500;
}
.takeaways li::before {
    content: counter(t);
    position: absolute;
    left: 18px; top: 50%;
    transform: translateY(-50%);
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font: 700 0.85rem/28px 'Sora', sans-serif;
    text-align: center;
}

/* --- pill links: code repos, related talks --- */
.code-links { display: flex; flex-wrap: wrap; gap: 12px; }
.code-links a {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--heading);
    font-weight: 500;
}
.code-links a:hover { border-color: var(--accent); color: var(--link); }

.page-footer {
    margin-top: 64px;
    background: var(--chrome);
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 28px 24px;
    font-size: 0.88rem;
}
.page-footer a { color: var(--accent); text-decoration: none; }

@media (max-width: 820px) {
    .hero-inner, .hero-inner:has(> .hero-video-wrap) { grid-template-columns: 1fr; gap: 32px; }
    .downloads, .install { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .wiki-frame iframe { height: 480px; }
    .doc-pages { height: auto; overflow: visible; padding: 10px; }   /* no scroll trap for thumbs: page 1, then "Show all" */
    .hero { padding: 40px 16px; }
    main { padding: 0 16px; }
    .top-nav { padding: 0 16px; }
    .conf-talks { padding: 16px; }
}

