/* hwaglyul.com — Frosted street wall journey */

:root {
    --frost-white: #E8EDF2;
    --ice-blue: #C8D6E0;
    --slate-teal: #4A6670;
    --paper-cream: #F5F0E8;
    --mountain-dusk: #7B8FA3;
    --frozen-berry: #9E7B8A;
    --winter-charcoal: #2C3E50;
    --cool-mist: #B8C9D8;
    --spring-ease: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html, body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: var(--frost-white);
    color: var(--slate-teal);
    font-family: "Source Serif 4", Georgia, serif;
}

body {
    /* crystalline repeating ground pattern (very faint) */
    background-image:
        radial-gradient(circle at 20% 30%, rgba(200,214,224,0.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(184,201,216,0.10) 0%, transparent 45%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><g fill='none' stroke='%23C8D6E0' stroke-opacity='0.14' stroke-width='0.8'><polygon points='60,14 100,36 100,84 60,106 20,84 20,36'/><line x1='60' y1='14' x2='60' y2='106'/><line x1='20' y1='36' x2='100' y2='84'/><line x1='100' y1='36' x2='20' y2='84'/></g></svg>");
    background-size: auto, auto, 220px 220px;
}

/* =========================================================
   Scroll container
   ========================================================= */
main#scroll-container {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    height: 100vh;
    width: 100vw;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

main#scroll-container::-webkit-scrollbar {
    display: none;
}

.panel {
    position: relative;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    overflow: hidden;
    isolation: isolate;
}

/* Frost overlay — breathing */
.frost-overlay {
    position: absolute;
    inset: 0;
    background: rgba(232, 237, 242, 0.68);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    z-index: 1;
    pointer-events: none;
    animation: breathing-frost 6s ease-in-out infinite;
}

@keyframes breathing-frost {
    0%, 100% { opacity: 0.68; }
    50%      { opacity: 0.78; }
}

/* Alley gap between panels */
.alley-gap {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4vw;
    background: linear-gradient(90deg,
        transparent,
        rgba(200, 214, 224, 0.25),
        transparent);
    z-index: 0;
}
.alley-right { right: 0; }

/* =========================================================
   Panel 1 — Title Wall
   ========================================================= */
.panel-title {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(245,240,232,0.35) 0%, transparent 55%),
        linear-gradient(120deg, #E8EDF2 0%, #C8D6E0 100%);
}

.mountain-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.mountain-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.title-cluster {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 8vw;
}

.hero-title {
    font-family: "Alfa Slab One", "Source Serif 4", serif;
    font-size: clamp(4rem, 12vw, 10rem);
    line-height: 0.95;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.02em;
}

.hero-title span {
    display: inline-block;
    transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--tr, 0));
    transition: transform 0.6s var(--spring-ease);
    text-shadow: 2px 4px 0 rgba(232, 237, 242, 0.4),
                 0 0 40px rgba(44, 62, 80, 0.05);
    filter: drop-shadow(2px 3px 0 rgba(44, 62, 80, 0.08));
}

.hero-title:hover span {
    transform: translate(calc(var(--tx, 0) * 1.4), calc(var(--ty, 0) * 1.4)) rotate(calc(var(--tr, 0) * 1.3));
}

.hero-sub {
    font-family: "Source Serif 4", serif;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    color: var(--frozen-berry);
    margin-top: 1.2rem;
    margin-left: 4rem;
    font-weight: 400;
}

.hero-tag {
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-weight: 500;
    font-size: 0.82rem;
    letter-spacing: 0.28em;
    color: var(--slate-teal);
    margin-top: 2.2rem;
    margin-left: 4rem;
    text-transform: uppercase;
    max-width: 40rem;
    line-height: 1.8;
}

/* scattered crystals */
.crystal {
    position: absolute;
    z-index: 2;
    animation: crystal-spin 30s linear infinite;
    transform-origin: center;
}

@keyframes crystal-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(60deg); }
}

.crystal-1 { top: 14%; right: 18%; width: 48px; height: 48px; }
.crystal-2 { top: 58%; right: 8%; width: 36px; height: 36px; animation-duration: 42s; animation-direction: reverse; }
.crystal-3 { top: 78%; left: 12%; width: 52px; height: 52px; animation-duration: 38s; }

/* =========================================================
   Panel labels
   ========================================================= */
.panel-label {
    position: absolute;
    top: 3rem;
    left: 3rem;
    z-index: 4;
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--slate-teal);
    padding: 0.4rem 0.8rem;
    background: rgba(232, 237, 242, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left: 2px solid var(--frozen-berry);
}

/* =========================================================
   Posters
   ========================================================= */
.panel-cluster {
    background:
        radial-gradient(ellipse at 70% 60%, rgba(245,240,232,0.25) 0%, transparent 60%),
        linear-gradient(110deg, #E8EDF2 0%, #C8D6E0 100%);
}

.poster {
    position: absolute;
    top: var(--top);
    left: var(--left);
    width: var(--w);
    height: var(--h);
    transform: rotate(var(--rot));
    background: var(--bg);
    clip-path: var(--clip);
    -webkit-clip-path: var(--clip);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.9s var(--spring-ease),
                transform 0.9s var(--spring-ease),
                filter 0.4s ease;
    filter: drop-shadow(4px 8px 16px rgba(44, 62, 80, 0.12));
    transform: rotate(var(--rot)) translateY(30px);
    /* paper-grain texture */
    background-image:
        radial-gradient(circle at 12% 18%, rgba(44,62,80,0.03) 0%, transparent 2%),
        radial-gradient(circle at 43% 72%, rgba(44,62,80,0.04) 0%, transparent 2.5%),
        radial-gradient(circle at 78% 31%, rgba(44,62,80,0.03) 0%, transparent 2%),
        radial-gradient(circle at 22% 86%, rgba(44,62,80,0.04) 0%, transparent 2.5%),
        radial-gradient(circle at 67% 8%, rgba(44,62,80,0.03) 0%, transparent 2%),
        radial-gradient(circle at 91% 55%, rgba(44,62,80,0.03) 0%, transparent 2%),
        radial-gradient(circle at 35% 42%, rgba(44,62,80,0.02) 0%, transparent 1.8%),
        linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.04) 100%),
        linear-gradient(90deg, rgba(245,240,232,0.1), rgba(245,240,232,0));
    background-color: var(--bg);
}

.poster.is-visible {
    opacity: 1;
    transform: rotate(var(--rot)) translateY(0);
}

.poster:hover {
    filter: drop-shadow(6px 12px 22px rgba(44, 62, 80, 0.18));
    z-index: 10;
}

/* diagonal fold line */
.poster::after {
    content: "";
    position: absolute;
    top: 0;
    left: 30%;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 49.4%, rgba(0,0,0,0.06) 49.7%, rgba(0,0,0,0.06) 50.1%, transparent 50.4%);
    pointer-events: none;
}

.poster-inner {
    position: relative;
    padding: 2rem 1.8rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--winter-charcoal);
    z-index: 2;
}

.poster-inner.poster-dark {
    color: var(--frost-white);
}

.poster-kicker {
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--frozen-berry);
    border-bottom: 1px solid rgba(44, 62, 80, 0.18);
    padding-bottom: 0.5rem;
}

.poster-kicker.light {
    color: var(--paper-cream);
    border-bottom-color: rgba(245, 240, 232, 0.3);
}

.poster-head {
    font-family: "Alfa Slab One", serif;
    font-size: 1.8rem;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--winter-charcoal);
}

.poster-head-small {
    font-family: "Alfa Slab One", serif;
    font-size: 1.5rem;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--winter-charcoal);
}

.light-head {
    color: var(--paper-cream);
    font-size: 3rem;
    letter-spacing: 0.1em;
}

.poster-body {
    font-family: "Source Serif 4", serif;
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--slate-teal);
}

.poster-body.light {
    color: var(--ice-blue);
}

.poster-body-large {
    font-family: "Source Serif 4", serif;
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.55;
    color: var(--winter-charcoal);
}

.poster-body-small {
    font-family: "Source Serif 4", serif;
    font-style: italic;
    font-size: 0.92rem;
    line-height: 1.6;
}

.poster-meta {
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-weight: 500;
    font-size: 0.68rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--mountain-dusk);
    margin-top: auto;
}

.poster-list {
    list-style: none;
    font-family: "Source Serif 4", serif;
    font-size: 0.92rem;
    line-height: 2;
    color: var(--slate-teal);
    font-style: italic;
}

.poster-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 1rem;
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    color: var(--slate-teal);
}

.poster-mountains {
    width: 100%;
    height: auto;
    margin: 0.6rem 0;
}

.poster-flower {
    width: 72%;
    align-self: center;
    margin: 0.6rem auto;
}

/* Tape elements */
.tape {
    position: absolute;
    width: 56px;
    height: 18px;
    background: rgba(245, 240, 232, 0.82);
    box-shadow: 0 1px 2px rgba(44, 62, 80, 0.1);
    z-index: 3;
}
.tape::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
}
.tape-tl { top: -8px; left: 12px; transform: rotate(-12deg); }
.tape-tr { top: -8px; right: 12px; transform: rotate(10deg); }
.tape-bl { bottom: -8px; left: 12px; transform: rotate(8deg); }
.tape-br { bottom: -8px; right: 12px; transform: rotate(-14deg); }

/* wheat-paste drip */
.paste-drip {
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 28px;
    background: linear-gradient(to top, rgba(245, 240, 232, 0.6), transparent);
    pointer-events: none;
    z-index: 1;
}

/* Decorative crystals inside clusters */
.crystal-deco {
    position: absolute;
    z-index: 1;
    animation: crystal-spin 30s linear infinite;
}
.c-d1 { top: 8%; left: 42%; width: 28px; height: 28px; }
.c-d2 { top: 78%; left: 12%; width: 24px; height: 24px; animation-direction: reverse; }
.c-d3 { top: 10%; left: 52%; width: 30px; height: 30px; }
.c-d4 { top: 82%; left: 78%; width: 26px; height: 26px; animation-direction: reverse; }

/* =========================================================
   Panel 3 & 5 — Mountain Vista
   ========================================================= */
.panel-vista {
    background:
        linear-gradient(180deg, #E8EDF2 0%, #C8D6E0 60%, #B8C9D8 100%);
}

.panel-vista-deep {
    background:
        linear-gradient(180deg, #E8EDF2 0%, #B8C9D8 50%, #7B8FA3 100%);
}

.vista-overlay {
    background: rgba(232, 237, 242, 0.45);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
}

.vista-mountains {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.vista-caption {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.4em;
    color: var(--slate-teal);
    text-transform: uppercase;
    padding: 0.8rem 1.6rem;
    background: rgba(245, 240, 232, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    white-space: nowrap;
}

.vista-caption-alt {
    bottom: auto;
    top: 12%;
    color: var(--paper-cream);
    background: rgba(44, 62, 80, 0.35);
}

/* =========================================================
   Panel 6 — Stickers
   ========================================================= */
.panel-stickers {
    background:
        radial-gradient(ellipse at 40% 50%, rgba(245,240,232,0.4) 0%, transparent 55%),
        linear-gradient(95deg, #E8EDF2 0%, #C8D6E0 50%, #E8EDF2 100%);
}

.stickers-wrap {
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 4rem;
}

.sticker {
    position: absolute;
    top: var(--top);
    left: var(--left);
    transform: rotate(var(--rot));
    background: var(--bg, var(--paper-cream));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    min-width: 64px;
    min-height: 64px;
    box-shadow: 2px 3px 8px rgba(44, 62, 80, 0.12);
    transition: transform 0.22s ease-out;
    cursor: default;
    z-index: var(--z, 2);
}

.sticker:hover {
    transform: rotate(calc(var(--rot) + 6deg)) scale(1.08);
    z-index: 99;
    box-shadow: 4px 6px 14px rgba(44, 62, 80, 0.2);
}

.sticker-circle {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    min-width: unset;
    min-height: unset;
}

.sticker-rect {
    border-radius: 6px;
    padding: 0.5rem 1.1rem;
}

.sticker-hex {
    width: 88px;
    height: 88px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    -webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    min-width: unset;
    min-height: unset;
    padding: 0;
}

.sticker-outline {
    background: transparent;
    border: 2px solid var(--slate-teal);
    box-shadow: none;
}

.sticker-text {
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-weight: 600;
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    color: var(--winter-charcoal);
    text-transform: uppercase;
    text-align: center;
    line-height: 1;
    pointer-events: none;
}

.sticker-text.light {
    color: var(--paper-cream);
}

.sticker-circle .sticker-text,
.sticker-hex .sticker-text {
    font-size: 1.2rem;
    letter-spacing: 0.02em;
}

.sticker-outline .sticker-text {
    color: var(--slate-teal);
}

/* =========================================================
   Panel 7 — Closing wall
   ========================================================= */
.panel-closing {
    background:
        radial-gradient(ellipse at center, rgba(232,237,242,0.8) 0%, rgba(200,214,224,0.5) 100%),
        linear-gradient(180deg, #E8EDF2, #B8C9D8);
}

.closing-wallpaper {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    opacity: 0.08;
    pointer-events: none;
    overflow: hidden;
}

.closing-wallpaper span {
    font-family: "Alfa Slab One", serif;
    font-size: clamp(2rem, 6vw, 5rem);
    text-transform: lowercase;
    color: var(--winter-charcoal);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
}

.closing-wallpaper span:nth-child(even) {
    transform: rotate(-4deg);
}
.closing-wallpaper span:nth-child(3n) {
    transform: rotate(3deg);
    opacity: 0.7;
}

.closing-center {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.4rem;
}

.closing-crystal {
    width: 260px;
    height: 260px;
    animation: crystal-spin 60s linear infinite;
    filter: drop-shadow(0 8px 24px rgba(44, 62, 80, 0.12));
}

.closing-meta {
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-weight: 500;
    font-size: 0.82rem;
    letter-spacing: 0.4em;
    color: var(--slate-teal);
    text-transform: uppercase;
}

.closing-sub {
    font-family: "Source Serif 4", serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--frozen-berry);
    letter-spacing: 0.06em;
}

/* =========================================================
   UI overlays — progress, meta, crystal home
   ========================================================= */
#progress-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(200, 214, 224, 0.4);
    z-index: 50;
}

#progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--cool-mist), var(--slate-teal));
    transition: width 0.1s linear;
}

#panel-meta {
    position: fixed;
    top: 2rem;
    right: 2.4rem;
    z-index: 50;
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    color: var(--slate-teal);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: rgba(232, 237, 242, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.meta-label { color: var(--mountain-dusk); }
.meta-sep   { color: var(--mountain-dusk); opacity: 0.6; }
#panel-current { color: var(--winter-charcoal); font-weight: 600; font-size: 0.95rem; }
#panel-total   { color: var(--mountain-dusk); }

#crystal-home {
    position: fixed;
    top: 1.8rem;
    left: 1.8rem;
    z-index: 60;
    width: 56px;
    height: 56px;
    background: rgba(232, 237, 242, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 102, 112, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.4s var(--spring-ease), background 0.3s ease;
}

#crystal-home svg {
    animation: crystal-pulse 3.2s ease-in-out infinite;
}

#crystal-home:hover {
    background: rgba(245, 240, 232, 0.85);
    transform: scale(1.08);
}

@keyframes crystal-pulse {
    0%, 100% { opacity: 0.75; transform: rotate(0deg); }
    50%      { opacity: 1;    transform: rotate(12deg); }
}

#scroll-hint {
    position: fixed;
    bottom: 1.6rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.32em;
    color: var(--slate-teal);
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    background: rgba(232, 237, 242, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.hint-arrow {
    animation: hint-slide 2.4s ease-in-out infinite;
    display: inline-block;
    font-size: 1rem;
}

@keyframes hint-slide {
    0%, 100% { transform: translateX(0); opacity: 0.6; }
    50%      { transform: translateX(8px); opacity: 1; }
}

#scroll-hint.is-hidden { opacity: 0; }

/* =========================================================
   Responsive niceties
   ========================================================= */
@media (max-width: 768px) {
    .panel-label { top: 1.4rem; left: 1.4rem; font-size: 0.68rem; }
    #panel-meta { top: 1rem; right: 1rem; font-size: 0.7rem; padding: 0.4rem 0.7rem; }
    #crystal-home { top: 1rem; left: 1rem; width: 44px; height: 44px; }
    #crystal-home svg { width: 30px; height: 30px; }
    .hero-title { font-size: clamp(3rem, 14vw, 6rem); }
    .hero-sub { margin-left: 1rem; }
    .hero-tag { margin-left: 1rem; }
    .poster-head { font-size: 1.4rem; }
    .light-head { font-size: 2rem; }
}
