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

:root {
    /* ========================================= */
    /* SURFACE COLORS - Marble & Stone Hierarchy */
    /* ========================================= */

    /* Base Stone Palette - Warm limestone tones */
    --surface: #EFEDEB;
    --surface-raised: #F7F6F4;
    --surface-deep: #E5E2DF;

    /* Tonal Zones - Architectural hierarchy */
    --surface-sidebar: #E2DFDC;
    --surface-panel: #EFEDEB;
    --surface-canvas: #F7F6F4;
    --surface-float: #FDFCFB;

    /* Warm Surface Variations */
    --surface-warm: #F2EFEB;
    --surface-cool: #EBEAE8;
    --surface-pressed: #E8E5E2;

    /* ================================== */
    /* SHADOW SYSTEM - Tactile Depth      */
    /* ================================== */

    /* Primary shadows - Soft, diffuse stone shadows */
    --shadow-dark: rgba(160, 152, 145, 0.45);
    --shadow-darker: rgba(140, 132, 125, 0.35);
    --shadow-darkest: rgba(120, 112, 105, 0.25);

    /* Highlight shadows - Specular light reflection */
    --shadow-light: rgba(255, 255, 255, 0.85);
    --shadow-lighter: rgba(255, 255, 255, 0.95);
    --shadow-brightest: rgba(255, 255, 255, 1);

    /* Ambient layers */
    --shadow-ambient: rgba(28, 25, 23, 0.04);
    --shadow-ambient-deep: rgba(28, 25, 23, 0.08);

    /* Edge definition */
    --shadow-edge: rgba(180, 175, 170, 0.2);
    --shadow-edge-light: rgba(255, 255, 255, 0.5);

    /* ================================== */
    /* TEXT COLORS - Engraved contrast    */
    /* ================================== */

    --text-primary: #2C2926;
    --text-secondary: #5C5752;
    --text-tertiary: #7A756F;
    --text-muted: #A5A099;
    --text-faint: #C4C0BA;

    /* ================================== */
    /* ACCENT COLORS - Inlaid Gold        */
    /* ================================== */

    --accent: #B8935A;
    --accent-light: #D4B87A;
    --accent-dark: #9A7A48;
    --accent-muted: #C9AD7A;
    --accent-glow: rgba(184, 147, 90, 0.25);
    --accent-subtle: rgba(184, 147, 90, 0.12);

    /* ================================== */
    /* SEMANTIC COLORS                    */
    /* ================================== */

    --success: #5F8D75;
    --success-light: #7BA38D;
    --destructive: #A15C5C;
    --destructive-light: #B87575;
    --warning: #C79558;
    --warning-light: #D9AD74;

    /* Architectural drawing overlay - warm sepia, Da Vinci notebook style */
    --drawing: #8A7560;
    --drawing-light: rgba(138, 117, 96, 0.08);
    --drawing-line: rgba(138, 117, 96, 0.18);
    --drawing-text: rgba(138, 117, 96, 0.5);

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 100px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--surface-sidebar);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    font-feature-settings: 'ss01' on, 'ss02' on;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent-light);
    color: var(--text-primary);
}

::-moz-selection {
    background: var(--accent-light);
    color: var(--text-primary);
}

/* ==================== */
/* STATUESQUE MARBLE SYSTEM - Tactile Elements */
/* ==================== */

/* ----------------------------- */
/* RAISED ELEMENTS - Slabs       */
/* ----------------------------- */

/* Large Slab - Primary containers */
.slab {
    background: var(--surface-panel);
    border-radius: var(--radius-lg);
    box-shadow:
        8px 8px 20px var(--shadow-dark),
        -6px -6px 16px var(--shadow-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Medium Slab - Cards, panels */
.slab-md {
    background: var(--surface-panel);
    border-radius: var(--radius-md);
    box-shadow:
        6px 6px 14px var(--shadow-dark),
        -5px -5px 12px var(--shadow-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Small Slab - Buttons, controls */
.slab-sm {
    background: var(--surface-panel);
    border-radius: var(--radius-sm);
    box-shadow:
        4px 4px 10px var(--shadow-dark),
        -3px -3px 8px var(--shadow-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Micro Slab - Tiny elements, icons */
.slab-xs {
    background: var(--surface-panel);
    border-radius: var(--radius-xs);
    box-shadow:
        2px 2px 6px var(--shadow-dark),
        -2px -2px 5px var(--shadow-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Slab Hover Behavior */
.slab-hover {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.slab-hover:hover {
    transform: translateY(-2px);
    box-shadow:
        10px 10px 24px var(--shadow-dark),
        -8px -8px 20px var(--shadow-lighter),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.slab-hover:active {
    transform: translateY(0);
    box-shadow:
        4px 4px 10px var(--shadow-dark),
        -3px -3px 8px var(--shadow-light),
        inset 0 1px 2px var(--shadow-ambient);
}

/* ==================== */
/* ARCHITECTURAL ELEMENTS */
/* ==================== */

.column-fluted {
    position: relative;
}

.column-fluted::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(184, 147, 90, 0.1) 20%,
            rgba(184, 147, 90, 0.15) 50%,
            rgba(184, 147, 90, 0.1) 80%,
            transparent 100%);
}

.classical-border {
    border: 1px solid rgba(184, 147, 90, 0.2);
    border-top: 2px solid rgba(184, 147, 90, 0.3);
    border-bottom: 2px solid rgba(184, 147, 90, 0.3);
}

/* ----------------------------- */
/* INSET ELEMENTS - Carvings     */
/* ----------------------------- */

/* Deep Inset - Input fields, wells */
.inset {
    background: var(--surface-sidebar);
    border-radius: var(--radius-sm);
    box-shadow:
        inset 3px 3px 8px var(--shadow-dark),
        inset -2px -2px 6px var(--shadow-light),
        0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Medium Inset - Secondary inputs */
.inset-md {
    background: var(--surface-sidebar);
    border-radius: var(--radius-sm);
    box-shadow:
        inset 3px 3px 8px var(--shadow-dark),
        inset -2px -2px 6px var(--shadow-light),
        0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Shallow Inset - Subtle depressions */
.inset-sm {
    background: var(--surface-sidebar);
    border-radius: var(--radius-xs);
    box-shadow:
        inset 2px 2px 5px var(--shadow-dark),
        inset -1px -1px 4px var(--shadow-light),
        0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Micro Inset - Toggle tracks, indicators */
.inset-xs {
    background: var(--surface-sidebar);
    border-radius: var(--radius-xs);
    box-shadow:
        inset 1px 1px 3px var(--shadow-dark),
        inset -1px -1px 2px rgba(255, 255, 255, 0.6);
}

/* ==================== */
/* LAYOUT               */
/* ==================== */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 0;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(253, 252, 251, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    box-shadow: 0 2px 8px rgba(28, 25, 23, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.logo {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* ==================== */
/* BUTTONS              */
/* ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    border: none;
}

.btn-raised {
    background: var(--surface-panel);
    color: var(--text-primary);
    box-shadow:
        4px 4px 10px var(--shadow-dark),
        -3px -3px 8px var(--shadow-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.btn-raised:hover {
    transform: translateY(-2px);
    box-shadow:
        6px 6px 14px var(--shadow-dark),
        -4px -4px 10px var(--shadow-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-raised:active {
    transform: translateY(0);
    box-shadow:
        inset 2px 2px 6px var(--shadow-dark),
        inset -2px -2px 5px var(--shadow-light);
}

.btn-primary {
    background: var(--accent);
    color: var(--surface-float);
    box-shadow:
        0 4px 12px var(--accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--accent-light);
    box-shadow:
        0 6px 16px var(--accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ==================== */
/* HERO                 */
/* ==================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 5rem;
    background:
        radial-gradient(ellipse 80% 60% at 65% 45%, rgba(184, 147, 90, 0.07) 0%, transparent 60%),
        radial-gradient(ellipse 50% 80% at 30% 60%, rgba(44, 41, 38, 0.03) 0%, transparent 50%),
        linear-gradient(180deg, var(--surface-sidebar) 0%, var(--surface) 40%, var(--surface-deep) 100%);
}

.hero-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-content {
    text-align: left;
    max-width: 520px;
}

/* Morph window wrapper — holds glow + window + controls */
.morph-window-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: morphFloat 6s ease-in-out infinite;
}

/* Radial glow behind window */
.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    width: 700px;
    height: 550px;
    background: radial-gradient(ellipse 50% 45% at 50% 50%,
        rgba(184, 147, 90, 0.12) 0%,
        rgba(184, 147, 90, 0.05) 40%,
        transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-content .hero-badge {
    justify-content: flex-start;
}

.hero-content .hero-cta {
    justify-content: flex-start;
}

/* Demo area on right side */
.hero-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    margin-bottom: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    border: 1px solid rgba(184, 147, 90, 0.2);
    border-radius: var(--radius-full);
}

.hero-badge .pulse {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(184, 147, 90, 0.4);
    }

    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 8px rgba(184, 147, 90, 0);
    }
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 4.5rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.hero h1 em {
    font-style: italic;
    color: var(--accent);
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================== */
/* HYBRID EDITOR DEMO   */
/* ==================== */

.hybrid-editor {
    background: var(--surface-canvas);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    border-left: none;
    overflow: hidden;
    flex: 1;
    position: relative;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hybrid-editor.publishing {
    transform: scale(0.7) translateX(-10%);
    opacity: 0;
    pointer-events: none;
}

.traffic-lights {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.traffic-light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.traffic-light.red {
    background: #E07A5F;
}

.traffic-light.yellow {
    background: #F2CC8F;
}

.traffic-light.green {
    background: #81B29A;
}

/* APP LAYOUT: Sidebar + Editor (like real app) */
.app-layout {
    display: flex;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

/* Left Sidebar (Navigation) - OUTSIDE the editor */
.app-sidebar {
    position: relative;
    width: 80px;
    background: var(--surface);
    border-right: 1px solid rgba(160, 152, 145, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.875rem 0 1rem;
    padding-top: 3.5rem;
    /* Space for traffic lights like app's pt-14 */
    gap: 1rem;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

/* Traffic Lights at top of sidebar */
.sidebar-traffic-lights {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    padding: 0.5rem 0;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    margin-bottom: 1rem;
    padding: 0;
    transition: transform 0.2s ease;
}

.sidebar-logo:hover {
    transform: scale(1.05);
}

.sidebar-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 5px rgba(0, 0, 0, 0.3));
}

.sidebar-nav-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.sidebar-nav-btn:hover {
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.sidebar-nav-btn.active {
    background: var(--surface);
    color: var(--accent);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-nav-btn svg {
    width: 20px;
    height: 20px;
}

.sidebar-spacer {
    flex: 1;
}

/* 3-PANE EDITOR LAYOUT (File tree, Preview, Source) */
.editor-body {
    display: grid;
    grid-template-columns: 200px 1fr 280px;
    height: 600px;
    position: relative;
    flex: 1;
}

/* Collapsed states - auto-width columns for tabs */
.editor-body.left-collapsed {
    grid-template-columns: auto 1fr 280px;
}

.editor-body.right-collapsed {
    grid-template-columns: 200px 1fr auto;
}

.editor-body.left-collapsed.right-collapsed {
    grid-template-columns: auto 1fr auto;
}

/* Traffic Lights at top of file tree panel */
.editor-traffic-lights {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    z-index: 100;
}

/* File Tree Pane (Left) */
.editor-pane-filetree {
    background: var(--surface-panel);
    border-right: 1px solid rgba(168, 162, 158, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.filetree-header {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    padding: 1.75rem 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(168, 162, 158, 0.25);
}

.filetree-content {
    flex: 1;
    padding: 0.5rem;
    overflow-y: auto;
}

.filetree-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filetree-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.filetree-item.active {
    background: var(--accent-subtle);
    color: var(--accent);
    font-weight: 500;
}

.filetree-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.filetree-folder {
    color: var(--accent);
}

/* ----------------------------- */
/* FLOATING CONTROLS (matches actual app) */
/* ----------------------------- */

.floating-controls-container {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    pointer-events: none;
}

.floating-controls {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.floating-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.floating-action-btn.reset {
    background: var(--destructive);
    color: white;
    box-shadow: 0 4px 12px rgba(161, 92, 92, 0.35);
}

.floating-action-btn.reset:hover {
    box-shadow: 0 6px 16px rgba(161, 92, 92, 0.4);
    transform: translateY(-1px);
}

.floating-action-btn.save {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(184, 147, 90, 0.35);
}

.floating-action-btn.save:hover {
    box-shadow: 0 6px 16px rgba(184, 147, 90, 0.4);
    transform: translateY(-1px);
}

.floating-action-btn.rebuild {
    background: var(--text-secondary);
    color: white;
    box-shadow: 0 4px 12px rgba(100, 100, 100, 0.35);
}

.floating-action-btn.rebuild:hover {
    box-shadow: 0 6px 16px rgba(100, 100, 100, 0.4);
    transform: translateY(-1px);
}

.floating-action-btn svg {
    width: 14px;
    height: 14px;
}

.floating-panel {
    display: flex;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(253, 252, 251, 0.92);
    border-radius: var(--radius-full);
    padding: 0.375rem 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.device-selector {
    display: flex;
    align-items: center;
}

.device-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.device-btn:hover {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.04);
}

.device-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.floating-divider {
    width: 1px;
    height: 20px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0 0.375rem;
}

.floating-panel.collapsed .panel-expanded-content {
    display: none;
}

.floating-panel:not(.collapsed) .panel-collapsed-trigger {
    display: none;
}

.panel-collapsed-trigger {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.625rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.panel-collapsed-trigger:hover {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.04);
}

.panel-collapsed-trigger svg {
    width: 16px;
    height: 16px;
}

.panel-collapsed-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.panel-expanded-content {
    display: flex;
    align-items: center;
}

.zoom-controls {
    display: flex;
    align-items: center;
}

.zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.04);
}

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

.zoom-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
    font-family: var(--font-mono);
}

.refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    color: var(--accent);
    background: rgba(184, 147, 90, 0.1);
}

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

.filetree-file {
    color: var(--text-muted);
}

.filetree-file.md {
    color: var(--accent);
}

.filetree-indent {
    padding-left: 1.25rem;
}

/* Visual Preview Pane (Center) */
.editor-pane-preview {
    background: var(--surface-canvas);
    border-right: 1px solid rgba(168, 162, 158, 0.25);
    display: flex;
    flex-direction: column;
    position: relative;
}

.preview-frame {
    flex: 1;
    background: white;
    margin: 0.75rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem;
    overflow: visible;
    position: relative;
    transition: all 0.3s ease;
}

.preview-frame.tablet {
    max-width: 280px;
    margin: 0.75rem auto;
}

.preview-frame.mobile {
    max-width: 180px;
    margin: 0.75rem auto;
}

/* Preview Website Content */
.preview-website {
    width: 100%;
    height: 100%;
    overflow: visible;
    padding-top: 35px;
    /* Space for toolbar above first element */
}

.editable-element {
    transition: outline 0.15s ease, opacity 0.2s ease, border-color 0.15s ease;
}

.editable-element {
    position: relative;
    cursor: text;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
    transition: outline 0.15s ease;
}

.editable-element:hover {
    outline: 1px dashed #B8956C;
    outline-offset: -1px;
}

.editable-element.selected {
    outline: 2px solid #B8956C;
    outline-offset: -2px;
}

/* When editing, element should look exactly the same - no visual changes */
.editable-element.editing {
    outline: 2px solid #B8956C;
    outline-offset: -2px;
}

/* Prevent any browser default styling on contentEditable elements */
.editable-element [contenteditable="true"] {
    outline: none !important;
    border: none !important;
    background: transparent !important;
    cursor: text;
}

/* Ensure no focus ring or other browser defaults appear */
.editable-element [contenteditable="true"]:focus {
    outline: none !important;
    border: none !important;
    background: transparent !important;
}

.editable-element.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.editable-element.drag-over {
    border-top: 2px solid #B8956C;
}

.editable-element.drag-over-bottom {
    border-bottom: 2px solid #B8956C;
}

/* Element Selector Toolbar - matches actual app */
.element-toolbar {
    position: absolute;
    right: 0;
    top: 0;
    display: none;
    align-items: center;
    background-color: #B8956C;
    height: 30px;
    z-index: 10000;
    pointer-events: auto;
    transform: translateY(-100%);
}

.editable-element.selected>.element-toolbar {
    display: flex;
}

.element-toolbar-label {
    color: white;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 0 10px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    height: 100%;
    display: flex;
    align-items: center;
}

.element-toolbar-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: white;
    padding: 0;
    margin: 0;
    transition: background-color 0.15s ease;
}

.element-toolbar-btn:hover {
    background-color: rgba(0, 0, 0, 0.15);
}

.element-toolbar-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.element-toolbar-btn.move {
    cursor: move;
}

/* Quick Actions Floating Toolbar */
.quick-actions-toolbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.editable-element.selected ~ .quick-actions-toolbar,
.editor-pane-preview .quick-actions-toolbar.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.qa-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #555;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.qa-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #222;
}

.qa-btn.active {
    background: rgba(184, 147, 90, 0.12);
    color: var(--accent);
}

.qa-btn svg {
    width: 15px;
    height: 15px;
}

.qa-divider {
    width: 1px;
    height: 18px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 2px;
}

.qa-color-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2c2c2c;
    border: 2px solid rgba(0, 0, 0, 0.12);
}

.qa-btn.qa-delete {
    color: #c0392b;
}

.qa-btn.qa-delete:hover {
    background: rgba(192, 57, 43, 0.1);
}

/* Drop indicator */
.drop-indicator {
    position: absolute;
    height: 2px;
    background-color: #B8956C;
    pointer-events: none;
    z-index: 10001;
}

.drop-indicator::before,
.drop-indicator::after {
    content: '';
    position: absolute;
    top: -3px;
    width: 8px;
    height: 8px;
    background-color: #B8956C;
    border-radius: 50%;
}

.drop-indicator::before {
    left: -4px;
}

.drop-indicator::after {
    right: -4px;
}

/* Legacy drag-handle - hidden in favor of toolbar */
.drag-handle {
    display: none;
}

/* Markdown Source Pane (Right) */
.editor-pane-source {
    background: var(--surface-canvas);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* ==================== */
/* COLLAPSIBLE PANELS   */
/* ==================== */

/* Collapsed panel tabs - vertical style matching actual app */
.panel-collapsed-tab {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    background: var(--surface);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.panel-collapsed-tab:hover {
    background: var(--surface-raised);
}

.panel-collapsed-tab .tab-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.panel-collapsed-tab:hover .tab-icon {
    color: var(--accent);
}

.panel-collapsed-tab .tab-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    writing-mode: vertical-lr;
    text-orientation: mixed;
}

.panel-collapsed-tab:hover .tab-label {
    color: var(--text-primary);
}

/* Left panel specific styles */
.panel-collapsed-tab.left-tab {
    border-right: 1px solid rgba(168, 162, 158, 0.25);
}

.panel-collapsed-tab.left-tab .tab-label {
    transform: rotate(180deg);
}

/* Right panel specific styles */
.panel-collapsed-tab.right-tab {
    border-left: 1px solid rgba(168, 162, 158, 0.25);
}

.panel-collapsed-tab.right-tab.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.panel-collapsed-tab.right-tab.disabled:hover {
    background: var(--surface);
}

/* Panel collapse/expand buttons */
.panel-toggle-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 32px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    cursor: pointer;
    opacity: 1;
    transition: background 0.2s ease;
    border-radius: 4px;
}

.panel-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.panel-toggle-btn svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.panel-toggle-btn:hover svg {
    color: var(--text-primary);
}

.panel-toggle-btn.collapse-left {
    right: 4px;
}

.panel-toggle-btn.collapse-right {
    left: 4px;
}

/* Panel states */
/* Collapsed panel states - hide the panel content */
.editor-body.left-collapsed .editor-pane-filetree {
    display: none;
}

.editor-body.right-collapsed .editor-pane-source {
    display: none;
}

/* Show collapsed tabs */
.editor-body.left-collapsed .panel-collapsed-tab.left-tab {
    display: flex;
}

.editor-body.right-collapsed .panel-collapsed-tab.right-tab {
    display: flex;
}

/* File Label - Floating at top-right */
.source-file-label {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 10;
    pointer-events: none;
}

.source-file-label span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(247, 246, 244, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Editor Content Area */
.source-editor-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    margin-top: 32px;
}

.source-editor-content {
    width: 100%;
    height: 100%;
    padding: 0 24px 24px 24px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.625;
    color: var(--text-primary);
    background: transparent;
    border: none;
    resize: none;
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.source-editor-content::selection {
    background: rgba(184, 147, 90, 0.2);
}

.source-line {
    display: block;
    padding: 0.05rem 0;
    transition: all 0.2s ease;
}

.source-line.heading {
    color: var(--text-primary);
    font-weight: 600;
}

.source-line.highlight {
    background: var(--accent-subtle);
    border-radius: 2px;
    padding-left: 4px;
    margin-left: -4px;
}

/* Source editor lines are editable */
.source-line[data-line] {
    cursor: text;
}

.source-line[data-line]:hover {
    background: rgba(184, 147, 90, 0.05);
    border-radius: 2px;
}

/* Prevent styling changes when editing source */
.source-line[contenteditable="true"] {
    outline: none !important;
    background: var(--accent-subtle) !important;
    border-radius: 2px;
}

.source-line[contenteditable="true"]:focus {
    outline: none !important;
    background: var(--accent-subtle) !important;
}

/* Status Bar - Minimal */
.source-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(242, 239, 235, 0.2);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.source-status-bar-left {
    display: flex;
    gap: 16px;
}

.source-status-bar-right {
    opacity: 0.4;
}

/* App Mockup Section */
.mockup-section {
    padding: 2rem 0 10rem;
    min-height: auto;
}

.mockup-container {
    position: relative;
    width: 95vw;
    max-width: 1300px;
    margin: 0 auto;
    min-height: 580px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(28, 25, 23, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.publish-browser {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    transform: scale(0.9);
    max-width: 1100px;
    height: 520px;
    background: var(--surface-panel);
    border-radius: var(--radius-lg);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
}

.publish-browser.visible {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.browser-chrome {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    background: var(--surface-deep);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.browser-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.browser-dot.red {
    background: #E07A5F;
}

.browser-dot.yellow {
    background: #F2CC8F;
}

.browser-dot.green {
    background: #81B29A;
}

.browser-address {
    flex: 1;
    margin: 0 0.75rem;
    padding: 0.4rem 0.75rem;
    background: var(--surface-panel);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    box-shadow:
        inset 2px 2px 5px var(--shadow-dark),
        inset -1px -1px 4px var(--shadow-light),
        0 1px 0 rgba(255, 255, 255, 0.35);
    text-align: center;
}

.browser-content {
    padding: 2rem;
    min-height: 460px;
    background: var(--surface-float);
    overflow-y: auto;
    max-height: 460px;
}

.back-to-editor-btn {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface-panel);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    box-shadow:
        4px 4px 10px var(--shadow-dark),
        -3px -3px 8px var(--shadow-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-editor-btn.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.back-to-editor-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow:
        6px 6px 14px var(--shadow-dark),
        -4px -4px 10px var(--shadow-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.back-to-editor-btn:active {
    transform: translateX(-50%) translateY(0);
    box-shadow:
        inset 2px 2px 6px var(--shadow-dark),
        inset -2px -2px 5px var(--shadow-light);
}

.back-to-editor-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.back-to-editor-btn:hover svg {
    transform: translateX(-3px);
}

/* ==================== */
/* WEBSITE TEMPLATES    */
/* ==================== */

/* Template 1: Portfolio - Classic Editorial */
.template-portfolio {
    font-family: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
    color: #2C2926;
    background: linear-gradient(180deg, #FDFCFA 0%, #F8F6F3 100%);
    padding: 1.5rem;
    min-height: 100%;
}

.template-portfolio h1 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: #1A1816;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
    line-height: 1.15;
    position: relative;
    padding-bottom: 0.75rem;
}

.template-portfolio h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #B8935A 0%, rgba(184, 147, 90, 0.3) 100%);
}

.template-portfolio p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 0.9rem;
    color: #5C5752;
    margin: 0 0 0.6rem 0;
    line-height: 1.7;
    font-weight: 400;
}

.template-portfolio p:last-of-type {
    margin-bottom: 1rem;
}

.template-portfolio .hero-img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    margin: 1rem 0;
    background: url('assets/portfolio_hero.png') center/cover no-repeat;
    box-shadow: 0 4px 20px rgba(44, 41, 38, 0.08);
}

.template-portfolio .gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-top: 1rem;
}

.template-portfolio .gallery-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(44, 41, 38, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.template-portfolio .gallery-img:nth-child(1) {
    background: url('assets/portfolio_gallery_1.png') center/cover no-repeat;
}

.template-portfolio .gallery-img:nth-child(2) {
    background: url('assets/portfolio_gallery_2.png') center/cover no-repeat;
}

.template-portfolio .gallery-img:nth-child(3) {
    background: url('assets/portfolio_gallery_3.png') center/cover no-repeat;
}

.template-portfolio .gallery-img:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 41, 38, 0.1);
}

/* Template 2: Blog - Editorial Clean */
.template-blog {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #2C2926;
    background: #FDFCFB;
    padding: 1.5rem;
    min-height: 100%;
}

.template-blog h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1A1816;
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.template-blog .meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #8B7355;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.template-blog p {
    font-size: 0.88rem;
    color: #4A4540;
    margin: 0 0 0.875rem 0;
    line-height: 1.75;
    font-weight: 400;
}

.template-blog p:last-of-type {
    margin-bottom: 1.25rem;
}

.template-blog .featured-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
    margin: 0.5rem 0 1.25rem 0;
    background: url('assets/travel_hero.png') center/cover no-repeat;
    box-shadow: 0 4px 24px rgba(44, 41, 38, 0.1);
}

.template-blog blockquote {
    border-left: 3px solid #B8935A;
    padding: 0.5rem 0 0.5rem 1rem;
    margin: 1.25rem 0;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    color: #5C5752;
    font-size: 0.95rem;
    line-height: 1.6;
    background: linear-gradient(90deg, rgba(184, 147, 90, 0.05) 0%, transparent 100%);
}

/* Template 3: Landing Page - Bold Modern */
.template-landing {
    font-family: 'Sora', -apple-system, sans-serif;
    color: #1A1816;
    text-align: center;
    background: linear-gradient(180deg, #FFFFFF 0%, #FAF8F5 100%);
    padding: 1.5rem;
    min-height: 100%;
}

.template-landing h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1A1816;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.template-landing .tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: #8B7355;
    margin-bottom: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.template-landing p {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    color: #5C5752;
    margin: 0 0 0.6rem 0;
    line-height: 1.65;
}

.template-landing p:last-of-type {
    margin-bottom: 1rem;
}

.template-landing .cta-button {
    display: inline-block;
    padding: 0.7rem 1.75rem;
    background: linear-gradient(135deg, #B8935A 0%, #9A7850 100%);
    color: #FFFFFF;
    border-radius: 8px;
    font-family: 'Sora', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.75rem 0 1rem 0;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 16px rgba(184, 147, 90, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.template-landing .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 147, 90, 0.45);
}

.template-landing .hero-visual {
    width: 100%;
    height: 110px;
    background: url('assets/travel_japan.png') center/cover no-repeat;
    border-radius: 14px;
    margin-top: 1rem;
    box-shadow: 0 4px 20px rgba(44, 41, 38, 0.1);
}

/* Template 4: Gallery - Artful Minimal */
.template-gallery {
    font-family: 'Instrument Serif', 'Cormorant Garamond', serif;
    color: #2C2926;
    background: #FAF8F5;
    padding: 1.5rem;
    min-height: 100%;
}

.template-gallery h1 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 400;
    color: #1A1816;
    margin: 0 0 0.35rem 0;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.template-gallery .subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #8B7355;
    margin-bottom: 1rem;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.template-gallery p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 0.88rem;
    color: #5C5752;
    margin: 0 0 1rem 0;
    line-height: 1.6;
    font-weight: 400;
}

.template-gallery .masonry {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.template-gallery .masonry-img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(44, 41, 38, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.template-gallery .masonry-img:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(44, 41, 38, 0.12);
}

.template-gallery .masonry-img:nth-child(1) {
    height: 110px;
    background: url('assets/portfolio_gallery_1.png') center/cover no-repeat;
}

.template-gallery .masonry-img:nth-child(2) {
    height: 85px;
    background: url('assets/portfolio_gallery_2.png') center/cover no-repeat;
}

.template-gallery .masonry-img:nth-child(3) {
    height: 85px;
    background: url('assets/portfolio_gallery_3.png') center/cover no-repeat;
}

.template-gallery .masonry-img:nth-child(4) {
    height: 110px;
    background: url('assets/portfolio_gallery_4.png') center/cover no-repeat;
}

/* Template 5: Resume - Professional Refined */
.template-resume {
    font-family: 'DM Sans', -apple-system, sans-serif;
    color: #2C2926;
    background: #FFFFFF;
    padding: 1.5rem;
    min-height: 100%;
}

.template-resume h1 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: #1A1816;
    margin: 0 0 0.35rem 0;
    letter-spacing: -0.02em;
    line-height: 1.1;
    position: relative;
    padding-bottom: 0.75rem;
}

.template-resume h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, #B8935A 0%, rgba(184, 147, 90, 0.2) 100%);
}

.template-resume .contact {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: #8B7355;
    margin-bottom: 1.25rem;
    letter-spacing: 0.04em;
}

.template-resume h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: #1A1816;
    margin: 1.25rem 0 0.6rem 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    padding-left: 0.75rem;
}

.template-resume h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #B8935A;
    border-radius: 50%;
}

.template-resume p {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    color: #5C5752;
    margin: 0 0 0.6rem 0;
    line-height: 1.6;
}

.template-resume .experience-item {
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(184, 147, 90, 0.3);
}

.template-resume .job-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: #1A1816;
    font-size: 0.8rem;
}

.template-resume .company {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    color: #8B7355;
    font-size: 0.75rem;
}

/* ==================== */
/* ARCHITECTURAL DRAWING SYSTEM */
/* ==================== */

/* Architectural grid background - subtle, warm, classical */
.drawing-grid {
    position: relative;
}

.drawing-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--drawing-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--drawing-line) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 70%);
}

/* Annotation - classical label with small terminus mark */
.annotation {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--drawing-text);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    white-space: nowrap;
}

.annotation::before {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    border: 1px solid var(--drawing-text);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.annotation-left::before {
    left: -14px;
}

.annotation-right::before {
    right: -14px;
}

/* Construction line - thin, elegant, slightly organic */
.construction-line {
    stroke: var(--drawing-line);
    stroke-width: 1;
    fill: none;
}

/* ==================== */
/* STEP SECTIONS - Full-screen storytelling */
/* ==================== */

.step-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.step-section-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Two-column step layout */
.step-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Step text block */
.step-text {
    max-width: 480px;
}

.step-indicator {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--drawing);
    opacity: 0.7;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-indicator::after {
    content: '';
    flex: 1;
    max-width: 60px;
    height: 1px;
    background: var(--drawing-line);
}

.step-headline {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.step-headline em {
    font-style: italic;
    color: var(--accent);
}

.step-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Step visual area */
.step-visual {
    position: relative;
}

/* Scroll-triggered animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-animate-delay-1 {
    transition-delay: 0.15s;
}

.scroll-animate-delay-2 {
    transition-delay: 0.3s;
}

.scroll-animate-delay-3 {
    transition-delay: 0.45s;
}

@media (max-width: 900px) {
    .step-columns {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .step-text {
        max-width: 100%;
        text-align: center;
    }

    .step-indicator {
        justify-content: center;
    }

    .step-section {
        min-height: auto;
        padding: 4rem 0;
    }
}

/* ==================== */
/* SECTION 2 - Generation Animation */
/* ==================== */

.generation-animation {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.generation-svg {
    width: 100%;
    height: auto;
}

/* Line drawing animation via stroke-dashoffset */
.gen-draw-line {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    transition: stroke-dashoffset 2s ease;
}

.gen-flow-line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.4s ease;
}

/* Fill blocks fade in */
.gen-fill-block {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Connection endpoint dots */
.gen-dot {
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Processing ring rotation */
.gen-process-ring {
    transform-origin: 350px 300px;
    animation: none;
}

/* Activated states - when scrolled into view */
.generation-animation.active .gen-draw-line {
    stroke-dashoffset: 0;
}

.generation-animation.active .gen-flow-line {
    stroke-dashoffset: 0;
}

.generation-animation.active .gen-fill-block {
    opacity: 1;
}

.generation-animation.active .gen-dot {
    opacity: 1;
}

.generation-animation.active .gen-process-ring {
    animation: processRingSpin 6s linear infinite;
}

@keyframes processRingSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== */
/* SECTION 4 - Publish & Stay in Sync */
/* ==================== */

.publish-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.publish-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.publish-visual {
    background: var(--surface-panel);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow:
        8px 8px 20px var(--shadow-dark),
        -6px -6px 16px var(--shadow-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.perf-scores {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.perf-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}

.perf-ring {
    width: 72px;
    height: 72px;
}

.perf-value {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--success);
}

.perf-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.publish-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.25rem 0;
    border-top: 1px solid rgba(168, 162, 158, 0.2);
    border-bottom: 1px solid rgba(168, 162, 158, 0.2);
    margin-bottom: 1.5rem;
}

.publish-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.domain-visual {
    display: flex;
    justify-content: center;
}

.domain-input-mock {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.25rem;
    background: var(--surface-sidebar);
    border-radius: var(--radius-sm);
    box-shadow:
        inset 2px 2px 5px var(--shadow-dark),
        inset -1px -1px 4px var(--shadow-light),
        0 1px 0 rgba(255, 255, 255, 0.35);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.domain-prefix {
    color: var(--text-muted);
}

.domain-name {
    color: var(--accent);
    font-weight: 600;
}

.domain-suffix {
    color: var(--text-secondary);
}

/* ==================== */
/* SECTIONS             */
/* ==================== */

.section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    max-width: 550px;
    margin: 0 auto 4rem;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.2;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(to right,
            transparent,
            rgba(184, 147, 90, 0.4),
            transparent);
}

/* ==================== */
/* STEPS                */
/* ==================== */

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.step-card {
    padding: 2.5rem 2rem;
    text-align: center;
}

.step-number {
    width: 50px;
    height: 50px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 50%;
    transition: color 0.3s ease;
}

.step-card:hover .step-number {
    color: var(--accent);
}

.step-card h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ========================== */
/* FEATURES COMPACT           */
/* ========================== */

.features-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.feature-compact {
    text-align: center;
}

.feature-compact-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface);
    box-shadow:
        inset 2px 2px 4px var(--shadow-dark),
        inset -2px -2px 4px var(--shadow-light);
    color: var(--accent);
}

.feature-compact-icon svg {
    width: 22px;
    height: 22px;
}

.feature-compact h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.feature-compact p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================== */
/* FAQ LIST                   */
/* ========================== */

.faq-list {
    max-width: 680px;
    margin: 0 auto;
}

.faq-plain {
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--shadow-edge);
}

.faq-plain:first-child {
    padding-top: 0;
}

.faq-plain:last-child {
    border-bottom: none;
}

.faq-plain h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.faq-plain p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ==================== */
/* USE CASES            */
/* ==================== */

.use-cases {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.use-case-chip {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== */
/* CTA                  */
/* ==================== */

.cta-section {
    padding: 6rem 0;
    text-align: center;
}

.cta-card {
    max-width: 550px;
    margin: 0 auto;
    padding: 3.5rem;
}

.cta-card h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.cta-card h2 em {
    font-style: italic;
    color: var(--accent);
}

.cta-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* ==================== */
/* FOOTER               */
/* ==================== */

footer {
    padding: 3rem 0;
    border-top: 1px solid rgba(168, 162, 158, 0.25);
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
}

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

@media (max-width: 900px) {
    .hero-columns {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .hero-content {
        text-align: center;
        max-width: 100%;
    }

    .hero-content .hero-badge,
    .hero-content .hero-cta {
        justify-content: center;
    }

    .morph-window {
        order: -1;
        width: 100%;
        max-width: 500px;
        height: 400px;
        margin: 0 auto;
    }

    .morph-window-wrapper {
        order: -1;
        animation: none;
    }

    .hero-glow {
        width: 500px;
        height: 400px;
    }

    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .app-sidebar {
        width: 64px;
        padding-top: 3rem;
    }

    .sidebar-nav-btn {
        width: 36px;
        height: 36px;
    }

    .editor-body {
        grid-template-columns: 140px 1fr 160px;
    }
}

@media (max-width: 640px) {
    .nav-links a:not(.btn) {
        display: none;
    }

    .nav-bar {
        padding: 0.5rem 1rem;
    }

    .morph-window {
        max-width: 360px;
        height: 320px;
    }

    .hero-glow {
        width: 360px;
        height: 300px;
    }

    .morph-site-hero {
        height: 90px;
    }

    .morph-site-hero-text h3 {
        font-size: 0.85rem;
    }

    .morph-site-body h4 {
        font-size: 0.75rem;
    }

    .morph-gallery-item {
        aspect-ratio: 1;
    }

    .morph-gallery-asymmetric {
        grid-template-columns: 1.4fr 1fr;
    }

    .morph-gallery-featured {
        min-height: 70px;
    }

    .morph-gallery-asymmetric .morph-gallery-item:not(.morph-gallery-featured) {
        aspect-ratio: 1.3;
    }

    .morph-menu-icon {
        width: 13px;
        height: 13px;
    }

    .morph-file-date {
        display: none;
    }

    footer .container {
        flex-direction: column;
        text-align: center;
    }

    .app-sidebar {
        width: 48px;
        padding: 0.5rem 0;
        padding-top: 2.5rem;
    }

    .sidebar-logo {
        width: 36px;
        height: 36px;
    }

    .sidebar-logo img {
        width: 36px;
        height: 36px;
    }

    .sidebar-nav-btn {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

    .sidebar-nav-btn svg {
        width: 16px;
        height: 16px;
    }

    .editor-body {
        grid-template-columns: 120px 1fr 0;
    }

    .editor-pane-source {
        display: none;
    }
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(247, 246, 244, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--surface-deep);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.loading-overlay::after {
    content: 'Generating...';
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== */
/* MORPH WINDOW - Hero Demo */
/* ==================== */

.morph-window {
    width: 620px;
    height: 480px;
    border-radius: var(--radius-lg);
    background: var(--surface-panel);
    box-shadow:
        0 4px 8px rgba(28, 25, 23, 0.04),
        0 8px 24px rgba(160, 152, 145, 0.35),
        -8px -8px 20px var(--shadow-light),
        12px 12px 32px var(--shadow-darker),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-top-color: rgba(255, 255, 255, 0.55);
    border-bottom-color: rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    cursor: pointer;
}

.morph-window:hover {
    box-shadow:
        0 4px 8px rgba(28, 25, 23, 0.04),
        0 12px 32px rgba(160, 152, 145, 0.4),
        -10px -10px 24px var(--shadow-lighter),
        16px 16px 40px var(--shadow-darker),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
}

@keyframes morphFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Title bar */
.morph-titlebar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(229, 226, 223, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

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

.morph-dots .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    transition: opacity 0.2s ease;
}

.morph-dots .dot:hover {
    opacity: 0.7;
}

.morph-dots .dot.red {
    background: #E07A5F;
}

.morph-dots .dot.yellow {
    background: #F2CC8F;
}

.morph-dots .dot.green {
    background: #81B29A;
}

.morph-title-track {
    flex: 1;
    position: relative;
    height: 1.4em;
    margin-right: 44px;
    overflow: hidden;
}

.morph-title {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-mono);
    transition: opacity 0.4s ease;
}

.morph-title-folder {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 1;
}

.morph-title-site {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--surface-canvas);
    padding: 2px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0, 0, 0, 0.04);
    display: inline-block;
    opacity: 0;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Body */
.morph-body {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.morph-folder,
.morph-website {
    position: absolute;
    inset: 0;
}

.morph-folder {
    background: var(--surface-canvas);
    opacity: 1;
    z-index: 2;
    display: flex;
    flex-direction: column;
    transition: opacity 0.15s ease;
}

.morph-website {
    background: #fff;
    opacity: 1;
    z-index: 1;
    overflow: hidden;
    clip-path: inset(0 100% 0 0);
    will-change: clip-path;
}

/* Golden sweep — bright center edge with warm halo */
.morph-sweep {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(184, 147, 90, 0.08) 18%,
            rgba(184, 147, 90, 0.32) 40%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(184, 147, 90, 0.32) 60%,
            rgba(184, 147, 90, 0.08) 82%,
            transparent 100%);
    transform: translateX(-110%);
    will-change: transform;
}

@keyframes sweepAcross {
    from {
        transform: translateX(-110%);
    }

    to {
        transform: translateX(110%);
    }
}

@keyframes wipeReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }

    to {
        clip-path: inset(0 0% 0 0);
    }
}

@keyframes wipeHide {
    from {
        clip-path: inset(0 0 0 0);
    }

    to {
        clip-path: inset(0 0 0 100%);
    }
}

/* ---- Window lift during morph ---- */
.morph-window.morphing,
.morph-window.morphed {
    transform: scale(1.025);
    box-shadow:
        0 6px 12px rgba(28, 25, 23, 0.05),
        0 16px 40px rgba(160, 152, 145, 0.45),
        -12px -12px 28px var(--shadow-lighter),
        18px 18px 48px var(--shadow-darker),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
}

/* ---- State: morphing ---- */
.morph-window.morphing .morph-sweep {
    animation: sweepAcross 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.morph-window.morphing .morph-title-folder {
    opacity: 0;
    transition: opacity 0.3s ease 0.15s;
}

.morph-window.morphing .morph-title-site {
    opacity: 1;
    transition: opacity 0.3s ease 0.25s;
}

.morph-window.morphing .morph-website {
    z-index: 3;
    animation: wipeReveal 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.05s forwards;
}

/* Staggered file row dissolve — slide left + fade */
.morph-file-row {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateX(0);
}

.morph-window.morphing .morph-file-row {
    opacity: 0;
    transform: translateX(-12px);
    transition-delay: calc(var(--row-i, 0) * 0.05s);
}

/* Staggered website section entrance — rise + fade in */
.morph-site-section {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.morph-window.morphing .morph-site-section,
.morph-window.morphed .morph-site-section {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(0.3s + var(--section-i, 0) * 0.12s);
}

/* ---- State: morphed ---- */
.morph-window.morphed .morph-title-folder {
    opacity: 0;
}

.morph-window.morphed .morph-title-site {
    opacity: 1;
}

.morph-window.morphed .morph-folder {
    opacity: 0;
}

.morph-window.morphed .morph-website {
    z-index: 3;
    clip-path: inset(0 0 0 0);
}

.morph-window.morphed .morph-sweep {
    transform: translateX(110%);
}

/* ---- State: reversing ---- */
.morph-window.reversing .morph-title-folder {
    opacity: 1;
    transition: opacity 0.35s ease 0.1s;
}

.morph-window.reversing .morph-title-site {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.morph-window.reversing .morph-folder {
    opacity: 1;
    transition: opacity 0.15s ease;
}

.morph-window.reversing .morph-website {
    z-index: 3;
    animation: wipeHide 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.morph-window.reversing .morph-sweep {
    transform: translateX(-110%);
    animation: none;
}

.morph-window.reversing .morph-file-row {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    transition-delay: calc(0.05s + var(--row-i, 0) * 0.04s);
}

/* ========================= */
/* Morph Folder — Finder List */
/* ========================= */

.morph-folder-header {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.morph-folder-header span {
    flex: 1;
}

.morph-folder-header span:first-child {
    flex: 2;
}

.morph-folder-header span:last-child {
    text-align: right;
}

.morph-file-row {
    display: flex;
    align-items: center;
    padding: 7px 14px;
    font-family: var(--font-mono);
}

.morph-file-row:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

.morph-file-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-right: 8px;
    color: var(--text-muted);
}

.morph-file-icon.folder-icon {
    color: var(--accent);
}

.morph-file-icon svg {
    width: 100%;
    height: 100%;
}

.morph-file-name {
    flex: 2;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.morph-file-date {
    flex: 1;
    font-size: 0.62rem;
    color: var(--text-muted);
    text-align: center;
}

.morph-file-size {
    flex: 0 0 60px;
    font-size: 0.62rem;
    color: var(--text-muted);
    text-align: right;
}

/* ========================= */
/* Morph Website — Preview    */
/* ========================= */

.morph-site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: var(--surface-canvas);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.morph-site-logo {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.morph-site-links {
    display: flex;
    gap: 14px;
}

.morph-site-links span {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 500;
}

.morph-site-hero {
    position: relative;
    height: 130px;
    overflow: hidden;
}

.morph-site-hero-bg {
    position: absolute;
    inset: 0;
}

.morph-site-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(44, 41, 38, 0.55), transparent);
}

.morph-site-hero-text {
    position: absolute;
    bottom: 14px;
    left: 18px;
    right: 18px;
}

.morph-site-hero-text h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 3px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.morph-site-hero-text p {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.morph-site-body {
    padding: 14px 18px;
}

.morph-site-body h4 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.morph-site-body p {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin-bottom: 8px;
}

/* Dark portfolio variant */
.morph-site-nav--dark {
    background: #111118;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.morph-site-nav--dark .morph-site-logo {
    color: #fff;
}

.morph-site-nav--dark .morph-site-links span {
    color: #888;
}

.morph-site-body--dark {
    background: #111118;
}

.morph-site-body--dark h4 {
    color: #fff;
}

/* Gallery grid */
.morph-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
}

.morph-gallery-item {
    aspect-ratio: 1.2;
    border-radius: 5px;
    overflow: hidden;
}

.morph-gallery-item svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Asymmetric gallery for portfolio variation */
.morph-gallery-asymmetric {
    grid-template-columns: 1.6fr 1fr;
    grid-template-rows: auto auto;
    gap: 5px;
}

.morph-gallery-featured {
    grid-row: 1 / 3;
    aspect-ratio: auto;
    min-height: 90px;
}

.morph-gallery-asymmetric .morph-gallery-item:not(.morph-gallery-featured) {
    aspect-ratio: 1.6;
}

/* Menu items for restaurant variation */
.morph-menu-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.morph-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px dotted rgba(0, 0, 0, 0.08);
}

.morph-menu-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: var(--font-body);
}

.morph-menu-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.morph-menu-item span:last-child {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Cafe nav warm accent */
.morph-site-nav--cafe {
    background: #F7F6F4;
    border-bottom: 1px solid rgba(184, 147, 90, 0.12);
}

/* Cafe hours line */
.morph-cafe-hours {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.morph-cafe-hours-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.morph-cafe-hours span {
    font-size: 0.58rem;
    color: var(--text-muted);
    font-family: var(--font-body);
}

/* Cafe body warm tint */
.morph-site-body--cafe {
    background: linear-gradient(to bottom, rgba(201, 168, 124, 0.04), transparent);
}

/* Blog post list for blog variation */
.morph-post-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.morph-post {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.morph-post-thumb {
    width: 44px;
    height: 34px;
    border-radius: 4px;
    flex-shrink: 0;
}

.morph-post-thumb--svg {
    background: none;
    overflow: hidden;
}

.morph-post-thumb--svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.morph-post-text h5 {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-family: var(--font-body);
}

.morph-post-text p {
    font-size: 0.56rem;
    color: var(--text-muted);
    margin-bottom: 0;
    font-family: var(--font-body);
}

/* ==================== */
/* MORPH CONTROLS       */
/* ==================== */

.morph-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    z-index: 2;
}

.morph-controls-divider {
    width: 1px;
    height: 12px;
    background: var(--text-muted);
    opacity: 0.25;
}

.morph-dot {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.morph-dot:hover {
    color: var(--text-secondary);
}

.morph-dot.active {
    color: var(--accent);
}

/* ==================== */
/* MORPH VARIATION STYLES */
/* ==================== */

/* Portfolio variation — dark luxe with Instrument Serif */
.morph-website .morph-var-portfolio .morph-site-logo {
    font-family: 'Instrument Serif', Georgia, serif;
    letter-spacing: -0.02em;
}

.morph-website .morph-var-portfolio .morph-site-hero-text h3 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.02em;
}

/* Cafe variation — artisan warm with Cormorant Garamond */
.morph-website .morph-var-cafe .morph-site-logo {
    font-family: var(--font-display);
    font-style: italic;
}

.morph-website .morph-var-cafe .morph-site-hero-text h3 {
    font-family: var(--font-display);
    font-style: italic;
}

/* Travel variation — clean editorial with Sora */
.morph-website .morph-var-travel .morph-site-logo {
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.morph-website .morph-var-travel .morph-site-hero-text h3 {
    font-family: 'Sora', sans-serif;
    font-weight: 600;
}

.morph-website .morph-var-travel .morph-site-links span {
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Travel blog tag pills */
.morph-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.45rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Portfolio footer bar */
.morph-site-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 8px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.05em;
}

.morph-site-footer--dark {
    background: #0c0a14;
}

/* Cafe decorative rule */
.morph-cafe-rule {
    width: 40px;
    height: 1px;
    background: rgba(139, 105, 20, 0.25);
    margin: 6px auto 10px;
}

/* ==================== */
/* EMAIL SIGNUP         */
/* ==================== */

.email-signup {
    margin-top: 2.5rem;
    text-align: center;
}

.email-signup p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.email-signup-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

.email-input {
    flex: 1;
    padding: 0.65rem 1rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-primary);
    background: var(--surface-deep);
    border: 1px solid rgba(168, 162, 158, 0.25);
    border-radius: var(--radius-sm);
    outline: none;
    box-shadow:
        inset 2px 2px 4px var(--shadow-dark),
        inset -1px -1px 3px var(--shadow-light);
    transition: border-color 0.2s ease;
}

.email-input:focus {
    border-color: var(--accent-muted);
}

.email-input::placeholder {
    color: var(--text-muted);
}

.email-btn {
    padding: 0.65rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--surface-raised);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -3px -3px 6px var(--shadow-light),
        inset 0 1px 0 var(--shadow-edge-light);
    transition: all 0.15s ease;
}

.email-btn:hover {
    box-shadow:
        2px 2px 4px var(--shadow-dark),
        -2px -2px 4px var(--shadow-light),
        inset 0 1px 0 var(--shadow-edge-light);
}

.email-btn:active {
    box-shadow:
        inset 2px 2px 4px var(--shadow-dark),
        inset -1px -1px 3px var(--shadow-light);
}

/* ============================== */
/* RESPONSIVE - New sections      */
/* ============================== */

@media (max-width: 900px) {
    .features-compact {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .features-compact {
        grid-template-columns: 1fr;
        max-width: 320px;
    }

    .email-signup-form {
        flex-direction: column;
    }
}

/* ============================================ */
/* SECTION STRATA — Geological surface variety  */
/* ============================================ */

/* New surface variables for section variety */
:root {
    --stratum-light: #F5F3F0;
    --stratum-warm: #EDE8E2;
    --stratum-deep: #DDD7D0;
    --stratum-dark: #D4CEC6;
    --stratum-accent: #E8DFD3;
}

/* --- Section 1 (Hero): Lightest stratum — fresh limestone --- */
#step-1 {
    background: linear-gradient(175deg,
            var(--surface-float) 0%,
            var(--stratum-light) 60%,
            var(--stratum-warm) 100%);
}

/* --- Section 2 (AI Generation): Warmer, deeper — sandstone --- */
#step-2 {
    background: var(--stratum-warm);
    position: relative;
}

#step-2::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 30% 40%, rgba(184, 147, 90, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 70% 60%, rgba(138, 117, 96, 0.05) 0%, transparent 60%);
    z-index: 0;
}

#step-2>* {
    position: relative;
    z-index: 1;
}

/* --- Section 3 (Editor Mockup): Darkest stratum — deep quarried stone --- */
#step-3 {
    background: linear-gradient(180deg,
            var(--stratum-deep) 0%,
            var(--stratum-dark) 40%,
            var(--stratum-deep) 100%);
}

/* --- Section 4 (Publish): Warm accent stratum — golden sandstone --- */
#step-4 {
    background: linear-gradient(175deg,
            var(--stratum-warm) 0%,
            var(--stratum-accent) 50%,
            var(--stratum-warm) 100%);
    position: relative;
}

#step-4::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 70% 50% at 60% 50%,
            rgba(184, 147, 90, 0.08) 0%,
            transparent 70%);
    z-index: 0;
}

#step-4>* {
    position: relative;
    z-index: 1;
}

/* --- FAQ: Return to light — polished marble --- */
#faq {
    background: var(--stratum-light);
    position: relative;
}

/* --- CTA: Warm glow — travertine with accent warmth --- */
.cta-section {
    background: linear-gradient(180deg,
            var(--stratum-light) 0%,
            var(--stratum-accent) 50%,
            var(--stratum-warm) 100%);
    position: relative;
}

/* --- Footer: Deepest layer --- */
footer {
    background: var(--stratum-deep);
}

/* ============================================ */
/* SECTION SEAMS — Architectural joint lines     */
/* ============================================ */

/* Thin ruled line between sections — like a stone joint */
.step-section+.step-section,
.step-section+.section,
.section+.cta-section {
    border-top: 1px solid rgba(138, 117, 96, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* ============================================ */
/* SCROLL-DOWN INDICATOR                        */
/* ============================================ */

.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
    opacity: 0.6;
    transition: opacity 0.4s ease;
}

.scroll-indicator:hover {
    opacity: 1;
}

.scroll-indicator-text {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--drawing);
}

.scroll-indicator-line {
    width: 1px;
    height: 40px;
    position: relative;
    overflow: hidden;
    background: rgba(138, 117, 96, 0.15);
}

.scroll-indicator-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent 0%,
            var(--accent) 50%,
            transparent 100%);
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
    0% {
        top: -100%;
    }

    100% {
        top: 100%;
    }
}

.scroll-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: scrollDotPulse 2s ease-in-out infinite;
}

@keyframes scrollDotPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* Hide scroll indicator after user scrolls */
.scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

/* ============================================ */
/* FROSTED GLASS TREATMENT                      */
/* ============================================ */

.glass {
    background: rgba(247, 246, 244, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 16px rgba(28, 25, 23, 0.06);
}

.glass-warm {
    background: rgba(237, 232, 226, 0.68);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 16px rgba(28, 25, 23, 0.08);
}

.glass-dark {
    background: rgba(212, 206, 198, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(28, 25, 23, 0.1);
}

/* Apply glass to CTA card — it sits on the warm accent stratum */
.cta-card.slab.glass {
    background: rgba(247, 246, 244, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Apply glass to publish visual panel */
.publish-visual.glass-warm {
    background: rgba(242, 239, 235, 0.55);
}

/* Apply glass to FAQ items container */
.faq-list.glass {
    padding: 2rem 2.5rem;
    border-radius: var(--radius-lg);
}

/* ============================================ */
/* SECTION BOTTOM FADE — hints at next section  */
/* ============================================ */

.step-section::before {
    z-index: 0;
}

/* Bottom gradient fade showing the next section's color bleeding through */
.section-peek {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    pointer-events: none;
    z-index: 1;
}

#step-1 .section-peek {
    background: linear-gradient(to bottom, transparent 0%, var(--stratum-warm) 100%);
}

#step-2 .section-peek {
    background: linear-gradient(to bottom, transparent 0%, var(--stratum-deep) 100%);
}

#step-3 .section-peek {
    background: linear-gradient(to bottom, transparent 0%, var(--stratum-warm) 100%);
}

#step-4 .section-peek {
    background: linear-gradient(to bottom, transparent 0%, var(--stratum-light) 100%);
}


/* ============================================ */
/* SCROLLYTELLING - Cinematic Theater System    */
/* ============================================ */

/* --- Layout: Full-viewport immersive experience --- */

.scrollytelling-section {
    min-height: auto;
    align-items: flex-start;
    overflow: visible;
    padding-bottom: 0;
    position: relative;
}

.scrolly-container {
    position: relative;
    min-height: 500vh; /* Extended for dramatic scroll journey */
}

.scrolly-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
}

/* Invisible scroll-trigger spacers */
.scrolly-steps {
    position: relative;
    pointer-events: none;
    z-index: 20;
}

.scrolly-step {
    min-height: 120vh; /* Taller steps for more substantial scrolling */
    position: relative;
}

/* First step needs less top margin since mockup is right above */
.scrolly-step:first-child {
    min-height: 100vh;
}

/* --- Mockup container with cinematic positioning --- */

.mockup-container {
    position: absolute;
    width: 95vw;
    max-width: 1300px;
    transition:
        transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.8s ease;
    will-change: transform;
}

/*
 * Camera journey: coherent spatial narrative
 * States 1-2: shift mockup left → emphasise preview+source (right side)
 * States 3-4: shift mockup right → emphasise file tree (left side)
 * Conservative transforms so nothing leaves the viewport.
 */

/* State 1: Focus on preview + source */
.mockup-container[data-scrolly-state="bidi-editing"] {
    transform: translateX(-5%) scale(0.94);
}

/* State 2: Same area, subtle zoom on toolbar */
.mockup-container[data-scrolly-state="quick-actions"] {
    transform: translateX(-4%) translateY(-1%) scale(0.96);
}

/* State 3: Pan to file tree */
.mockup-container[data-scrolly-state="folder-sitemap"] {
    transform: translateX(8%) scale(0.94);
}

/* State 4: Zoom into file tree area */
.mockup-container[data-scrolly-state="ai-instructions"] {
    transform: translateX(12%) translateY(-1%) scale(0.97);
}

/* Transition between states */
.mockup-container.scrolly-active {
    transition:
        transform 1.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.8s ease;
}

/* --- Bottom-bar captions with gradient fade --- */
/* Captions live inside .scrolly-sticky but outside .mockup-container,
   so they stay fixed in viewport space while the mockup moves. */

.scrolly-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    pointer-events: none;
    padding: 6rem 5% 2rem;
    background: linear-gradient(to top,
        var(--surface) 0%,
        var(--surface) 30%,
        transparent 100%);
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scrolly-caption.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Inner content wrapper — constrained width, aligned per state */
.scrolly-caption-content {
    max-width: 380px;
}

.scrolly-caption-number {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--accent);
    display: block;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.scrolly-caption-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.scrolly-caption-title em {
    font-style: italic;
    color: var(--accent);
}

.scrolly-caption-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
    font-weight: 400;
}

/* States 1-2 (camera right): text anchored bottom-left */
.scrolly-caption[data-spotlight="bidi-editing"] .scrolly-caption-content,
.scrolly-caption[data-spotlight="quick-actions"] .scrolly-caption-content {
    /* default: left-aligned */
}

/* States 3-4 (camera left): text anchored bottom-right */
.scrolly-caption[data-spotlight="folder-sitemap"],
.scrolly-caption[data-spotlight="ai-instructions"] {
    display: flex;
    justify-content: flex-end;
}

.scrolly-caption[data-spotlight="folder-sitemap"] .scrolly-caption-content,
.scrolly-caption[data-spotlight="ai-instructions"] .scrolly-caption-content {
    text-align: right;
}


/* --- Cinematic spotlight dimming system --- */

/* Add transitions to all zones - slower for drama */
.scrolly-active [data-scrolly-zone] {
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                filter 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dim non-spotlighted zones so highlights pop */
.scrolly-active.scrolly-dimming [data-scrolly-zone] {
    opacity: 0.12;
    filter: saturate(0.2) brightness(0.8);
    pointer-events: none;
}

/* Spotlighted zones override back to full */
.scrolly-active.scrolly-dimming [data-scrolly-zone].spotlight {
    opacity: 1;
    filter: none;
    pointer-events: auto;
}

/* Also dim collapsed tabs during scrollytelling */
.scrolly-active.scrolly-dimming .panel-collapsed-tab {
    opacity: 0.1;
    transition: opacity 0.8s ease;
}


/* --- Smooth panel transitions during scrollytelling ---
   Instead of display:none (instant), we collapse panels with
   animatable properties so they slide in/out smoothly. */

/* During scrollytelling: force both panels visible so they can animate */
.scrolly-active .editor-pane-filetree,
.scrolly-active .editor-pane-source {
    display: flex !important;
}

/* Hide the collapsed-tab toggles entirely during scrollytelling */
.scrolly-active .panel-collapsed-tab {
    display: none !important;
}

/* Base transition on both panes */
.scrolly-active .editor-pane-filetree,
.scrolly-active .editor-pane-source {
    transition:
        max-width 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.5s ease,
        padding 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        border-width 0.7s ease;
    min-width: 0;
}

/* Smooth grid transition */
.scrolly-active .editor-body {
    grid-template-columns: auto 1fr auto !important;
    transition: none; /* grid is auto — panes control their own width */
}

/* --- States 1 & 2: expand source, collapse filetree --- */

.scrolly-active[data-scrolly-state="bidi-editing"] .editor-pane-source,
.scrolly-active[data-scrolly-state="quick-actions"] .editor-pane-source {
    max-width: 280px;
    width: 280px;
    opacity: 1;
}

.scrolly-active[data-scrolly-state="bidi-editing"] .editor-pane-filetree,
.scrolly-active[data-scrolly-state="quick-actions"] .editor-pane-filetree {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    border-width: 0;
}

/* --- States 3 & 4: expand filetree, collapse source --- */

.scrolly-active[data-scrolly-state="folder-sitemap"] .editor-pane-filetree,
.scrolly-active[data-scrolly-state="ai-instructions"] .editor-pane-filetree {
    max-width: 200px;
    width: 200px;
    opacity: 1;
}

.scrolly-active[data-scrolly-state="folder-sitemap"] .editor-pane-source,
.scrolly-active[data-scrolly-state="ai-instructions"] .editor-pane-source {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    border-width: 0;
}


/* =============================================
   State-specific HIGHLIGHTS — bold & unmissable
   ============================================= */

/* --- State 1 (bidi-editing): selected element + source line --- */

.scrolly-active[data-scrolly-state="bidi-editing"] .editable-element.selected {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow:
        0 0 0 7px rgba(184, 147, 90, 0.35),
        0 0 40px rgba(184, 147, 90, 0.5),
        0 0 80px rgba(184, 147, 90, 0.2);
    border-radius: 6px;
    animation: scrollyPulseRing 2s ease-in-out infinite;
}

.scrolly-active[data-scrolly-state="bidi-editing"] .source-line.highlight {
    background: rgba(184, 147, 90, 0.3);
    box-shadow:
        -4px 0 0 var(--accent),
        0 0 20px rgba(184, 147, 90, 0.35);
    border-radius: 4px;
    padding: 3px 8px 3px 10px;
}

/* Glowing connector bar on the source pane edge */
.scrolly-active[data-scrolly-state="bidi-editing"] .editor-pane-source::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, transparent 10%, var(--accent) 40%, var(--accent) 60%, transparent 90%);
    opacity: 0.8;
    animation: scrollyEdgePulse 2s ease-in-out infinite;
    z-index: 5;
}

/* --- State 2 (quick-actions): toolbar glow + element highlight --- */

.scrolly-active[data-scrolly-state="quick-actions"] .editable-element.selected {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow:
        0 0 0 7px rgba(184, 147, 90, 0.3),
        0 0 40px rgba(184, 147, 90, 0.3);
    border-radius: 6px;
}

.scrolly-active[data-scrolly-state="quick-actions"] .element-toolbar {
    box-shadow:
        0 4px 24px rgba(184, 147, 90, 0.7),
        0 0 0 2px rgba(184, 147, 90, 0.5),
        0 0 60px rgba(184, 147, 90, 0.3);
    animation: scrollyToolbarGlow 1.8s ease-in-out infinite;
    transform: translateY(-100%) scale(1.05);
}

.scrolly-active[data-scrolly-state="quick-actions"] .quick-actions-toolbar {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    box-shadow:
        0 4px 24px rgba(184, 147, 90, 0.5),
        0 0 0 2px rgba(184, 147, 90, 0.4),
        0 0 40px rgba(184, 147, 90, 0.2);
    animation: scrollyToolbarGlow 1.8s ease-in-out infinite;
}

/* --- State 3 (folder-sitemap): folder items with bold gold accent --- */

.scrolly-active[data-scrolly-state="folder-sitemap"] .filetree-item[data-folder] {
    background: rgba(184, 147, 90, 0.22);
    box-shadow:
        inset 4px 0 0 var(--accent),
        0 0 0 2px rgba(184, 147, 90, 0.3),
        0 0 20px rgba(184, 147, 90, 0.15);
    border-radius: 4px;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.scrolly-active[data-scrolly-state="folder-sitemap"] .filetree-item[data-folder] .filetree-folder {
    color: var(--accent);
}

/* --- State 4 (ai-instructions): _page.txt pulse + tooltip --- */

.scrolly-active[data-scrolly-state="ai-instructions"] .filetree-item[data-file="page-txt"] {
    background: rgba(184, 147, 90, 0.25);
    color: var(--accent);
    box-shadow:
        inset 4px 0 0 var(--accent),
        0 0 0 2px rgba(184, 147, 90, 0.4),
        0 0 30px rgba(184, 147, 90, 0.3);
    animation: scrollyPulseItem 2s ease-in-out infinite;
}

/* Tooltip with prominent shadow */
.scrolly-active[data-scrolly-state="ai-instructions"] .ai-instruction-tooltip {
    display: block;
    opacity: 1;
    transform: translateX(0);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.18),
        0 0 0 2px rgba(184, 147, 90, 0.35),
        0 0 40px rgba(184, 147, 90, 0.15);
}

/* --- Keyframes --- */

@keyframes scrollyPulseRing {
    0%, 100% {
        box-shadow:
            0 0 0 7px rgba(184, 147, 90, 0.35),
            0 0 40px rgba(184, 147, 90, 0.5),
            0 0 80px rgba(184, 147, 90, 0.2);
    }
    50% {
        box-shadow:
            0 0 0 10px rgba(184, 147, 90, 0.2),
            0 0 50px rgba(184, 147, 90, 0.6),
            0 0 100px rgba(184, 147, 90, 0.25);
    }
}

@keyframes scrollyToolbarGlow {
    0%, 100% {
        box-shadow:
            0 4px 24px rgba(184, 147, 90, 0.7),
            0 0 0 2px rgba(184, 147, 90, 0.5),
            0 0 60px rgba(184, 147, 90, 0.3);
    }
    50% {
        box-shadow:
            0 6px 32px rgba(184, 147, 90, 0.85),
            0 0 0 2px rgba(184, 147, 90, 0.6),
            0 0 80px rgba(184, 147, 90, 0.4);
    }
}

@keyframes scrollyPulseItem {
    0%, 100% {
        box-shadow:
            inset 4px 0 0 var(--accent),
            0 0 0 2px rgba(184, 147, 90, 0.4),
            0 0 30px rgba(184, 147, 90, 0.3);
    }
    50% {
        box-shadow:
            inset 4px 0 0 var(--accent),
            0 0 0 3px rgba(184, 147, 90, 0.5),
            0 0 50px rgba(184, 147, 90, 0.4);
    }
}

@keyframes scrollyEdgePulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}


/* --- AI Instruction Tooltip (base styles) --- */

.ai-instruction-tooltip {
    display: none;
    position: absolute;
    left: calc(100% + 8px);
    top: 1.5rem;
    width: 220px;
    background: var(--surface-float);
    border: 1px solid rgba(184, 147, 90, 0.25);
    border-radius: var(--radius-sm);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 0 0 1px var(--accent-subtle);
    z-index: 200;
    font-size: 0.75rem;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.ai-tooltip-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-weight: 600;
    color: var(--accent);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ai-tooltip-header svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.ai-tooltip-body {
    padding: 0.6rem 0.75rem;
}

.ai-tooltip-body code {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: block;
    white-space: pre-wrap;
}

/* Allow tooltip to overflow the filetree pane */
.scrolly-active[data-scrolly-state="ai-instructions"] .editor-pane-filetree {
    overflow: visible;
}

.scrolly-active[data-scrolly-state="ai-instructions"] .filetree-content {
    overflow: visible;
    position: relative;
}

/* --- Responsive --- */

@media (max-width: 900px) {
    .scrolly-caption-content {
        max-width: 280px;
    }

    .ai-instruction-tooltip {
        left: 0;
        top: auto;
        bottom: -5rem;
        width: 100%;
        transform: translateY(8px);
    }

    .scrolly-active[data-scrolly-state="ai-instructions"] .ai-instruction-tooltip {
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .scrolly-sticky {
        position: relative;
        top: auto;
    }

    .scrolly-step {
        min-height: 50vh;
    }

    .scrolly-step:first-child {
        min-height: 30vh;
    }

    .scrolly-caption {
        justify-content: center !important;
        padding: 4rem 5% 1.5rem;
    }

    .scrolly-caption-content {
        text-align: center !important;
        max-width: 90vw;
    }
}
