/* ========================================= */
/* 1. VARIABLES & THEME CONFIGURATION        */
/* ========================================= */
:root {
    /* --- Colors --- */
    --primary: #0984e3;
    --primary-dark: #0069d9;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --text-light: #dfe6e9;
    
    /* --- Backgrounds --- */
    --bg-body: #f8f9fa;
    --bg-surface: #ffffff;
    --bg-dark: #1e1e1e;
    --bg-accent-subtle: #f1f8ff;
    
    /* --- Borders & Separators --- */
    --border-color: #e1e4e8;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    /* --- Shadows (Modern/Diffuse) --- */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.1);
    --shadow-modal: 0 20px 50px rgba(0, 0, 0, 0.3);

    /* --- Spacing --- */
    --container-width: 1100px;
    --header-height: 60px;
}

/* ========================================= */
/* 2. RESET & BASE STYLES                    */
/* ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-body);
    margin: 0;
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

/* ========================================= */
/* 3. LAYOUT UTILITIES                       */
/* ========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
header {
    padding: 80px 0;
    text-align: center;
    background: var(--bg-surface);
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    font-size: 3rem;
    margin: 0 0 10px 0;
    letter-spacing: -0.25px;
    color: var(--text-main);
}

header p {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* --- Footer --- */
footer {
    background: #2d3436;
    color: var(--text-light);
    padding: 60px 0;
    text-align: center;
    margin-top: auto;
}

.footer-link {
    color: white;
    font-weight: 500;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
}

.footer-link:hover {
    color: var(--primary);
}

/* ========================================= */
/* 4. COMPONENT: CARDS & GRID                */
/* ========================================= */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.card {
    background: var(--bg-surface);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.card-info {
    padding: 25px;
}

.card-info span {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}

.card-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    color: var(--text-main);
}

.card-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ========================================= */
/* 5. COMPONENT: BUTTONS                     */
/* ========================================= */
.btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    margin-right: 10px;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--primary-dark);
    color: white;
    text-decoration: none;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

/* ========================================= */
/* 6. PAGE: CASE STUDIES & DOCUMENTATION     */
/* ========================================= */

/* --- Case Study Header --- */
.case-header {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-surface);
    margin-bottom: 60px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color); /* Added for consistency with cards */
}

.project-section {
    margin-bottom: 80px;
}

.project-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    color: var(--text-main);
}

/* --- Document Body Wrapper --- */
.doc-body {
    background-color: #f4f6f8;
    padding: 40px 20px;
}

.paper-doc {
    max-width: 850px;
    margin: 0 auto;
    background: var(--bg-surface);
    padding: 60px;
    box-shadow: var(--shadow-sm);
    border-radius: var(--border-radius);
    border-top: 6px solid var(--primary);
}

.back-link {
    display: inline-block;
    margin-bottom: 30px;
    color: var(--text-muted);
    font-weight: 500;
}

.back-link:hover { color: var(--primary); }

/* Typography inside Docs */
.paper-doc h1 { font-size: 2.2rem; margin-bottom: 10px; line-height: 1.2; }
.paper-doc h2 { 
    font-size: 1.5rem; 
    margin-top: 40px; 
    margin-bottom: 15px; 
    border-bottom: 2px solid #eee; 
    padding-bottom: 10px; 
    color: var(--primary); 
}
.paper-doc h3 { font-size: 1.2rem; margin-top: 30px; font-weight: 600; }
.paper-doc p, .paper-doc li { color: #444; margin-bottom: 16px; }

/* Tables */
.paper-doc table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.95rem;
}

.paper-doc th {
    background-color: #f1f4f8;
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid #dde1e5;
    width: 30%;
}

.paper-doc td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

/* ========================================= */
/* 7. PAGE: PROJECT LIFECYCLE (Split View)   */
/* ========================================= */
body.lifecycle-layout {
    margin: 0;
    height: 100vh;
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    background: var(--bg-body);
}

/* --- Top Header --- */
.lifecycle-header {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.lifecycle-header h1 { font-size: 1.2rem; margin: 0; color: var(--text-main); }
.back-btn { font-weight: 600; font-size: 0.9rem; }

/* --- Sidebar (Tree) --- */
.sidebar {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.project-select-container {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    z-index: 5;
}

.project-dropdown {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-family: inherit;
    background-color: var(--bg-body);
    outline: none;
    cursor: pointer;
}

.project-dropdown:focus {
    border-color: var(--primary);
    background-color: white;
}

.project-tree-container {
    padding: 20px;
    flex-grow: 1;
}

/* Tree Items */
.folder-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 25px 0 10px 0;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.folder-label svg { width: 14px; margin-right: 6px; fill: #b2bec3; }

.file-list { list-style: none; padding: 0; margin: 0; }

.file-link {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.95rem;
    margin-bottom: 4px;
    border-left: 3px solid transparent;
}

.file-link:hover {
    background: var(--bg-accent-subtle);
    color: var(--primary);
}

.file-link.active {
    background: #e3f2fd;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* --- Work Area (Right Side) --- */
.work-area {
    background: #f4f6f8;
    height: 100%;
    position: relative;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-muted);
}

/* ========================================= */
/* 8. MEDIA & GALLERY STYLES                 */
/* ========================================= */

/* --- Logic Images (Fit to Screen) --- */
.logic-container {
    background: var(--bg-body);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
    margin-bottom: 10px;
}

.logic-img-small {
    max-height: 500px;
    width: auto;
    max-width: 100%;
    transition: transform 0.2s ease;
    cursor: zoom-in;
}

.logic-img-small:hover { transform: scale(1.02); }

/* --- Thumbnail Grid (Gallery) --- */
.ui-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 15px;
    margin-top: 20px;
}

.ui-frame {
    background: white;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: zoom-in;
}

.ui-frame:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.ui-frame img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: top;
    border-radius: 4px;
    margin-bottom: 8px;
}

.ui-frame p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================= */
/* 9. SPECIALIZED COMPONENTS                 */
/* ========================================= */

/* --- Index: Process / Approach Section (between Work and About) --- */
.approach-section {
    background-color: var(--bg-body);
    border-top: 1px solid var(--border-color);
    padding: 80px 0;
    margin-top: 0;
}

.approach-section .container {
    max-width: var(--container-width);
}

.approach-section h2 {
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    color: var(--text-main);
}

.approach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.approach-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.approach-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.approach-card h3 {
    font-size: 1.1rem;
    margin: 0 0 10px 0;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.approach-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- About Section --- */
.about-section {
    background-color: white;
    border-top: 1px solid var(--border-color);
    padding: 80px 0;
    margin-top: 60px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
    align-items: center;
}

.profile-img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--shadow-lg);
    display: block;
    margin: 0 auto;
}

/* --- Live Preview (Code Browser Look) --- */
.live-preview-container {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-modal);
    margin: 30px 0;
}

.browser-header {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.live-frame {
    width: 100%;
    height: 600px;
    background: white;
    border: none;
    border-radius: 4px;
}

/* --- Flow Cards (User Journey) --- */
.flow-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.flow-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.flow-card h4 {
    margin-top: 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.flow-goal {
    font-size: 0.9rem;
    color: var(--text-muted);
    background: var(--bg-body);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 3px solid var(--primary);
}

.step-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.step-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 12px;
    min-width: 60px;
    text-align: center;
}

/* Badge Colors */
.badge-start { background: #e3f2fd; color: #0984e3; }
.badge-decision { background: #fff3e0; color: #e67e22; }
.badge-action { background: #f1f2f6; color: #2d3436; }
.badge-system { background: #f3e5f5; color: #9c27b0; }
.badge-end { background: #e8f5e9; color: #27c93f; }

/* --- Skills Matrix --- */
.skills-matrix {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.skill-category h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #b2bec3;
    letter-spacing: 1px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 10px; }

.skill-tag {
    background: #f1f2f6;
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s;
}

/* Skill Hover Effects */
.skill-category:nth-child(1) .skill-tag:hover { background: #e3f2fd; color: #0984e3; border-color: #0984e3; }
.skill-category:nth-child(2) .skill-tag:hover { background: #e8f5e9; color: #27c93f; border-color: #27c93f; }
.skill-category:nth-child(3) .skill-tag:hover { background: #fff3e0; color: #e67e22; border-color: #e67e22; }

/* ========================================= */
/* 10. MODAL (Lightbox)                      */
/* ========================================= */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    padding-top: 50px; 
    left: 0; top: 0;
    width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    animation: zoom 0.3s;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: #ccc;
    padding: 20px 0;
    font-weight: 300;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close:hover { color: #bbb; }

@keyframes zoom {
    from {transform:scale(0.9); opacity: 0;} 
    to {transform:scale(1); opacity: 1;}
}

/* ========================================= */
/* 11. EMBED UTILITIES (Visily, etc)         */
/* ========================================= */

/* Tab Switching for Design Views */
.design-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #eee;
    margin-bottom: 30px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover { color: var(--primary); }

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.design-content {
    display: none;
    animation: fadeIn 0.4s;
}

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

/* Browser Window Container */
.browser-mockup {
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    overflow: hidden;
    margin: 20px 0;
}

.browser-header {
    background: #2d3436;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.browser-dots { display: flex; gap: 8px; }
.browser-url { 
    background: #000; 
    color: #888; 
    font-size: 0.8rem; 
    padding: 4px 15px; 
    border-radius: 20px; 
    flex-grow: 1; 
    text-align: center;
    font-family: monospace;
}

/* Embed Overlay (Click to Load) */
.embed-container {
    position: relative;
    width: 100%;
    height: 600px; /* Fixed height for canvas view */
    background: #fff;
}

.visily-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.embed-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #f4f6f8;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.embed-overlay:hover { background: #e3f2fd; }

.loader-content {
    text-align: center;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.loader-icon {
    width: 48px;
    height: 48px;
    animation: pulse 2s infinite;
}

.action-row {
    margin-top: 20px;
    text-align: right;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* ========================================= */
/* 12. RESPONSIVE UTILITIES                  */
/* ========================================= */
.hidden { display: none !important; }

@media (max-width: 768px) {
    /* Layout */
    .two-col, .about-grid, .flow-grid, .approach-grid { grid-template-columns: 1fr; }
    
    /* Lifecycle */
    body.lifecycle-layout { grid-template-columns: 1fr; height: auto; overflow: auto; }
    .sidebar { height: auto; max-height: 400px; border-bottom: 1px solid var(--border-color); }
    .work-area { height: 800px; }
    
    /* Documentation */
    .paper-doc { padding: 30px 20px; }
    .paper-doc th, .paper-doc td { display: block; width: 100%; }
    .paper-doc th { padding-bottom: 5px; color: var(--primary); }
    .paper-doc td { padding-top: 5px; padding-left: 0; }
    
    /* Footer */
    .footer-link { width: 100%; justify-content: center; }
    
    /* Embeds */
    .embed-container { height: 400px; }
}