/* Base reset and typography shared across pages */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

html, body {
    cursor: none; /* Hide default cursor to use custom one */
}

a, button, .project-item, .cat-link {
    cursor: none;
}

/* ============================================
   CLICK RIPPLE EFFECT
   ============================================ */
.click-ripple {
    position: fixed;
    border: 1px solid rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%) scale(0);
    width: 20px;
    height: 20px;
    animation: ripple-grow 0.8s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

@keyframes ripple-grow {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
        width: 10px;
        height: 10px;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
        width: 150px;
        height: 150px;
    }
}

:root {
    /* Typography System - Option A (Futura-style) */
    --font-display: 'Jost', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    /* Global Light Theme Variables */
    --bg-color: #808080;
    --text-color: #000000;
    --header-bg: rgba(128, 128, 128, 0.98);
    --secondary-text: #666666;
    --border-color: #666666;
    --accent-color: #000000;

    /* Project Detail Specific (Light) */
    --meta-label: #666666;
    --meta-value: #000000;
    --desc-color: #333333;
    --back-color: #444444;
    --back-hover: #000000;
}

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

html,
body {
    background: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
}

/* ============================================
   TEXT LOGO STYLING
   ============================================ */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-text-group {
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
    width: fit-content;
}

.logo-name {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 4px;
    letter-spacing: 0.1em;
}

.logo-name span {
    display: inline-block;
}

.logo-desc {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: var(--secondary-text);
    display: block;
    text-align: justify;
    text-align-last: justify;
    width: 100%;
}

.logo-desc::after {
    content: '';
    display: inline-block;
    width: 100%;
    height: 0;
}

/* ============================================
   HEADER & NAVIGATION (Hiroshi Nakamura Style)
/* ============================================
   HEADER & NAVIGATION (Hiroshi Nakamura Style)
   ============================================ */
.header, .gallery-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 30px 0 20px;
    background: var(--bg-color);
    z-index: 1100;
}

.header-inner {
    max-width: 1160px; /* Matched to project-stack width */
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-left, .header-right {
    flex: 1;
    display: flex;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    flex: 0 1 auto;
    display: flex;
    justify-content: center;
}

.nav, .category-nav {
    display: flex;
    gap: 40px; /* Increased gap for Nakamura breathing room */
}

.nav-link, .cat-link {
    font-size: 0.75rem; /* Slightly smaller for uppercase */
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--secondary-text);
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active,
.cat-link:hover, .cat-link.active {
    color: var(--text-color);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--secondary-text);
}

.lang-toggle-btn {
    background: none;
    border: none;
    color: inherit;
    padding: 5px;
    cursor: pointer;
    transition: color 0.3s ease;
    text-transform: uppercase;
}

.lang-toggle-btn:hover, .lang-toggle-btn.active {
    color: var(--text-color);
}

.lang-divider {
    opacity: 0.3;
}

/* Remove old Lang Toggle */
.lang-toggle:not(.lang-toggle-btn) {
    display: none;
}

@media (max-width: 1200px) {
    .header, .gallery-header {
        padding: 20px 40px;
    }
}

@media (max-width: 1024px) {
    .header, .gallery-header {
        padding: 15px 30px;
    }

    .nav, .category-nav {
        gap: 20px;
    }
}

/* Tablets: reserve space for the full logo so its subtitle never wraps into the navigation. */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-left {
        flex: 0 0 160px;
        min-width: 160px;
    }

    .header-right {
        flex: 0 0 auto;
    }

    .header-center {
        min-width: 0;
    }

    .logo-text-group {
        width: 160px;
    }

    .logo-name {
        font-size: 1.8rem;
        letter-spacing: 0.08em;
    }

    .logo-desc {
        font-size: 0.6rem;
        letter-spacing: 0.12em;
        white-space: nowrap;
    }

    .nav, .category-nav {
        gap: clamp(8px, 1.5vw, 16px);
    }

    .nav-link, .cat-link {
        font-size: 0.68rem;
    }
}

@media (max-width: 768px) {
    .header, .gallery-header {
        padding: 15px 20px;
    }
    
    .header-inner {
        flex-direction: column;
        gap: 12px;
    }
    
    .header-left, .header-right, .header-center {
        flex: none;
        width: 100%;
        justify-content: center;
    }
    
    .nav, .category-nav {
        gap: 4px;
        flex-wrap: nowrap;
        justify-content: space-between;
        width: 100%;
        display: flex;
        overflow: visible;
        padding-bottom: 0;
    }

    .nav-link, .cat-link {
        font-size: 0.75rem;
        flex-shrink: 1;
    }
}

/* Responsive Typography */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .logo-name {
        font-size: 1.8rem;
        letter-spacing: 0.08em;
    }
    
    .logo-desc {
        font-size: 0.6rem;
        letter-spacing: 0.12em;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    .logo-name {
        font-size: 1.5rem;
        letter-spacing: 0.06em;
    }
    
    .logo-desc {
        font-size: 0.5rem;
        letter-spacing: 0.1em;
    }
    
    .nav, .category-nav {
        gap: 2px;
        justify-content: space-between;
    }
    
    .nav-link, .cat-link {
        font-size: 0.6rem;
        letter-spacing: 0.01em;
        white-space: nowrap;
        flex-shrink: 1;
    }
}

/* ============================================
   CUSTOM CURSOR & FOLLOWER (Antigravity Style)
   ============================================ */
.cursor-dot {
    position: fixed;
    width: 6px;
    height: 6px;
    background: #000;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
}

.cursor-follower {
    position: fixed;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999998;
    transform: translate(-50%, -50%);
    transition: width 0.4s cubic-bezier(0.2, 1, 0.3, 1), 
                height 0.4s cubic-bezier(0.2, 1, 0.3, 1), 
                background 0.4s ease,
                border-color 0.4s ease;
}

/* Hover State */
.cursor-follower.hovering {
    width: 90px;
    height: 90px;
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.7);
}

@media (max-width: 1024px) {
    html, body, a, button, .project-item, .cat-link {
        cursor: auto !important;
    }
    .cursor-dot, .cursor-follower {
        display: none !important;
    }
}

/* ============================================
   SITE FOOTER & SOCIAL ICONS
   ============================================ */
.site-footer {
    width: 100%;
    padding: 15px 0 45px;
    background: transparent;
    z-index: 10;
    position: relative;
}

.footer-container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info {
    padding-left: 10px;
    border-left: 1.5px solid var(--text-color);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.footer-line1 {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 0.01em;
}

.footer-line2 {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--secondary-text);
    letter-spacing: 0.01em;
}

.footer-social {
    padding-right: 10px;
    border-right: 1.5px solid var(--text-color);
    display: flex;
    align-items: center;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.social-icon {
    color: var(--secondary-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transition: fill 0.3s ease;
}

.social-icon:hover {
    color: var(--text-color);
    transform: translateY(-2px);
}

@media (max-width: 1200px) {
    .footer-container {
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        padding-left: 20px;
        padding-right: 20px;
    }

    .footer-social {
        border-right: none;
        border-left: 1.5px solid var(--text-color);
        padding-right: 0;
        padding-left: 10px;
    }
}
