/* =========================================================
   HHUDDL.com — Y2K Futurism meets Bento-Box
   A sunset timeline you can scroll through
   Interaction IntersectionObserver trigger entry animations.
   ========================================================= */

:root {
    /* Color tokens from DESIGN.md */
    --bg-cream: #FFF5EB;
    --peach: #FFAD85;
    --coral: #FF6F61;
    --sunset-violet: #A855F7;
    --card-white: #FFFFFF;
    --text-primary: #2D1B14;
    --text-secondary: #8B6F73;
    --accent-warm: #FF8C42;
    --accent-cool: #C4A7E7;
    --star-gold: #FFD166;
    --blush: #F2C4CE;
    --deep-plum: #3B0F2E;

    /* Gradients */
    --grad-sunset: linear-gradient(135deg, #FFAD85, #FF6F61, #A855F7);
    --grad-warm-glow: radial-gradient(circle at 30% 40%, #FFD166 0%, #FFAD85 40%, #FF6F61 100%);
    --grad-twilight: linear-gradient(180deg, #FFF5EB, #F2C4CE, #C4A7E7, #3B0F2E);

    /* Springy curve */
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Star clip-path */
    --star-clip: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', 'Inter', system-ui, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--grad-twilight);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* =========================================================
   Constellation overlay (big SVG behind cells)
   ========================================================= */
.constellation-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    opacity: 0.55;
}

/* =========================================================
   Pill Nav
   ========================================================= */
.pill-nav {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 14px 10px 18px;
    background: rgba(255, 245, 235, 0.55);
    border: 1.5px solid rgba(242, 196, 206, 0.8);
    border-radius: 999px;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 50;
    transition: padding 320ms var(--spring), background 320ms ease, backdrop-filter 320ms ease, transform 320ms var(--spring), top 320ms var(--spring);
    box-shadow: 0 10px 30px rgba(255, 111, 97, 0.12);
}

.pill-nav.scrolled {
    padding: 6px 10px 6px 12px;
    top: 10px;
    background: rgba(255, 245, 235, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px rgba(59, 15, 46, 0.14);
}

.pill-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-family: 'Quicksand', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.logo-star {
    width: 18px;
    height: 18px;
    background: var(--star-gold);
    clip-path: var(--star-clip);
    display: inline-block;
    animation: star-pulse 2.4s ease-in-out infinite;
}

.logo-text {
    font-size: 1.05rem;
    letter-spacing: 0.06em;
}

.pill-links {
    display: flex;
    gap: 4px;
}

.pill-link {
    text-decoration: none;
    color: var(--text-primary);
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 999px;
    transition: background 220ms ease, color 220ms ease, transform 220ms var(--spring);
}

.pill-link:hover {
    background: rgba(255, 141, 66, 0.18);
    color: var(--deep-plum);
    transform: translateY(-1px);
}

.pill-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--grad-sunset);
    color: #fff;
    text-decoration: none;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 9px 16px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(255, 111, 97, 0.35);
    transition: transform 260ms var(--spring), box-shadow 260ms ease;
}

.pill-cta:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 26px rgba(168, 85, 247, 0.45);
}

.cta-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FFD166;
    box-shadow: 0 0 10px #FFD166, 0 0 20px rgba(255, 209, 102, 0.6);
    animation: pulse-dot 1.8s ease-in-out infinite;
}

/* =========================================================
   Chapter + Grid foundations
   ========================================================= */
.chapter {
    position: relative;
    padding: 92px 14px 34px;
    z-index: 2;
}

.chapter-header {
    max-width: 1440px;
    margin: 0 auto 18px;
    padding: 0 6px;
    display: flex;
    align-items: baseline;
    gap: 18px;
    flex-wrap: wrap;
}

.chapter-number {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--coral);
    padding: 4px 12px;
    border: 1.5px solid var(--blush);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
}

.chapter-title {
    font-family: 'Quicksand', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.4vw, 1.85rem);
    letter-spacing: -0.01em;
    color: var(--deep-plum);
}

.dark-header .chapter-title {
    color: #fff;
    text-shadow: 0 2px 18px rgba(59, 15, 46, 0.5);
}

.dark-header .chapter-number {
    color: var(--star-gold);
    border-color: rgba(255, 209, 102, 0.6);
    background: rgba(59, 15, 46, 0.35);
}

.bento-grid {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 12px;
}

/* Span helpers */
.span-1x1 { grid-column: span 1; grid-row: span 1; }
.span-2x1 { grid-column: span 2; grid-row: span 1; }
.span-3x1 { grid-column: span 3; grid-row: span 1; }
.span-4x1 { grid-column: span 4; grid-row: span 1; }
.span-1x2 { grid-column: span 1; grid-row: span 2; }
.span-2x2 { grid-column: span 2; grid-row: span 2; }
.span-3x2 { grid-column: span 3; grid-row: span 2; }

/* =========================================================
   Bento cell base
   ========================================================= */
.bento-cell {
    position: relative;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid rgba(242, 196, 206, 0.7);
    border-radius: 24px;
    padding: 22px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(255, 111, 97, 0.12);
    transition: transform 300ms var(--spring), box-shadow 300ms ease, border-color 300ms ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    isolation: isolate;
}

/* Reveal-state defaults (JS flips .visible) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms ease, transform 600ms var(--spring), box-shadow 300ms ease, border-color 300ms ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hover lift — applies AFTER reveal */
.reveal.visible:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 22px 44px rgba(255, 111, 97, 0.28);
    border-color: rgba(255, 141, 66, 0.8);
}

.cell-label {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 245, 235, 0.7);
    border: 1px solid rgba(242, 196, 206, 0.8);
    align-self: flex-start;
    width: fit-content;
    z-index: 2;
}

.light-label {
    color: #fff;
    background: rgba(59, 15, 46, 0.35);
    border-color: rgba(255, 209, 102, 0.4);
}

.cell-heading {
    font-family: 'Quicksand', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.55rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--deep-plum);
}

.cell-heading.small-h {
    font-size: 1.2rem;
}

.light-h {
    color: #fff;
    text-shadow: 0 2px 14px rgba(59, 15, 46, 0.6);
}

.cell-body {
    font-size: 1rem;
    color: var(--text-primary);
}

.cell-body-sm {
    font-size: 0.94rem;
    color: var(--text-primary);
}

.light-b {
    color: rgba(255, 245, 235, 0.92);
}

.micro {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.micro-badge {
    align-self: flex-end;
    margin-top: auto;
}

.eyebrow {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 245, 235, 0.85);
    padding: 4px 10px;
    background: rgba(59, 15, 46, 0.3);
    border: 1px solid rgba(255, 209, 102, 0.45);
    border-radius: 999px;
    width: fit-content;
}

/* =========================================================
   HERO bento cell
   ========================================================= */
.hero-chapter {
    padding-top: 104px;
}

.hero-main {
    min-height: 560px;
    padding: 38px 40px;
    background: #3B0F2E;
    border-color: rgba(255, 173, 133, 0.4);
    color: #fff;
    position: relative;
}

.hero-gradient-bg {
    position: absolute;
    inset: 0;
    background: var(--grad-sunset);
    background-size: 400% 400%;
    animation: gradientShift 12s ease-in-out infinite;
    z-index: 0;
}

.hero-gradient-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 20%, rgba(255, 209, 102, 0.55), transparent 55%),
                radial-gradient(ellipse at 20% 90%, rgba(168, 85, 247, 0.45), transparent 55%);
    mix-blend-mode: soft-light;
}

.hero-star-field {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.collage-frames {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.collage-frame {
    position: absolute;
    border-radius: 22px;
    box-shadow: 8px 8px 24px rgba(59, 15, 46, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.35);
    mix-blend-mode: soft-light;
}

.frame-a {
    width: 220px;
    height: 160px;
    right: 6%;
    top: 12%;
    background: linear-gradient(135deg, #FFD166, #FFAD85);
    transform: rotate(4deg);
}

.frame-b {
    width: 180px;
    height: 220px;
    right: 22%;
    top: 42%;
    background: linear-gradient(160deg, #F2C4CE, #C4A7E7);
    transform: rotate(-3deg);
    mix-blend-mode: screen;
}

.frame-c {
    width: 140px;
    height: 140px;
    right: 4%;
    bottom: 8%;
    background: radial-gradient(circle at 30% 30%, #FFFFFF 0%, #FFD166 40%, #FF6F61 100%);
    transform: rotate(5deg);
    mix-blend-mode: screen;
}

.hero-text {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 62%;
    justify-content: flex-end;
    height: 100%;
}

.hero-title {
    font-family: 'Quicksand', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 0.92;
    color: #fff;
    text-shadow: 0 4px 28px rgba(59, 15, 46, 0.55), 0 0 40px rgba(255, 209, 102, 0.25);
    display: inline-flex;
    flex-wrap: wrap;
}

.hero-word {
    display: inline-block;
    transform-origin: center bottom;
    animation: letter-drop 1200ms var(--spring) both;
}

.hero-h  { animation-delay: 0.05s; }
.hero-h2 { animation-delay: 0.15s; color: #FFD166; }
.hero-u  { animation-delay: 0.25s; }
.hero-d1 { animation-delay: 0.35s; }
.hero-d2 { animation-delay: 0.45s; color: #C4A7E7; }
.hero-l  { animation-delay: 0.55s; }

.hero-sub {
    max-width: 54ch;
    font-size: 1.1rem;
    color: rgba(255, 245, 235, 0.92);
    font-weight: 600;
}

.hero-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

/* Pill badges */
.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.badge-gold {
    background: rgba(255, 209, 102, 0.22);
    border-color: rgba(255, 209, 102, 0.6);
    color: #FFF5EB;
}

.badge-lavender {
    background: rgba(196, 167, 231, 0.25);
    border-color: rgba(196, 167, 231, 0.7);
}

.badge-blush {
    background: rgba(242, 196, 206, 0.45);
    border-color: rgba(242, 196, 206, 0.9);
    color: var(--deep-plum);
}

.badge-plum {
    background: rgba(59, 15, 46, 0.6);
    border-color: rgba(255, 209, 102, 0.55);
    color: #FFD166;
}

/* ==========  Hero small cells ========== */
.hero-clock {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 209, 102, 0.35));
    justify-content: center;
    align-items: flex-start;
}

.clock-face {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.clock-time {
    font-family: 'Quicksand', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 2.3rem;
    letter-spacing: -0.02em;
    color: var(--deep-plum);
    font-variant-numeric: tabular-nums;
}

.clock-meta {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.hero-chrome {
    background: linear-gradient(160deg, rgba(242, 196, 206, 0.6), rgba(196, 167, 231, 0.6));
    justify-content: space-between;
}

.chrome-orb-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb-wrap-sm {
    min-height: 80px;
}

.chrome-orb {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(from 210deg,
        #ffffff 0deg,
        #f4f4f4 40deg,
        #a8a8a8 80deg,
        #f4f4f4 140deg,
        #ffffff 180deg,
        #c0c0c0 220deg,
        #6b6b6b 260deg,
        #c0c0c0 300deg,
        #ffffff 360deg);
    box-shadow:
        inset 6px 6px 14px rgba(255, 255, 255, 0.7),
        inset -6px -8px 18px rgba(59, 15, 46, 0.45),
        0 10px 26px rgba(59, 15, 46, 0.25);
    position: relative;
    animation: orb-spin 10s linear infinite;
}

.chrome-orb::after {
    content: "";
    position: absolute;
    top: 16%;
    left: 22%;
    width: 28%;
    height: 22%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    filter: blur(1px);
}

.chrome-orb.small {
    width: 74px;
    height: 74px;
    animation-duration: 8s;
}

.chrome-orb.big {
    width: 160px;
    height: 160px;
    animation-duration: 14s;
}

.orb-mini {
    width: 44px;
    height: 44px;
    position: absolute;
    top: 18px;
    right: 18px;
    animation: orb-spin 9s linear infinite reverse;
}

.hero-dialup {
    background: linear-gradient(135deg, rgba(255, 141, 66, 0.9), rgba(255, 111, 97, 0.85));
    color: #fff;
    justify-content: space-between;
}

.hero-dialup .cell-label {
    background: rgba(59, 15, 46, 0.3);
    color: #FFF5EB;
    border-color: rgba(255, 209, 102, 0.5);
}

.dialup-viz {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin: 10px 0;
    height: 70px;
}

.dialbar {
    flex: 1;
    background: linear-gradient(180deg, #FFD166, #FFF5EB);
    border-radius: 4px 4px 2px 2px;
    height: var(--h);
    box-shadow: 0 0 10px rgba(255, 209, 102, 0.6);
    animation: dial-beat 1.2s ease-in-out infinite;
}

.dialbar:nth-child(2n)  { animation-delay: 0.15s; }
.dialbar:nth-child(3n)  { animation-delay: 0.3s; }
.dialbar:nth-child(5n)  { animation-delay: 0.45s; }
.dialbar:nth-child(7n)  { animation-delay: 0.6s; }

.hero-dialup .micro {
    color: rgba(255, 245, 235, 0.9);
}

/* =========================================================
   DISCOVERY chapter-specific cells
   ========================================================= */
.cell-collage {
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.92), rgba(242, 196, 206, 0.5));
    min-height: 340px;
}

.stacked-frames {
    position: relative;
    flex: 1;
    margin: 6px 0 12px;
    min-height: 170px;
}

.s-frame {
    position: absolute;
    border-radius: 18px;
    box-shadow: 6px 6px 18px rgba(255, 111, 97, 0.28);
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.s-frame-1 {
    width: 58%;
    height: 72%;
    left: 4%;
    top: 12%;
    background: linear-gradient(140deg, #FFAD85, #FF6F61);
    transform: rotate(-4deg);
}

.s-frame-2 {
    width: 42%;
    height: 58%;
    right: 8%;
    top: 6%;
    background: linear-gradient(150deg, #FFD166, #FF8C42);
    transform: rotate(3deg);
}

.s-frame-3 {
    width: 40%;
    height: 40%;
    right: 18%;
    bottom: 6%;
    background: linear-gradient(160deg, #C4A7E7, #F2C4CE);
    transform: rotate(-2deg);
}

.sticker {
    position: absolute;
    font-size: 1.4rem;
    filter: drop-shadow(2px 2px 4px rgba(59, 15, 46, 0.3));
    animation: float 4.5s ease-in-out infinite;
}

.sticker-gold {
    top: -8px;
    right: 28%;
    color: var(--star-gold);
    animation-delay: 0.3s;
}

.sticker-pink {
    bottom: -2px;
    left: 18%;
    color: #FF6F61;
    animation-delay: 1.2s;
}

.cell-text {
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.94), rgba(255, 245, 235, 0.85));
    justify-content: space-between;
}

.cell-text em {
    font-style: normal;
    background: linear-gradient(120deg, #FF8C42, #A855F7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

.cell-gradient {
    background: var(--grad-warm-glow);
    background-size: 300% 300%;
    animation: gradientShift 14s ease-in-out infinite;
    justify-content: space-between;
}

.gradient-panel {
    flex: 1;
    border-radius: 16px;
    margin: 6px 0 0;
    min-height: 110px;
    box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.25), 0 6px 18px rgba(255, 111, 97, 0.3);
    position: relative;
    overflow: hidden;
}

.panel-peach {
    background: linear-gradient(135deg, #FFD166 0%, #FFAD85 40%, #FF6F61 75%, #A855F7 100%);
    background-size: 200% 200%;
    animation: gradientShift 10s ease-in-out infinite;
}

.panel-peach::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55), transparent 60%);
    mix-blend-mode: soft-light;
}

.cell-stars {
    background: linear-gradient(150deg, rgba(59, 15, 46, 0.88), rgba(168, 85, 247, 0.65));
    color: #fff;
    justify-content: space-between;
    min-height: 200px;
}

.cell-stars .cell-label {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 245, 235, 0.92);
    border-color: rgba(255, 209, 102, 0.4);
}

.cell-stars .micro {
    color: rgba(255, 245, 235, 0.85);
}

.star-lane {
    position: relative;
    flex: 1;
    min-height: 100px;
}

.cell-pixels {
    background: linear-gradient(170deg, rgba(196, 167, 231, 0.25), rgba(242, 196, 206, 0.4));
    min-height: 340px;
    justify-content: space-between;
}

.pixel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
}

.pixel-grid span {
    aspect-ratio: 1;
    background: var(--star-gold);
    border-radius: 2px;
    box-shadow:
        0 0 0 1px rgba(255, 141, 66, 0.4),
        0 0 8px rgba(255, 209, 102, 0.7);
    animation: pixel-pop 2.8s ease-in-out infinite;
}

.pixel-grid span:nth-child(odd) {
    background: #FF8C42;
    animation-delay: 0.4s;
}

.pixel-grid span:nth-child(3n) {
    background: #C4A7E7;
    animation-delay: 0.8s;
}

.pixel-grid span:nth-child(5n) {
    background: #F2C4CE;
    animation-delay: 1.2s;
}

.cell-orb {
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(196, 167, 231, 0.35));
    align-items: flex-start;
    justify-content: space-between;
}

/* =========================================================
   IMMERSION chapter (decorative)
   ========================================================= */
.immersion-chapter {
    padding-top: 110px;
}

.deco-cell {
    min-height: 220px;
}

.gradient-shift {
    background: var(--grad-sunset);
    background-size: 400% 400%;
    animation: gradientShift 12s ease-in-out infinite;
    overflow: hidden;
}

.gradient-shift .shift-layer {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 60% 40%, rgba(255, 209, 102, 0.55), transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(196, 167, 231, 0.55), transparent 55%);
    mix-blend-mode: screen;
    animation: slow-drift 16s ease-in-out infinite alternate;
}

.orb-stage {
    background: linear-gradient(160deg, rgba(59, 15, 46, 0.88), rgba(168, 85, 247, 0.4));
    align-items: center;
    justify-content: center;
}

.orb-stage .cell-label {
    position: absolute;
    bottom: 14px;
    left: 14px;
}

.glass-cell {
    background: rgba(255, 255, 255, 0.22);
    border: 2px solid rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
    position: relative;
}

.glass-inner {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.glass-cell::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.25), rgba(168, 85, 247, 0.25));
    pointer-events: none;
}

.glass-cell .cell-label {
    position: absolute;
    bottom: 14px;
    left: 14px;
    z-index: 2;
}

.constellation-cell {
    background: linear-gradient(150deg, rgba(59, 15, 46, 0.9), rgba(168, 85, 247, 0.45));
    min-height: 220px;
    overflow: hidden;
    position: relative;
}

.inline-const {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.9;
    pointer-events: none;
}

.constellation-cell .cell-label {
    position: absolute;
    bottom: 14px;
    left: 14px;
    text-transform: none;
    letter-spacing: 0.04em;
}

.constellation-cell .cell-label em {
    font-style: italic;
    color: var(--star-gold);
}

/* =========================================================
   CONNECTION chapter
   ========================================================= */
.connection-chapter {
    padding-top: 110px;
}

.cell-deep {
    background: linear-gradient(160deg, #3B0F2E, #A855F7 160%);
    border-color: rgba(255, 209, 102, 0.35);
    color: #fff;
    min-height: 220px;
    justify-content: space-between;
}

.cell-deep .hero-chips {
    margin-top: 14px;
}

.cell-guestbook {
    background: linear-gradient(170deg, #3B0F2E, #A855F7);
    border-color: rgba(255, 209, 102, 0.45);
    color: #fff;
    min-height: 460px;
    justify-content: space-between;
}

.cell-guestbook .cell-label {
    background: rgba(255, 209, 102, 0.18);
    color: var(--star-gold);
    border-color: rgba(255, 209, 102, 0.55);
}

.guest-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    flex: 1;
    overflow: hidden;
}

.guest-list li {
    display: grid;
    grid-template-columns: 24px 60px 1fr;
    gap: 8px;
    align-items: baseline;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.88rem;
    transition: background 260ms ease, transform 260ms var(--spring);
}

.guest-list li:hover {
    background: rgba(255, 209, 102, 0.18);
    transform: translateX(3px);
}

.gb-star {
    color: var(--star-gold);
    font-size: 1rem;
}

.gb-init {
    font-family: 'Quicksand', 'Inter', sans-serif;
    font-weight: 700;
    color: var(--star-gold);
    letter-spacing: 0.04em;
}

.gb-note {
    color: rgba(255, 245, 235, 0.88);
    font-style: italic;
}

.sign-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #FFD166, #FF8C42);
    color: var(--deep-plum);
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 10px 16px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(255, 141, 66, 0.4);
    transition: transform 260ms var(--spring), box-shadow 260ms ease;
    margin-top: 12px;
    align-self: flex-start;
}

.sign-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 14px 28px rgba(255, 209, 102, 0.55);
}

.webring {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.ring-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 209, 102, 0.3);
    border: 1.5px solid rgba(255, 209, 102, 0.6);
    transition: transform 300ms var(--spring), background 300ms ease;
}

.ring-dot.active {
    background: var(--star-gold);
    box-shadow: 0 0 12px var(--star-gold), 0 0 24px rgba(255, 209, 102, 0.65);
    transform: scale(1.35);
}

.cell-mixtape {
    position: relative;
    overflow: hidden;
}

.tape-spools {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex: 1;
    margin: 10px 0;
}

.spool {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #3B0F2E 0%, #3B0F2E 20%, #FFD166 21%, #FFD166 24%, #3B0F2E 25%),
        conic-gradient(from 0deg, #6b6b6b, #c0c0c0, #6b6b6b, #c0c0c0, #6b6b6b);
    background-blend-mode: normal;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5), 0 6px 18px rgba(59, 15, 46, 0.5);
    position: relative;
    animation: orb-spin 3.5s linear infinite;
}

.spool::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    background: radial-gradient(circle, var(--star-gold), #FF8C42);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 209, 102, 0.7);
}

.cell-sunset {
    overflow: hidden;
    justify-content: flex-end;
    min-height: 180px;
    position: relative;
}

.sunset-bars {
    position: absolute;
    inset: 0;
    display: flex;
}

.sunset-bars span {
    flex: 1;
    height: 100%;
}

.sunset-bars span:nth-child(1) { background: #FFF5EB; }
.sunset-bars span:nth-child(2) { background: #FFD166; }
.sunset-bars span:nth-child(3) { background: #FFAD85; }
.sunset-bars span:nth-child(4) { background: #FF8C42; }
.sunset-bars span:nth-child(5) { background: #FF6F61; }
.sunset-bars span:nth-child(6) { background: #C4A7E7; }
.sunset-bars span:nth-child(7) { background: #A855F7; }
.sunset-bars span:nth-child(8) { background: #3B0F2E; }

.cell-sunset .cell-label,
.cell-sunset .cell-body {
    position: relative;
    z-index: 2;
}

.cell-sunset .cell-body {
    background: rgba(59, 15, 46, 0.55);
    padding: 10px 14px;
    border-radius: 16px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-self: flex-start;
    max-width: 80%;
}

/* =========================================================
   Stars (decorative element everywhere)
   ========================================================= */
.star {
    position: absolute;
    width: var(--size, 18px);
    height: var(--size, 18px);
    left: var(--x, 50%);
    top: var(--y, 50%);
    clip-path: var(--star-clip);
    animation: star-pulse 3s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    pointer-events: none;
    z-index: 2;
}

.star-gold {
    background: var(--star-gold);
    filter: drop-shadow(0 0 6px rgba(255, 209, 102, 0.7));
}

.star-lavender {
    background: var(--accent-cool);
    filter: drop-shadow(0 0 6px rgba(196, 167, 231, 0.7));
}

.star.floating {
    animation: star-pulse 3s ease-in-out infinite, float 5s ease-in-out infinite;
}

/* =========================================================
   Farewell footer (deep twilight)
   ========================================================= */
.farewell {
    position: relative;
    margin-top: 12px;
    padding: 120px 24px 60px;
    background: linear-gradient(180deg, #A855F7 0%, #3B0F2E 70%, #1a0717 100%);
    color: #fff;
    text-align: center;
    overflow: hidden;
    border-radius: 32px 32px 0 0;
    z-index: 2;
}

.farewell::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 0%, rgba(255, 111, 97, 0.45), transparent 55%),
        radial-gradient(ellipse at 70% 10%, rgba(255, 141, 66, 0.35), transparent 60%);
    pointer-events: none;
}

.farewell-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.farewell-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.farewell-tag {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--star-gold);
}

.farewell-title {
    font-family: 'Quicksand', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 9vw, 6rem);
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #FFD166, #FFAD85 45%, #C4A7E7 80%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 40px rgba(255, 209, 102, 0.4);
}

.farewell-sub {
    color: rgba(255, 245, 235, 0.85);
    font-size: 1rem;
    max-width: 48ch;
}

.farewell-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

.farewell-links a {
    color: var(--star-gold);
    text-decoration: none;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 209, 102, 0.4);
    transition: background 220ms ease, color 220ms ease;
}

.farewell-links a:hover {
    background: rgba(255, 209, 102, 0.2);
    color: #fff;
}

.farewell-links .dot {
    color: rgba(255, 245, 235, 0.5);
}

.farewell-copy {
    margin-top: 18px;
    color: rgba(255, 245, 235, 0.55);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}

/* =========================================================
   Keyframes
   ========================================================= */
@keyframes star-pulse {
    0%, 100% { opacity: 0.5; transform: scale(0.9); }
    50%      { opacity: 1.0; transform: scale(1.1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50%      { transform: translateY(-12px) rotate(5deg); }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@keyframes pulse-dot {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.3); opacity: 0.7; }
}

@keyframes letter-drop {
    0%   { opacity: 0; transform: translateY(-40px) rotate(-8deg); }
    100% { opacity: 1; transform: translateY(0)     rotate(0deg);  }
}

@keyframes dial-beat {
    0%, 100% { transform: scaleY(0.85); opacity: 0.8; }
    50%      { transform: scaleY(1.2);  opacity: 1; }
}

@keyframes pixel-pop {
    0%, 100% { opacity: 0.5; transform: scale(0.9); }
    50%      { opacity: 1;   transform: scale(1.08); }
}

@keyframes slow-drift {
    0%   { transform: translate(0, 0) scale(1);   }
    100% { transform: translate(-8%, 6%) scale(1.12); }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .span-3x1, .span-4x1, .span-3x2, .span-2x2, .span-2x1 {
        grid-column: span 2;
    }

    .span-1x2 {
        grid-row: span 1;
    }

    .hero-main {
        min-height: 500px;
    }

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

    .pill-links {
        display: none;
    }

    .pill-nav {
        padding: 8px 12px;
    }
}

@media (max-width: 620px) {
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .span-1x1, .span-2x1, .span-3x1, .span-4x1,
    .span-1x2, .span-2x2, .span-3x2 {
        grid-column: span 1;
        grid-row: span 1;
    }

    .chapter {
        padding: 84px 10px 22px;
    }

    .hero-main {
        padding: 28px 24px;
        min-height: 460px;
    }

    .hero-title {
        font-size: 3.2rem;
    }

    .farewell {
        padding: 80px 18px 40px;
    }
}
