/* ================================================================
   SHARED STRUCTURAL
   ================================================================ */
.notebook-card { position: relative; }

.card-action {
    width: 9rem;
}
.card-action .try-menu,
.card-action .primary-btn,
.card-action .read-btn {
    box-sizing: border-box;
    width: 100%;
}

.section-title {
    margin: 0;
}
.section-intro {
    margin-top: 0;
}
.section-description {
    margin: 0 0 1.4em;
    max-width: 720px;
}
.section-description > :first-child {
    margin-top: 0;
}
.section-description p {
    margin: 0 0 1em;
}
.section-description ul,
.section-description ol {
    margin: 0 0 1em;
    padding-left: 1.4em;
}
.section-description li {
    padding-left: 0.15em;
}
.section-description > :last-child {
    margin-bottom: 0;
}

.secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em 1.2em;
    margin-top: 0.6em;
}
.secondary-actions a {
    transition: all 0.15s;
}

.ref-links {
    margin-top: 0.8em;
}
.ref-links span {
    display: inline;
}
.ref-links a {
    transition: color 0.15s;
}

.site-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7em;
    margin-top: 1.5em;
}
.site-action-btn {
    display: inline-block;
    transition: all 0.15s;
}
.site-action-codespaces::after,
.site-action-slides::after {
    content: ' \2197';
    font-size: 0.85em;
}
.site-action-download::before {
    content: '\2193  ';
    opacity: 0.5;
}

.primary-btn::after {
    content: ' \2197';
    font-size: 0.85em;
}
.try-menu {
    position: relative;
    display: inline-block;
}
.try-menu > summary {
    cursor: pointer;
    list-style: none;
}
.try-menu > summary::-webkit-details-marker {
    display: none;
}
.try-menu > .primary-btn {
    position: relative;
    display: block;
    text-align: center;
}
.try-menu > .primary-btn::after {
    content: '\25BE';
    position: absolute;
    right: 1.1em;
    top: 50%;
    transform: translateY(-50%);
}
.try-options {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    display: none;
    min-width: 180px;
    overflow: hidden;
    border-radius: 4px;
}
.try-menu[open] .try-options {
    display: flex;
    flex-direction: column;
}
.try-options a {
    display: block;
    padding: 0.65em 0.85em;
    text-decoration: none;
    white-space: nowrap;
}

.action-codealong::before {
    content: '\270E  ';
    opacity: 0.5;
}
.action-download::before {
    content: '\2193  ';
    opacity: 0.5;
}

.section-downloads {
    margin-top: 1.5em;
    margin-bottom: 1.2em;
}
.section-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.section-download-btn::before {
    content: '\2193  ';
    opacity: 0.5;
}

/* ================================================================

   THEME: NOIR
   Dark, editorial. Giant italic serif. Ruled rows.

   ================================================================ */
.theme-noir {
    background: #111;
    color: #999;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 19px;
    line-height: 1.6;
}

.theme-noir .page { max-width: 820px; }

.theme-noir .conference-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.7em;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #c0392b;
    margin-bottom: 1.2em;
}

.theme-noir .site-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3.2em, 7vw, 5em);
    font-weight: 400;
    font-style: italic;
    color: #f0ece4;
    line-height: 1.08;
    margin-bottom: 0.4em;
    letter-spacing: -0.01em;
}

.theme-noir .site-author {
    font-family: 'Inter', sans-serif;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 1.2em;
}

.theme-noir .site-description {
    font-size: 1em;
    color: #777;
    line-height: 1.65;
    margin-bottom: 0.3em;
}
.theme-noir .site-description strong {
    color: #e8e4dc;
    font-weight: 600;
}

.theme-noir .site-meta-links {
    font-family: 'Inter', sans-serif;
    font-size: 0.85em;
    color: #555;
    margin-top: 1.5em;
}
.theme-noir .site-meta-links a {
    color: #888;
}
.theme-noir .site-meta-links a:hover {
    color: #f0ece4;
}

.theme-noir .site-action-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.78em;
    font-weight: 500;
    color: #e8e4dc;
    border: 1px solid #444;
    padding: 8px 16px;
    border-radius: 4px;
}
.theme-noir .site-action-btn:hover {
    border-color: #e8e4dc;
    background: #e8e4dc;
    color: #111;
}
.theme-noir .site-action-highlight {
    background: #e8e4dc;
    border-color: #e8e4dc;
    color: #111;
}
.theme-noir .site-action-highlight:hover {
    background: #fff;
    border-color: #fff;
    color: #111;
}

.theme-noir .section-divider {
    border: none;
    margin: 2em 0 0;
}

.theme-noir .section-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #777;
    margin: 0 0 0.8em;
}
.theme-noir .section-description {
    color: #888;
}
.theme-noir .section-description a {
    color: #e8e4dc;
}

.theme-noir .section-intro {
    border-top: 1px solid #222;
    padding: 1.8em 0;
}

.theme-noir .section-intro > * {
    margin-left: 72px;
}

.theme-noir .section-download-btn {
    font-size: 0.8em;
    color: #111;
    background: #e8e4dc;
    border: 1px solid #e8e4dc;
    letter-spacing: 0.02em;
}
.theme-noir .section-download-btn:hover {
    color: #111;
    background: #fff;
    border-color: #fff;
    transform: translateY(-1px);
}

.theme-noir .notebook-card {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 0 24px;
    align-items: start;
    padding: 1.8em 0;
    border-top: 1px solid #222;
}
.theme-noir .notebook-card:last-of-type {
    border-bottom: 1px solid #222;
}

.theme-noir .step-number {
    font-family: 'Playfair Display', serif;
    font-size: 1.05em;
    color: #c0392b;
    padding-top: 2px;
    font-style: italic;
}

.theme-noir .card-content {
    min-width: 0;
}

.theme-noir .notebook-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.9em;
    font-weight: 600;
    color: #e8e4dc;
    margin-bottom: 0.35em;
    line-height: 1.3;
}
.theme-noir .notebook-title a {
    color: inherit;
}
.theme-noir .notebook-title a:hover {
    color: #c0392b;
}

.theme-noir .notebook-desc {
    font-size: 0.9em;
    color: #666;
    line-height: 1.55;
}

.theme-noir .card-action {
    padding-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-noir .primary-btn {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 0.7em;
    font-weight: 500;
    color: #e8e4dc;
    border: 1px solid #444;
    padding: 8px 20px;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.15s;
}
.theme-noir .primary-btn:hover {
    border-color: #e8e4dc;
    background: #e8e4dc;
    color: #111;
}
.theme-noir .try-menu > .primary-btn {
    background: #e8e4dc;
    border-color: #e8e4dc;
    color: #111;
}
.theme-noir .try-menu > .primary-btn:hover {
    background: #fff;
    border-color: #fff;
    color: #111;
}
.theme-noir .try-options {
    background: #181818;
    border: 1px solid #444;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.theme-noir .try-options a {
    font-family: 'Inter', sans-serif;
    font-size: 0.78em;
    color: #ddd;
}
.theme-noir .try-options a:hover {
    background: #242424;
    color: #fff;
}

.theme-noir .read-btn {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 0.7em;
    font-weight: 500;
    color: #888;
    border: 1px solid #333;
    padding: 7px 20px;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.15s;
    text-align: center;
}
.theme-noir .read-btn:hover {
    color: #e8e4dc;
    border-color: #666;
}

.theme-noir .secondary-actions {
    grid-column: 2 / -1;
    margin-top: 0.6em;
    margin-bottom: 0.3em;
}
.theme-noir .secondary-actions a {
    font-family: 'Inter', sans-serif;
    font-size: 0.8em;
    color: #bbb;
    letter-spacing: 0.02em;
}
.theme-noir .secondary-actions a:hover {
    color: #e8e4dc;
}

.theme-noir .ref-links {
    grid-column: 2 / -1;
    font-family: 'Inter', sans-serif;
    font-size: 0.85em;
    color: #555;
}
.theme-noir .ref-links span { color: #555; }
.theme-noir .ref-links a { color: #9a8a7a; }
.theme-noir .ref-links a:hover { color: #c0392b; }

.theme-noir .site-footer {
    margin-top: 4em;
    font-family: 'Inter', sans-serif;
}
.theme-noir .newsletter-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5em;
    font-style: italic;
    color: #e8e4dc;
    margin-bottom: 0.2em;
}
.theme-noir .newsletter-desc {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 0.5em;
}
.theme-noir .newsletter-signup {
    background: #111;
    text-align: center;
}
.theme-noir .newsletter-embed {
    width: 100%;
    max-width: 480px;
    height: 100px;
}

/* ================================================================

   THEME: BROADSHEET
   Light, massive condensed type. Monospace body.

   ================================================================ */
.theme-broadsheet {
    background: #f0ece4;
    color: #3a3530;
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    font-size: 18px;
    line-height: 1.65;
}

.theme-broadsheet .page { max-width: 880px; }

.theme-broadsheet .conference-label {
    display: inline-block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c0392b;
    border: 2px solid #c0392b;
    padding: 6px 14px;
    margin-bottom: 1.5em;
}

.theme-broadsheet .site-title {
    font-family: 'Archivo Black', Impact, sans-serif;
    font-size: clamp(2.8em, 7vw, 5em);
    font-weight: 800;
    color: #1a1a1a;
    line-height: 0.92;
    text-transform: uppercase;
    margin-bottom: 0.25em;
    letter-spacing: 0.01em;
}

.theme-broadsheet .site-author {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #f0ece4;
    background: #1a1a1a;
    padding: 0.35em 0.7em;
    margin-bottom: 1.5em;
}

.theme-broadsheet .site-description {
    font-size: 1em;
    color: #3a3530;
    line-height: 1.7;
    margin-bottom: 0.3em;
}
.theme-broadsheet .site-description strong {
    color: #1a1a1a;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.theme-broadsheet .site-meta-links {
    font-size: 1em;
    color: #888;
    margin-top: 1.5em;
}
.theme-broadsheet .site-meta-links a { color: #8b5e3c; }
.theme-broadsheet .site-meta-links a:hover { color: #c0392b; }

.theme-broadsheet .site-action-btn {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.88em;
    font-weight: 600;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
    padding: 8px 16px;
    border-radius: 2px;
}
.theme-broadsheet .site-action-btn:hover {
    background: #1a1a1a;
    color: #f5f0e6;
}
.theme-broadsheet .site-action-highlight {
    background: #1a1a1a;
    color: #f5f0e6;
}
.theme-broadsheet .site-action-highlight:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.theme-broadsheet .section-divider {
    border: none;
    border-top: 3px solid #1a1a1a;
    margin: 2em 0 0;
}

.theme-broadsheet .section-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.15em;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #1a1a1a;
    margin: 0 0 0.8em;
}
.theme-broadsheet .section-description {
    color: #4c473f;
}
.theme-broadsheet .section-description a {
    color: #8b5e3c;
}

.theme-broadsheet .section-download-btn {
    font-size: 0.95em;
    color: #1a1a1a;
    background: #fff;
    border: 2px solid #1a1a1a;
    font-family: 'IBM Plex Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.theme-broadsheet .section-download-btn:hover {
    color: #f5f0e6;
    background: #1a1a1a;
    border-color: #1a1a1a;
    transform: translateY(-1px);
}

.theme-broadsheet .notebook-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 32px;
    align-items: start;
    padding: 2em 0;
    border-bottom: 2px solid #ccc5b8;
    overflow: visible;
}

.theme-broadsheet .step-number {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Archivo Black', Impact, sans-serif;
    font-size: 8em;
    font-weight: 900;
    color: #1a1a1a;
    opacity: 0.06;
    line-height: 1;
    pointer-events: none;
}

.theme-broadsheet .card-content { min-width: 0; }

.theme-broadsheet .notebook-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1.1em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.4em;
    line-height: 1.3;
    letter-spacing: 0.02em;
}
.theme-broadsheet .notebook-title a {
    color: inherit;
}
.theme-broadsheet .notebook-title a:hover {
    color: #c0392b;
}

.theme-broadsheet .notebook-desc {
    font-size: 0.95em;
    color: #4a4440;
    line-height: 1.6;
    max-width: 540px;
}

.theme-broadsheet .card-action {
    padding-top: 0;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-broadsheet .primary-btn {
    display: inline-block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #f0ece4;
    background: #1a1a1a;
    padding: 10px 22px;
    white-space: nowrap;
    transition: all 0.15s;
    text-align: center;
}
.theme-broadsheet .primary-btn:hover {
    background: #c0392b;
}
.theme-broadsheet .try-options {
    background: #f5f0e6;
    border: 2px solid #1a1a1a;
    box-shadow: 6px 6px 0 #1a1a1a;
}
.theme-broadsheet .try-options a {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9em;
    color: #1a1a1a;
}
.theme-broadsheet .try-options a:hover {
    background: #1a1a1a;
    color: #f5f0e6;
}

.theme-broadsheet .read-btn {
    display: inline-block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85em;
    font-weight: 500;
    color: #1a1a1a;
    border: 1.5px solid #999;
    padding: 8px 22px;
    white-space: nowrap;
    transition: all 0.15s;
    text-align: center;
}
.theme-broadsheet .read-btn:hover {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: #f0ece4;
}

.theme-broadsheet .secondary-actions {
    grid-column: 1 / -1;
}
.theme-broadsheet .secondary-actions a {
    font-size: 0.95em;
    color: #8b5e3c;
}
.theme-broadsheet .secondary-actions a:hover { color: #c0392b; }

.theme-broadsheet .ref-links {
    grid-column: 1 / -1;
    font-size: 1em;
    color: #777;
}
.theme-broadsheet .ref-links span { color: #777; }
.theme-broadsheet .ref-links a { color: #8b5e3c; text-decoration: underline; }
.theme-broadsheet .ref-links a:hover { color: #c0392b; }

.theme-broadsheet .site-footer {
    margin-top: 4em;
}
.theme-broadsheet .newsletter-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.6em;
    text-transform: uppercase;
    color: #1a1a1a;
    margin-bottom: 0.2em;
}
.theme-broadsheet .newsletter-desc {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 0.5em;
}
.theme-broadsheet .newsletter-signup {
    background: #f0ece4;
    text-align: center;
}
.theme-broadsheet .newsletter-embed {
    width: 100%;
    max-width: 480px;
    height: 100px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 640px) {
    .theme-noir .notebook-card,
    .theme-broadsheet .notebook-card {
        grid-template-columns: 1fr;
        gap: 0.5em 0;
    }
    .theme-noir .step-number { margin-bottom: 0.3em; }
    .theme-broadsheet .step-number { display: none; }
    .theme-noir .card-action,
    .theme-broadsheet .card-action {
        grid-column: 1;
        margin-top: 0.8em;
        width: 100%;
        max-width: 12rem;
    }
    .theme-noir .primary-btn,
    .theme-broadsheet .primary-btn,
    .theme-noir .read-btn,
    .theme-broadsheet .read-btn {
        text-align: center;
    }
    .theme-noir .secondary-actions,
    .theme-broadsheet .secondary-actions,
    .theme-noir .ref-links,
    .theme-broadsheet .ref-links {
        grid-column: 1;
    }
    .theme-noir .section-intro > * {
        margin-left: 0;
    }
}
