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

sup {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 20px;
    text-shadow: none;
    padding-left: 6px;
}

:root {
    --bg-cream: #FFFEF2;
    --bubble-yellow: #FFD93D;
    --text-black: #000;
    --accent-red: #FF6B6B;
    --accent-blue: #4ECDC4;
    --border-thick: 4px;
    --menu-black: #1a1a1a;
}

@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Patrick+Hand&display=swap');

body {
    font-family: 'Patrick Hand', cursive;
    background: linear-gradient(45deg, #FFFEF2 25%, transparent 25%, transparent 75%, #FFFEF2 75%, #FFFEF2),
                linear-gradient(45deg, #FFFEF2 25%, transparent 25%, transparent 75%, #FFFEF2 75%, #FFFEF2);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    background-color: #F5F3E8;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Menu Bar */
.menu-bar {
    position: sticky;
    top: 0;
    width: 100%;
    background: var(--menu-black);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 12px 20px;
}

.menu-bar a {
    font-family: 'Bangers', cursive;
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    letter-spacing: 1px;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.menu-bar a:hover {
    color: var(--bubble-yellow);
    transform: scale(1.05);
}

.menu-logo {
    width: 32px;
    height: 32px;
}

/* Main Layout */
.main-content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Left Callouts Panel */
.callouts-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 260px;
    padding-top: 60px;
}

.callout-bubble {
    background: var(--bubble-yellow);
    border: var(--border-thick) solid var(--text-black);
    border-radius: 20px;
    padding: 15px 20px;
    position: relative;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.15);
    transform: rotate(-2deg);
    transition: transform 0.2s ease;
}

.callout-bubble:nth-child(even) {
    transform: rotate(2deg);
}

.callout-bubble:hover {
    transform: rotate(0deg) scale(1.02);
}

.callout-bubble h3 {
    font-family: 'Bangers', cursive;
    font-size: 1.4rem;
    color: var(--text-black);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.callout-bubble p {
    font-size: 1rem;
    color: #333;
}

/* Callout tail pointing right */
.callout-bubble::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 20px solid var(--bubble-yellow);
    filter: drop-shadow(-4px 0 0 var(--bubble-yellow));
}

.callout-bubble::before {
    content: '';
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 24px solid var(--text-black);
}

/* Center Demo Section */
.demo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.product-container {
    position: relative;
    width: 400px;
    height: 500px;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    border: 4px solid var(--text-black);
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.product-image.active {
    opacity: 1;
}

.product-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ddd 25%, #ccc 25%, #ccc 50%, #ddd 50%, #ddd 75%, #ccc 75%);
    background-size: 20px 20px;
    border: 3px dashed #999;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.2rem;
    text-align: center;
    padding: 20px;
}

.demo-canvas-container {
    position: absolute;
    transform: translateX(-50%);
    width: 160px;
    height: 86px;
    border: 2px solid #333;
    border-radius: 4px;
    overflow: hidden;
    background: white;
    transition: top 0.6s ease-in-out, left 0.6s ease-in-out;
}

/* Per-image canvas positioning */
.demo-canvas-container.canvas-pos-1 {
    top: 105px;
    left: 285px;
}

.demo-canvas-container.canvas-pos-2 {
    top: 78px;
    left: 225px;
}

.demo-canvas-container.canvas-pos-3 {
    top: 78px;
    left: 225px;
}

.demo-canvas-container.canvas-pos-4 {
    top: 78px;
    left: 225px;
}

.demo-canvas-container.canvas-pos-5 {
    top: 78px;
    left: 225px;
}

.demo-canvas-container.canvas-pos-6 {
    top: 78px;
    left: 225px;
}

#demoCanvas {
    width: 100%;
    height: 100%;
}

/* Right Panel - Quip Editor */
.editor-panel {
    width: 320px;
    padding-top: 20px;
}

.editor-title {
    font-family: 'Bangers', cursive;
    font-size: 1.8rem;
    color: var(--text-black);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.quip-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.speech-bubble {
    background: var(--bubble-yellow);
    border: var(--border-thick) solid var(--text-black);
    border-radius: 20px;
    padding: 15px;
    position: relative;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.15);
    transition: transform 0.2s ease;
}

.speech-bubble:hover {
    transform: translateY(-2px);
}

.speech-bubble.tail-left::before {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 5px solid transparent;
    border-top: 18px solid var(--text-black);
}

.speech-bubble.tail-left::after {
    content: '';
    position: absolute;
    bottom: -13px;
    left: 22px;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 4px solid transparent;
    border-top: 15px solid var(--bubble-yellow);
}

.quip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.quip-label {
    font-family: 'Bangers', cursive;
    font-size: 1.2rem;
    color: var(--text-black);
    letter-spacing: 1px;
}

.quip-input {
    width: 100%;
    padding: 10px;
    border: 3px solid var(--text-black);
    border-radius: 12px;
    font-family: 'Patrick Hand', cursive;
    font-size: 1rem;
    background: white;
    resize: none;
}

.quip-input:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.remove-btn {
    background: var(--accent-red);
    color: white;
    border: 2px solid var(--text-black);
    padding: 5px 12px;
    border-radius: 10px;
    font-family: 'Bangers', cursive;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.remove-btn:hover {
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}

.add-quip-btn {
    width: 100%;
    background: var(--accent-blue);
    color: var(--text-black);
    border: var(--border-thick) solid var(--text-black);
    padding: 12px;
    border-radius: 15px;
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    cursor: pointer;
    margin-top: 15px;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

.add-quip-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 rgba(0,0,0,0.2);
}

.add-quip-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Site Title (BRICK QUIPS!) */
.site-title {
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    color: var(--text-black);
    text-align: center;
    margin: 30px 0 10px 0;
    text-shadow: 3px 3px 0 var(--accent-red);
    letter-spacing: 2px;
    transform: rotate(-2deg);
}

.site-tagline {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.4rem;
    color: #333;
    text-align: center;
    margin: 0 auto 20px auto;
    max-width: 300px;
    line-height: 1.4;
}

/* Help Page Styles */
.help-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.help-title {
    font-family: 'Bangers', cursive;
    font-size: 3rem;
    color: var(--text-black);
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 3px 3px 0 var(--accent-red);
    letter-spacing: 3px;
}

.help-subtitle {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 40px;
    color: #333;
}

.faq-section {
    margin-bottom: 40px;
}

.faq-section-title {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    color: var(--text-black);
    margin-bottom: 20px;
    padding-left: 10px;
    border-left: 5px solid var(--accent-red);
}

.faq-item {
    background: var(--bubble-yellow);
    border: var(--border-thick) solid var(--text-black);
    border-radius: 20px;
    padding: 20px 25px;
    margin-bottom: 15px;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.15);
}

.faq-question {
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    color: var(--text-black);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.faq-answer {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6;
}

.faq-answer ul {
    margin-left: 20px;
    margin-top: 10px;
}

.faq-answer li {
    margin-bottom: 5px;
}

.faq-answer code {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Comic decorations */
.comic-star {
    position: fixed;
    font-size: 3rem;
    opacity: 0.1;
    animation: twinkle 3s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.3; transform: scale(1.2) rotate(180deg); }
}

/* Responsive */
@media (max-width: 1100px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }

    .demo-section {
        order: -1;
    }

    .callouts-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        padding-top: 20px;
    }

    .callout-bubble {
        width: calc(50% - 20px);
        max-width: 250px;
    }

    .callout-bubble::after,
    .callout-bubble::before {
        display: none;
    }

    .callout-bubble.tail-bottom::after {
        content: '';
        display: block;
        position: absolute;
        bottom: -18px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-top: 18px solid var(--bubble-yellow);
    }

    .callout-bubble.tail-bottom::before {
        content: '';
        display: block;
        position: absolute;
        bottom: -23px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 15px solid transparent;
        border-right: 15px solid transparent;
        border-top: 22px solid var(--text-black);
    }

    .editor-panel {
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 600px) {
    .menu-bar {
        gap: 15px;
        padding: 10px 15px;
        flex-wrap: wrap;
    }

    .menu-bar a {
        font-size: 1rem;
    }

    .callout-bubble {
        width: 100%;
        max-width: none;
    }

    .help-title {
        font-size: 2rem;
    }

    .faq-section-title {
        font-size: 1.5rem;
    }
}

/* Live Demo Section */
.live-demo-section {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 20px;
}

.live-demo-title {
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    color: var(--text-black);
    text-align: center;
    margin-bottom: 40px;
    text-shadow: 3px 3px 0 var(--accent-red);
    letter-spacing: 2px;
}

.live-demo-card {
    display: flex;
    gap: 30px;
    background: var(--bubble-yellow);
    border: var(--border-thick) solid var(--text-black);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.15);
    transform: rotate(-1deg);
    transition: transform 0.2s ease;
    align-items: center;
}

.live-demo-card:hover {
    transform: rotate(0deg) scale(1.01);
}

.live-demo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.live-demo-heading {
    font-family: 'Bangers', cursive;
    font-size: 1.8rem;
    color: var(--text-black);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.live-demo-text {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.15rem;
    color: #333;
    line-height: 1.6;
    margin-bottom: 15px;
}

.live-demo-text:last-child {
    margin-bottom: 0;
}

.live-demo-video-container {
    flex-shrink: 0;
    width: 400px;
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid var(--text-black);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}

.live-demo-video {
    width: 100%;
    height: auto;
    display: block;
}

/* Live Demo Responsive */
@media (max-width: 700px) {
    .live-demo-card {
        flex-direction: column-reverse;
        text-align: center;
    }

    .live-demo-video-container {
        width: 180px;
    }

    .live-demo-title {
        font-size: 2rem;
    }
}

/* Stories Section */
.stories-section {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 20px;
}

.stories-title {
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    color: var(--text-black);
    text-align: center;
    margin-bottom: 40px;
    text-shadow: 3px 3px 0 var(--accent-blue);
    letter-spacing: 2px;
}

.story-card {
    display: flex;
    gap: 30px;
    background: var(--bubble-yellow);
    border: var(--border-thick) solid var(--text-black);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.15);
    transform: rotate(-1deg);
    transition: transform 0.2s ease;
}

.story-card:nth-child(odd) {
    transform: rotate(1deg);
}

.story-card:hover {
    transform: rotate(0deg) scale(1.01);
}

.story-card.reverse {
    flex-direction: row-reverse;
}

.story-image {
    flex-shrink: 0;
    width: 200px;
    height: 260px;
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid var(--text-black);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.story-image:hover {
    transform: scale(1.03);
    box-shadow: 5px 5px 0 rgba(0,0,0,0.25);
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.story-title {
    font-family: 'Bangers', cursive;
    font-size: 1.8rem;
    color: var(--text-black);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.story-text {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.15rem;
    color: #333;
    line-height: 1.6;
}

/* Stories Responsive */
@media (max-width: 700px) {
    .story-card,
    .story-card.reverse {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .story-image {
        width: 180px;
        height: 240px;
    }

    .stories-title {
        font-size: 2rem;
    }
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.image-modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: var(--accent-red);
    color: white;
    border: 3px solid var(--text-black);
    border-radius: 50%;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
    z-index: 2001;
}

.modal-close:hover {
    transform: scale(1.1);
}

#modalImage {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 15px;
    border: 4px solid var(--text-black);
    box-shadow: 8px 8px 0 rgba(0,0,0,0.3);
}

.modal-caption {
    margin-top: 20px;
    padding: 15px 25px;
    background: var(--bubble-yellow);
    border: 3px solid var(--text-black);
    border-radius: 15px;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.3rem;
    color: var(--text-black);
    text-align: center;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
}

/* Modal Responsive */
@media (max-width: 600px) {
    .modal-close {
        top: -10px;
        right: -10px;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }

    .modal-caption {
        font-size: 1.1rem;
        padding: 12px 18px;
    }
}
