/* Base styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* normal title slides */
    --title-font-size: 54px;
    /* sections - usually the only slide content */
    --section-font-size: 96px;
    --subtitle-font-size: 36px;
    --body-large-font-size: 32px;
    --body-font-size: 24px;
    --label-font-size: 20px;
    --code-font-size: 20px;
    --code-small-font-size: 16px;
    --code-fullscreen-font-size: 21px;
    --title-slide-h1-font-size: 134px;
    --title-slide-subtitle-font-size: 77px;
    --title-slide-link-font-size: 58px;
    --bg-transition-duration: 30s;
    --bg-r1: 255; --bg-g1: 107; --bg-b1: 53;
    --bg-r2: 247; --bg-g2: 147; --bg-b2: 30;
    --bg-r3: 118; --bg-g3: 75; --bg-b3: 162;
    --border-r: 255; --border-g: 107; --border-b: 53;
    background: linear-gradient(135deg,
        rgb(var(--bg-r1), var(--bg-g1), var(--bg-b1)) 0%,
        rgb(var(--bg-r2), var(--bg-g2), var(--bg-b2)) 50%,
        rgb(var(--bg-r3), var(--bg-g3), var(--bg-b3)) 100%);
    color: #2d2d2d;
    min-height: 100vh;
    transition: --bg-r1 var(--bg-transition-duration), --bg-g1 var(--bg-transition-duration), --bg-b1 var(--bg-transition-duration),
                --bg-r2 var(--bg-transition-duration), --bg-g2 var(--bg-transition-duration), --bg-b2 var(--bg-transition-duration),
                --bg-r3 var(--bg-transition-duration), --bg-g3 var(--bg-transition-duration), --bg-b3 var(--bg-transition-duration),
                --border-r var(--bg-transition-duration), --border-g var(--bg-transition-duration), --border-b var(--bg-transition-duration);
}

@property --bg-r1 { syntax: '<number>'; inherits: false; initial-value: 255; }
@property --bg-g1 { syntax: '<number>'; inherits: false; initial-value: 107; }
@property --bg-b1 { syntax: '<number>'; inherits: false; initial-value: 53; }
@property --bg-r2 { syntax: '<number>'; inherits: false; initial-value: 247; }
@property --bg-g2 { syntax: '<number>'; inherits: false; initial-value: 147; }
@property --bg-b2 { syntax: '<number>'; inherits: false; initial-value: 30; }
@property --bg-r3 { syntax: '<number>'; inherits: false; initial-value: 118; }
@property --bg-g3 { syntax: '<number>'; inherits: false; initial-value: 75; }
@property --bg-b3 { syntax: '<number>'; inherits: false; initial-value: 162; }

@property --border-r { syntax: '<number>'; inherits: true; initial-value: 255; }
@property --border-g { syntax: '<number>'; inherits: true; initial-value: 107; }
@property --border-b { syntax: '<number>'; inherits: true; initial-value: 53; }

/* Slide styles */
.step {
    width: 1728px;
    height: 972px;
    display: flex;
    flex-direction: column;
    font-size: var(--body-font-size);
    line-height: 1.5;
    box-sizing: border-box;
    position: relative;
}

/* White content area */
.slide-content {
    flex: 1;
    min-height: 0;
    background-color: #fff;
    border: 6px solid rgb(var(--border-r), var(--border-g), var(--border-b));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15),
                inset 0 0 0 3px rgba(0, 0, 0, 0.08);
    padding: 40px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Slide type: title (h1 centered on gradient) */
.step.slide-title {
    justify-content: center;
    align-items: center;
}

.step.slide-title h1 {
    font-size: var(--title-slide-h1-font-size);
}

.step.slide-title .subtitle {
    font-size: var(--title-slide-subtitle-font-size);
}

.step.slide-title a {
    font-size: var(--title-slide-link-font-size);
    text-decoration: none;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Slide type: section (h2 centered on gradient) */
.step.slide-section {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.step.slide-section .section-image {
    max-height: 540px;
    max-width: 1152px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
}

.step.slide-section p {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Slide type: callout (big text centered on gradient) */
.step.slide-callout {
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Slide type: code (h2 + pre filling space) */
.step.slide-code {
    /* h2 left-aligned, pre fills remaining space */
}

.step.slide-code .commit-sha {
    font-size: var(--label-font-size);
    color: rgba(255, 255, 255, 0.8);
    margin: -10px 0 15px 0;
}

.step.slide-code .commit-sha code {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Slide type: image (white box with full image) */
.step.slide-image .slide-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image directly in slide-image (no slide-content wrapper) */
.step.slide-image > img {
    flex: 1;
    min-height: 0;
    object-fit: contain;
    border-radius: 8px;
    margin: 2em;
}

.step h1 {
    font-size: var(--title-font-size);
    margin: 0 0 20px 0;
    color: #fff;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.step .subtitle {
    font-size: var(--subtitle-font-size);
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.step.slide-section h2 {
    font-size: var(--section-font-size);
}
.step h2 {
    font-size: var(--title-font-size);
    margin: 0 0 20px 0;
    color: #fff;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.step p {
    margin: 20px 0;
    color: #424242;
}

.step ul {
    margin: 20px 0;
    padding-left: 0;
    list-style: none;
    text-align: left;
}

.step li {
    margin: 10px 0;
}

/* Hide inactive steps, show active */
.impress-enabled .step {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0s;
}

.impress-enabled .step.active {
    opacity: 1;
    pointer-events: auto;
}

.impress-enabled .step.past {
    opacity: 0;
}

.impress-enabled .step.future {
    opacity: 0;
}

/* Code blocks */
pre {
    background-color: #2b2b2b;
    border-left: 4px solid #ff6e40;
    padding: 15px;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    font-size: var(--code-font-size);
    border-radius: 6px;
    color: #f5f5f5;
    position: relative;
}

pre code,
pre code.hljs {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    display: block;
}

pre::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3em;
    background: linear-gradient(transparent, #2b2b2b);
    pointer-events: none;
}

code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    /*background-color: #2b2b2b;*/
    color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
}

.slide-content pre {
    overflow: hidden !important;
}

.slide-content pre code {
    color: #f5f5f5;
    overflow: hidden !important;
}

/* Before/after split layout */
.slide-content.before-after {
    display: flex;
    gap: 30px;
}

.slide-content.before-after .before,
.slide-content.before-after .after {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.slide-content.before-after h3 {
    margin: 0 0 10px 0;
    font-size: var(--label-font-size);
    color: #666;
}

.slide-content.before-after pre {
    flex: 1;
    margin: 0;
}

/* Vertical before/after layout */
.slide-content.before-after-vertical {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.slide-content.before-after-vertical .before,
.slide-content.before-after-vertical .after {
    display: flex;
    flex-direction: column;
}

.slide-content.before-after-vertical .before {
    flex: 0 0 auto;
}

.slide-content.before-after-vertical .after {
    flex: 0 0 auto;
}

.slide-content.before-after-vertical h3 {
    margin: 0 0 10px 0;
    font-size: var(--label-font-size);
    color: #666;
}

.slide-content.before-after-vertical pre {
    margin: 0;
}
.slide-content code {
    color: #2d2d2d;
    background-color: rgba(0, 0, 0, 0.08);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.slide-content img {
    max-height: 100%;
    object-fit: contain;
}

/* Stars for night sky */
#stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--bg-transition-duration) ease-in-out;
}

#stars.visible {
    opacity: 1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.3; }
}

/* Hide speaker notes */
.notes {
    display: none;
}

/* Callout text styling */
.callout {
    font-size: var(--section-font-size);
    font-weight: 600;
    text-align: center;
    color: #bf360c;
    margin: 0;
}

/* Callout in slide-callout type - white text on gradient */
.step.slide-callout .callout {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Epoch slide */
.step.slide-epoch .epoch-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 192px;
}

.step.slide-epoch p {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-size: var(--body-large-font-size);
    text-align: right;
}

/* Side-by-side images */
.slide-content.side-by-side {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
}

.slide-content.side-by-side figure {
    margin: 0;
    text-align: center;
    width: 672px;
}

.slide-content.side-by-side .img-container {
    width: 672px;
    height: 672px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-content.side-by-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content.side-by-side img.frame-down-left {
    object-position: -20% -05%;
}

.slide-content.side-by-side figcaption {
    margin-top: 16px;
    font-size: var(--body-font-size);
}

.slide-content.side-by-side figcaption a {
    color: #764BA2;
    text-decoration: none;
}

.slide-content.side-by-side figcaption a:hover {
    text-decoration: underline;
}

/* Client architecture radial diagram */
.client-arch {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.client-arch-diagram {
    position: relative;
    width: 780px;
    height: 780px;
}

.client-arch-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.client-arch-center img {
    width: 156px;
    height: 156px;
    object-fit: contain;
}

.client-arch-center .label {
    display: block;
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--label-font-size);
    font-weight: 600;
    color: #2d2d2d;
}

.client-arch-node {
    position: absolute;
    width: 104px;
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-arch-node img {
    width: 117px;
    height: 117px;
    object-fit: contain;
}

/* Position nodes in a circle around center (starts at 2 because SVG is child 1) */
.client-arch-node:nth-child(2) { top: 0; left: 50%; transform: translateX(-50%); }
.client-arch-node:nth-child(3) { top: 13%; right: 5%; }
.client-arch-node:nth-child(4) { bottom: 13%; right: 5%; }
.client-arch-node:nth-child(5) { bottom: 0; left: 50%; transform: translateX(-50%); }
.client-arch-node:nth-child(6) { bottom: 13%; left: 5%; }
.client-arch-node:nth-child(7) { top: 13%; left: 5%; }

/* Arrows pointing to center */
.client-arch-arrow {
    position: absolute;
    stroke: #666;
    stroke-width: 3;
    fill: none;
}

.client-arch-arrow-head {
    fill: #666;
}

.client-arch-arrows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Horizontal split layout */
.slide-content.split-horizontal {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    padding: 40px;
}

.slide-content.split-horizontal.split-igotmad div:first-child {
    margin-left: 50px;
    margin-right: -50px;
}

.slide-content.split-horizontal.split-igotmad div:not(first-child) {
    margin-right: 50px;
    margin-left: -50px;
}

.split-panel {
    flex: 1;
    gap: 1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.split-panel ul {
    align-self: flex-start;
}

/* Centered list layout */
.slide-content.centered-list {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 15%;
}

.slide-content.centered-list ul {
    font-size: var(--body-large-font-size);
}

.slide-content.centered-list li {
    margin: 1.5em 0;
}

/* Experiment slide */
.step.slide-experiment h2 {
    text-align: center;
    color: #39ff14;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.4);
    letter-spacing: 0.05em;
}

.step.slide-experiment .split-panel img {
    width: 90%;
    height: auto;
    max-height: none;
    margin: 5%;
}

.step.slide-experiment .split-panel ul {
    font-size: var(--body-large-font-size);
}

.step.slide-experiment .split-panel li {
    margin: 1.5em 0;
}

.split-panel img {
    width: 100%;
    height: 540px;
    object-fit: cover;
    border-radius: 8px;
}

.split-panel img.frame-zoom-out {
    object-fit: contain;
    /*object-position: -20% -05%;*/
    /*transform: zoom(2);*/
}

.split-panel img.frame-narrow {
    max-width: 70%;
    object-fit: contain;
}

.split-panel p {
    font-size: var(--body-large-font-size);
    font-weight: 600;
    color: #424242;
    margin: 24px 0 0 0;
}

/* Code split layout */
.slide-content.code-split .split-panel {
    justify-content: flex-start;
}

.slide-content.code-split .split-panel p {
    margin: 0 0 16px 0;
    font-size: var(--body-font-size);
}

.slide-content.code-split pre {
    margin: 0;
    font-size: var(--code-small-font-size);
    flex: 1;
    min-height: 0;
    text-align: left;
}

.slide-content.code-split .split-panel:first-child {
    justify-content: center;
}

.slide-content.code-split .split-panel ul {
    align-self: center;
}

.slide-content.code-split .split-panel li {
    margin: 0.8em 0;
}

/* Pre directly in step (no slide-content wrapper) - styled like slide-content */
.step > pre {
    flex: 1;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 40px;
    font-size: var(--code-fullscreen-font-size);
    line-height: 1.4;
    border: 6px solid rgb(var(--border-r), var(--border-g), var(--border-b));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

/* MSRV cycle diagram */
.msrv-cycle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.msrv-cycle-diagram {
    position: relative;
    width: 80%;
    height: 90%;
}

.msrv-cycle-arrows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.msrv-step {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.8em 1.2em;
    border-radius: 0.5em;
    background: #f5f5f5;
    border: 0.15em solid #666;
    font-size: var(--body-font-size);
    font-weight: 600;
    color: #2d2d2d;
}

.msrv-step code {
    font-size: inherit;
    background: transparent;
    padding: 0;
}

/* Step 1: top, centered horizontally */
.msrv-step-1 {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Step 2: right, centered vertically */
.msrv-step-2 {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

/* Step 3: bottom, centered horizontally */
.msrv-step-3 {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Step 4: left, centered vertically */
.msrv-step-4 {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.msrv-label {
    line-height: 1.3;
}

/* Horizons list slide */
.step.slide-horizons-list .slide-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.step.slide-horizons-list ul {
    font-size: var(--body-large-font-size);
    text-align: center;
}

.step.slide-horizons-list li {
    margin: 0.8em 0;
}

/* Horizons table slide */
.step.slide-horizons-table .slide-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.step.slide-horizons-table table {
    font-size: var(--body-large-font-size);
    border-collapse: separate;
    border-spacing: 1em 0.6em;
}

.step.slide-horizons-table td {
    padding: 0.3em 0.5em;
    text-align: left;
}

/* Impact level colors (from chart_style.py) */
.impact-min {
    background-color: #66BB6A;
    padding: 2px 6px;
    border-radius: 3px;
}

.impact-low {
    background-color: #FDD835;
    padding: 2px 6px;
    border-radius: 3px;
}

.impact-moderate {
    background-color: #FFB74D;
    padding: 2px 6px;
    border-radius: 3px;
}

.impact-high {
    background-color: #FF7043;
    padding: 2px 6px;
    border-radius: 3px;
}

.impact-severe {
    background-color: #E53935;
    padding: 2px 6px;
    border-radius: 3px;
    color: #fff;
}

/* Timeline list */
.timeline-list {
    padding-left: 0;
}

.timeline-list li {
    margin: 0.4em 0;
}

.slide-content.centered-list:has(.timeline-list) {
    padding: 40px 5%;
}

/* 1000x World Tour slide */
.step.slide-1000x {
    width: 1920px;
    height: 1080px;
    background: #000;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.slide-1000x-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* When viewport is narrower than 4:3, switch to contain to preserve sides */
@media (max-aspect-ratio: 4/3) {
    .slide-1000x-banner {
        object-fit: contain;
        transform: scale(1.2);
    }
}

/* When viewport is very wide (ultra-wide monitors), use letterboxing instead of cropping */
@media (min-aspect-ratio: 2/1) {
    .slide-1000x-banner {
        object-fit: contain;
    }
}

/* Section slides with smaller font, larger image */
#slide-compat-quest h2,
#slide-tigerstyle h2,
#slide-initial-msrv .callout {
    font-size: 64px;
}

#slide-compat-quest .section-image,
#slide-tigerstyle .section-image {
    max-height: 680px;
    max-width: 1400px;
}

