@page {
    size: A4 landscape;
    margin: 10mm;
}

/* Loaded only for print. Override mobile screen limits so no content is clipped. */
body {
    margin: 0;
    min-height: 0;
    overflow: visible !important;
    background: #ffffff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    counter-reset: portfolio-page;
}

.sidebar,
.progress,
.controls {
    display: none !important;
}

.deck,
.stage {
    display: block !important;
    min-height: 0 !important;
    margin: 0;
    padding: 0 !important;
}

.slide {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0;
    padding: 5mm !important;
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
    animation: none !important;
    break-after: page;
    page-break-after: always;
    counter-increment: portfolio-page;
}

.slide:last-of-type {
    break-after: auto;
    page-break-after: auto;
}

.slide::after {
    display: block;
    margin-top: 5mm;
    color: var(--muted);
    font-size: 9pt;
    text-align: right;
    content: "Study Portfolio · " counter(portfolio-page);
}

h1 { font-size: 30pt !important; line-height: 1.2; }
h2 { margin-bottom: 6mm; font-size: 23pt !important; line-height: 1.25; }
h1, h2, h3 { word-break: keep-all; text-wrap: balance; }
h3 { margin-bottom: 3mm; font-size: 14pt !important; }
p, .stack-table span, .ops-list span, .flow-notes span {
    font-size: 11pt !important;
    line-height: 1.55 !important;
}
.eyebrow { margin-bottom: 3mm; font-size: 9pt !important; }
.lead, .closing p:not(.eyebrow) { max-width: none; font-size: 14pt !important; }
.portfolio-updated { font-size: 10pt !important; }

.slide-grid, .architecture, .deployment { gap: 4mm; }
.hero-layout { grid-template-columns: 1fr !important; }
.product-shot { display: none; } /* Decorative feed illustration, not portfolio text. */
.goal-grid, .highlight-grid, .flow-notes, .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4mm;
}
.feature-board, .rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 4mm; }
.service-row { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 3mm; }
.deploy-resources { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 3mm; }
.stack-table div { grid-template-columns: 42mm 1fr !important; gap: 4mm !important; padding: 4mm; }
.stack-table strong { font-size: 12pt; }

.goal-grid > div, .highlight-grid > div, .feature-board section, .rule-grid section,
.endpoint-layout div, .flow-notes span, .node, .service-row .node {
    min-height: 0;
    min-width: 0;
    padding: 4mm;
    break-inside: avoid;
    page-break-inside: avoid;
}
.node { width: auto !important; font-size: 12pt; }
.node small { font-size: 9pt; }
.node.app, .node.user, .deploy-step.main, .hero-actions a { color: var(--ink); background: #e7f4f1; }
.number { margin-bottom: 3mm; font-size: 18pt; }
.rule-grid span { margin-bottom: 3mm; font-size: 9pt; }
.hero-actions { margin-top: 5mm; gap: 4mm; }
.hero-actions a { width: auto; padding: 3mm 4mm; }
.hero-stats { margin-top: 5mm; }
.architecture, .stack-table { overflow: visible !important; }
.line.horizontal { height: 4mm; }
.flow-notes { margin-top: 4mm; }
.endpoint-layout { gap: 3mm; }
.endpoint-layout p { margin-bottom: 3mm; }
.endpoint-layout code { padding: 3mm; font-size: 10pt; }
.deploy-step { padding: 3mm 4mm; font-size: 13pt; }
.deploy-resources span, .closing-tags span { padding: 3mm; font-size: 11pt; }
.ops-list { margin-top: 4mm; gap: 2mm; }
.ops-list span { padding: 2mm 3mm; }
.closing { display: block; min-height: 0; }
.closing-tags { margin-top: 6mm; gap: 3mm; }
