:root {
    /* Toss-style Light Theme Variables */
    --bg-base: #ffffff;
    --bg-elevated: #f9fafb;
    --bg-card: #f2f4f6;
    
    --text-pure: #191f28;
    --text-primary: #333d4b;
    --text-secondary: #4e5968;
    --text-muted: #8b95a1;
    
    --border-dim: #e5e8eb;
    --border-bright: #d1d6db;
    
    --accent: #3182f6; 
    --font-sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --transition-fast: 0.2s ease-out;
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    background-color: var(--bg-base);
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-base); /* Assuming --bg-base is intended, not --bg-pure as it's not defined */
    color: var(--text-pure);
    transition: background-color 0.3s, color 0.3s;
    letter-spacing: -0.01em;
    font-weight: 500;
    word-break: keep-all;
    overflow-wrap: break-word;
    overflow-x: hidden;
}

/* Custom Webkit Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.container {
    max-width: 1040px; margin: 0 auto; padding: 0 24px;
}

/* Typography (Clean & Balanced Base) */
h1 { 
    font-size: clamp(44px, 7vw, 60px); 
    font-weight: 700; 
    color: var(--text-pure); 
    letter-spacing: -0.03em;
    line-height: 1.15;
    text-wrap: balance;
}
h1.modal-title { 
    font-size: clamp(32px, 6vw, 44px); 
    font-weight: 700; 
    color: var(--text-pure); 
    letter-spacing: -0.02em; 
    line-height: 1.25;
    margin-bottom: 32px;
    word-break: keep-all;
    text-wrap: balance;
}
h2 { 
    font-size: clamp(28px, 4vw, 36px); 
    font-weight: 600; 
    color: var(--text-pure); 
    letter-spacing: -0.02em; 
    line-height: 1.3;
}
h3 { 
    font-size: 22px; 
    font-weight: 600; 
    color: var(--text-pure); 
    letter-spacing: -0.015em; 
    line-height: 1.4;
}
h4 {
    font-size: 18px; 
    font-weight: 600; 
    color: var(--text-pure); 
    letter-spacing: -0.01em; 
}

.text-glow { color: #000; } /* Remove glow gradient to keep it pure Vercel minimalist */
.text-muted { color: var(--text-muted) !important; }

/* Navigation */
.premium-nav {
    position: fixed; top: 0; left: 0; width: 100%; height: 72px;
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    transition: var(--transition-fast);
}
.premium-nav.scrolled {
    border-bottom: 1px solid var(--border-dim);
    background: rgba(255, 255, 255, 0.95);
}
/* Standard Nav Layout */
.nav-container {
    height: 100%; display: flex; justify-content: space-between; align-items: center; 
    max-width: 1040px; margin: 0 auto; padding: 0 24px;
}
.logo { 
    color: var(--text-pure); text-decoration: none; 
    font-weight: 700; font-size: 18px; letter-spacing: -0.02em; 
}
.nav-links { display: flex; gap: 32px; }
.nav-link { 
    color: var(--text-muted); text-decoration: none; 
    font-size: 15px; font-weight: 600; transition: var(--transition-fast); 
}
.nav-link:hover, .nav-link.active { color: var(--text-pure); }

/* About Section */
.about-section {
    min-height: 70vh; display: flex; align-items: center; padding: 120px 0;
}
.about-title {
    font-size: 40px; font-weight: 700; color: #000; letter-spacing: -0.02em; margin-bottom: 32px;
}
.about-content {
    font-size: 18px; color: #666; line-height: 1.6; max-width: 600px; font-weight: 400;
}

/* --- Surfit Style Formatted CV --- */
.cv-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 120px 24px;
}
.cv-header { margin-bottom: 80px; }
.cv-name { font-size: 32px; font-weight: 700; color: #111; margin-bottom: 12px; letter-spacing: -0.02em;}
.cv-title { font-size: 18px; color: #444; font-weight: 600; margin-bottom: 24px; letter-spacing: -0.01em;}
.cv-contact { display: flex; gap: 16px; font-size: 14px; color: #666; flex-wrap: wrap; }
.cv-contact a { color: #666; text-decoration: none; transition: color var(--transition-fast); }
.cv-contact a:hover { color: #111; text-decoration: underline; }

.cv-section {
    border-top: 1px solid #eaeaea;
    padding: 48px 0;
}
.cv-section:last-child {
    border-bottom: 1px solid #eaeaea;
}
.cv-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
@media(min-width: 768px) {
    .cv-grid { flex-direction: row; gap: 64px; }
    .cv-left { flex: 0 0 160px; }
    .cv-right { flex: 1; min-width: 0; }
}

.cv-section-title {
    font-size: 15px; font-weight: 700; color: #111; letter-spacing: 0.02em; 
    line-height: 1.5;
}

.cv-item { margin-bottom: 64px; position: relative; } /* increased bottom margin for better timeline spacing */
.cv-item:last-child { margin-bottom: 0; }

/* Timeline UI */
.timeline-container {
    position: relative;
    padding-left: 28px;
}
.timeline-container::before {
    content: "";
    position: absolute;
    left: 4px; /* Center of the line is exactly at x=4.5px */
    top: 8px;
    bottom: 0;
    width: 1px;
    background: rgba(0,0,0,0.12);
}
.timeline-container .cv-item::before {
    content: "";
    position: absolute;
    box-sizing: border-box;
    left: -28px; /* Puts the 9px dot exactly at x=0 relative to container, centering it at 4.5px */
    top: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #bbb;
    z-index: 1;
}

.cv-item-header {
    display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; flex-wrap: wrap; gap: 8px;
}
.cv-company { font-size: 18px; font-weight: 600; color: #111; letter-spacing: -0.01em; line-height: 1.4; }
.cv-date { font-size: 15px; color: #888; font-variant-numeric: tabular-nums; padding-top: 2px;}
.cv-role { font-size: 15px; font-weight: 400; font-style: italic; color: #666; margin-bottom: 24px; line-height: 1.5; letter-spacing: -0.01em;}

.cv-desc p { font-size: 15px; color: #222; line-height: 1.6; margin-bottom: 12px; font-weight: 400;}
.cv-desc h4 { font-size: 15px; font-weight: 600; color: #111; margin: 24px 0 8px 0; letter-spacing: -0.01em;}
.cv-desc h4 span { font-size: 14px; font-weight: 400; color: #888; margin-left: 8px; }
.cv-desc ul { display: flex; flex-direction: column; gap: 8px; list-style: none; padding-left: 0; margin-bottom: 32px;}
.cv-desc li { display: flex; align-items: flex-start; font-size: 15px; color: #222; line-height: 1.6; font-weight: 400;}
.cv-desc li::before { content: "•"; width: 14px; flex-shrink: 0; color: #aaa; }
.cv-desc li.impact { font-weight: 400; color: #111; margin-top: 8px;}
.cv-desc li.impact::before { content: "→"; color: #111; font-weight: 500; font-size: 14px; padding-top: 1px; }

.cv-simple-list { display: flex; flex-direction: column; gap: 24px; }
.cv-simple-item h4 { font-size: 15px; font-weight: 500; color: #111; margin-bottom: 4px; }
.cv-simple-item p { font-size: 15px; font-weight: 400; color: #666; margin-bottom: 0; line-height: 1.6; }

/* Hero Section */
.hero-section {
    min-height: 70vh; display: flex; align-items: center; justify-content: center;
    padding-top: 100px; padding-bottom: 40px;
}
.hero-container {
    width: 100%;
}
.hero-content {
    text-align: left;
    width: 100%;
}
.eyebrow {
    font-size: 14px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase;
    color: #666; display: block; margin-bottom: 20px;
}
.hero-title {
    margin-bottom: 24px;
}
.hero-title-static {
    font-weight: 300;
    display: block;
    color: #888;
}
.hero-rotating-text {
    display: block;
    font-weight: 700;
    color: var(--text-pure);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-rotating-text.fade-out {
    opacity: 0;
}
.hero-rotating-text.visible {
    opacity: 1;
}
.hero-sub {
    font-size: 20px; color: #666; line-height: 1.5; 
    max-width: 540px; font-weight: 500; margin-bottom: 40px;
    letter-spacing: -0.01em;
    text-wrap: pretty;
}
.hero-links { display: flex; gap: 24px; }
.btn-link {
    color: #000; text-decoration: none; font-size: 15px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 8px; transition: var(--transition-fast);
    padding-bottom: 4px;
}
.btn-link .arrow { font-family: monospace; font-size: 1.1em; transition: transform 0.2s; color: var(--text-muted); }
.btn-link:hover { color: var(--accent); }
.work-visual img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.work-card:hover .work-visual img { transform: scale(1.05); }
.work-card:hover .work-visual { 
    transform: translateY(-4px); border-color: var(--accent);
}

/* Section Headers */
.section-header { margin-bottom: 32px; }
.section-title { 
    font-size: 24px; font-weight: 600; color: var(--text-pure); letter-spacing: -0.02em; 
}

/* Works Grid (Vercel/Linear/Figma Style) */
.works-section { padding-bottom: 160px; padding-top: 24px; }
.works-grid { display: grid; grid-template-columns: 1fr; gap: 80px 48px; }
@media(min-width: 768px) { .works-grid { grid-template-columns: repeat(2, 1fr); gap: 120px 64px; } }

.work-card {
    text-decoration: none; display: flex; flex-direction: column; color: inherit;
    transition: transform var(--transition-fast);
}

/* Figma Maker Stories Featured Card */
@media(min-width: 768px) {
    .featured-work-card {
        grid-column: 1 / -1; 
        flex-direction: row; 
        align-items: center;
        gap: 64px; 
    }
    .featured-work-card .work-visual {
        flex: 1.5; 
        margin-bottom: 0;
        aspect-ratio: 16 / 10;
    }
    .featured-work-card .work-info {
        flex: 1; 
        padding-right: 0;
    }
    .featured-work-card .work-title {
        font-size: 32px; /* Softened hero title */
        font-weight: 600;
        line-height: 1.25;
        margin-bottom: 16px;
        letter-spacing: -0.02em;
        color: var(--text-pure);
    }
    .featured-work-card .work-desc {
        font-size: 16px;
        line-height: 1.5;
    }
    .featured-work-card .work-meta {
        font-size: 13px;
        margin-bottom: 12px;
    }
}

/* Linear-style Thumbnail (The Craft) */
.work-visual {
    width: 100%; aspect-ratio: 16 / 10; background: var(--bg-card); 
    border-radius: 12px; margin-bottom: 24px; position: relative; overflow: hidden;
    transition: transform var(--transition-base);
    border: 1px solid var(--border-dim);
}
.work-visual-text {
    font-size: 14px; font-weight: 600; letter-spacing: 0.1em; color: #888; text-transform: uppercase;
    transition: transform var(--transition-slow), color var(--transition-fast);
    z-index: 10;
}

.work-card:hover .work-visual { 
    border-color: rgba(0, 0, 0, 0.16);
    transform: translateY(-4px); 
    /* Very subtle Vercel-like hover shadow instead of huge blurry shadow */
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.04); 
}
.work-card:hover .work-visual-text { color: #000; transform: scale(1.02); }

/* Vercel-style Card Info Layout */
.work-info { padding: 0; }
.work-meta { 
    font-size: 13px; font-weight: 500; color: #666; /* Neutral high-contrast meta instead of colorful */
    display: block; margin-bottom: 8px; /* Tighter margin */
}
.work-title { 
    font-size: 20px; margin-bottom: 8px; color: var(--text-pure); font-weight: 600; letter-spacing: -0.01em; 
    line-height: 1.35;
    transition: color var(--transition-fast);
    word-break: keep-all;
    overflow-wrap: break-word;
}
.work-desc {
    font-size: 15px; color: #666; line-height: 1.5; font-weight: 400;
}
.work-card:hover .work-title { color: var(--accent); }

/* About Section */
.about-section { padding-bottom: 160px; }
.about-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media(min-width: 768px) { .about-grid { grid-template-columns: 1fr 2fr; gap: 64px; } }
.about-text p { font-size: 18px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; font-weight: 500; }

/* Experience Section */
.exp-section { padding-bottom: 160px; }
.exp-row {
    padding: 40px 0; border-bottom: 1px solid var(--border-dim);
    display: grid; grid-template-columns: 1fr; gap: 16px;
}
@media(min-width: 768px) { .exp-row { grid-template-columns: 1fr 3fr; gap: 48px; } }
.exp-date { font-size: 15px; font-weight: 600; color: var(--text-muted); }
.exp-company { font-size: 24px; font-weight: 700; color: var(--text-pure); margin-bottom: 4px; }
.exp-role { font-size: 16px; font-weight: 600; color: var(--accent); margin-bottom: 16px; }
.exp-desc { font-size: 16px; color: var(--text-secondary); line-height: 1.6; font-weight: 500; }

/* Footer */
footer { padding: 48px 0; background-color: var(--bg-elevated); }
.footer-inner { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 14px; font-weight: 500; }

/* ==================================================== */
/* MODAL: The Reading Experience */
/* ==================================================== */
.project-overlay {
    position: fixed; inset: 0; background: rgba(252, 252, 250, 0.99); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 2000; opacity: 0; visibility: hidden; transition: opacity 0.4s ease;
}
.project-overlay.active { opacity: 1; visibility: visible; }
.overlay-container { width: 100%; height: 100%; position: relative; }

.close-btn {
    position: absolute; top: 32px; right: 32px; background: var(--bg-card); border: none;
    color: var(--text-pure); cursor: pointer; z-index: 2010; transition: transform 0.2s, background 0.2s;
    width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { background: var(--border-dim); transform: scale(1.05); }

/* Tab Logic */
.tab-content {
    display: none;
    animation: fadeTabIn 0.5s ease forwards;
}
.tab-content.active {
    display: block;
}

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

.project-scroll-area {
    width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden; padding: 120px 0 100px;
}

.project-inner { 
    max-width: 720px; margin: 0 auto; opacity: 0; transform: translateY(20px); 
    padding: 0 24px; box-sizing: content-box;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s; transition-delay: 0.1s; 
}
.project-overlay.wide-modal .project-inner {
    max-width: 1100px;
}
.project-overlay.active .project-inner { opacity: 1; transform: translateY(0); }
.modal-body { opacity: 0; animation: fadeUp 0.6s ease 0.3s forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* PDF Full-bleed refinement */
.pdf-full-bleed {
    margin: 0; padding: 0; border: none !important; border-radius: 0 !important; background: transparent !important;
}
.pdf-full-bleed img {
    margin-bottom: 0 !important; border-bottom: none !important; width: 100%;
}

/* Modal Header Area */
.modal-header-area {
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding-bottom: 56px;
    margin-bottom: 80px;
}
.modal-category { 
    display: inline-block; 
    font-size: 15px; 
    font-weight: 700; 
    color: var(--accent); 
    background: rgba(49, 130, 246, 0.08); /* Light blue pill background */
    padding: 6px 16px;
    border-radius: 20px;
    letter-spacing: 0; 
    text-transform: none; /* Keep natural capitalization like 'Mobile UX' */
    margin-bottom: 24px; 
}
.modal-title { 
    font-size: clamp(40px, 8vw, 64px); 
    font-weight: 700; 
    line-height: 1.15; 
    letter-spacing: -0.04em; 
    margin-bottom: 32px; 
    color: #000; 
}
.modal-hero-desc { 
    font-size: 20px; 
    color: #666; 
    line-height: 1.6; 
    font-weight: 400;
    margin-bottom: 0; 
}

.modal-body { font-size: 16px; line-height: 1.7; color: var(--text-secondary); }
.case-meta-grid { display: flex; gap: 48px; border-top: 1px solid var(--border-dim); border-bottom: 1px solid var(--border-dim); padding: 24px 0; margin-bottom: 64px; }
.meta-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.meta-value { color: var(--text-pure); font-size: 15px; font-weight: 600;}

/* Advanced Modal Content Elements — True Full Bleed Sections */
.case-section { 
    /* Force width to exactly 100vw and align with viewport edge */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-top: 0;
    margin-bottom: 0;
    padding: 80px 24px;
    background: #f7f7f5;
    box-sizing: border-box;
    border: none !important;
}
.case-meta-grid + .case-section {
    margin-top: 40px;
}
/* Alternate section: pure white */
.case-section:nth-child(even):not(.outcome-section) {
    background: #ffffff;
}
/* Inner content wrapper constrained to readable width */
.case-section > * {
    max-width: 720px;
    margin-left: auto !important;
    margin-right: auto !important;
}
/* Completely distinct Outcome Section (Dark Theme Footer) */
.case-section.outcome-section {
    background: #0d0d0d !important;
    margin-top: 20px;
    padding: 100px 24px 120px;
}
.case-section.outcome-section .section-heading { color: var(--accent); opacity: 0.8; }
.case-section.outcome-section .section-heading-main { color: #ffffff; }
.case-section.outcome-section .case-text,
.case-section.outcome-section .case-list li { color: #999999; }
.case-section.outcome-section .case-quote { 
    border-left-color: rgba(255,255,255,0.15); 
    background: rgba(255,255,255,0.02);
}
.case-section.outcome-section .case-quote-title { color: #ffffff; }
.case-section.outcome-section .case-quote-sub { color: #888888; }
.case-section.outcome-section .case-list li strong { color: #ffffff; }
.case-section.outcome-section .subsection-heading { color: #ffffff; }

.section-heading { 
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: block;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.section-heading-main {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-pure);
    letter-spacing: -0.02em;
    margin-bottom: 32px;
    display: block;
    margin-top: 4px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.case-text { font-size: 16px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; font-weight: 400; }

.subsection-heading { font-size: 20px; font-weight: 600; color: var(--text-pure); margin-top: 40px; margin-bottom: 12px; letter-spacing: -0.01em; }

/* The left-border highlight group - FORBIDDEN EFFECTS COMPLETELY REMOVED */
.highlight-group {
    /* No borders, no padding, just clean vertical rhythm */
    margin: 48px 0 24px 0;
}
.highlight-group .subsection-heading {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 20px;
    letter-spacing: -0.01em;
    color: var(--text-pure);
}
.highlight-group .case-text {
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Premium Vercel/Linear Quote Block - NO GRAY BACKGROUND */
.case-quote {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 64px 0;
    /* Extremely subtle indentation line, much thinner and fainter than the forbidden styling */
    border-left: 1px solid rgba(0, 0, 0, 0.08); /* Re-enabled soft line for structure */
    padding-left: 32px;
}
.case-quote-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-pure);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.4;
}
.case-quote-sub {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Toss Style Lists */
.case-list {
    list-style-type: none;
    margin-bottom: 32px;
    padding-left: 0;
}
.case-list li {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
    font-weight: 500;
    position: relative;
    padding-left: 18px;
}
.case-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #b0b8c1;
    font-weight: bold;
    font-size: 18px;
    line-height: 1.4;
}
.case-list li strong {
    color: var(--text-pure);
    font-weight: 700;
}

/* Strategy Grids */
.strategy-list { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 32px; }
@media(min-width: 600px) { .strategy-list { grid-template-columns: 1fr 1fr; } }
.strategy-card { padding: 32px; background: var(--bg-card); border-radius: 20px; }
.strategy-card h4 { font-size: 18px; font-weight: 700; margin-bottom: 12px; color: var(--text-pure); }
.strategy-card p { font-size: 15px; color: var(--text-secondary); line-height: 1.6; font-weight: 500;}

/* Elegant Image Placeholders */
.image-placeholder {
    width: 100%; background: var(--bg-elevated); border: 1px dashed var(--border-bright); border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 14px; font-weight: 600; letter-spacing: 0.05em;
    margin: 64px 0;
}
.image-placeholder.aspect-wide { aspect-ratio: 21 / 9; }
.image-placeholder.aspect-video { aspect-ratio: 16 / 9; }

/* Reveal Animations */
.reveal-up { opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.reveal-up.visible { opacity: 1; transform: translateY(0); }

/* Zigzag Layout for Case Studies */
.zigzag-container { display: flex; flex-direction: column; gap: 80px; margin: 80px 0; }
.zigzag-row { 
    display: flex; flex-direction: column; gap: 32px; align-items: center; 
}

@media (min-width: 768px) {
    .zigzag-row { flex-direction: row; gap: 64px; }
    .zigzag-row:nth-child(even) { flex-direction: row-reverse; }
    .zigzag-img { flex: 1.5; }
    .zigzag-content { flex: 1; }
}

.zigzag-img { 
    border-radius: 12px; overflow: hidden; background: #f9f9f7; /* Warm grey base */
    aspect-ratio: 3 / 2; display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(0,0,0,0.05);
}
.zigzag-img img { width: 100%; height: 100%; object-fit: cover; }
.zigzag-content h3 { font-size: 22px; font-weight: 700; margin-bottom: 12px; color: var(--text-pure); letter-spacing: -0.01em; }
.zigzag-content p { font-size: 16px; color: var(--text-secondary); line-height: 1.6; }

/* Solution 2 (3 Frames) - Accelerated Step-out */
.fade-frame-3 { position: absolute; top: 0; left: 0; width: 100%; opacity: 1; }
.fade-frame-3.f-1 { z-index: 1; opacity: 1; } /* Image 6 (Result) - Visible at the end */
.fade-frame-3.f-2 { z-index: 2; animation: stepOutSol2_Mid 5s infinite; } /* Image 5 (Transition) */
.fade-frame-3.f-3 { z-index: 3; animation: stepOutSol2_Top 5s infinite; } /* Image 4 (Start) */

@keyframes stepOutSol2_Top {
    0%, 14.99% { opacity: 1; }
    15%, 100% { opacity: 0; }
}
@keyframes stepOutSol2_Mid {
    0%, 29.99% { opacity: 1; }
    30%, 100% { opacity: 0; }
}

.fade-frame-4 { position: absolute; top: 0; left: 0; width: 100%; opacity: 1; }
.fade-frame-4.f-1 { z-index: 1; opacity: 1; } /* Base layer */
.fade-frame-4.f-2 { z-index: 2; animation: stepOut4_2 12s infinite; }
.fade-frame-4.f-3 { z-index: 3; animation: stepOut4_3 12s infinite; }
.fade-frame-4.f-4 { z-index: 4; animation: stepOut4_4 12s infinite; }

@keyframes stepOut4_4 {
    0%, 24.99% { opacity: 1; }
    25%, 100% { opacity: 0; }
}
@keyframes stepOut4_3 {
    0%, 49.99% { opacity: 1; }
    50%, 100% { opacity: 0; }
}
@keyframes stepOut4_2 {
    0%, 74.99% { opacity: 1; }
    75%, 100% { opacity: 0; }
}

/* ═══ Pattern Architecture Deep Dive ═══ */

/* Layer Diagram */
.pattern-layers {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 40px 0;
}
.pattern-layer {
    display: grid;
    grid-template-columns: 180px 1fr;
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.pattern-layer:hover {
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
.pattern-layer-label {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.pattern-layer-num {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 10px;
    opacity: 0.5;
    font-weight: 500;
    letter-spacing: 0.06em;
}
.pattern-layer-name {
    font-size: 15px;
    font-weight: 700;
}
.pattern-layer-q {
    font-size: 12px;
    font-style: italic;
    opacity: 0.6;
    margin-top: 2px;
}
.pattern-layer-content {
    padding: 20px 24px;
    border-left: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: var(--bg-card);
}
.pattern-layer-desc {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
}
.pattern-layer-desc strong {
    color: var(--text-pure);
    font-weight: 600;
}
.pattern-layer-eg {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12px;
    color: var(--text-muted);
}
/* Layer color themes */
.pattern-layer.l-intent .pattern-layer-label { background: #1a1a1a; color: #fff; }
.pattern-layer.l-intent .pattern-layer-q { color: rgba(255,255,255,0.45); }
.pattern-layer.l-intent .pattern-layer-num { color: rgba(255,255,255,0.4); }
.pattern-layer.l-recipe .pattern-layer-label { background: var(--accent); color: #fff; }
.pattern-layer.l-recipe .pattern-layer-q { color: rgba(255,255,255,0.55); }
.pattern-layer.l-recipe .pattern-layer-num { color: rgba(255,255,255,0.5); }
.pattern-layer.l-component .pattern-layer-label { background: #0891b2; color: #fff; }
.pattern-layer.l-component .pattern-layer-q { color: rgba(255,255,255,0.55); }
.pattern-layer.l-component .pattern-layer-num { color: rgba(255,255,255,0.5); }

.pattern-arrow {
    text-align: center;
    color: var(--border-bright, #ccc);
    font-size: 18px;
    line-height: 1;
    padding: 2px 0;
    user-select: none;
}

/* Intent Grid — 8 action intents */
.intent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 40px 0;
}
.intent-card {
    padding: 20px;
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.intent-card:hover {
    border-color: var(--text-muted);
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.intent-card-num {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}
.intent-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-pure);
    margin-bottom: 4px;
}
.intent-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Flow Example */
.pattern-flow {
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    overflow: hidden;
    margin: 40px 0;
}
.pattern-flow-header {
    background: #f7f7f5;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-dim);
    display: flex;
    align-items: center;
    gap: 12px;
}
.pattern-flow-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-pure);
}
.pattern-flow-tag {
    font-size: 11px;
    background: var(--text-pure);
    color: #fff;
    padding: 2px 10px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-weight: 500;
}
.pattern-flow-steps {
    display: flex;
    flex-direction: column;
}
.pattern-flow-step {
    display: grid;
    grid-template-columns: 32px 120px 1fr;
    align-items: start;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-dim);
    background: var(--bg-card);
}
.pattern-flow-step:last-child { border-bottom: none; }
.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    font-family: 'SF Mono', 'Consolas', monospace;
    flex-shrink: 0;
    margin-top: 2px;
    color: #fff;
}
.step-dot.s-intent { background: #1a1a1a; }
.step-dot.s-recipe { background: var(--accent); }
.step-dot.s-component { background: #0891b2; }
.step-layer-name {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Consolas', monospace;
    padding-top: 6px;
}
.step-detail {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
}
.step-detail strong {
    display: block;
    color: var(--text-pure);
    font-weight: 700;
    margin-bottom: 2px;
}
.step-detail .dim {
    font-size: 13px;
    color: var(--text-muted);
}

/* Insight cards */
.pattern-insight-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 40px 0;
}
.pattern-insight-card {
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    padding: 24px;
    background: var(--bg-card);
}
.pattern-insight-icon {
    font-size: 24px;
    margin-bottom: 12px;
}
.pattern-insight-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-pure);
    margin-bottom: 6px;
}
.pattern-insight-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Architecture Diagram (simplified) */
.arch-diagram {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 48px 0 36px;
    flex-wrap: wrap;
    justify-content: center;
}
.arch-node {
    padding: 14px 24px;
    border: 1.5px solid var(--text-pure);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-pure);
    transition: all 0.2s;
    background: var(--bg-card);
}
.arch-node:hover, .arch-node.active {
    background: var(--text-pure);
    color: var(--bg-card);
}
.arch-arrow {
    width: 32px;
    text-align: center;
    font-size: 14px;
    color: var(--border-bright, #ccc);
}

@media (max-width: 640px) {
    .pattern-layer { grid-template-columns: 1fr; }
    .pattern-layer-content { border-left: none; border-top: 1px solid var(--border-dim); }
    .pattern-insight-grid { grid-template-columns: 1fr; }
    .pattern-flow-step { grid-template-columns: 32px 1fr; }
    .step-layer-name { display: none; }
    .intent-grid { grid-template-columns: 1fr 1fr; }
}

/* PDF Full Bleed & Pagination Masking */
.pdf-full-bleed {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #f1f1f1;
}
.pdf-full-bleed img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 2px; /* Slight gap for separation */
    position: relative;
}
/* Masking the top-left pagination in PDFs */
.pdf-full-bleed { position: relative; }
.pdf-full-bleed::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 60px; /* Width of the mask */
    height: 40px; /* Height of the mask */
    background: white; /* Matches PDF background */
    z-index: 10;
    pointer-events: none;
}
/* Mask for EACH image corner */
.pdf-full-bleed-item { position: relative; width: 100%; }
.pdf-full-bleed-mask {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: var(--mask-color, #ffffff);
    border-radius: 4px;
    z-index: 5;
    opacity: 0.98;
}
