/* ============================================
   Payo — Animated Landing + Step Flow
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --color-bg: #ffffff;
    --color-surface: #f2f2f7;
    --color-card-dark: #1a1a1a;
    --color-text: #1d1d1f;
    --color-text-secondary: #86868b;
    --color-text-on-dark: #e5e5ea;
    --color-border: #e8e8ed;
    --color-accent: #4F6BF6;
    --color-success: #30d158;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-pill: 100px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    overflow-x: hidden;
}

a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
}

a:hover { opacity: 0.7; }

.tip a,
.card a,
.path-content a,
.scenario-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.link-button:hover {
    opacity: 0.8;
}

.tip a:hover,
.card a:hover,
.path-content a:hover,
.scenario-content a:hover {
    opacity: 0.8;
}

/* --- Typography --- */
h2 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 36px;
    margin-bottom: 12px;
}

p {
    margin-bottom: 20px;
    color: var(--color-text-secondary);
    font-size: 16px;
    line-height: 1.7;
}

code {
    font-family: var(--font-mono);
    font-size: 13.5px;
    background: var(--color-surface);
    padding: 3px 8px;
    border-radius: 6px;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

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

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Stagger helper — each child gets progressively delayed */
.stagger > *:not(.landing-bg) {
    opacity: 0;
    animation: fadeSlideUp 0.6s ease-out forwards;
}
.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.2s; }
.stagger > *:nth-child(4) { animation-delay: 0.3s; }
.stagger > *:nth-child(5) { animation-delay: 0.4s; }
.stagger > *:nth-child(6) { animation-delay: 0.5s; }
.stagger > *:nth-child(7) { animation-delay: 0.6s; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.4s ease-out;
    border-color: #ff375f !important;
}

/* Step enter/exit */
.step-enter {
    animation: fadeSlideUp 0.4s ease-out forwards;
}

.step-exit {
    animation: fadeOut 0.25s ease-in forwards;
}

/* Landing transitions */
#landing.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
    pointer-events: none;
}

#steps.fade-in {
    animation: fadeIn 0.35s ease-out forwards;
}

/* ==========================================
   TOP NAVIGATION
   ========================================== */

.topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.topnav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
}

.topnav-logo:hover { text-decoration: none; opacity: 1; }
.topnav-logo img { width: 28px; height: 28px; border-radius: 8px; }

.topnav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topnav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    transition: all 0.2s;
}

.topnav-link:hover {
    color: var(--color-text);
    background: var(--color-surface);
    opacity: 1;
}

.topnav-link-cta {
    color: #fff;
    background: var(--color-text);
    font-weight: 600;
}

.topnav-link-cta:hover {
    color: #fff;
    background: #333;
}

/* ==========================================
   LANDING PAGE
   ========================================== */

#landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 32px 80px;
    background: radial-gradient(ellipse at 50% 0%, rgba(79, 107, 246, 0.06) 0%, transparent 70%);
    position: relative;
    overflow: hidden;
}

/* --- Animated Background Orbs --- */
.landing-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

#landing > *:not(.landing-bg) {
    position: relative;
    z-index: 1;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    will-change: transform;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79, 107, 246, 0.5), rgba(79, 107, 246, 0) 70%);
    top: -10%;
    left: -5%;
    animation: orbFloat1 14s ease-in-out infinite;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(191, 90, 242, 0.45), rgba(191, 90, 242, 0) 70%);
    top: 20%;
    right: -8%;
    animation: orbFloat2 18s ease-in-out infinite;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(48, 209, 88, 0.3), rgba(48, 209, 88, 0) 70%);
    bottom: -5%;
    left: 30%;
    animation: orbFloat3 16s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, 40px) scale(1.05); }
    66% { transform: translate(-30px, 60px) scale(0.95); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-50px, 30px) scale(0.95); }
    66% { transform: translate(30px, -40px) scale(1.08); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.06); }
    66% { transform: translate(-50px, -20px) scale(0.96); }
}

.landing-title {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
    max-width: 680px;
    margin-bottom: 20px;
}

.landing-subtitle {
    font-size: 19px;
    color: var(--color-text-secondary);
    max-width: 480px;
    margin-bottom: 40px;
    line-height: 1.7;
}

/* Hero code showcase */
.hero-code-showcase {
    width: 100%;
    max-width: 520px;
    margin-bottom: 32px;
}

.hero-code-tabs {
    display: inline-flex;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 16px;
}

.hero-code-tab {
    padding: 6px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.hero-code-tab.active {
    color: #fff;
    background: var(--color-accent);
}

.hero-code-window {
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.hero-code-titlebar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-code-dots {
    display: flex;
    gap: 6px;
}

.hero-code-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3a3a4a;
}

.hero-code-filename {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-right: 34px;
}

.hero-code-window pre {
    margin: 0;
    padding: 20px 24px 24px;
    font-size: 14px;
    line-height: 1.7;
    overflow-x: auto;
    background: transparent !important;
}

.hero-code-window code {
    background: transparent !important;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.highlight-line {
    display: block;
    margin: 0 -24px;
    padding: 0 24px;
    border-left: 3px solid #6b8aff !important;
    background: rgba(107, 138, 255, 0.12) !important;
    animation: highlightGlow 3s ease-in-out infinite !important;
}

@keyframes highlightGlow {
    0%, 100% {
        background: rgba(107, 138, 255, 0.08) !important;
        box-shadow: inset 0 0 0 0 transparent;
    }
    50% {
        background: rgba(107, 138, 255, 0.22) !important;
        box-shadow: inset 40px 0 30px -20px rgba(107, 138, 255, 0.08);
    }
}

.code-comment {
    color: #636e7b !important;
    font-style: italic;
}

.hero-code-caption {
    font-size: 16px;
    color: var(--color-text-secondary);
    margin-top: 24px;
    text-align: center;
    line-height: 1.5;
}

/* Rotating badge */
.hero-rotating-badge {
    position: relative;
    height: 28px;
    width: 100%;
    margin-bottom: 40px;
}

.rotating-word {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%) translateY(16px);
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-secondary);
    white-space: nowrap;
    opacity: 0;
    animation: rotateWord 9s ease-in-out infinite;
}

.rotating-word:nth-child(1) { animation-delay: 0s; }
.rotating-word:nth-child(2) { animation-delay: 3s; }
.rotating-word:nth-child(3) { animation-delay: 6s; }

@keyframes rotateWord {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(16px);
    }
    5% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    28% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    33% {
        opacity: 0;
        transform: translateX(-50%) translateY(-16px);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-16px);
    }
}

/* Feature cards */
/* CTA Button */
.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 40px;
    background: var(--color-text);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.25s;
}

.btn-cta:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.btn-cta:active { transform: translateY(0); }

.btn-cta svg { width: 18px; height: 18px; }

.landing-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Secondary outline button */
.btn-secondary-outline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.25s;
}

.btn-secondary-outline:hover {
    border-color: var(--color-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.btn-secondary-outline:active { transform: translateY(0); }
.btn-secondary-outline svg { width: 18px; height: 18px; }

/* ==========================================
   PROGRESS BAR
   ========================================== */

.progress-bar {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-surface);
    z-index: 99;
}

.progress-fill {
    height: 100%;
    background: var(--color-text);
    border-radius: 0 2px 2px 0;
    transition: width 0.4s ease;
    width: 0%;
}

/* ==========================================
   STEP FLOW
   ========================================== */

#steps {
    display: none;
    padding-top: 72px;
    min-height: 100vh;
}

#steps.visible {
    display: block;
}

.step-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 32px 100px;
    position: relative;
}

/* Individual step */
.step {
    display: none;
}

.step.active {
    display: block;
}

.step.step-centered {
    padding-top: 60px;
}

.step h2 {
    margin-bottom: 12px;
    text-align: center;
}

.step > p:first-of-type {
    text-align: center;
}

.step > p:first-of-type {
    font-size: 17px;
}

/* --- Content Cards --- */
.card {
    background: var(--color-surface);
    border: none;
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 24px;
}

/* --- Instruction Steps --- */
.instructions { counter-reset: instruction; }

.instruction {
    display: flex;
    gap: 18px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.instruction:last-child { margin-bottom: 0; }

.instruction-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-secondary);
    flex-shrink: 0;
    margin-top: 1px;
}

.instruction-text { flex: 1; }

.instruction-text p {
    margin-bottom: 8px;
    color: var(--color-text);
    font-size: 15px;
}

.instruction-text p:last-child { margin-bottom: 0; }

/* --- Code Blocks --- */
.code-block {
    background: var(--color-card-dark);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-lang {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.07);
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.75);
}

.copy-btn.copied {
    color: var(--color-success);
    background: rgba(48, 209, 88, 0.1);
}

.code-block pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
}

.code-block pre code {
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--color-text-on-dark);
    background: none;
    padding: 0;
    border-radius: 0;
}

/* Prism overrides */
.code-block pre[class*="language-"],
.code-block code[class*="language-"] {
    background: none;
    text-shadow: none;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.65;
}

.code-block .token.comment,
.code-block .token.prolog,
.code-block .token.doctype { color: #636e7b; }
.code-block .token.keyword { color: #ff7ab2; }
.code-block .token.string { color: #ff8170; }
.code-block .token.function { color: #67b7a4; }
.code-block .token.number { color: #d0bf69; }
.code-block .token.operator { color: #e5e5ea; }
.code-block .token.punctuation { color: #a0a0a8; }
.code-block .token.class-name { color: #acf2e4; }
.code-block .token.property { color: #78c2b3; }
.code-block .token.builtin { color: #b281eb; }
.code-block .token.boolean { color: #d0bf69; }

/* --- Tip Callout --- */
.tip {
    display: flex;
    gap: 14px;
    padding: 20px 24px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.tip-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--color-text-secondary);
    margin-top: 2px;
}

.tip p {
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 0;
}

.tip-important {
    background: rgba(255, 159, 10, 0.08);
    border: 1px solid rgba(255, 159, 10, 0.2);
}

.tip-important .tip-icon {
    color: #ff9f0a;
}

/* --- Completion Screen (Step 5) --- */

.completion-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 20px 40px;
    position: relative;
    overflow: hidden;
}

.completion-ring {
    width: 96px;
    height: 96px;
    margin-bottom: 32px;
    position: relative;
}

.completion-check {
    width: 96px;
    height: 96px;
}

.completion-circle {
    stroke-dasharray: 201;
    stroke-dashoffset: 201;
    fill: none;
}

.completion-tick {
    stroke-dasharray: 44;
    stroke-dashoffset: 44;
}

.step.active .completion-circle {
    animation: drawCircle 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

.step.active .completion-tick {
    animation: drawTick 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.7s forwards;
}

@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawTick {
    to { stroke-dashoffset: 0; }
}

.completion-title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(12px);
}

.step.active .completion-title {
    animation: completionFadeUp 0.5s ease-out 0.9s forwards;
}

.completion-subtitle {
    font-size: 17px;
    color: var(--color-muted);
    line-height: 1.6;
    max-width: 420px;
    margin-bottom: 36px;
    opacity: 0;
    transform: translateY(12px);
}

.step.active .completion-subtitle {
    animation: completionFadeUp 0.5s ease-out 1.05s forwards;
}

.completion-choices {
    display: flex;
    gap: 16px;
    width: 100%;
    max-width: 520px;
    opacity: 0;
    transform: translateY(12px);
}

.step.active .completion-choices {
    animation: completionFadeUp 0.5s ease-out 1.2s forwards;
}

.completion-choice {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 28px 20px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s;
    position: relative;
}

.completion-choice:hover {
    border-color: var(--color-text);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.completion-choice-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: 12px;
    color: var(--color-accent);
}

.completion-choice-icon svg {
    width: 24px;
    height: 24px;
}

.completion-choice strong {
    font-size: 16px;
    color: var(--color-text);
}

.completion-choice span {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.55;
}

.completion-choice-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    background: rgba(79, 107, 246, 0.08);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    margin-top: 2px;
}

@keyframes completionFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Confetti particles */
.completion-screen::before,
.completion-screen::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
}

.step.active .completion-screen::before {
    animation: confettiBurst 1.8s ease-out 0.6s forwards;
    background-image:
        radial-gradient(circle, #30d158 3px, transparent 3px),
        radial-gradient(circle, #4F6BF6 2.5px, transparent 2.5px),
        radial-gradient(circle, #ff9f0a 2px, transparent 2px),
        radial-gradient(circle, #ff375f 3px, transparent 3px),
        radial-gradient(circle, #bf5af2 2.5px, transparent 2.5px),
        radial-gradient(circle, #30d158 2px, transparent 2px),
        radial-gradient(circle, #4F6BF6 3px, transparent 3px),
        radial-gradient(circle, #ff9f0a 2.5px, transparent 2.5px);
    background-size: 6px 6px, 5px 5px, 4px 4px, 6px 6px, 5px 5px, 4px 4px, 6px 6px, 5px 5px;
    background-position:
        15% 20%, 75% 15%, 85% 35%, 25% 75%,
        65% 80%, 40% 10%, 90% 60%, 10% 55%;
    background-repeat: no-repeat;
}

.step.active .completion-screen::after {
    animation: confettiBurst 1.8s ease-out 0.75s forwards;
    background-image:
        radial-gradient(circle, #ff375f 2px, transparent 2px),
        radial-gradient(circle, #30d158 3px, transparent 3px),
        radial-gradient(circle, #bf5af2 2.5px, transparent 2.5px),
        radial-gradient(circle, #4F6BF6 2px, transparent 2px),
        radial-gradient(circle, #ff9f0a 3px, transparent 3px),
        radial-gradient(circle, #30d158 2.5px, transparent 2.5px);
    background-size: 4px 4px, 6px 6px, 5px 5px, 4px 4px, 6px 6px, 5px 5px;
    background-position:
        55% 12%, 30% 45%, 80% 50%, 45% 85%,
        20% 30%, 70% 70%;
    background-repeat: no-repeat;
}

@keyframes confettiBurst {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    30% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1.8);
    }
}

/* --- Product ID Banner (Step 4) --- */

.product-ids-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 14px;
    flex-wrap: wrap;
}

.product-ids-banner-label {
    font-weight: 600;
    color: var(--color-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.product-ids-banner-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-id-pill {
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 4px 10px;
    padding-right: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.product-id-pill::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23999' stroke-width='1.5'%3E%3Crect x='5' y='5' width='8' height='8' rx='1.5'/%3E%3Cpath d='M5 11V3.5A1.5 1.5 0 0 1 6.5 2H11'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.product-id-pill:hover::after {
    opacity: 1;
}

.product-id-pill:hover {
    border-color: rgba(0, 0, 0, 0.25);
    background: #fafafa;
    padding-right: 10px;
}

.product-id-pill .pill-tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: white;
    font-family: Inter, system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    animation: tooltipPop 0.2s ease-out;
}

@keyframes tooltipPop {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.product-id-pill.copied {
    border-color: #30d158;
    color: #1a7a3a;
    background: #f0faf4;
}

.product-id-pill.copied::after {
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231a7a3a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 8.5L7 11.5L12 5'/%3E%3C/svg%3E");
}

/* --- Bundle ID Input --- */
.bundle-id-input {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-text);
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    transition: border-color 0.2s;
}

.bundle-id-input:focus {
    outline: none;
    border-color: var(--color-text);
}

.bundle-id-input::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.5;
}

/* --- Button States --- */
.btn.btn-success {
    background: var(--color-success);
    color: #fff;
}

.btn.btn-success:hover {
    background: #28b84d;
}

/* --- Product ID Input --- */
.product-id-input-wrapper {
    margin-bottom: 24px;
}

.product-id-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.product-id-input {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-text);
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    resize: vertical;
    transition: border-color 0.2s;
}

.product-id-input:focus {
    outline: none;
    border-color: var(--color-text);
}

.product-id-input::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.5;
}

/* --- Collapsible Section --- */
.collapsible {
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.collapsible summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: var(--color-surface);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    border-radius: var(--radius-md);
    list-style: none;
    transition: background 0.2s;
}

.collapsible summary::-webkit-details-marker { display: none; }

.collapsible summary::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--color-text-secondary);
    border-bottom: 2px solid var(--color-text-secondary);
    transform: rotate(-45deg);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.collapsible[open] summary::before {
    transform: rotate(45deg);
}

.collapsible summary:hover { background: #e8e8ed; }

.collapsible-content { padding: 24px 0 0; }

/* --- Path Choice Cards --- */
.path-choices {
    display: flex;
    gap: 16px;
    margin-top: 40px;
}

.path-choice {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 40px 28px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s;
}

.path-choice:hover {
    border-color: var(--color-text);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.path-choice-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: 14px;
    color: var(--color-accent);
}

.path-choice-icon svg {
    width: 28px;
    height: 28px;
}

.path-choice strong {
    font-size: 17px;
    color: var(--color-text);
}

.path-choice span {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.path-choice-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.path-content {
    display: none;
}

/* --- Framework Toggle --- */
.framework-toggle {
    display: inline-flex;
    background: var(--color-surface);
    border-radius: var(--radius-pill);
    padding: 3px;
    margin-bottom: 16px;
}

.framework-option {
    padding: 8px 20px;
    border: none;
    background: none;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s;
}

.framework-option:hover {
    color: var(--color-text);
}

.framework-option.active {
    background: var(--color-text);
    color: #fff;
}

.framework-option.active:hover {
    color: #fff;
}

/* Framework visibility */
.framework-uikit { display: none; }
body.show-uikit .framework-swiftui { display: none; }
body.show-uikit .framework-uikit { display: block; }


/* --- Download Cards --- */
.download-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.download-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 24px 28px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 16px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    text-align: center;
    font-family: inherit;
    color: inherit;
}

.download-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 16px rgba(107, 138, 255, 0.15);
    transform: translateY(-2px);
}

.download-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(107, 138, 255, 0.1);
    border-radius: 14px;
    color: var(--color-accent);
    margin-bottom: 4px;
}

.download-card-icon svg {
    width: 24px;
    height: 24px;
}

.download-card strong {
    font-size: 16px;
    color: var(--color-text);
}

.download-card span {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.download-card-action {
    display: inline-block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-accent) !important;
}

.download-card:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.download-card.btn-success {
    border-color: #34c759;
}

.download-card.btn-success .download-card-action {
    color: #34c759 !important;
}

/* --- Sticky Bottom Navigation --- */
.step-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.step-nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 720px;
    margin: 0 auto;
}

.step-nav.hidden {
    display: none;
}

.step-nav-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-muted);
    letter-spacing: 0.02em;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--color-text);
    color: #fff;
}

.btn-primary:hover { background: #333; }

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
}

.btn-secondary:hover { background: #e8e8ed; }

.btn-hidden { visibility: hidden; }

.btn svg { width: 16px; height: 16px; }

.btn-download {
    width: 100%;
    justify-content: center;
    margin-bottom: 24px;
    padding: 16px 28px;
    font-size: 16px;
}

/* --- Inline styles --- */
p code, li code, td code, .instruction-text code {
    font-size: 13px;
    background: var(--color-surface);
    padding: 3px 8px;
    border-radius: 6px;
    color: var(--color-text);
}

.instruction-text strong {
    color: var(--color-text);
    font-weight: 600;
}

/* ==========================================
   SCENARIO GRID
   ========================================== */

#scenarios {
    display: none;
    padding-top: 72px;
    min-height: 100vh;
}

#scenarios.visible {
    display: block;
}

.scenarios-header {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 32px 32px;
    text-align: center;
}

.scenarios-header h2 {
    margin-bottom: 8px;
}

.scenarios-header p {
    font-size: 17px;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 640px;
    margin: 0 auto 48px;
    padding: 0 32px;
}

.scenario-card {
    background: var(--color-surface);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s;
}

.scenario-card:hover {
    border-color: var(--color-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.scenario-card-icon {
    font-size: 24px;
    margin-bottom: 12px;
}

.scenario-card h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--color-text);
}

.scenario-card p {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
}

.scenarios-footer {
    text-align: center;
    padding: 0 32px 80px;
}

/* ==========================================
   SCENARIO DETAIL
   ========================================== */

#scenario-detail {
    display: none;
    padding-top: 72px;
    min-height: 100vh;
}

#scenario-detail.visible {
    display: block;
}

.scenario-detail-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 32px 80px;
}

.scenario-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0;
    margin-bottom: 32px;
    transition: color 0.2s;
}

.scenario-back:hover {
    color: var(--color-text);
}

.scenario-back svg {
    width: 16px;
    height: 16px;
}

.scenario-content {
    display: none;
}

.scenario-content.active {
    display: block;
}

.scenario-content h2 {
    margin-bottom: 8px;
}

.scenario-content > p:first-of-type {
    font-size: 17px;
}

.api-signature {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--color-surface);
    padding: 6px 14px;
    border-radius: 8px;
    color: var(--color-text);
    margin-bottom: 24px;
}

/* ==========================================
   WHY PAYO SECTION
   ========================================== */


/* ==========================================
   SCENARIO CARD SVG ICONS
   ========================================== */

.scenario-card-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-accent);
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 48px 48px 40px;
    border-top: 1px solid var(--color-border);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.footer-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--color-text);
    opacity: 1;
}

.footer-tagline {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 0;
    opacity: 0.7;
}

/* ==========================================
   CLAUDE CODE MODAL
   ========================================== */

.claude-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.claude-modal-overlay.open {
    display: flex;
}

body.modal-open {
    overflow: hidden;
}

.claude-modal {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    animation: fadeSlideUp 0.3s ease-out;
}

.claude-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.claude-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.claude-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--color-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.claude-modal-close:hover {
    background: var(--color-border);
}

.claude-modal-close svg {
    width: 14px;
    height: 14px;
    color: var(--color-text-secondary);
}

.claude-modal-desc {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.claude-modal-hint {
    font-size: 12px;
    color: var(--color-text-tertiary, #8e8e93);
    margin-bottom: 20px;
}

.claude-modal-hint code {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

.claude-modal-code-wrapper {
    background: var(--color-card-dark);
    border-radius: var(--radius-sm);
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.claude-modal-code {
    margin: 0;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--color-text-on-dark);
    white-space: pre-wrap;
    word-break: break-word;
}

.claude-modal-copy {
    width: 100%;
    justify-content: center;
    padding: 14px 28px;
}

.claude-modal-copy.copied {
    background: var(--color-success);
    color: #fff;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .topnav { padding: 0 20px; }

    .topnav-links { gap: 4px; }
    .topnav-link { font-size: 13px; padding: 5px 10px; }
    .topnav-link-cta { padding: 5px 12px; }

    #landing {
        padding: 70px 24px 60px;
    }

    .landing-title {
        font-size: 36px;
    }

    .landing-subtitle {
        font-size: 16px;
        margin-bottom: 32px;
    }

    .hero-code-window pre {
        font-size: 12px;
        padding: 16px 18px 20px;
    }

    .highlight-line {
        margin: 0 -18px;
        padding: 0 18px;
    }

    .landing-actions {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 320px;
    }

    .btn-cta,
    .btn-secondary-outline {
        width: 100%;
        justify-content: center;
        padding: 16px 32px;
        font-size: 16px;
    }

    .step-container {
        padding: 0 20px 60px;
    }

    h2 { font-size: 26px; }

    .card { padding: 22px; }

    .code-block pre { padding: 16px; }
    .code-block pre code { font-size: 12.5px; }

    h3 { margin-top: 28px; }

    .download-cards { flex-direction: column; }
    .path-choices { flex-direction: column; }

    .step-nav { padding: 12px 20px; }
    .btn { padding: 12px 22px; font-size: 14px; }

    .scenario-grid { grid-template-columns: 1fr; }
    .scenarios-header { padding: 0 20px 24px; }
    .scenario-grid { padding: 0 20px; }
    .scenario-detail-container { padding: 0 20px 60px; }

    .completion-choices {
        flex-direction: column;
        max-width: 320px;
    }

    .footer-links { gap: 16px; flex-wrap: wrap; }
    .site-footer { padding: 40px 24px 32px; }

    .claude-modal-overlay { padding: 16px; }
    .claude-modal { padding: 24px; }
}

@media (max-width: 480px) {
    .landing-title { font-size: 30px; }

    .topnav-link:not(.topnav-link-cta) { display: none; }

    .step-nav { padding: 10px 16px; }
    .step-nav-label { font-size: 12px; }
}

/* ==========================================
   DARK MODE
   ========================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #000000;
        --color-surface: #1c1c1e;
        --color-card-dark: #1c1c1e;
        --color-text: #f5f5f7;
        --color-text-secondary: #86868b;
        --color-text-on-dark: #e5e5ea;
        --color-border: #38383a;
        --color-accent: #6b8aff;
        --color-success: #30d158;
    }

    body {
        background: var(--color-bg);
        color: var(--color-text);
    }

    .topnav {
        background: rgba(0, 0, 0, 0.85);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .topnav-link-cta {
        background: #f5f5f7;
        color: #000;
    }

    .topnav-link-cta:hover {
        background: #e0e0e2;
        color: #000;
    }

    #landing {
        background: radial-gradient(ellipse at 50% 0%, rgba(107, 138, 255, 0.08) 0%, transparent 70%);
    }

    .orb { opacity: 0.5; }
    .orb-1 { background: radial-gradient(circle, rgba(107, 138, 255, 0.6), rgba(107, 138, 255, 0) 70%); }
    .orb-2 { background: radial-gradient(circle, rgba(191, 90, 242, 0.5), rgba(191, 90, 242, 0) 70%); }
    .orb-3 { background: radial-gradient(circle, rgba(48, 209, 88, 0.35), rgba(48, 209, 88, 0) 70%); }

    .btn-cta {
        background: #f5f5f7;
        color: #000;
    }

    .btn-cta:hover {
        background: #e0e0e2;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    }

    .btn-secondary-outline {
        color: var(--color-text);
        border-color: var(--color-border);
    }

    .btn-secondary-outline:hover {
        border-color: var(--color-text);
    }

    .btn-primary {
        background: #f5f5f7;
        color: #000;
    }

    .btn-primary:hover {
        background: #e0e0e2;
    }

    .btn-secondary {
        background: var(--color-surface);
        color: var(--color-text);
    }

    .btn-secondary:hover {
        background: #2c2c2e;
    }

    .framework-option.active {
        background: #f5f5f7;
        color: #000;
    }

    .framework-option.active:hover {
        color: #000;
    }

    code {
        background: var(--color-surface);
        color: var(--color-text);
    }

    .code-block {
        background: #141414;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    }

    .instruction-number {
        background: var(--color-bg);
    }

    .product-id-pill {
        background: var(--color-surface);
        color: var(--color-text);
        border-color: var(--color-border);
    }

    .product-id-pill:hover {
        background: #2c2c2e;
        border-color: rgba(255, 255, 255, 0.2);
    }

    .product-id-pill.copied {
        border-color: #30d158;
        color: #30d158;
        background: rgba(48, 209, 88, 0.1);
    }

    .step-nav {
        background: rgba(0, 0, 0, 0.85);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .collapsible summary:hover {
        background: #2c2c2e;
    }

    .download-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }

    .path-choice:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }

    .path-choice.active {
        background: rgba(107, 138, 255, 0.08);
    }

    .scenario-card:hover {
        border-color: var(--color-text);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }

    .site-footer {
        border-top-color: var(--color-border);
    }

    .bundle-id-input,
    .product-id-input {
        background: var(--color-surface);
        border-color: var(--color-border);
        color: var(--color-text);
    }

    .bundle-id-input:focus,
    .product-id-input:focus {
        border-color: var(--color-text);
    }

    .completion-choice:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }

    .completion-choice-tag {
        background: rgba(107, 138, 255, 0.15);
    }

    .claude-modal {
        border: 1px solid var(--color-border);
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    }

    .claude-modal-copy.copied {
        background: var(--color-success);
        color: #fff;
    }
}
