/* ============================================
   SSETTL.com - Sunset Neomorphic Horizontal Scroll
   ============================================ */

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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Lora', serif;
    font-weight: 400;
    color: #3D2B1F;
    background: #E8C9A8;
    line-height: 1.65;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Typography --- */
h1, h2, h3, .welcome-title, .interlude-quote, .closing-message {
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 0.03em;
    line-height: 1.15;
}

.gallery-hint, .feature-label, .scroll-hint,
.welcome-subtitle, .closing-sub {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
}

/* --- Scroll Container --- */
.scroll-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* --- Panel Base --- */
.panel {
    position: relative;
    min-width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    transition: background-color 0.6s ease;
    overflow: hidden;
}

/* --- Dot Grid Overlay --- */
.panel-dot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16.3' cy='15.7' r='1' fill='%23C4986E' opacity='0.2'/%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
}

.dot-grid-alt {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='15.8' cy='16.4' r='1' fill='%23C4986E' opacity='0.25'/%3E%3C/svg%3E");
}

/* --- Neomorphic Utilities --- */
.neo-raised {
    background: #E8C9A8;
    border-radius: 20px;
    box-shadow: 8px 8px 16px #C4986E, -8px -8px 16px #F5E0C8;
    border: 1px solid #E8C9A8;
}

.neo-inset {
    background: #E8C9A8;
    border-radius: 16px;
    box-shadow: inset 6px 6px 12px #C4986E, inset -6px -6px 12px #F5E0C8;
    border: 1px solid #E8C9A8;
}

.neo-pressed {
    background: #E8C9A8;
    border-radius: 16px;
    box-shadow: inset 6px 6px 12px #C4986E, inset -6px -6px 12px #F5E0C8;
    border: 1px solid #E8C9A8;
}

.neo-raised-dark {
    background: #5E3A52;
    border-radius: 50%;
    box-shadow: 10px 10px 20px #3A2233, -10px -10px 20px #6E4A62;
    border: 1px solid #5E3A52;
}

/* --- Zigzag Divider --- */
.zigzag-divider {
    width: 100%;
    height: 8px;
    margin: 16px 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='8'%3E%3Cpath d='M0 4 L5 0 L10 4 L15 0 L20 4 L15 8 L10 4 L5 8 Z' fill='none' stroke='%23C97B7B' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    opacity: 0.6;
}

/* ============================================
   Panel 1: Welcome
   ============================================ */
.panel-welcome {
    background: #E8C9A8;
}

.welcome-pillow {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 520px;
    height: 320px;
    background: #E8C9A8;
    border-radius: 40px;
    box-shadow: 12px 12px 24px #C4986E, -12px -12px 24px #F5E0C8;
    border: 1px solid #E8C9A8;
    transform: rotate(-2deg);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.welcome-pillow:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 14px 14px 28px #C4986E, -14px -14px 28px #F5E0C8;
}

.welcome-title {
    font-size: 5rem;
    font-weight: 700;
    color: #3D2B1F;
    letter-spacing: 0.08em;
}

.welcome-subtitle {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #B8896A;
    margin-top: 12px;
}

.scroll-hint {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    animation: pulseRight 2s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes pulseRight {
    0%, 100% { transform: translateY(-50%) translateX(0); opacity: 0.5; }
    50% { transform: translateY(-50%) translateX(10px); opacity: 1; }
}

/* ============================================
   Panel 2: Story
   ============================================ */
.panel-story {
    background: #E4C5A2;
}

.story-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    gap: 32px;
    width: 80%;
    max-width: 1100px;
    height: 60vh;
}

.story-text-card {
    flex: 0 0 58%;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.story-heading {
    font-size: 2.4rem;
    font-weight: 700;
    color: #3D2B1F;
    margin-bottom: 8px;
}

.story-body {
    font-size: 1.05rem;
    color: #3D2B1F;
    margin-bottom: 16px;
    line-height: 1.7;
}

.story-image-card {
    flex: 0 0 38%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-image-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    filter: contrast(0.9) saturate(0.7) sepia(0.2) brightness(1.05);
}

.story-image-placeholder svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================================
   Panel 3: Gallery
   ============================================ */
.panel-gallery {
    background: #DBBF9A;
}

.gallery-title {
    position: relative;
    z-index: 1;
    font-size: 2.2rem;
    font-weight: 700;
    color: #3D2B1F;
    margin-bottom: 40px;
}

.gallery-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    gap: 32px;
    align-items: center;
}

.gallery-hint {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #B8896A;
    margin-top: 32px;
}

/* --- Flip Cards --- */
.flip-card {
    width: 240px;
    height: 280px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card[data-offset="-12"] {
    transform: translateY(-12px);
}

.flip-card[data-offset="12"] {
    transform: translateY(12px);
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease-in-out, box-shadow 0.6s ease-in-out;
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 20px;
    overflow: hidden;
}

.flip-card-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.flip-card-back {
    transform: rotateY(180deg);
    background: #C97B7B;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-shadow: 8px 8px 16px #C4986E, -8px -8px 16px #F5E0C8;
    border: 1px solid #C97B7B;
}

.card-back-content {
    position: relative;
    text-align: center;
}

.card-back-content p {
    font-family: 'Lora', serif;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #F2E6D9;
    font-weight: 400;
}

.dot-border {
    position: absolute;
    top: -16px;
    left: -16px;
    right: -16px;
    bottom: -16px;
    border: 2px dotted rgba(242, 230, 217, 0.3);
    border-radius: 12px;
    pointer-events: none;
}

.card-image {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    filter: contrast(0.9) saturate(0.7) sepia(0.2) brightness(1.05);
}

.card-image svg {
    width: 100%;
    height: 100%;
    display: block;
}

.card-label {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 1.05rem;
    color: #3D2B1F;
}

/* ============================================
   Panel 4: Detail
   ============================================ */
.panel-detail {
    background: #DBBF9A;
}

.detail-card {
    position: relative;
    z-index: 1;
    width: 70%;
    max-width: 900px;
    padding: 16px;
}

.detail-well {
    padding: 48px 44px;
}

.detail-heading {
    font-size: 2.2rem;
    font-weight: 700;
    color: #3D2B1F;
    margin-bottom: 8px;
}

.detail-text {
    font-size: 1.05rem;
    color: #3D2B1F;
    margin-bottom: 20px;
    line-height: 1.7;
}

.detail-text em {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 1.15rem;
    color: #D4663A;
}

.detail-image-embed {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin: 24px 0;
    box-shadow: inset 4px 4px 8px #C4986E, inset -4px -4px 8px #F5E0C8;
    filter: contrast(0.9) saturate(0.7) sepia(0.2) brightness(1.05);
}

.detail-image-embed svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   Panel 5: Interlude
   ============================================ */
.panel-interlude {
    background: #C9AD8A;
    position: relative;
}

.interlude-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    filter: contrast(0.9) saturate(0.7) sepia(0.2) brightness(1.05);
}

.interlude-image svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.interlude-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(232, 165, 75, 0.5) 60%, rgba(74, 44, 64, 0.6) 100%);
    z-index: 1;
}

.interlude-text {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 40px;
}

.interlude-quote {
    font-size: 2.8rem;
    font-weight: 600;
    font-style: italic;
    color: #F2E6D9;
    text-shadow: 0 2px 16px rgba(61, 43, 31, 0.4);
    line-height: 1.35;
}

/* ============================================
   Panel 6: Features
   ============================================ */
.panel-features {
    background: #B8896A;
}

.features-title {
    position: relative;
    z-index: 1;
    font-size: 2.2rem;
    font-weight: 700;
    color: #3D2B1F;
    margin-bottom: 40px;
}

.features-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 500px;
    max-width: 90%;
}

.feature-tile {
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.feature-small {
    padding: 24px 28px;
}

.feature-large {
    padding: 36px 32px;
}

.feature-icon-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: #E8C9A8;
    box-shadow: 4px 4px 8px #C4986E, -4px -4px 8px #F5E0C8;
}

.feature-icon-ring svg {
    width: 32px;
    height: 32px;
}

.feature-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #3D2B1F;
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 0.95rem;
    color: #3D2B1F;
    line-height: 1.6;
}

/* ============================================
   Panel 7: Closing
   ============================================ */
.panel-closing {
    background: linear-gradient(135deg, #5E3A52 0%, #4A2C40 60%, #3D2B1F 100%);
}

.closing-circle {
    position: relative;
    z-index: 1;
    width: 320px;
    height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.closing-message {
    font-size: 1.8rem;
    font-weight: 600;
    color: #F2E6D9;
    margin-bottom: 16px;
}

.closing-sub {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #E8A54B;
    opacity: 0.8;
}

.closing-dots {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    margin-top: 40px;
}

.closing-dots .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #E8A54B;
    opacity: 0.5;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-bar-track {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #E8C9A8;
    box-shadow: inset 1px 1px 3px #C4986E, inset -1px -1px 3px #F5E0C8;
    z-index: 100;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: #E8A54B;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px #E8A54B, 0 0 3px #E8A54B;
    transition: width 0.15s ease-out;
}

/* ============================================
   Responsive: Vertical on mobile
   ============================================ */
@media (max-width: 768px) {
    .scroll-container {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
    }

    .panel {
        min-width: 100vw;
        min-height: 100vh;
    }

    /* Reduce neomorphic intensity */
    .neo-raised {
        box-shadow: 5px 5px 10px #C4986E, -5px -5px 10px #F5E0C8;
    }

    .neo-inset, .neo-pressed {
        box-shadow: inset 4px 4px 8px #C4986E, inset -4px -4px 8px #F5E0C8;
    }

    .welcome-pillow {
        width: 85%;
        max-width: 400px;
        height: 260px;
        box-shadow: 8px 8px 16px #C4986E, -8px -8px 16px #F5E0C8;
    }

    .welcome-title {
        font-size: 3.5rem;
    }

    .story-container {
        flex-direction: column;
        width: 90%;
        height: auto;
        padding: 40px 0;
    }

    .story-text-card {
        flex: none;
        padding: 32px 24px;
    }

    .story-image-card {
        flex: none;
        height: 250px;
    }

    .gallery-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .flip-card {
        width: 160px;
        height: 200px;
    }

    .flip-card[data-offset="-12"],
    .flip-card[data-offset="12"] {
        transform: translateY(0);
    }

    .card-image {
        width: 130px;
        height: 130px;
    }

    .gallery-hint {
        display: block;
    }

    .detail-card {
        width: 90%;
    }

    .detail-well {
        padding: 28px 20px;
    }

    .interlude-quote {
        font-size: 1.8rem;
    }

    .features-container {
        width: 90%;
    }

    .closing-circle {
        width: 260px;
        height: 260px;
    }

    .closing-message {
        font-size: 1.4rem;
    }

    .scroll-hint {
        right: 20px;
        display: none;
    }

    /* Progress bar becomes vertical on mobile */
    .progress-bar-track {
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
    }
}
