@import url('https://fonts.googleapis.com/css2?family=Bad+Script&family=Badeen+Display&family=Instrument+Serif:ital@0;1&display=swap');

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* --- BLUR IN ANIMATION FOR MENU --- */
@keyframes blurIn {
    0% {
        opacity: 0;
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes bounce-in-top {
    0% {
        transform: translateY(-500px);
        animation-timing-function: ease-in;
        opacity: 0;
    }

    38% {
        transform: translateY(0);
        animation-timing-function: ease-out;
        opacity: 1;
    }

    55% {
        transform: translateY(-65px);
        animation-timing-function: ease-in;
    }

    72% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }

    81% {
        transform: translateY(-28px);
        animation-timing-function: ease-in;
    }

    90% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }

    95% {
        transform: translateY(-8px);
        animation-timing-function: ease-in;
    }

    100% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }
}

/* --- VARIABLES --- */
:root {
    --logo-nudge: 0%;
}

/* --- GLOBAL STYLES & CUSTOM CURSOR --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Bahianita', cursive;
    background-color: #fcfcfc;
    background-image: radial-gradient(#c5c5c5 1px, transparent 1px);
    background-size: 15px 15px;
    color: #000;
    overflow-x: hidden;
    animation: bgScroll 2s linear infinite;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- UKRYCIE PASKA PRZEWIJANIA --- */
html,
body {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* Internet Explorer oraz starszy Edge */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, nowszy Edge i Opera */
}

.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 25px;
    height: 25px;
    background-color: white;
    border-radius: 50%;
    pointer-events: none;
    mix-blend-mode: difference;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease-out;
}

/* Ukryj kursor tylko po najechaniu na odtwarzacz YouTube (iframe) w rozwiniętym kafelku */
body:has(.bento-item.expanded iframe:hover) .cursor-dot {
    opacity: 0;
}

@keyframes bgScroll {
    0% {
        background-position: 0px 0px;
    }

    100% {
        background-position: 15px 15px;
    }
}

/* --- THEME TOGGLE SWITCH (iOS STYLE) --- */
.theme-switch-wrapper {
    position: fixed;
    top: 25px;
    right: 30px;
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

/* Ukryj przełącznik, gdy otwarty jest kafelek, by nie zasłaniał X-a */
body:has(.bento-item.expanded) .theme-switch-wrapper {
    opacity: 0;
    pointer-events: none;
}

.theme-switch {
    display: inline-block;
    height: 28px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #e5e5e5;
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
    border: 2px solid #d4d4d4;
}

/* --- IKONY I GAŁKA PRZEŁĄCZNIKA --- */
.slider:before,
.slider:after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 2px;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: .4s cubic-bezier(0.4, 0.0, 0.2, 1);
    background-repeat: no-repeat;
    background-position: center;
}

/* SŁOŃCE - Tryb Jasny (domyślny) */
.slider:before {
    background-color: #fff;
    z-index: 2;
    background-size: 13px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cline x1='12' y1='1' x2='12' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='23'/%3E%3Cline x1='4.22' y1='4.22' x2='5.64' y2='5.64'/%3E%3Cline x1='18.36' y1='18.36' x2='19.78' y2='19.78'/%3E%3Cline x1='1' y1='12' x2='3' y2='12'/%3E%3Cline x1='21' y1='12' x2='23' y2='12'/%3E%3Cline x1='4.22' y1='19.78' x2='5.64' y2='18.36'/%3E%3Cline x1='18.36' y1='5.64' x2='19.78' y2='4.22'/%3E%3C/svg%3E");
    opacity: 1;
    background-position: 48% 48%;
}

/* KSIĘŻYC - Tryb Ciemny (ukryty domyślnie) */
.slider:after {
    background-color: #f1f1f1;
    z-index: 3;
    background-size: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333' stroke='none'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
    opacity: 0;
}

input:checked+.slider {
    background-color: #1a1a1a;
    border-color: #333;
}

input:checked+.slider:before {
    transform: translateX(22px);
    opacity: 0;
}

input:checked+.slider:after {
    transform: translateX(22px);
    opacity: 1;
}

/* --- HEADER --- */
#site-header {
    position: fixed;
    left: 0;
    width: 100%;
    top: 50%;
    transform: translateY(calc(-50% - var(--scroll-y, 0px)));
    height: 350px;
    /* Fixed height for centered absolute children */
    z-index: 100;
    pointer-events: none;
    transition: height 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
                background-color 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
                backdrop-filter 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
                border-bottom 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Active transition on top and transform ONLY during a swoop activation */
#site-header.swoop {
    transition: top 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
                height 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
                background-color 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
                backdrop-filter 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
                border-bottom 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#site-header.subpage-mode {
    top: 0;
    transform: translateY(0);
    height: 80px;
    background-color: rgba(252, 252, 252, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode #site-header.subpage-mode {
    background-color: rgba(17, 17, 17, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- LOGO WRAPPER --- */
.logo-container {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    z-index: 2;
    display: flex;
    justify-content: center;
    transition: top 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
        left 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#site-header.subpage-mode .logo-container {
    top: 40%;
    left: 40px;
    transform: translate(0, -50%) scale(0.38);
    transform-origin: left center;
}

.logo-wrapper {
    position: relative;
    display: inline-block;
    pointer-events: none;
}



/* --- ANIMATED CHARACTER CLASS --- */
.logo-char {
    display: inline-block;
    animation: bounce-in-top 1.1s ease-in-out both;
}

/* --- 1. FULL BLACK BACK OBJECT --- */
.coolbatzki-shadow {
    font-family: 'Badeen Display', sans-serif !important;
    font-style: normal;
    font-weight: 400;
    font-size: clamp(40px, 9vw, 129px);
    line-height: 1.4;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
    margin: 0;
    position: relative;
    z-index: 1;
}

.coolbatzki-shadow .logo-char {
    color: #000;
    -webkit-text-stroke: 1px #000;
    text-shadow:
        0 1px 0 #000, 0 2px 0 #000, 0 3px 0 #000, 0 4px 0 #000,
        0 5px 0 #000, 0 6px 0 #000, 0 7px 0 #000, 0 8px 0 #000,
        0 9px 0 #000, 0 10px 0 #000, 0 11px 0 #000, 0 12px 0 #000,
        0 13px 0 #000, 0 14px 0 #000, 0 15px 0 #000;
    transition: color 0.3s, -webkit-text-stroke 0.3s, text-shadow 0.3s;
}

/* --- 2. RAINBOW GRADIENT FRONT OBJECT --- */
.coolbatzki-front {
    font-family: 'Badeen Display', sans-serif !important;
    font-style: normal;
    font-weight: 400;
    font-size: clamp(40px, 9vw, 129px);
    line-height: 1.4;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
    margin: 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.coolbatzki-front .logo-char {
    background: linear-gradient(90deg, rgba(255, 0, 0, 0.15) 0%, rgba(255, 128, 0, 0.15) 14%, rgba(247, 255, 0, 0.15) 28%, rgba(0, 251, 0, 0.15) 42%, rgba(0, 253, 253, 0.15) 56%, rgba(20, 13, 126, 0.15) 73.56%, rgba(255, 0, 221, 0.15) 91.35%), #FFFFFF;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 1px #000;
    background-size: 1000% 100%;
    transition: background 0.3s, -webkit-text-stroke 0.3s;
}

.coolbatzki-front .logo-char:nth-child(1) {
    background-position: 0% 0;
}

.coolbatzki-front .logo-char:nth-child(2) {
    background-position: 11.1% 0;
}

.coolbatzki-front .logo-char:nth-child(3) {
    background-position: 22.2% 0;
}

.coolbatzki-front .logo-char:nth-child(4) {
    background-position: 33.3% 0;
}

.coolbatzki-front .logo-char:nth-child(5) {
    background-position: 44.4% 0;
}

.coolbatzki-front .logo-char:nth-child(6) {
    background-position: 55.5% 0;
}

.coolbatzki-front .logo-char:nth-child(7) {
    background-position: 66.6% 0;
}

.coolbatzki-front .logo-char:nth-child(8) {
    background-position: 77.7% 0;
}

.coolbatzki-front .logo-char:nth-child(9) {
    background-position: 88.8% 0;
}

.coolbatzki-front .logo-char:nth-child(10) {
    background-position: 100% 0;
}

/* --- 3. DESIGN TEXT SHADOW OBJECT --- */
.design-shadow {
    opacity: 0;
    position: absolute;
    right: clamp(-10px, -1.5vw, -20px);
    bottom: clamp(-5px, -1vw, -11px);
    font-family: 'Bad Script', cursive !important;
    font-size: clamp(16px, 3vw, 40px);
    color: #000;
    -webkit-text-stroke: 4px #000;
    transform: rotate(-12deg);
    z-index: 3;
    animation: fadeIn 0.5s ease-in-out forwards;
    animation-delay: 1.6s;
    transition: color 0.3s, -webkit-text-stroke 0.3s;
}

/* --- 4. DESIGN TEXT FRONT OBJECT --- */
.design-front {
    opacity: 0;
    position: absolute;
    right: clamp(-10px, -1.5vw, -20px);
    bottom: clamp(-5px, -1vw, -10px);
    font-family: 'Bad Script', cursive !important;
    font-size: clamp(16px, 3vw, 40px);
    color: #fff;
    -webkit-text-stroke: 0px #000;
    transform: rotate(-12deg);
    z-index: 4;
    animation: fadeIn 0.5s ease-in-out forwards;
    animation-delay: 1.4s;
    transition: color 0.3s;
}



/* --- NAVIGATION STYLES --- */
.nav-menu {
    position: absolute;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 20px;
    opacity: 0;
    filter: blur(10px);
    animation: blurIn 1s ease-out forwards;
    animation-delay: 1.5s;
    transition: top 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
        left 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
        filter 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#site-header.subpage-mode .nav-menu {
    top: 50%;
    /* Dynamically computed left boundary to sit precisely next to the scaled logo without overlapping */
    left: calc(115px + clamp(80px, 18vw, 258px));
    transform: translate(0, -50%);
    opacity: 1;
    filter: blur(0);
    gap: 15px;
}

.nav-line {
    height: 2px;
    width: 50px;
    background-color: #000;
    margin-top: 5px;
    transition: width 0.7s, background-color 0.3s;
}

#site-header.subpage-mode .nav-line {
    width: 30px;
}

.nav-link {
    text-decoration: none;
    color: #000;
    font-size: 2.5rem;
    letter-spacing: 1px;
    display: inline-flex;
    transition: transform 0.2s, color 0.3s;
}

#site-header.subpage-mode .nav-link {
    font-size: 2rem;
}

.nav-link:hover {
    transform: translateY(-3px);
}

.nav-link:active {
    transform: translateY(2px) scale(0.95);
}

.char {
    display: inline-block;
    transition: -webkit-text-stroke 0.2s, font-weight 0.2s, color 0.3s;
}

.nav-link:hover .char,
.sidebar-nav-link:hover .char {
    color: #777;
}

.char.bold-char {
    -webkit-text-stroke: 1.5px #000;
}

/* --- MAIN CONTENT & PAGES --- */
#main-content {
    position: relative;
    width: 100%;
    padding-top: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Sekcja powitalna na pełen ekran */
.hero-spacer {
    min-height: 65vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

#work-page {
    opacity: 0;
    filter: blur(10px);
    transition: opacity 0.2s ease-out, filter 0.2s ease-out;
}

.page-section {
    width: 100%;
    max-width: 1200px;
    padding: 120px 20px 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* --- BENTO GRID SYSTEM --- */
.bento-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.2fr;
    grid-template-rows: 180px 180px 300px 180px 180px 300px;
    gap: 20px;
    width: 100%;
}

.bento-item {
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    background-color: #111;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 0.3s ease,
        top 0.5s cubic-bezier(0.8, 0, 0.2, 1),
        left 0.5s cubic-bezier(0.8, 0, 0.2, 1),
        width 0.5s cubic-bezier(0.8, 0, 0.2, 1),
        height 0.5s cubic-bezier(0.8, 0, 0.2, 1),
        background-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.bento-item:hover:not(.expanded) {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.bento-item:active:not(.expanded) {
    transform: translateY(2px) scale(0.98);
}

/* --- VIDEO & PREVIEW STYLES --- */
.bento-preview {
    width: 100%;
    height: 100%;
    position: relative;
    background-size: cover;
    background-position: center;
    background-color: #333;
    transition: height 0.5s cubic-bezier(0.8, 0, 0.2, 1);
    flex: none;
    overflow: hidden;
}

.bento-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 0;
}

.bento-video:fullscreen {
    object-fit: contain !important;
    background-color: #000 !important;
}

.bento-video:-webkit-full-screen {
    object-fit: contain !important;
    background-color: #000 !important;
}

.bento-video:-moz-full-screen {
    object-fit: contain !important;
    background-color: #000 !important;
}

.bento-video:-ms-fullscreen {
    object-fit: contain !important;
    background-color: #000 !important;
}

.bento-item.expanded .bento-video {
    pointer-events: auto;
}

.bento-preview iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    aspect-ratio: 16 / 9;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    border: none;
    pointer-events: none;
    z-index: 0;
}

.bento-item.expanded .bento-preview iframe {
    pointer-events: auto;
}

/* Portrait video specific aspect ratio override for 'Just Chill' */
.item-1 .bento-preview iframe,
.item-2 .bento-preview iframe,
.item-3 .bento-preview iframe {
    aspect-ratio: 9 / 16;
}

/* While expanded but not active (i.e. showing the cropped preview), keep cover behavior */
.bento-item.expanded:not(.player-active).item-1 .bento-preview iframe,
.bento-item.expanded:not(.player-active).item-2 .bento-preview iframe,
.bento-item.expanded:not(.player-active).item-3 .bento-preview iframe {
    aspect-ratio: 9 / 16;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
}

/* For portrait videos, when expanded and player is active, we show the full video height and center it, not crop it */
.bento-item.expanded.player-active.item-1 .bento-preview iframe,
.bento-item.expanded.player-active.item-2 .bento-preview iframe,
.bento-item.expanded.player-active.item-3 .bento-preview iframe {
    min-width: unset;
    min-height: unset;
    width: auto;
    height: 100%;
}

/* Custom styles for the play button overlay in the expanded preview state */
.bento-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, background-color 0.3s ease;
}

/* Show play overlay ONLY when item is expanded and player is NOT active */
.bento-item.expanded:not(.player-active) .bento-play-overlay {
    opacity: 1;
    pointer-events: auto;
}

.play-btn-circle {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease, border-color 0.3s ease;
    margin-bottom: 12px;
}

.play-icon {
    width: 28px;
    height: 28px;
    color: #fff;
    transform: translateX(2px);
    transition: transform 0.3s ease;
}

.play-text {
    font-size: 1.8rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.bento-play-overlay:hover .play-btn-circle {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
}

.bento-play-overlay:hover .play-text {
    opacity: 1;
    transform: translateY(2px);
}

/* Prevent pointer events on the iframe inside the expanded preview before activation to allow overlay click */
.bento-item.expanded:not(.player-active) .bento-preview iframe {
    pointer-events: none !important;
}

/* Enable pointer events once the player becomes active */
.bento-item.expanded.player-active .bento-preview iframe {
    pointer-events: auto !important;
}



/* TILE GRID PLACEMENTS */
.item-1 {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.item-2 {
    grid-column: 2;
    grid-row: 1;
}

.item-3 {
    grid-column: 2;
    grid-row: 2;
}

.item-4 {
    grid-column: 3;
    grid-row: 1 / span 2;
}

.item-5 {
    grid-column: 1;
    grid-row: 3;
}

.item-6 {
    grid-column: 2;
    grid-row: 3;
}

.item-7 {
    grid-column: 3;
    grid-row: 3;
}

.item-8 {
    grid-column: 1;
    grid-row: 4 / span 2;
}

.item-9 {
    grid-column: 2;
    grid-row: 4;
}

.item-10 {
    grid-column: 2;
    grid-row: 5;
}

.item-11 {
    grid-column: 3;
    grid-row: 4 / span 2;
}

.item-12 {
    grid-column: 1;
    grid-row: 6;
}

.item-13 {
    grid-column: 2;
    grid-row: 6;
}

.item-14 {
    grid-column: 3;
    grid-row: 6;
}

/* PREVIEW COLORS */
.item-1 .bento-preview {
    background-color: #ff8b73;
}

.item-2 .bento-preview {
    background-color: #4a4a4a;
}

.item-3 .bento-preview {
    background-color: #ffcc00;
}

.item-4 .bento-preview {
    background-color: #000000;
}

.item-5 .bento-preview {
    background-color: #1b4b5a;
}

.item-6 .bento-preview {
    background-color: #6a7c64;
}

.item-7 .bento-preview {
    background-color: #111111;
}

.item-8 .bento-preview {
    background-color: #ff9a76;
}

.item-9 .bento-preview {
    background-color: #7b6a9a;
}

.item-10 .bento-preview {
    background-color: #e5b25d;
}

.item-11 .bento-preview {
    background-color: #2c3e50;
}

.item-12 .bento-preview {
    background-color: #4b8b7a;
}

.item-13 .bento-preview {
    background-color: #9b5a6b;
}

.item-14 .bento-preview {
    background-color: #5b7c8a;
}

/* --- EXPANDED STATE --- */
.bento-item.expanded {
    transform: none !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7) !important;
    z-index: 50;
}

.bento-item.expanded .bento-preview {
    height: 60%;
    background-color: transparent !important;
}

.bento-item.expanded .bento-overlay {
    opacity: 0 !important;
    pointer-events: none;
}

/* --- BENTO TEXT DETAILS AREA --- */
.bento-details {
    width: 100%;
    height: 0px;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 40px;
    padding-right: 40px;
    opacity: 0;
    overflow: hidden;
    flex: none;

    transition: height 0.5s cubic-bezier(0.8, 0, 0.2, 1),
        padding 0.5s cubic-bezier(0.8, 0, 0.2, 1),
        opacity 0.3s ease;
}

.bento-item.expanded .bento-details {
    padding-top: 40px;
    padding-bottom: 40px;
    opacity: 1;
    transition-delay: 0s, 0s, 0.2s;
}

.bento-details h3 {
    font-family: 'Bahianita', cursive;
    font-size: 4rem;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.bento-details p {
    font-family: sans-serif;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #ddd;
    margin-bottom: 20px;
}

/* --- CLOSE BUTTON --- */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-family: sans-serif;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: opacity 0.3s ease, background-color 0.2s;
}

.bento-item.expanded .close-btn {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0.3s;
}

.close-btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

/* --- PREVIEW OVERLAY --- */
.bento-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 1;
    transition: opacity 0.3s ease, background-color 0.3s;
}

.bento-item:hover:not(.expanded) .bento-overlay {
    opacity: 1;
}

.bento-item.expanded .bento-overlay {
    opacity: 0 !important;
    pointer-events: none;
}

.bento-overlay h2 {
    color: #000;
    font-size: 3.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transform: translateY(15px);
    transition: transform 0.3s ease, color 0.3s;
}

.bento-item:hover:not(.expanded) .bento-overlay h2 {
    transform: translateY(0);
}

.placeholder-content {
    text-align: center;
    padding-top: 40px;
    transition: color 0.3s;
}

.placeholder-content h2 {
    font-size: 5rem;
    margin-bottom: 10px;
}

.placeholder-content p {
    font-size: 2rem;
    color: #666;
    font-family: sans-serif;
    transition: color 0.3s;
}

/* --- ABOUT PAGE STYLES --- */
.about-content {
    max-width: 1000px;
    width: 100%;
    background-color: #fff;
    border: 1px solid #eaeaea;
    border-radius: 15px;
    padding: 60px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: left;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.8s ease-in-out;
}

.about-layout {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-photo-placeholder {
    flex-shrink: 0;
    width: 250px;
    height: 250px;
    background-color: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.about-photo-placeholder::after {
    content: 'PHOTO';
    font-family: 'Bahianita', cursive;
    font-size: 3rem;
    color: #bbb;
    position: absolute;
    pointer-events: none;
    transition: color 0.3s ease;
}

.about-photo-placeholder img[src]:not([src=""]) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    background-color: #fff;
}

.about-text h2 {
    font-family: 'Bahianita', cursive;
    font-size: 5rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: #000;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.about-text p {
    font-family: sans-serif;
    font-size: 1.3rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* --- CONTACT PAGE STYLES --- */
.contact-content {
    max-width: 900px;
    width: 100%;
    background-color: #fff;
    border: 1px solid #eaeaea;
    border-radius: 15px;
    padding: 60px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: left;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.8s ease-in-out;
}

.contact-content h2 {
    font-family: 'Bahianita', cursive;
    font-size: 5rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: #000;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.contact-content p {
    font-family: sans-serif;
    font-size: 1.3rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 30px;
    transition: color 0.3s ease;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 30px;
    border-top: 1px solid #eaeaea;
    transition: border-color 0.3s ease;
}

.contact-item {
    font-family: sans-serif;
    font-size: 1.2rem;
    color: #222;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.3s ease, transform 0.2s ease;
}

.contact-item strong {
    width: 100px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: #888;
}

a.contact-item:hover {
    color: #000;
    transform: translateX(5px);
}

a.contact-item:hover strong {
    color: #000;
}

/* ==================================================
   --- DARK MODE STYLES ---
   ================================================== */
body.dark-mode {
    background-color: #111;
    background-image: radial-gradient(#333 1px, transparent 1px);
    color: #fff;
}

body.dark-mode .nav-link {
    color: #fff;
}

body.dark-mode .nav-line {
    background-color: #fff;
}

body.dark-mode .coolbatzki-shadow .logo-char {
    color: #000;
    -webkit-text-stroke: 1px #000;
    text-shadow:
        0 1px 0 #000, 0 2px 0 #000, 0 3px 0 #000, 0 4px 0 #000,
        0 5px 0 #000, 0 6px 0 #000, 0 7px 0 #000, 0 8px 0 #000,
        0 9px 0 #000, 0 10px 0 #000, 0 11px 0 #000, 0 12px 0 #000,
        0 13px 0 #000, 0 14px 0 #000, 0 15px 0 #000;
}

body.dark-mode .coolbatzki-front .logo-char {
    -webkit-text-stroke: 1px #000;
    background-image: linear-gradient(90deg, rgba(255, 0, 0, 0.3) 0%, rgba(255, 128, 0, 0.3) 14%, rgba(247, 255, 0, 0.3) 28%, rgba(0, 251, 0, 0.3) 42%, rgba(0, 253, 253, 0.3) 56%, rgba(20, 13, 126, 0.3) 73.56%, rgba(255, 0, 221, 0.3) 91.35%);
    background-color: #FFFFFF;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 1000% 100%;
}



body.dark-mode .design-shadow {
    color: #fff;
    -webkit-text-stroke: 4px #fff;
}

body.dark-mode .design-front {
    color: #111;
}

body.dark-mode .char.bold-char {
    -webkit-text-stroke: 1.5px #fff;
}

body.dark-mode .nav-link:hover .char {
    color: #888;
}

body.dark-mode .bento-overlay {
    background-color: rgba(0, 0, 0, 0.85);
}

body.dark-mode .bento-overlay h2 {
    color: #fff;
}

body.dark-mode .bento-item {
    background-color: #1a1a1a;
    border: 1px solid #333;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

body.dark-mode .bento-item:hover:not(.expanded) {
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.8);
}

body.dark-mode .placeholder-content p {
    color: #aaa;
}

/* ABOUT PAGE DARK MODE */
body.dark-mode .about-content {
    background-color: #1a1a1a;
    border: 1px solid #333;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

body.dark-mode .about-text h2 {
    color: #fff;
}

body.dark-mode .about-text p {
    color: #ccc;
}

body.dark-mode .about-photo-placeholder {
    background-color: #222;
    border-color: #444;
}

body.dark-mode .about-photo-placeholder::after {
    color: #555;
}

/* CONTACT PAGE DARK MODE */
body.dark-mode .contact-content {
    background-color: #1a1a1a;
    border: 1px solid #333;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

body.dark-mode .contact-content h2 {
    color: #fff;
}

body.dark-mode .contact-content p {
    color: #ccc;
}

body.dark-mode .contact-details {
    border-top-color: #333;
}

body.dark-mode .contact-item {
    color: #ddd;
}

body.dark-mode .contact-item strong {
    color: #666;
}

body.dark-mode a.contact-item:hover {
    color: #fff;
}

body.dark-mode a.contact-item:hover strong {
    color: #fff;
}

/* ================================================== */

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-auto-rows: 250px;
    }

    .bento-item {
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    #site-header {
        height: 250px;
    }

    .logo-container {
        top: 30%;
    }

    .nav-menu {
        top: 70%;
        flex-direction: column;
        gap: 5px;
    }

    .nav-line {
        display: none;
    }

    #site-header.subpage-mode {
        top: 0;
        padding: 0 15px;
        height: 70px;
    }

    #site-header.subpage-mode .logo-container {
        top: 50%;
        left: 15px;
        transform: translate(0, -50%) scale(0.28);
    }

    /* Mobile calc to dynamically position menu to the right of scaled mobile logo without any overlapping */
    #site-header.subpage-mode .nav-menu {
        top: 50%;
        left: calc(48px + clamp(58px, 13vw, 100px));
        transform: translate(0, -50%);
        flex-direction: row;
        gap: 8px;
    }

    #site-header.subpage-mode .nav-link {
        font-size: 1.3rem;
    }

    #main-content {
        padding-top: 0;
    }

    .bento-details {
        padding-left: 20px;
        padding-right: 20px;
    }

    .bento-item.expanded .bento-details {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .theme-switch-wrapper {
        top: 15px;
        right: 15px;
    }

    /* ABOUT PAGE MOBILE */
    .about-content {
        padding: 30px;
    }

    .about-layout {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .about-photo-placeholder {
        width: 200px;
        height: 200px;
    }

    .about-text h2 {
        font-size: 3.5rem;
        margin-bottom: 15px;
    }

    .about-text p {
        font-size: 1.1rem;
        line-height: 1.6;
    }

    /* CONTACT PAGE MOBILE */
    .contact-content {
        padding: 30px;
    }

    .contact-content h2 {
        font-size: 3.5rem;
        margin-bottom: 15px;
    }

    .contact-content p {
        font-size: 1.1rem;
        line-height: 1.6;
        margin-bottom: 20px;
    }

    .contact-details {
        padding-top: 20px;
        gap: 12px;
    }

    .contact-item {
        font-size: 1.1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .contact-item strong {
        width: auto;
        font-size: 0.85rem;
    }
}