:root {
    --font-primary: 'Inter', sans-serif;
    --font-expressive: 'Syne', sans-serif;
    --font-nippo: 'Nippo', sans-serif;

    --color-bg: #000000;
    --color-text: #d6d3c2;
    --color-text-dim: #666666;

    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-smooth-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-fast: 0.3s var(--ease-smooth);
    --transition-slow: 0.8s var(--ease-smooth);
}

/* Smooth scrolling globally */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    width: 100vw;
}

/* Default no-scroll class for pages that need it */
body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

/* Custom Cursor */
#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    background-color: #D6D3C1;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    will-change: transform;
    transform: translate3d(0, 0, 0) translate(-50%, -50%);
}

#custom-cursor.hover {
    transform: translate3d(0, 0, 0) translate(-50%, -50%) scale(1);
}

/* Layout Container */
.container {
    height: 100vh;
    padding: clamp(1rem, 2.5vw, 2.5rem);
    display: flex;
    flex-direction: column;
}

/* Top Nav */
.top-nav {
    display: flex;
    justify-content: flex-end;
}

.nav-link {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
}

.nav-link .arrow {
    margin-right: 0.5rem;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateX(5px);
    transition: width 0.3s var(--ease-smooth), opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth);
    display: inline-block;
    white-space: nowrap;
}

.nav-link:hover .arrow {
    width: 15px; /* Adjust based on arrow size */
    opacity: 1;
    transform: translateX(0);
}

/* Workspace (Main) */
.workspace {
    display: flex;
    align-items: stretch;
    /* FIXED: Stretch to allow children to push to bottom */
    flex: 1;
    gap: 4vw;
    margin-top: 3vh;
    padding-bottom: 1vh;
}

/* Left Side: Name */
.name-section {
    flex: 0 0 35vw;
    /* FIXED: Maintain stable width for the name */
    width: 35vw;
}

.bold-name {
    font-weight: 900;
    font-size: clamp(3rem, 10vw, 18.5vh);
    line-height: 0.8;
    font-family: var(--font-nippo);
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    color: var(--color-text);
}

.bold-name span {
    display: block;
}

/* Removed .bold-name.expressive */

.footer-left .mobile-text {
    display: none;
}

.footer-left .desktop-text {
    display: block;
}

/* Right Side: Info Grid */
.info-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 18vw 12vw 10vw 8vw;
    /* FIXED: Explicitly defined widths for total stability */
    gap: 2vw;
    align-items: stretch;
    margin-bottom: 0.5rem;
}

.col h3 {
    font-size: 0.55rem;
    color: var(--color-text-dim);
    margin-bottom: 1.2rem;
    letter-spacing: 0.15em;
    font-weight: 400;
}

.col-intro {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Ensures column takes full height of grid row */
    min-height: 45vh;
    /* Minimum height to push socials down on larger screens */
}

.socials-vertical {
    margin-top: auto;
    /* pushes socials down */
}

.intro-text p {
    font-size: clamp(0.65rem, 0.75vw, 0.95rem);
    line-height: 1.35;
    text-transform: uppercase;
    font-weight: 400;
    max-width: 260px;
    text-align: justify;
}

/* Social links */
.socials-vertical .social-links {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    list-style: none;
}

.social-link {
    color: var(--color-text);
    text-decoration: none;
    font-size: clamp(0.65rem, 0.65vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    transition: transform var(--transition-fast), color var(--transition-fast);
    width: fit-content;
    position: relative;
}

.social-link:hover {
    color: var(--color-text-dim);
}

.tilt-arrow {
    margin-left: 0;
    font-size: 0.55rem;
    opacity: 1;
    transform: translate(0, 0);
    transition: transform 0.3s var(--ease-smooth);
}

.social-link:hover .tilt-arrow {
    transform: translate(2px, -2px);
}

.col ul {
    list-style: none;
}

.col ul li {
    font-size: clamp(0.75rem, 0.8vw, 1rem);
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    font-weight: 400;
    width: fit-content;
}

.stat-row {
    display: grid;
    grid-template-columns: 1.5rem 1fr;
    /* Reduced gap/width for tighter alignment */
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-row .num {
    font-size: 0.9rem;
    font-weight: 700;
}

.stat-row .label {
    font-size: 0.65rem;
    color: var(--color-text);
    text-transform: uppercase;
}

/* Footer */
.footer {
    margin-top: auto;
    /* FIXED */
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem; /* Updated to match index.html */
    font-weight: 700; /* Updated to match index.html */
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.1em; /* Updated to match index.html */
    border-top: 1px solid #222;
    padding-top: 1.5rem;
}

#design-dev-credit {
    cursor: pointer;
}

/* Responsive */
@media (max-height: 600px) {
    .container {
        padding: 1rem;
    }

    .bold-name {
        font-size: 15vh;
    }

    .col h3 {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 1100px) {
    .info-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Two columns */
        gap: 2rem;
    }

    .col-intro {
        grid-column: span 2; /* Span full width */
        min-height: auto;
        margin-bottom: 2rem;
    }

    .socials-vertical {
        margin-top: 2rem;
    }

    .social-links {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    /* Allow scrolling on mobile */
    body {
        overflow: auto !important;
        height: auto !important;
    }

    body.no-scroll {
        overflow: auto !important;
        height: auto !important;
    }

    /* Hide custom cursor on mobile */
    #custom-cursor {
        display: none;
    }

    /* Restore default cursor */
    * {
        cursor: auto !important;
    }

    .container {
        padding: 0;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    /* Top Navigation */
    .top-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        padding: 1rem 1.5rem;
        background: #000;
        z-index: 1000;
        border-bottom: 1px solid #222;
    }

    .nav-link {
        color: var(--color-text);
        font-size: 0.7rem;
    }

    /* Stack workspace vertically */
    .workspace {
        flex-direction: column;
        padding: 0 1.5rem;
        padding-top: 80px; /* Account for fixed nav */
        gap: 1rem;
        height: auto;
        margin-top: 0;
        padding-bottom: 2rem;
    }

    /* Name section - center aligned */
    .name-section {
        width: 100%;
        flex: none;
        display: flex;
        justify-content: center;
        text-align: center;
    }

    .bold-name {
        font-size: 12vw;
        line-height: 0.9;
        align-items: center;
        text-align: center;
        font-family: var(--font-nippo);
        font-weight: 900;
    }
    
    /* Intro text section */
    .col-intro {
        width: 100%;
        flex: none;
        min-height: auto;
    }

    .intro-text {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .intro-text p {
        max-width: 100%;
        font-size: 0.85rem;
        line-height: 1.6;
        color: var(--color-text);
        text-align: justify;
    }

    /* Social links in 3-column grid (3 over 3 - symmetric) */
    .socials-vertical {
        margin-top: 0;
        margin-bottom: 3rem;
    }

    .social-links {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1.5rem;
        list-style: none;
        width: 100%;
    }

    .social-link {
        font-size: 0.75rem;
        text-transform: uppercase;
        color: var(--color-text);
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .social-link .tilt-arrow {
        display: inline-flex;
        opacity: 1;
        margin-left: 0.3rem;
    }

    /* Info grid sections below socials */
    .info-grid {
        display: flex;
        flex-direction: column;
        gap: 3rem;
        width: 100%;
        grid-template-columns: none;
    }

    .col {
        width: 100%;
    }

    .col h3 {
        font-size: 0.65rem;
        color: var(--color-text-dim);
        margin-bottom: 1.5rem;
        letter-spacing: 0.15em;
        font-weight: 400;
        text-transform: uppercase;
    }

    .col ul li {
        font-size: 0.85rem;
        margin-bottom: 1rem;
        text-transform: uppercase;
    }

    .stat-row {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: baseline;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .stat-row .num {
        font-size: 1rem;
        font-weight: 700;
    }

    .stat-row .label {
        font-size: 0.65rem;
        color: var(--color-text);
        text-transform: uppercase;
    }

    /* Footer optimized for mobile */
    .footer {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem 1.5rem;
        margin-top: 3rem;
        border-top: 1px solid #222;
        gap: 0.5rem;
        text-align: center;
    }

    .footer-left {
        font-size: 0.55rem;
        color: var(--color-text);
        text-transform: uppercase;
        letter-spacing: 0.1em;
        font-weight: 700;
        width: 100%;
        order: 1;
    }

    .footer-center {
        display: none;
    }

    .footer-right {
        font-size: 0.55rem;
        color: var(--color-text);
        text-transform: uppercase;
        letter-spacing: 0.1em;
        font-weight: 700;
        width: 100%;
        text-align: center;
        order: 2;
    }

    .footer-left .mobile-text {
        display: block;
    }

    .footer-left .desktop-text {
        display: none;
    }

    .footer-left p,
    .footer-right p {
        margin: 0;
    }
}

/* ====================================
   View Transitions API - Seamless Page Navigation
   ==================================== */

/* Root transition styling */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.4s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(root) {
    animation-name: fade-and-scale-out;
}

::view-transition-new(root) {
    animation-name: fade-and-scale-in;
}

@keyframes fade-and-scale-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.98);
    }
}

@keyframes fade-and-scale-in {
    from {
        opacity: 0;
        transform: scale(1.02);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Page exit animation class */
.page-exiting {
    animation: page-exit 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes page-exit {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Page enter animation class */
.page-entering {
    animation: page-enter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}