:root {
    --bg-color: #111111;
    --text-color: #ffffff;
    --text-muted: #a0a0a0;
    --font-main: 'Nunito Sans', sans-serif;
    --grid-line-color: rgba(255, 255, 255, 0.04); /* 4% opacity white lines */
}

:root[data-theme="light"] {
    --bg-color: #faf9f6;
    --text-color: #111111;
    --text-muted: #555555;
    --grid-line-color: rgba(17, 17, 17, 0.04); /* Subtle 4% opacity dark lines */
}

html[data-theme="light"] body {
    background-image: none;
}

html[data-theme="light"] .navbar-container {
    background-color: rgba(250, 249, 246, 0.75);
    border-bottom: 1px solid rgba(17, 17, 17, 0.06);
}

html[data-theme="light"] .navbar-pill {
    border: none;
    background: transparent;
}

html[data-theme="light"] .site-footer {
    border-top: 1px solid rgba(17, 17, 17, 0.12);
}



html[data-theme="light"] .logo-icon svg path[fill="white"] {
    fill: #111111;
}

html[data-theme="light"] .logo-icon svg path[fill="#1D2A29"],
html[data-theme="light"] .logo-icon svg path[fill="#474F52"],
html[data-theme="light"] .logo-icon svg path[fill="#020006"] {
    fill: var(--bg-color);
}

/* Theme Toggle Button Styling */
.theme-toggle-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    opacity: 0.6;
    transition: opacity 0.3s ease, color 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 50%;
}

.theme-toggle-btn:hover {
    opacity: 1;
    color: var(--text-color);
    transform: scale(1.1);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    display: block;
    stroke-width: 2;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Hide sun icon in light mode, hide moon icon in dark mode */
html[data-theme="light"] .theme-toggle-btn .sun-icon {
    display: none;
}
html:not([data-theme="light"]) .theme-toggle-btn .moon-icon {
    display: none;
}

/* Mobile drawer and divider light mode style */
html[data-theme="light"] .drawer-panel {
    background: #faf9f6;
    border-bottom: 1px solid rgba(17, 17, 17, 0.1);
}

html[data-theme="light"] .drawer-panel a {
    border-bottom: 1px solid rgba(17, 17, 17, 0.06);
}

html[data-theme="light"] .divider {
    color: rgba(17, 17, 17, 0.15);
}

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

html,
body {
    overflow-x: hidden;
    width: 100%;
    cursor: url('Image/cursor.svg') 1 0, auto;
}

/* Custom Hover/Click Cursor override */
a,
button,
select,
input[type="submit"],
input[type="button"],
[role="button"],
.menu-icon,
.grid-item,
.wave-music-btn,
.lock-close-btn,
.lock-unlock-btn {
    cursor: url('Image/hover-cursor.svg') 7 0, pointer !important;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Noise canvas — jittery film grain, fixed behind everything */
#noise-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.04;
}

/* Background grid lines — above noise canvas, below content */
.bg-grid {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-image: 
        linear-gradient(to right, var(--grid-line-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line-color) 1px, transparent 1px);
    background-size: 80px 80px;
    /* Soft vignette mask to fade out the grid lines at the edges */
    mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
}

/* Navbar */
.navbar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background-color: rgba(17, 17, 17, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.navbar-pill {
    display: flex;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 0 80px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes spinOnce {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.logo-icon svg.spin-now {
    animation: spinOnce 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 20px;
    font-weight: 300;
    margin: 0 4px;
}

.greeting {
    font-size: 20px;
    font-weight: 500;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    opacity: 0.6;
    font-weight: 500;
    font-size: 20px;
    transition: opacity 0.3s ease, color 0.3s ease, background-color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-color);
    opacity: 1;
}

.menu-icon {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.menu-icon span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    transition: transform 0.3s ease;
}

.menu-icon.open span:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

.menu-icon.open span:nth-child(2) {
    transform: translateY(-4px) rotate(-45deg);
}

/* Hero Section */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 48px;
    max-width: 1600px;
    margin: 80px auto 0;
    padding: 100px 80px;
    position: relative;
    z-index: 2;
}

.hero-left {
    flex: 1;
}

.hero h1 {
    font-size: 60px;
    font-weight: 600;
    letter-spacing: -2px;
    line-height: 1.15;
    text-align: left;
    margin: 0;
}


.hero-right {
    flex-shrink: 0;
    text-align: right;
}

.hero-right p {
    font-size: 24px;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.5;
    white-space: nowrap;
    margin: 0;
    font-style: italic;
    padding-right: 8px;
}

/* ─── Figma Selection Frame ─── */
.figma-frame-container {
    position: relative;
    border: 1px solid #18A0FB;
    padding: 16px 24px;
    margin: -16px -24px;
    border-radius: 1px;
    box-sizing: border-box;
}

/* Figma Handles */
.figma-handle {
    width: 7px;
    height: 7px;
    background: #FFFFFF;
    border: 1.5px solid #18A0FB;
    position: absolute;
    box-sizing: border-box;
    z-index: 10;
    transform: scale(calc(1 / var(--scale-x, 1)), calc(1 / var(--scale-y, 1)));
}

.figma-handle-tl {
    top: -4px;
    left: -4px;
    cursor: nwse-resize;
    transform-origin: top left;
}

.figma-handle-tr {
    top: -4px;
    right: -4px;
    cursor: nesw-resize;
    transform-origin: top right;
}

.figma-handle-bl {
    bottom: -4px;
    left: -4px;
    cursor: nesw-resize;
    transform-origin: bottom left;
}

.figma-handle-br {
    bottom: -4px;
    right: -4px;
    cursor: nwse-resize;
    transform-origin: bottom right;
}

.figma-frame-container.is-stretching-back,
.figma-frame-container.is-stretching-back .figma-handle,
.figma-frame-container.is-stretching-back .figma-frame-name,
.figma-frame-container.is-stretching-back .figma-frame-code-btn,
.figma-frame-container.is-stretching-back .figma-badge,
.figma-frame-container.is-stretching-back .reveal-meta {
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.4);
}

/* Figma Edges */
.figma-edge {
    position: absolute;
    box-sizing: border-box;
    z-index: 8;
    background: transparent;
}

.figma-edge-t {
    top: -5px;
    left: 4px;
    right: 4px;
    height: 10px;
    cursor: ns-resize;
}

.figma-edge-b {
    bottom: -5px;
    left: 4px;
    right: 4px;
    height: 10px;
    cursor: ns-resize;
}

.figma-edge-l {
    left: -5px;
    top: 4px;
    bottom: 4px;
    width: 10px;
    cursor: ew-resize;
}

.figma-edge-r {
    right: -5px;
    top: 4px;
    bottom: 4px;
    width: 10px;
    cursor: ew-resize;
}

/* Figma Frame Header */
.figma-frame-header {
    position: absolute;
    top: -28px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #18A0FB;
    z-index: 9;
}

.figma-frame-name {
    background: transparent;
    padding: 2px 0;
    white-space: nowrap;
    cursor: text;
    outline: none;
    display: inline-block;
    transform: scale(calc(1 / var(--scale-x, 1)), calc(1 / var(--scale-y, 1)));
    transform-origin: left bottom;
}

.figma-frame-code-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transform: scale(calc(1 / var(--scale-x, 1)), calc(1 / var(--scale-y, 1)));
    transform-origin: right bottom;
}

.figma-frame-code-btn svg {
    display: block;
}

/* Figma Tooltip */
.figma-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    transform: translateY(-4px);
    background: #2C2C2C;
    color: #FFFFFF;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Tooltip arrow pointing up */
.figma-tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 5px;
    border-width: 4px;
    border-style: solid;
    border-color: transparent transparent #2C2C2C transparent;
}

.figma-frame-code-btn:hover .figma-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Figma Dimensions Badge */
.figma-badge {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%) scale(calc(1 / var(--scale-x, 1)), calc(1 / var(--scale-y, 1)));
    transform-origin: center bottom;
    background: #18A0FB;
    color: #FFFFFF;
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 2px;
    white-space: nowrap;
    z-index: 9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

/* ─── Hero Reveal Animations ─── */
.reveal-line {
    display: block;
    overflow: hidden;
}

.reveal-line span {
    display: block;
    transform: translateY(105%);
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.2s ease;
}

.reveal-meta {
    display: block;
    overflow: hidden;
    transform: scale(calc(1 / var(--scale-x, 1)), calc(1 / var(--scale-y, 1)));
    transform-origin: right center;
}

@media (max-width: 768px) {
    .reveal-meta {
        transform-origin: left center;
    }
}

.reveal-meta p {
    transform: translateY(105%);
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.2s ease;
}

.hero.active .reveal-line span,
.hero.active .reveal-meta p {
    transform: translateY(0);
    opacity: 1;
}

/* Stagger delays for Hero elements */
.hero.active .reveal-line:nth-child(1) span {
    transition-delay: 0.15s;
}

.hero.active .reveal-line:nth-child(2) span {
    transition-delay: 0.28s;
}

.hero.active .reveal-line:nth-child(3) span {
    transition-delay: 0.4s;
}

.hero.active .reveal-line:nth-child(4) span {
    transition-delay: 0.52s;
}

.hero.active .reveal-meta:nth-child(1) p {
    transition-delay: 0.65s;
}

.hero.active .reveal-meta:nth-child(2) p {
    transition-delay: 0.75s;
}

.changing-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}

.invisible-placeholder {
    display: inline-grid;
    visibility: hidden;
}

.invisible-placeholder span {
    grid-area: 1 / 1;
}

.changing-word,
.changing-word-greeting {
    position: absolute;
    top: 0;
    white-space: nowrap;
    transition: top 1s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 1s ease;
}

.changing-word {
    left: 50%;
    transform: translateX(-50%);
}

.changing-word-greeting {
    left: 0;
}

.changing-word.roll-out,
.changing-word-greeting.roll-out {
    top: -100%;
    opacity: 0;
}

.changing-word.roll-in,
.changing-word-greeting.roll-in {
    top: 100%;
    opacity: 0;
}



/* Gallery Grid */
.gallery {
    padding: 0 80px 6rem;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(5, 600px);
    gap: 16px;
}

.grid-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background-color: #1a1a1a;
    min-height: 0;
    display: block;
    text-decoration: none;
    color: inherit;
}

/* ─── Case Studies Reveal Transitions ─── */
.grid-item.reveal-hidden {
    opacity: 0 !important;
    transform: translateY(60px) scale(0.98);
}

.grid-item.reveal-visible {
    opacity: 1 !important;
    transform: translateY(0) scale(1);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Row 1 — Full width */
.item-r1 {
    grid-column: 1 / -1;
    grid-row: 1;
}

/* Row 2 — Left: 8 cols, Right: 4 cols — same height from grid row */
.item-r2-left {
    grid-column: span 8;
    grid-row: 2;
}

.item-r2-right {
    grid-column: span 4;
    grid-row: 2;
}

/* Row 3 — Left: 4 cols, Right: 8 cols — same height from grid row */
.item-r3-left {
    grid-column: span 4;
    grid-row: 3;
}

.item-r3-right {
    grid-column: span 8;
    grid-row: 3;
}

/* Row 4 — Full width */
.item-r4 {
    grid-column: 1 / -1;
    grid-row: 4;
}

/* Row 5 — Left: 8 cols, Right: 4 cols */
.item-r5-left {
    grid-column: span 8;
    grid-row: 5;
}

.item-r5-right {
    grid-column: span 4;
    grid-row: 5;
}

.coming-soon-card {
    background: linear-gradient(135deg, #161a22 0%, #0d0f13 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.coming-soon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    pointer-events: none;
}

/* Hover Effect */
.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 11, 11, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 20px;
    text-align: left;
}

.grid-item:hover .hover-overlay,
.grid-item.js-hover .hover-overlay {
    opacity: 1;
}

.grid-item:hover img,
.grid-item.js-hover img {
    transform: scale(1.03);
}

.click-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: #ffffff;
    color: #111111;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s;
}

.click-circle svg {
    display: block;
    color: inherit;
}

.grid-item:hover .click-circle,
.grid-item.js-hover .click-circle {
    transform: translate(-50%, -50%) scale(1);
}

.click-circle:hover {
    background-color: #e0e0e0;
}

.project-info {
    width: 100%;
    transform: translateY(15px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s;
}

.grid-item:hover .project-info,
.grid-item.js-hover .project-info {
    transform: translateY(0);
    opacity: 1;
}

.project-info h2 {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 0.2rem;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.project-info p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 1.5rem;
}

.tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tags span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 12px;
    background-color: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

/* ─── Mobile Drawer (top drop-down) ─── */
.mobile-drawer {
    display: none;
    position: fixed;
    top: 64px;
    /* sits right below the 64px navbar */
    left: 0;
    width: 100%;
    height: calc(100% - 64px);
    z-index: 998;
    pointer-events: none;
}

.mobile-drawer.open {
    display: block;
    pointer-events: auto;
}

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mobile-drawer.open .drawer-backdrop {
    opacity: 1;
}

.drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #111111;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 8px 0 16px;
    transform: translateY(-110%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mobile-drawer.open .drawer-panel {
    transform: translateY(0);
}

.drawer-panel a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.05rem;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: color 0.2s ease, background 0.2s ease;
    display: block;
}

.drawer-panel a:last-child {
    border-bottom: none;
}

.drawer-panel a:active {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

/* Hamburger icon lines */
.menu-icon span {
    transition: transform 0.3s ease;
}

/* ─── Tablet ─── */
@media (max-width: 1024px) {
    .navbar-pill {
        padding: 0 40px;
    }

    .hero {
        padding: 160px 40px 80px;
        gap: 32px;
    }

    .hero h1 {
        font-size: 3rem;
        letter-spacing: -1.5px;
    }

    .gallery {
        padding: 0 40px 4rem;
    }

    .grid-container {
        grid-template-columns: repeat(12, 1fr);
        grid-template-rows: 400px 400px 400px 400px;
    }
}

/* ─── Mobile ─── */
@media (max-width: 768px) {

    /* Navbar */
    .navbar-container {
        height: 64px;
        padding: 0;
    }

    .navbar-pill {
        padding: 0 20px;
        width: 100%;
    }

    .greeting {
        font-size: 14px;
        white-space: nowrap;
    }



    .divider {
        font-size: 16px;
    }

    .logo-icon svg {
        width: 24px;
        height: 20px;
    }

    .navbar-brand {
        gap: 0.5rem;
    }

    .nav-links {
        display: flex;
        align-items: center;
        gap: 0;
        margin-left: auto;
        margin-right: 16px;
    }

    .nav-links li:not(.audio-nav-item):not(.theme-toggle-nav-item) {
        display: none;
    }

    .menu-icon {
        display: flex;
        gap: 5px;
    }

    /* Hero */
    .hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 60px;
        padding: 40px 20px;
    }

    .hero h1 {
        font-size: 32px;
        letter-spacing: -0.5px;
        line-height: 1.25;
    }

    .hero h1 .reveal-line {
        display: inline;
    }

    .hero h1 .reveal-line span {
        display: inline;
    }

    .hero h1 .reveal-line:not(:last-child)::after {
        content: " ";
    }

    .hero-right {
        width: 100%;
        box-sizing: border-box;
    }

    .hero-right p {
        font-size: 20px;
        white-space: normal;
        font-style: italic;
        padding-right: 8px;
    }

    .figma-frame-container {
        display: block;
        text-align: left;
        padding: 12px 16px;
        margin: -12px 4px;
    }

    .figma-frame-header {
        top: -26px;
    }

    .figma-badge {
        bottom: -18px;
    }

    /* Gallery grid — single column stack */
    .gallery {
        padding: 0 16px 3rem;
    }

    .grid-container {
        display: flex;
        flex-direction: column;
        gap: 40px;
    }

    .grid-item {
        width: 100%;
        height: auto;
        border-radius: 0;
        overflow: visible;
        background-color: transparent;
        display: flex;
        flex-direction: column;
    }

    .grid-item img {
        width: 100%;
        height: auto;
        object-fit: cover;
        border-radius: 10px;
        transition: none;
    }

    /* Preserve desktop aspect ratios on mobile images */
    .item-r1 img,
    .item-r4 img {
        aspect-ratio: 12 / 5;
    }

    .item-r2-left img,
    .item-r3-right img {
        aspect-ratio: 8 / 5;
    }

    .item-r2-right img,
    .item-r3-left img {
        aspect-ratio: 4 / 5;
    }

    /* Disable hover zoom animation on mobile */
    .grid-item:hover img,
    .grid-item.js-hover img {
        transform: none;
    }

    /* On mobile, show project info below image */
    .hover-overlay {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: auto;
        opacity: 1 !important;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 12px 0 0 0;
        display: block;
    }

    .grid-item:hover .hover-overlay,
    .grid-item.js-hover .hover-overlay {
        opacity: 1 !important;
    }

    .click-circle {
        display: none;
    }

    .project-info {
        transform: none !important;
        opacity: 1 !important;
    }

    .grid-item:hover .project-info,
    .grid-item.js-hover .project-info {
        transform: none !important;
        opacity: 1 !important;
    }

    .project-info h2 {
        font-size: 1.25rem;
        font-weight: 600;
        margin-bottom: 0.15rem;
        color: var(--text-color);
    }

    .project-info p {
        font-size: 16px;
        margin-bottom: 0.75rem;
        color: var(--text-muted);
    }

    .tags span {
        font-size: 14px;
        padding: 5px 9px;
        color: var(--text-color);
        border-color: rgba(255, 255, 255, 0.15);
    }

    html[data-theme="light"] .tags span {
        border-color: rgba(17, 17, 17, 0.15);
    }

    /* Prevent mobile tooltip screen cutoff by right-aligning it */
    .tooltip-text {
        font-size: 12px;
        padding: 6px 10px;
    }

    .tooltip-wrapper.tooltip-bottom .tooltip-text {
        left: auto;
        right: -10px;
        transform: translateX(0) translateY(-8px);
    }

    .tooltip-wrapper.tooltip-bottom:hover .tooltip-text,
    .wave-music-btn:hover .tooltip-wrapper.tooltip-bottom .tooltip-text {
        transform: translateX(0) translateY(0);
    }

    .tooltip-wrapper.tooltip-bottom .tooltip-text::after {
        left: auto;
        right: 12px;
        transform: none;
    }

    .tooltip-wrapper.tooltip-bottom .tooltip-text::before {
        left: auto;
        right: 11px;
        transform: none;
    }
}

/* ─── Footer ─── */
.site-footer {
    width: 100%;
    height: 80px;
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    z-index: 10;
    background-color: var(--bg-color);
}

.footer-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 80px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-main);
}

.footer-left {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-color);
}

.footer-cursor {
    font-weight: 200;
    color: var(--text-color);
    animation: cursor-blink 0.8s infinite;
}

@keyframes cursor-blink {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

.footer-hammer {
    display: inline-block;
    font-size: 20px;
    opacity: 0;
    transform: scale(0);
    width: 0;
    margin: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, width 0.3s ease, margin 0.3s ease, visibility 0.3s;
    transform-origin: bottom center;
}

.footer-hammer.active {
    opacity: 1;
    transform: scale(1);
    width: auto;
    margin-left: 8px;
    visibility: visible;
}

.footer-hammer.swing {
    animation: hammer-swing 0.4s ease 3;
}

@keyframes hammer-swing {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1) rotate(-35deg);
    }
}

.footer-text-container {
    display: inline-block;
    vertical-align: middle;
}

#footer-text {
    display: inline;
}

.footer-word-wrapper {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}

.footer-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(105%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    white-space: nowrap;
}

.footer-word.visible {
    opacity: 1;
    transform: translateY(0);
}

.footer-word.exit {
    opacity: 0;
    transform: translateY(-105%);
}

.footer-dot {
    opacity: 0.2;
    font-size: 0.7em;
    vertical-align: middle;
    margin: 0 6px;
    display: inline-block;
}

.footer-text-container.shake {
    animation: text-shake 0.15s ease infinite;
}

@keyframes text-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-2px) translateY(1px);
    }

    75% {
        transform: translateX(2px) translateY(-1px);
    }
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-right a {
    color: var(--text-muted);
    font-size: 16px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-right a:hover {
    color: var(--text-color);
}

.footer-divider {
    width: 1px;
    height: 14px;
    background-color: var(--text-color);
    opacity: 0.12;
}

/* Tooltips */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    color: #ffffff;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    padding: 8px 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
    z-index: 100;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.12) transparent transparent transparent;
}

.tooltip-text::before {
    content: '';
    position: absolute;
    top: 99%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #1E1E1E transparent transparent transparent;
    z-index: 1;
}

.tooltip-wrapper:hover .tooltip-text,
.wave-music-btn:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Prevent right-side cutoff by aligning the tooltip to the right edge of its parent, extending left */
.tooltip-wrapper.tooltip-left-align .tooltip-text {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(8px);
}

.tooltip-wrapper.tooltip-left-align:hover .tooltip-text {
    transform: translateX(0) translateY(0);
}

.tooltip-wrapper.tooltip-left-align .tooltip-text::after {
    left: auto;
    right: 12px;
    transform: none;
}

.tooltip-wrapper.tooltip-left-align .tooltip-text::before {
    left: auto;
    right: 11px;
    transform: none;
}


@media (max-width: 1024px) {
    .footer-container {
        padding: 0 40px;
    }
}

@media (max-width: 768px) {
    .site-footer {
        height: auto;
        padding: 20px 0;
    }

    .footer-container {
        padding: 0 20px;
        flex-direction: column;
        gap: 24px;
        text-align: center;
        height: auto;
        width: 100%;
        overflow: hidden;
    }

    .footer-left {
        justify-content: center;
        width: 100%;
        font-size: 14px;
    }

    .footer-hammer {
        font-size: 16px;
    }

    .footer-right {
        justify-content: center;
        width: 100%;
        gap: 12px;
    }
}

/* ─── Page Loader ─── */
.page-loader {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-logo {
    width: 60px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-logo svg {
    width: 60px;
    height: 48px;
    animation: loader-spin-one 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes loader-spin-one {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ─── Gear 5th Easter Egg Styles ─── */
.wave-music-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: color 0.3s, background-color 0.3s;
    width: 28px;
    height: 28px;
    position: relative;
    outline: none;
}

.wave-music-btn:hover {
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Glass-effect pill container for Design to Me button */
.wave-music-btn.design-audio-pill {
    display: none;
    width: auto;
    height: 40px;
    border-radius: 9999px;
    padding: 0 14px 0 10px;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.wave-music-btn.design-audio-pill:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text-color);
}

.wave-music-btn.design-audio-pill.playing {
    border-color: rgba(76, 209, 55, 0.3);
    background: rgba(76, 209, 55, 0.05);
}

.wave-music-btn.design-audio-pill.playing:hover {
    border-color: rgba(76, 209, 55, 0.5);
    background: rgba(76, 209, 55, 0.1);
}

.design-audio-text {
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    font-family: var(--font-main);
    letter-spacing: -0.1px;
    white-space: nowrap;
}

/* Light theme support */
html[data-theme="light"] .wave-music-btn.design-audio-pill {
    background: rgba(17, 17, 17, 0.05);
    border-color: rgba(17, 17, 17, 0.1);
}

html[data-theme="light"] .wave-music-btn.design-audio-pill:hover {
    background-color: rgba(17, 17, 17, 0.1);
    border-color: rgba(17, 17, 17, 0.2);
}

.wave-icon-wrapper {
    position: relative;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-wave-icon {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.wave-bar {
    transform-origin: center;
    transition: transform 0.2s ease;
}

.mute-slash-icon {
    width: 100%;
    height: 100%;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    opacity: 1;
    color: var(--text-muted);
}

.wave-music-btn.playing {
    color: #4cd137;
    /* Green neon soundwave when active */
}

.wave-music-btn.playing .mute-slash-icon {
    opacity: 0;
    transform: scale(0) rotate(-45deg);
}

/* Sound wave animations */
@keyframes wave-bounce-short {

    0%,
    100% {
        transform: scaleY(0.4);
    }

    50% {
        transform: scaleY(1.1);
    }
}

@keyframes wave-bounce-tall {

    0%,
    100% {
        transform: scaleY(0.3);
    }

    50% {
        transform: scaleY(1.4);
    }
}

@keyframes wave-bounce-medium {

    0%,
    100% {
        transform: scaleY(0.5);
    }

    50% {
        transform: scaleY(1.2);
    }
}

.wave-music-btn.playing .wave-bar-1 {
    animation: wave-bounce-tall 1.0s infinite ease-in-out;
}

.wave-music-btn.playing .wave-bar-2 {
    animation: wave-bounce-medium 0.8s infinite ease-in-out 0.1s;
}

.wave-music-btn.playing .wave-bar-3 {
    animation: wave-bounce-short 1.2s infinite ease-in-out 0.2s;
}

.wave-music-btn.playing .wave-bar-4 {
    animation: wave-bounce-medium 0.9s infinite ease-in-out 0.15s;
}

.wave-music-btn.playing .wave-bar-5 {
    animation: wave-bounce-short 1.1s infinite ease-in-out 0.05s;
}

/* ─── Rubber Bounce Layout Animations ─── */
body.gear-5-active {
    animation: rubber-bg-pulse 4s infinite ease-in-out;
}

@keyframes rubber-bg-pulse {

    0%,
    100% {
        background-color: var(--bg-color);
    }

    50% {
        background-color: #160c2b;
        /* Deep cartoonish purple vibe */
    }
}

body.gear-5-active::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;
    box-shadow: inset 0 0 100px rgba(255, 255, 255, 0.08);
    opacity: 1;
    animation: rubber-fog 8s infinite ease-in-out;
}

@keyframes rubber-fog {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.9;
    }
}

/* Float & stretch layout components */
@keyframes gear-5-float-odd {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    25% {
        transform: translateY(-24px) rotate(-1.5deg) scale(1.04, 0.96);
    }

    50% {
        transform: translateY(12px) rotate(1deg) scale(0.96, 1.04);
    }

    75% {
        transform: translateY(-12px) rotate(-0.5deg) scale(1.01, 0.99);
    }
}

@keyframes gear-5-float-even {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    30% {
        transform: translateY(-18px) rotate(1.8deg) scale(0.95, 1.05);
    }

    60% {
        transform: translateY(8px) rotate(-1deg) scale(1.03, 0.97);
    }

    80% {
        transform: translateY(-8px) rotate(0.8deg) scale(0.99, 1.01);
    }
}

@keyframes gear-5-float-text {

    0%,
    100% {
        transform: translateY(0) scale(1) skewX(0deg);
    }

    33% {
        transform: translateY(-8px) scale(1.06, 0.94) skewX(-2deg);
    }

    66% {
        transform: translateY(4px) scale(0.95, 1.05) skewX(2deg);
    }
}

@keyframes gear-5-rubber-nav {

    0%,
    100% {
        transform: translateY(0) scaleX(1) scaleY(1);
    }

    50% {
        transform: translateY(6px) scaleX(1.02) scaleY(0.98);
    }
}

body.gear-5-active .grid-item:nth-child(odd) {
    animation: gear-5-float-odd 2.4s infinite ease-in-out;
}

body.gear-5-active .grid-item:nth-child(even) {
    animation: gear-5-float-even 2.8s infinite ease-in-out;
}

body.gear-5-active h1,
body.gear-5-active h2,
body.gear-5-active .hero-right p,
body.gear-5-active .greeting,
body.gear-5-active .navbar-brand {
    animation: gear-5-float-text 2s infinite ease-in-out;
    display: inline-block;
}

body.gear-5-active .navbar-container {
    animation: gear-5-rubber-nav 3s infinite ease-in-out;
}

body.gear-5-active img {
    animation: gear-5-float-even 3s infinite ease-in-out;
}

body.gear-5-active .site-footer {
    animation: gear-5-rubber-nav 3.6s infinite ease-in-out;
}

/* Tooltip Bottom Override - shared base rules */
.tooltip-wrapper.tooltip-bottom .tooltip-text {
    top: 150%;
    bottom: auto;
}

.tooltip-wrapper.tooltip-bottom .tooltip-text::after {
    top: auto;
    bottom: 100%;
    border-color: transparent transparent rgba(255, 255, 255, 0.12) transparent;
}

.tooltip-wrapper.tooltip-bottom .tooltip-text::before {
    top: auto;
    bottom: 99%;
    border-color: transparent transparent #1E1E1E transparent;
}

/* Desktop horizontal centering rules */
@media (min-width: 769px) {
    .tooltip-wrapper.tooltip-bottom .tooltip-text {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-8px);
    }

    .tooltip-wrapper.tooltip-bottom:hover .tooltip-text,
    .wave-music-btn:hover .tooltip-wrapper.tooltip-bottom .tooltip-text {
        transform: translateX(-50%) translateY(0);
    }
}

/* ─── Subtitle Overlay Styles ─── */
.subtitle-strip {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    width: auto;
    max-width: 90vw;
}

.subtitle-strip.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.subtitle-text {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    font-style: italic;
    letter-spacing: -0.3px;
    line-height: 1.4;
    margin: 0;
    padding: 10px 22px;
    background: rgba(13, 13, 13, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: inline-block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    animation: subtitle-pop 0.3s ease-out;
}

.subtitle-text:empty {
    display: none;
}

@keyframes subtitle-pop {
    0% {
        transform: scale(0.96);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 600px) {
    .subtitle-strip {
        bottom: 30px;
    }

    .subtitle-text {
        font-size: 1rem;
        padding: 8px 16px;
    }

    /* Collapse audio pill text early for intermediate mobile screen sizes */
    .wave-music-btn.design-audio-pill {
        padding: 0 10px;
    }

    .wave-music-btn.design-audio-pill .design-audio-text {
        display: none;
    }
}

/* Extra small screens - optimize spacing and typography to fit the complete greeting text without ellipsis (keeping 20px padding) */
@media (max-width: 480px) {
    .navbar-pill {
        padding: 0 20px;
    }

    .navbar-brand {
        gap: 0.35rem;
    }

    .greeting {
        font-size: 14px;
    }

    .divider {
        font-size: 14px;
        margin: 0 2px;
    }

    .nav-links {
        margin-right: 12px;
    }
}

@media (max-width: 360px) {
    .navbar-brand {
        gap: 0.25rem;
    }

    .nav-links {
        margin-right: 0;
    }

    .nav-links li.audio-nav-item {
        display: none;
        /* Hide audio pill to fit the 14px greeting text on extremely small screens */
    }
}