/* ==========================================================================
   Typography & Global Reset
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@200;300;400;500&display=swap');

:root {
    --cursor-size: 20px;
    --cursor-hover-size: 50px;
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #555555;
    --color-bg: #fdfdfd;
    --easing-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
    font-family: 'Helvetica Neue', 'Helvetica', 'Arial', 'Noto Sans SC', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    cursor: none; /* Hide default cursor for custom implementation */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Custom Cursor
   ========================================================================== */
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--cursor-size);
    height: var(--cursor-size);
    border: 1px solid rgba(26, 26, 26, 0.5);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: width 0.3s var(--easing-smooth), 
                height 0.3s var(--easing-smooth), 
                background-color 0.3s ease,
                border-color 0.3s ease;
    mix-blend-mode: difference;
    will-change: width, height, transform;
}

#cursor.hover {
    width: var(--cursor-hover-size);
    height: var(--cursor-hover-size);
    background-color: rgba(255, 255, 255, 0.9);
    border-color: transparent;
    mix-blend-mode: normal;
    backdrop-filter: invert(1);
}

/* ==========================================================================
   Loader
   ========================================================================== */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s var(--easing-smooth), visibility 0.8s;
}

.loader-circle {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Navigation & Transitions
   ========================================================================== */
.page-section {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    transition: opacity 0.8s var(--easing-smooth), transform 0.8s var(--easing-smooth);
    transform: translateY(20px);
    pointer-events: none;
}

.page-section.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    transform: translateY(0);
    pointer-events: auto;
}

/* Navigation Line Animation */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 50%;
    background-color: currentColor;
    transition: width 0.3s var(--easing-smooth), left 0.3s var(--easing-smooth);
}
.nav-link:hover::after {
    width: 100%;
    left: 0;
}

/* ==========================================================================
   Home Page - Glimpses
   ========================================================================== */
.hero-slider {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 1.5s ease-in-out, transform 8s linear;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

.hero-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0));
}

/* ==========================================================================
   Archives Page
   ========================================================================== */
.archive-grid-item {
    break-inside: avoid;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.archive-img-wrapper {
    overflow: hidden;
    position: relative;
}

.archive-img {
    transition: transform 0.8s var(--easing-smooth), filter 0.4s ease;
    width: 100%;
    display: block;
}

.archive-grid-item:hover .archive-img {
    transform: scale(1.05);
    filter: brightness(0.9);
}

.archive-desc {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem 1.5rem;
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.5s var(--easing-smooth), opacity 0.5s ease;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    opacity: 0;
    font-weight: 300;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}

.archive-grid-item:hover .archive-desc {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================================================
   Perspectives Page
   ========================================================================== */
.perspective-module {
    min-height: 90vh;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.perspective-module.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Utility & Micro-interactions
   ========================================================================== */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

#back-to-top {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    mix-blend-mode: exclusion;
    color: white;
}
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Text Selection */
::selection {
    background: rgba(200, 200, 200, 0.3);
    color: #000;
}