:root {
    --ink: #17202a;
    --muted: #6d7784;
    --line: #d8dee8;
    --paper: #f7f8fb;
    --panel: #ffffff;
    --accent: #0f766e;
    --accent-strong: #134e4a;
    --gold: #c47f2c;
    --blue: #2563eb;
    --shadow: 0 22px 60px rgba(31, 41, 55, 0.16);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, "Pretendard", "Noto Sans KR", Arial, sans-serif;
}

a {
    color: inherit;
}

.deck {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 34px;
    padding: 34px 26px;
    border-right: 1px solid var(--line);
    background: #ffffff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    color: white;
    background: var(--accent-strong);
    font-size: 22px;
    font-weight: 800;
}

.brand strong,
.brand span {
    display: block;
}

.brand span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.toc {
    display: grid;
    gap: 10px;
}

.toc button {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.toc button.active,
.toc button:hover {
    color: var(--ink);
    border-color: var(--line);
    background: #f1f5f9;
}

.stage {
    position: relative;
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 42px 54px 92px;
}

.progress {
    position: fixed;
    top: 0;
    right: 0;
    left: 280px;
    height: 5px;
    background: #e6eaf0;
    z-index: 10;
}

.progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--blue));
    transition: width 180ms ease;
}

.slide {
    display: none;
    width: min(1120px, 100%);
    min-height: min(650px, calc(100vh - 150px));
    padding: 56px;
    border: 1px solid rgba(216, 222, 232, 0.9);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.slide.active {
    display: block;
    animation: slideIn 220ms ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-grid {
    display: grid;
    gap: 42px;
}

.hero-layout {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.portfolio-updated {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 22px;
    font-size: clamp(40px, 6vw, 68px);
    line-height: 1.05;
    letter-spacing: 0;
}

h2 {
    max-width: 840px;
    margin-bottom: 34px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.12;
    letter-spacing: 0;
}

h3 {
    margin-bottom: 10px;
    font-size: 22px;
}

.lead {
    max-width: 620px;
    color: #46515f;
    font-size: 20px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
}

.hero-actions a {
    padding: 13px 18px;
    border-radius: 8px;
    color: white;
    background: var(--accent-strong);
    font-weight: 800;
    text-decoration: none;
}

.hero-actions span {
    color: var(--muted);
    font-size: 14px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 26px 0 0;
}

.hero-stats div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.hero-stats dt,
.hero-stats dd {
    margin: 0;
}

.hero-stats dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.hero-stats dd {
    margin-top: 6px;
    color: var(--accent-strong);
    font-size: 17px;
    font-weight: 900;
}

.product-shot {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fafb;
}

.browser-bar {
    display: flex;
    gap: 8px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: #eef2f7;
}

.browser-bar span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #94a3b8;
}

.feed-preview {
    padding: 28px;
}

.profile-line {
    width: 58%;
    height: 18px;
    margin-bottom: 22px;
    border-radius: 999px;
    background: #cbd5e1;
}

.image-tile {
    aspect-ratio: 4 / 3;
    margin-bottom: 22px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.9), rgba(37, 99, 235, 0.75)),
        repeating-linear-gradient(45deg, transparent, transparent 18px, rgba(255, 255, 255, 0.2) 19px, rgba(255, 255, 255, 0.2) 20px);
}

.text-line {
    width: 62%;
    height: 13px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: #d6dde7;
}

.text-line.wide {
    width: 88%;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 26px;
}

.metric-row strong {
    padding: 16px 10px;
    border-radius: 8px;
    color: var(--accent-strong);
    background: #e7f4f1;
    font-size: 13px;
    text-align: center;
}

.goal-grid,
.feature-board,
.highlight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-board {
    grid-template-columns: repeat(2, 1fr);
}

.goal-grid > div,
.feature-board section,
.highlight-grid > div {
    min-height: 190px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.goal-grid p,
.feature-board p,
.highlight-grid p {
    color: var(--muted);
    font-size: 17px;
    line-height: 1.6;
}

.number {
    display: inline-block;
    margin-bottom: 34px;
    color: var(--gold);
    font-size: 30px;
    font-weight: 900;
}

.architecture {
    display: grid;
    justify-items: center;
    gap: 24px;
    margin-top: 10px;
}

.node {
    min-width: 170px;
    padding: 22px 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
    font-size: 18px;
    font-weight: 800;
    text-align: center;
}

.node small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.node.user {
    color: white;
    background: var(--ink);
}

.node.app {
    min-width: 260px;
    color: white;
    background: var(--accent);
}

.line.horizontal {
    width: 2px;
    height: 24px;
    background: var(--line);
}

.service-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    width: 100%;
}

.service-row .node {
    min-width: 0;
    padding: 20px 14px;
    font-size: 16px;
}

.flow-notes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 26px;
}

.flow-notes span {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #46515f;
    background: #ffffff;
    font-size: 15px;
    line-height: 1.5;
}

.stack-table {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.stack-table div {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 22px;
    padding: 22px 26px;
    border-bottom: 1px solid var(--line);
}

.stack-table div:last-child {
    border-bottom: 0;
}

.stack-table strong {
    color: var(--accent-strong);
    font-size: 18px;
}

.stack-table span {
    color: #46515f;
    font-size: 18px;
}

.rule-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.rule-grid section,
.endpoint-layout div {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.rule-grid span {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.rule-grid p,
.endpoint-layout p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.endpoint-layout {
    display: grid;
    gap: 16px;
}

.endpoint-layout code {
    display: block;
    overflow-wrap: anywhere;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: var(--accent-strong);
    background: #eef7f5;
    font-size: 15px;
    font-weight: 800;
}

.deployment {
    display: grid;
    justify-items: center;
    gap: 14px;
    max-width: 760px;
    margin: 0 auto;
}

.deploy-step {
    width: min(560px, 100%);
    padding: 18px 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
}

.deploy-step.main {
    color: white;
    background: var(--accent-strong);
}

.deploy-resources {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    margin-top: 14px;
}

.deploy-resources span,
.closing-tags span {
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    font-weight: 800;
    text-align: center;
}

.ops-list {
    display: grid;
    gap: 10px;
    max-width: 760px;
    margin: 22px auto 0;
}

.ops-list span {
    padding: 13px 16px;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    color: #46515f;
    background: #f4f8fb;
    font-size: 15px;
}

.closing {
    display: grid;
    align-content: center;
    min-height: 520px;
}

.closing p:not(.eyebrow) {
    max-width: 760px;
    color: #46515f;
    font-size: 21px;
    line-height: 1.7;
}

.closing-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.controls {
    position: fixed;
    right: 54px;
    bottom: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(31, 41, 55, 0.12);
}

.controls button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.controls button:disabled {
    color: #a8b0bb;
    cursor: not-allowed;
}

.controls span {
    min-width: 64px;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.controls .save-pdf-button {
    width: auto;
    min-width: 64px;
    padding: 0 14px;
    border-color: var(--accent-strong);
    color: #ffffff;
    background: var(--accent-strong);
    font: inherit;
    font-weight: 800;
}

.controls .save-pdf-button:hover {
    background: var(--accent);
}

.controls button:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}

.pdf-save-status {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: min(300px, calc(100vw - 28px));
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--panel);
    box-shadow: var(--shadow);
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 980px) {
    .deck {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        gap: 18px;
        padding: 20px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .toc {
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .toc button {
        flex: 0 0 auto;
        width: auto;
        white-space: nowrap;
    }

    .progress {
        left: 0;
    }

    .stage {
        padding: 26px 20px 92px;
    }

    .slide {
        min-height: auto;
        padding: 30px;
    }

    .hero-layout,
    .goal-grid,
    .feature-board,
    .highlight-grid,
    .rule-grid,
    .flow-notes,
    .service-row,
    .deploy-resources,
    .hero-stats {
        grid-template-columns: 1fr;
    }

    .stack-table div {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .controls {
        right: 20px;
        bottom: 18px;
    }
}

body.mobile-view {
    overflow-x: hidden;
}

body.mobile-view .deck {
    grid-template-columns: 1fr;
}

body.mobile-view .sidebar {
    position: static;
    gap: 18px;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
}

body.mobile-view .toc {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

body.mobile-view .toc button {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
}

body.mobile-view .progress {
    left: 0;
}

body.mobile-view .stage {
    min-height: auto;
    padding: 26px 14px 92px;
}

body.mobile-view .slide {
    width: 100%;
    min-height: auto;
    padding: 24px 18px;
}

body.mobile-view .hero-layout,
body.mobile-view .goal-grid,
body.mobile-view .feature-board,
body.mobile-view .highlight-grid,
body.mobile-view .rule-grid,
body.mobile-view .flow-notes,
body.mobile-view .service-row,
body.mobile-view .deploy-resources,
body.mobile-view .hero-stats,
body.mobile-view .metric-row {
    grid-template-columns: 1fr;
}

body.mobile-view .stack-table div {
    grid-template-columns: 1fr;
    gap: 8px;
}

body.mobile-view .architecture,
body.mobile-view .stack-table,
body.mobile-view .product-shot {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.mobile-view h1 {
    font-size: 36px;
}

body.mobile-view h2 {
    font-size: 29px;
}

body.mobile-view .lead,
body.mobile-view .closing p:not(.eyebrow) {
    font-size: 17px;
}

body.mobile-view .controls {
    right: 14px;
    bottom: 14px;
}

@media (max-width: 560px) {
    body {
        overflow-x: hidden;
    }

    .deck {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .sidebar {
        display: none;
    }

    .stage {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 12px 10px 74px;
        place-items: stretch;
    }

    .progress {
        height: 4px;
    }

    .slide {
        width: 100%;
        min-height: calc(100vh - 88px);
        min-height: calc(100dvh - 88px);
        max-height: calc(100vh - 88px);
        max-height: calc(100dvh - 88px);
        overflow-y: auto;
        padding: 18px 16px;
        border-radius: 8px;
        box-shadow: 0 12px 32px rgba(31, 41, 55, 0.14);
    }

    .slide-grid {
        gap: 18px;
    }

    .eyebrow {
        margin-bottom: 10px;
        font-size: 11px;
    }

    h1 {
        margin-bottom: 14px;
        font-size: 27px;
        line-height: 1.18;
    }

    h2 {
        margin-bottom: 18px;
        font-size: 25px;
        line-height: 1.18;
    }

    h3 {
        font-size: 18px;
    }

    .lead,
    .closing p:not(.eyebrow) {
        font-size: 16px;
        line-height: 1.55;
    }

    .hero-actions {
        gap: 10px;
        margin-top: 18px;
    }

    .hero-actions a {
        width: 100%;
        padding: 11px 14px;
        text-align: center;
    }

    .product-shot {
        max-height: 230px;
    }

    .feed-preview {
        padding: 16px;
    }

    .goal-grid,
    .feature-board,
    .highlight-grid,
    .rule-grid {
        gap: 10px;
    }

    .goal-grid > div,
    .feature-board section,
    .highlight-grid > div,
    .rule-grid section,
    .endpoint-layout div {
        min-height: auto;
        padding: 16px;
    }

    .goal-grid p,
    .feature-board p,
    .highlight-grid p,
    .rule-grid p,
    .endpoint-layout p {
        font-size: 15px;
        line-height: 1.48;
    }

    .number {
        margin-bottom: 12px;
        font-size: 22px;
    }

    .architecture {
        gap: 10px;
    }

    .node,
    .node.app {
        width: 100%;
        min-width: 0;
        padding: 14px 12px;
        font-size: 15px;
    }

    .node small {
        font-size: 12px;
    }

    .line.horizontal {
        height: 12px;
    }

    .stack-table div {
        padding: 14px 16px;
    }

    .stack-table strong,
    .stack-table span {
        font-size: 15px;
    }

    .deploy-step {
        padding: 13px 14px;
        font-size: 16px;
    }

    .deploy-resources {
        gap: 8px;
    }

    .deploy-resources span,
    .closing-tags span {
        padding: 11px 10px;
        font-size: 14px;
    }

    .closing {
        min-height: calc(100vh - 130px);
        min-height: calc(100dvh - 130px);
    }

    .closing-tags {
        gap: 8px;
        margin-top: 22px;
    }

    .metric-row {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 16px;
    }

    .metric-row strong {
        padding: 11px 10px;
        font-size: 12px;
    }

    .controls {
        right: 10px;
        bottom: 10px;
        left: 10px;
        justify-content: center;
        padding: 8px;
    }

    .controls button {
        width: 40px;
        height: 40px;
    }

    .controls span {
        min-width: 58px;
    }
}
