/* ============================================
   tnhec.com - Pop Art Comic Panel Design
   ============================================ */

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

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    color: #1A1A1A;
    background-color: #FFD700;
    overflow-x: hidden;
}

/* --- Comic Page Container --- */
.comic-page {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #FFD700;
    padding: 8px;
}

/* --- Panel Base --- */
.panel {
    position: relative;
    border: 4px solid #0D0D0D;
    overflow: hidden;
    scroll-snap-align: start;
}

.panel-splash {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-standard {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-wide {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-tall {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-square {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Panel Colors --- */
.panel-magenta {
    background-color: #FF1493;
}

.panel-cyan {
    background-color: #00E5FF;
}

.panel-cream {
    background-color: #FFFDF5;
}

.panel-black {
    background-color: #0D0D0D;
}

.panel-green {
    background-color: #ADFF2F;
}

.panel-orange {
    background-color: #FF6B35;
}

/* --- Ben-Day Dot Overlays --- */
.ben-day-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #E8A0BF 1px, transparent 1px);
    background-size: 6px 6px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

.ben-day-large {
    background-size: 8px 8px;
}

.ben-day-small {
    background-size: 4px 4px;
}

/* Ben-Day dot drift animation */
@keyframes dotDrift {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 48px 48px;
    }
}

.panel-splash .ben-day-overlay {
    animation: dotDrift 8s linear infinite;
}

/* --- Panel Content --- */
.panel-content {
    position: relative;
    z-index: 2;
    padding: 3rem 4rem;
    max-width: 1200px;
    width: 100%;
}

.splash-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.panel-content-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* --- Typography --- */

/* Bangers - Primary Display */
.splash-title {
    font-family: 'Bangers', cursive;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #FFFDF5;
    text-shadow: 4px 4px 0px #0D0D0D;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.splash-title .letter {
    display: inline-block;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.splash-title .letter:hover {
    transform: scale(1.15) rotate(-3deg);
}

.splash-title-secondary {
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    color: #0D0D0D;
    text-shadow: 3px 3px 0px #FFD700;
}

.splash-title-closing {
    color: #00E5FF;
    text-shadow: 4px 4px 0px #FF1493;
}

.panel-heading {
    font-family: 'Bangers', cursive;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #FFFDF5;
    text-shadow: 3px 3px 0px #0D0D0D;
    margin-bottom: 1.2rem;
    line-height: 1.15;
}

.panel-heading-dark {
    color: #0D0D0D;
    text-shadow: 2px 2px 0px #E8A0BF;
}

.panel-heading-light {
    color: #FFFDF5;
    text-shadow: 3px 3px 0px #FF1493;
}

.panel-body {
    font-family: 'Commissioner', sans-serif;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    font-weight: 400;
    line-height: 1.65;
    color: #F0EDE5;
    max-width: 600px;
    margin-bottom: 1.5rem;
}

.panel-body-dark {
    color: #1A1A1A;
}

.panel-body-manifesto {
    color: #0D0D0D;
    font-weight: 600;
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    max-width: 700px;
}

/* --- Speech Bubbles --- */
.speech-bubble {
    position: relative;
    background-color: #FFFDF5;
    border: 3px solid #0D0D0D;
    border-radius: 4px;
    padding: 1rem 1.5rem;
    max-width: 400px;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.speech-bubble.visible {
    transform: scale(1);
}

.speech-text {
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    color: #0D0D0D;
    line-height: 1.4;
}

/* Speech bubble tails */
.speech-tail {
    position: absolute;
    width: 0;
    height: 0;
}

.speech-tail-right {
    bottom: -16px;
    right: 30px;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 16px solid #0D0D0D;
}

.speech-tail-right::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: -10px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 14px solid #FFFDF5;
}

.speech-tail-left {
    bottom: -16px;
    left: 30px;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 16px solid #0D0D0D;
}

.speech-tail-left::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: -10px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 14px solid #FFFDF5;
}

.speech-tail-down {
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 16px solid #0D0D0D;
}

.speech-tail-down::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: -10px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 14px solid #FFFDF5;
}

.speech-bubble-right {
    margin-top: 1rem;
    transform-origin: bottom right;
}

.speech-bubble-inline {
    margin-top: 1.5rem;
    transform-origin: bottom left;
}

.speech-bubble-card {
    transform-origin: bottom center;
    margin-bottom: 1.5rem;
}

.speech-bubble-icon {
    margin-top: 1.5rem;
    transform-origin: bottom left;
}

.speech-bubble-closing {
    margin-top: 2rem;
    transform-origin: bottom left;
}

/* --- Panel Rows (Multi-column) --- */
.panel-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.panel-row-asymmetric {
    grid-template-columns: 2fr 1fr;
}

/* --- Panel Columns (within panels) --- */
.panel-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.panel-col {
    display: flex;
    justify-content: center;
}

/* --- Buttons --- */
.pop-button {
    font-family: 'Bangers', cursive;
    font-size: clamp(1rem, 2vw, 1.4rem);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.8rem 2.5rem;
    border: 4px solid #0D0D0D;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0ms, color 0ms;
    position: relative;
    z-index: 2;
}

.pop-button-green {
    background-color: #ADFF2F;
    color: #0D0D0D;
}

.pop-button-green:hover {
    background-color: #0D0D0D;
    color: #ADFF2F;
}

.pop-button-orange {
    background-color: #FF6B35;
    color: #FFFDF5;
}

.pop-button-orange:hover {
    background-color: #FFFDF5;
    color: #FF6B35;
}

.pop-button-black {
    background-color: #0D0D0D;
    color: #FFFDF5;
}

.pop-button-black:hover {
    background-color: #FFFDF5;
    color: #0D0D0D;
}

/* --- Starburst Decorative Elements --- */
.starburst {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.starburst-text {
    font-family: 'Bangers', cursive;
    font-size: clamp(2rem, 4vw, 4rem);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #FF6B35;
    text-shadow: 2px 2px 0px #0D0D0D;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.starburst.visible .starburst-text {
    transform: scale(1);
}

.starburst-decorative {
    top: 10%;
    right: 8%;
    transform: rotate(12deg);
}

.starburst-bg {
    bottom: 10%;
    left: 5%;
    transform: rotate(-8deg);
}

.starburst-corner {
    bottom: 8%;
    right: 6%;
    left: auto;
    transform: rotate(15deg);
}

.starburst-closing {
    bottom: 15%;
    right: 10%;
    transform: rotate(-10deg);
}

.starburst-closing .starburst-text {
    font-size: clamp(3rem, 6vw, 6rem);
    color: #ADFF2F;
}

/* Starburst SVG background shape */
.starburst::before {
    content: '';
    position: absolute;
    width: clamp(80px, 12vw, 160px);
    height: clamp(80px, 12vw, 160px);
    background-color: #FFD700;
    clip-path: polygon(
        50% 0%, 61% 15%, 78% 5%, 73% 25%, 95% 25%, 82% 40%,
        100% 50%, 82% 60%, 95% 75%, 73% 75%, 78% 95%, 61% 85%,
        50% 100%, 39% 85%, 22% 95%, 27% 75%, 5% 75%, 18% 60%,
        0% 50%, 18% 40%, 5% 25%, 27% 25%, 22% 5%, 39% 15%
    );
    z-index: -1;
    border: 3px solid #0D0D0D;
}

.starburst-closing::before {
    width: clamp(100px, 16vw, 220px);
    height: clamp(100px, 16vw, 220px);
}

/* --- Pop Icon (Star SVG) --- */
.pop-icon {
    width: clamp(80px, 15vw, 150px);
    height: clamp(80px, 15vw, 150px);
}

.icon-silhouette {
    border: 3px solid #0D0D0D;
    background-color: #FFFDF5;
    padding: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- Panel Entry Animations --- */
@keyframes panelContentIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.panel-content {
    opacity: 0;
    transform: scale(0.8);
}

.panel.animate-in .panel-content {
    animation: panelContentIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Staggered animations for child elements */
.panel.animate-in .panel-heading {
    animation: panelContentIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.05s forwards;
}

.panel.animate-in .panel-body {
    animation: panelContentIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s forwards;
}

.panel.animate-in .pop-button {
    animation: panelContentIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.15s forwards;
}

/* --- Panel Click Pulse --- */
@keyframes panelPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.panel.pulse {
    animation: panelPulse 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Splash Title Letter Stagger --- */
@keyframes letterPop {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-15deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.panel-splash.animate-in .letter {
    opacity: 0;
    display: inline-block;
}

.panel-splash.animate-in .letter:nth-child(1) {
    animation: letterPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s forwards;
}

.panel-splash.animate-in .letter:nth-child(2) {
    animation: letterPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s forwards;
}

.panel-splash.animate-in .letter:nth-child(3) {
    animation: letterPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s forwards;
}

.panel-splash.animate-in .letter:nth-child(4) {
    animation: letterPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.4s forwards;
}

.panel-splash.animate-in .letter:nth-child(5) {
    animation: letterPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s forwards;
}

/* Handwritten rotation for speech bubble text */
.speech-bubble-inline .speech-text {
    transform: rotate(-1deg);
}

.speech-bubble-closing .speech-text {
    transform: rotate(1deg);
}

.speech-bubble-icon .speech-text {
    transform: rotate(-2deg);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .panel-row {
        grid-template-columns: 1fr;
    }

    .panel-row-asymmetric {
        grid-template-columns: 1fr;
    }

    .panel-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .panel-content {
        padding: 2rem 1.5rem;
    }

    .splash-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .starburst-decorative {
        top: 5%;
        right: 3%;
    }

    .starburst-corner {
        bottom: 5%;
        right: 3%;
    }
}

@media (max-width: 600px) {
    .comic-page {
        gap: 6px;
        padding: 6px;
    }

    .panel {
        border-width: 3px;
    }

    .panel-content {
        padding: 1.5rem 1rem;
    }

    .speech-bubble {
        max-width: 280px;
        padding: 0.8rem 1rem;
    }

    .pop-button {
        padding: 0.6rem 1.8rem;
        border-width: 3px;
    }

    .starburst::before {
        width: 60px;
        height: 60px;
    }
}
