/* ============================================================
   Geocities Hello World — style.css
   Retro 1997 aesthetic with modern CSS
   ============================================================ */

/* ---------- CSS Custom Properties (Theme) ---------- */

:root {
    /* Dark theme (default) */
    --bg-primary: #0a0a1a;
    --bg-secondary: #1a0a2e;
    --text-primary: #e0e0ff;
    --text-secondary: #a0a0d0;
    --neon-pink: #ff00ff;
    --neon-cyan: #00ffff;
    --neon-green: #39ff14;
    --neon-yellow: #ffff00;
    --neon-orange: #ff6600;
    --glow-pink: 0 0 10px #ff00ff, 0 0 20px #ff00ff, 0 0 40px #ff00ff;
    --glow-cyan: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 40px #00ffff;
    --glow-green: 0 0 10px #39ff14, 0 0 20px #39ff14;
    --border-style: 3px double var(--neon-cyan);
    --room-bg: rgba(10, 10, 40, 0.85);
    --room-border: inset 2px 2px 4px rgba(0, 255, 255, 0.3);
    --led-bg: #1a0a00;
    --led-digit: #ff3300;
    --led-glow: 0 0 8px #ff3300, 0 0 16px #ff0000;
    --marquee-bg: linear-gradient(90deg, #1a0a2e, #0a0a1a, #1a0a2e);
    --room-inset: inset 2px 2px 5px rgba(0, 0, 0, 0.5),
                  inset -1px -1px 2px rgba(255, 255, 255, 0.05);
    --button-bg: linear-gradient(180deg, #4a0080, #2a0040);
    --button-border: 2px outset #8000ff;
    --button-text: #ffff00;
    --guestbook-bg: rgba(20, 10, 30, 0.9);
    --guestbook-border: 2px solid var(--neon-pink);
    --entry-bg: rgba(40, 20, 60, 0.6);
}

[data-theme="light"] {
    --bg-primary: #fffff0;
    --bg-secondary: #fffacd;
    --text-primary: #2a2a4a;
    --text-secondary: #5a5a7a;
    --neon-pink: #ff69b4;
    --neon-cyan: #4682b4;
    --neon-green: #228b22;
    --neon-yellow: #daa520;
    --neon-orange: #cc7000;
    --glow-pink: 0 0 8px #ff69b4;
    --glow-cyan: 0 0 8px #4682b4;
    --glow-green: 0 0 8px #228b22;
    --border-style: 3px double var(--neon-cyan);
    --room-bg: rgba(255, 255, 245, 0.95);
    --room-border: inset 1px 1px 3px rgba(0, 0, 0, 0.15);
    --led-bg: #f0f0f0;
    --led-digit: #333366;
    --led-glow: none;
    --marquee-bg: linear-gradient(90deg, #fffacd, #fffff0, #fffacd);
    --room-inset: inset 1px 1px 3px rgba(0, 0, 0, 0.1);
    --button-bg: linear-gradient(180deg, #dda0dd, #ba55d3);
    --button-border: 2px outset #da70d6;
    --button-text: #ffffff;
    --guestbook-bg: rgba(255, 250, 240, 0.95);
    --guestbook-border: 2px solid #ff69b4;
    --entry-bg: rgba(245, 240, 230, 0.8);
}

/* ---------- Smooth theme transition ---------- */
:root,
body,
.room,
.marquee-container,
.visitor-footer,
.guestbook-entry {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* ---------- Reset & Base ---------- */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", cursive, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ---------- Starfield Background ---------- */

#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-primary);
}

/* CSS animated starfield using repeating gradients as fallback */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(1px 1px at 10% 20%, var(--neon-cyan) 50%, transparent 100%),
        radial-gradient(1px 1px at 30% 60%, var(--neon-pink) 50%, transparent 100%),
        radial-gradient(1px 1px at 50% 10%, var(--neon-yellow) 50%, transparent 100%),
        radial-gradient(1px 1px at 70% 80%, var(--neon-cyan) 50%, transparent 100%),
        radial-gradient(1px 1px at 90% 40%, var(--neon-green) 50%, transparent 100%),
        radial-gradient(1px 1px at 15% 85%, white 50%, transparent 100%),
        radial-gradient(1px 1px at 85% 15%, var(--neon-pink) 50%, transparent 100%),
        radial-gradient(1px 1px at 45% 45%, white 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 25% 35%, var(--neon-yellow) 50%, transparent 100%),
        radial-gradient(1px 1px at 65% 55%, white 50%, transparent 100%),
        radial-gradient(1px 1px at 5% 50%, var(--neon-cyan) 50%, transparent 100%),
        radial-gradient(1px 1px at 75% 25%, var(--neon-pink) 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 55% 75%, var(--neon-green) 50%, transparent 100%),
        radial-gradient(1px 1px at 35% 95%, white 50%, transparent 100%),
        radial-gradient(1px 1px at 95% 65%, var(--neon-yellow) 50%, transparent 100%);
    animation: starfield-drift 30s linear infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes starfield-drift {
    0% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-20px) translateX(10px); }
    100% { transform: translateY(0) translateX(0); }
}

/* ---------- Marquee ---------- */

.marquee-container {
    background: var(--marquee-bg);
    border-bottom: 2px solid var(--neon-pink);
    overflow: hidden;
    padding: 0.5rem 0;
    position: relative;
    z-index: 10;
}

.marquee {
    display: flex;
    animation: marquee-scroll 20s linear infinite;
    white-space: nowrap;
}

.marquee-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--neon-yellow);
    text-shadow: var(--glow-yellow, 0 0 10px var(--neon-yellow), 0 0 20px var(--neon-orange));
    padding: 0 2rem;
    animation: marquee-bounce 0.6s ease-in-out infinite alternate;
}

@keyframes marquee-scroll {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

@keyframes marquee-bounce {
    0% { transform: translateY(-3px); }
    100% { transform: translateY(3px); }
}

/* ---------- Rooms Grid ---------- */

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.room {
    background: var(--room-bg);
    border: var(--border-style);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--room-inset), 0 0 15px rgba(0, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.room::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--neon-pink),
        var(--neon-cyan),
        var(--neon-green),
        var(--neon-yellow),
        var(--neon-orange),
        var(--neon-pink));
    background-size: 200% 100%;
    animation: rainbow-bar 4s linear infinite;
}

@keyframes rainbow-bar {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.room-title {
    font-size: 1.3rem;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
    margin-bottom: 1rem;
    font-family: "Courier New", monospace;
}

.room p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ---------- Neon Glow Text ---------- */

.neon-glow {
    color: var(--neon-pink);
    text-shadow: var(--glow-pink);
}

/* ---------- Counter / LED Display ---------- */

.counter-display {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--led-bg);
    border: 2px solid var(--neon-orange);
    border-radius: 4px;
}

.counter-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.counter-digits {
    font-family: "Courier New", monospace;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--led-digit);
    text-shadow: var(--led-glow);
    letter-spacing: 0.15em;
    padding: 0.2rem 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.counter-inline {
    color: var(--neon-orange);
    font-family: "Courier New", monospace;
    font-weight: bold;
    text-shadow: var(--led-glow);
}

/* ---------- Retro Buttons ---------- */

.retro-button {
    background: var(--button-bg);
    color: var(--button-text);
    border: var(--button-border);
    padding: 0.6rem 1.2rem;
    font-family: "Comic Sans MS", cursive;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.1s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.retro-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
}

.retro-button:active {
    transform: scale(0.98);
}

.toggle-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

.theme-hint {
    font-size: 0.8rem !important;
    margin-top: 0.5rem;
    font-style: italic;
}

.audio-status {
    font-size: 0.85rem !important;
    margin-top: 0.5rem;
    color: var(--neon-green) !important;
    text-shadow: var(--glow-green);
}

/* ---------- Guestbook ---------- */

.guestbook {
    grid-column: 1 / -1;
    max-width: 100%;
}

.guestbook-entries {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.guestbook-entry {
    background: var(--entry-bg);
    border: 1px solid var(--neon-pink);
    border-left: 4px solid var(--neon-cyan);
    padding: 0.8rem 1rem;
    margin-bottom: 0.8rem;
    border-radius: 4px;
    text-align: left;
    box-shadow: var(--room-inset);
}

.guestbook-entry strong {
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
    font-size: 1rem;
}

.gb-timestamp {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: "Courier New", monospace;
    margin: 0.2rem 0;
}

/* ---------- Footer ---------- */

.visitor-footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 2px solid var(--neon-pink);
    background: linear-gradient(180deg, transparent, var(--bg-secondary));
    position: relative;
    z-index: 1;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.footer-text a {
    color: var(--neon-cyan);
    text-decoration: underline;
}

/* ---------- SVG Icons ---------- */

.construction-icon {
    width: 100px;
    height: 100px;
    margin: 1rem auto;
    display: block;
    animation: construction-bob 2s ease-in-out infinite alternate;
}

@keyframes construction-bob {
    0% { transform: translateY(-5px) rotate(-3deg); }
    100% { transform: translateY(5px) rotate(3deg); }
}

.globe-icon {
    width: 120px;
    height: 120px;
    margin: 1rem auto;
    display: block;
    animation: globe-spin 8s linear infinite;
}

@keyframes globe-spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* ---------- Y2K Bug Banner ---------- */

.y2k-bug {
    background: var(--neon-yellow);
    color: #000000;
    font-family: "Courier New", monospace;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    padding: 0.8rem 1rem;
    border: 3px dashed var(--neon-pink);
    border-radius: 4px;
    margin: 1rem auto;
    max-width: 600px;
    animation: y2k-flash 0.4s ease-in-out infinite alternate;
    box-shadow: 0 0 20px var(--neon-yellow), 0 0 40px var(--neon-pink);
    z-index: 100;
    position: relative;
}

@keyframes y2k-flash {
    0% { background: var(--neon-yellow); }
    100% { background: var(--neon-orange); }
}

/* ---------- Cursor Trail ---------- */

#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.flame-particle {
    position: fixed;
    pointer-events: none;
    width: 16px;
    height: 16px;
    opacity: 1;
    animation: flame-fade 0.8s ease-out forwards;
}

@keyframes flame-fade {
    0% { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(0.3) translateY(-20px); }
}

/* ---------- Y2K Bug Banner ---------- */

.y2k-bug {
    background: repeating-linear-gradient(
        45deg,
        #ffff00,
        #ffff00 10px,
        #000000 10px,
        #000000 20px
    );
    color: #ff0000;
    text-align: center;
    padding: 0.8rem 1rem;
    font-size: 1.4rem;
    font-weight: bold;
    font-family: "Courier New", monospace;
    text-shadow: 2px 2px 0 #000;
    border-bottom: 4px solid #ff0000;
    animation: y2k-flash 0.5s step-start infinite;
    z-index: 100;
    position: relative;
}

@keyframes y2k-flash {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.7; }
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .rooms-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }

    .marquee-text {
        font-size: 1.2rem;
    }

    .room-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .rooms-grid {
        grid-template-columns: 1fr;
        padding: 0.8rem;
    }

    .room {
        padding: 1rem;
    }

    .marquee-text {
        font-size: 1rem;
    }

    .counter-digits {
        font-size: 1.4rem;
    }
}

/* Viewport <320px: horizontal scroll within rooms */
@media (max-width: 319px) {
    .room {
        overflow-x: auto;
        min-width: 0;
    }

    .room-title {
        min-width: fit-content;
    }

    .rooms-grid {
        gap: 0.5rem;
        padding: 0.5rem;
    }
}

/* ---------- Reduced Motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .marquee {
        animation: none;
        justify-content: center;
    }

    .marquee-text {
        animation: none;
    }

    .construction-icon {
        animation: none;
    }

    .globe-icon {
        animation: none;
    }

    body::before {
        animation: none;
    }

    #starfield {
        display: none;
    }

    body {
        background: var(--bg-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Crect width='1' height='1' fill='%23ffffff08'/%3E%3C/svg%3E");
    }
}

/* ---------- Print ---------- */

@media print {
    .marquee-container,
    #cursor-trail,
    #starfield,
    .retro-button {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .room {
        border: 1px solid #333;
        box-shadow: none;
        background: white;
    }
}

/* ============================================================
   Cat Gallery — Masonry Grid + Lightbox Styles
   ============================================================ */

/* ---------- Cat Gallery Room ---------- */

.cat-gallery-room {
    grid-column: 1 / -1;
    max-width: 100%;
}

.cat-gallery {
    columns: 3;
    column-gap: 12px;
    margin-top: 1rem;
}

@media (max-width: 767px) {
    .cat-gallery {
        columns: 2;
    }
}

@media (max-width: 479px) {
    .cat-gallery {
        columns: 1;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ---------- Cat Item Card ---------- */

.cat-item {
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--room-bg);
    border: 2px solid rgba(0, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    opacity: 0;
    animation: cat-fade-in 0.4s ease forwards;
}

.cat-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--glow-cyan), 0 8px 25px rgba(0, 0, 0, 0.4);
    border-color: var(--neon-cyan);
}

/* Light theme hover adjustment */
[data-theme="light"] .cat-item:hover {
    box-shadow: 0 0 8px #4682b4, 0 8px 20px rgba(0, 0, 0, 0.2);
    border-color: #4682b4;
}

.cat-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: filter 0.2s ease;
}

.cat-item:hover img {
    filter: brightness(1.1);
}

/* ---------- Cat Caption ---------- */

.cat-caption {
    display: block;
    padding: 6px 8px;
    font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", cursive, sans-serif;
    font-size: 0.78rem;
    text-align: center;
    color: var(--text-primary);
    border-bottom: 2px solid var(--neon-pink);
    line-height: 1.3;
}

[data-theme="light"] .cat-caption {
    color: #2a2a4a;
}

/* ---------- Fade-In Animation ---------- */

@keyframes cat-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Placeholder for Failed Images ---------- */

.cat-item.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    background: repeating-linear-gradient(
        45deg,
        #ffff00,
        #ffff00 10px,
        #000000 10px,
        #000000 20px
    );
    border: 2px solid var(--neon-orange);
}

.cat-item.placeholder .placeholder-content {
    text-align: center;
    padding: 1rem;
}

.cat-item.placeholder .placeholder-content svg {
    width: 60px;
    height: 60px;
    display: block;
    margin: 0 auto 0.5rem;
}

.cat-item.placeholder .placeholder-text {
    font-family: "Comic Sans MS", cursive;
    font-size: 0.8rem;
    font-weight: bold;
    color: #000;
    text-shadow: 1px 1px 0 #fff;
}

/* ---------- Lightbox Overlay ---------- */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    cursor: pointer;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border: 3px solid var(--neon-cyan);
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
    cursor: default;
}

[data-theme="light"] .lightbox-image {
    border-color: #4682b4;
    box-shadow: 0 0 20px rgba(70, 130, 180, 0.3);
}

.lightbox-caption {
    margin-top: 1rem;
    font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", cursive, sans-serif;
    font-size: 1rem;
    color: #e0e0ff;
    text-align: center;
    border-bottom: 2px solid var(--neon-pink);
    padding-bottom: 4px;
    cursor: default;
    max-width: 90vw;
}

.lightbox-counter {
    margin-top: 0.4rem;
    font-family: "Courier New", monospace;
    font-size: 0.8rem;
    color: var(--neon-yellow);
    cursor: default;
}

/* ---------- Lightbox Buttons ---------- */

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: var(--neon-pink);
    text-shadow: var(--glow-pink);
    cursor: pointer;
    background: none;
    border: none;
    font-family: "Comic Sans MS", cursive;
    padding: 0.2rem 0.6rem;
    z-index: 10000;
    transition: transform 0.1s;
}

.lightbox-close:hover {
    transform: scale(1.2);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    z-index: 10000;
    transition: transform 0.1s, color 0.1s;
    user-select: none;
}

.lightbox-prev {
    left: 0.5rem;
}

.lightbox-next {
    right: 0.5rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.2);
    color: var(--neon-pink);
}

@media (max-width: 767px) {
    .lightbox-prev,
    .lightbox-next {
        font-size: 1.8rem;
        padding: 0.3rem 0.6rem;
    }

    .lightbox-close {
        font-size: 1.5rem;
        top: 0.5rem;
        right: 0.8rem;
    }

    .lightbox-caption {
        font-size: 0.85rem;
    }
}

/* ---------- Lightbox: Light Theme Adjustments ---------- */

[data-theme="light"] .lightbox-overlay {
    background: rgba(255, 255, 240, 0.95);
}

[data-theme="light"] .lightbox-close {
    color: #ff69b4;
    text-shadow: 0 0 8px #ff69b4;
}

[data-theme="light"] .lightbox-prev,
[data-theme="light"] .lightbox-next {
    color: #4682b4;
    text-shadow: 0 0 8px #4682b4;
}

[data-theme="light"] .lightbox-caption {
    color: #2a2a4a;
}

[data-theme="light"] .lightbox-counter {
    color: #daa520;
}

/* ---------- Reduced Motion: Gallery ---------- */

@media (prefers-reduced-motion: reduce) {
    .cat-item {
        opacity: 1 !important;
        animation: none !important;
    }

    .cat-item,
    .cat-item img {
        transition: none !important;
    }

    .lightbox-overlay {
        transition: none !important;
        opacity: 1 !important;
    }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        transition: none !important;
    }
}
