/* xity.one - Ocean-Deep Wabi-Sabi City Exploration */

/* ===== CSS Custom Properties ===== */
:root {
    --deep-base: #1a1a2e;
    --primary-blue: #4a90d9;
    --warm-white: #f5f0e8;
    --accent-gold: #e8b84b;
    --muted-gray: #6c757d;
    --sidebar-width: 240px;
    --font-heading: 'Lora', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: clamp(14px, 1.2vw, 18px);
}

body {
    font-family: var(--font-body);
    background-color: var(--deep-base);
    color: var(--warm-white);
    overflow-x: hidden;
    line-height: 1.7;
}

/* ===== Ocean Background Gradient Mesh ===== */
#ocean-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.mesh-layer {
    position: absolute;
    width: 100%;
    height: 100%;
}

.mesh-layer-1 {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(74, 144, 217, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(26, 26, 46, 0.9) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(74, 144, 217, 0.1) 0%, transparent 40%);
    animation: meshPulse1 12s ease-in-out infinite;
}

.mesh-layer-2 {
    background:
        radial-gradient(ellipse at 60% 40%, rgba(232, 184, 75, 0.08) 0%, transparent 45%),
        radial-gradient(ellipse at 30% 70%, rgba(74, 144, 217, 0.12) 0%, transparent 50%);
    animation: meshPulse2 15s ease-in-out infinite;
}

.mesh-layer-3 {
    background:
        radial-gradient(ellipse at 70% 60%, rgba(26, 26, 46, 0.5) 0%, transparent 60%),
        radial-gradient(ellipse at 10% 30%, rgba(232, 184, 75, 0.05) 0%, transparent 40%);
    animation: meshPulse3 18s ease-in-out infinite;
}

@keyframes meshPulse1 {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

@keyframes meshPulse2 {
    0%, 100% { opacity: 0.7; transform: translate(0, 0); }
    50% { opacity: 1; transform: translate(20px, -10px); }
}

@keyframes meshPulse3 {
    0%, 100% { opacity: 0.6; transform: scale(1.02); }
    50% { opacity: 0.9; transform: scale(0.98); }
}

/* ===== Parallax Depth Layers ===== */
#parallax-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
}

.depth-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(74, 144, 217, 0.3);
    width: 4px;
    height: 4px;
    animation: float 20s ease-in-out infinite;
}

.depth-particle:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.depth-particle:nth-child(2) { top: 25%; left: 45%; animation-delay: -3s; }
.depth-particle:nth-child(3) { top: 60%; left: 70%; animation-delay: -6s; }
.depth-particle:nth-child(4) { top: 80%; left: 25%; animation-delay: -9s; }
.depth-particle:nth-child(5) { top: 40%; left: 85%; animation-delay: -2s; }
.depth-particle:nth-child(6) { top: 70%; left: 50%; animation-delay: -5s; }
.depth-particle:nth-child(7) { top: 15%; left: 75%; animation-delay: -8s; }
.depth-particle:nth-child(8) { top: 90%; left: 60%; animation-delay: -11s; }

.depth-particle.mid {
    width: 6px;
    height: 6px;
    background: rgba(232, 184, 75, 0.2);
    animation-duration: 15s;
}

.depth-particle.mid:nth-child(1) { top: 20%; left: 30%; }
.depth-particle.mid:nth-child(2) { top: 50%; left: 60%; }
.depth-particle.mid:nth-child(3) { top: 70%; left: 20%; }
.depth-particle.mid:nth-child(4) { top: 35%; left: 80%; }
.depth-particle.mid:nth-child(5) { top: 85%; left: 45%; }

.depth-particle.near {
    width: 8px;
    height: 8px;
    background: rgba(245, 240, 232, 0.08);
    animation-duration: 10s;
}

.depth-particle.near:nth-child(1) { top: 30%; left: 20%; }
.depth-particle.near:nth-child(2) { top: 60%; left: 70%; }
.depth-particle.near:nth-child(3) { top: 80%; left: 40%; }

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
    25% { transform: translateY(-30px) translateX(10px); opacity: 0.6; }
    50% { transform: translateY(-10px) translateX(-15px); opacity: 0.4; }
    75% { transform: translateY(-40px) translateX(5px); opacity: 0.7; }
}

/* ===== Sidebar Navigation ===== */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.95) 0%, rgba(26, 26, 46, 0.85) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    border-right: 1px solid rgba(74, 144, 217, 0.1);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(108, 117, 125, 0.2);
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--warm-white);
    letter-spacing: 0.05em;
}

.sidebar-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--muted-gray);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--warm-white);
    background: rgba(74, 144, 217, 0.08);
}

.nav-link.active {
    color: var(--accent-gold);
}

.nav-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--muted-gray);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-link:hover .nav-indicator {
    border-color: var(--primary-blue);
}

.nav-link.active .nav-indicator {
    border-color: var(--accent-gold);
    background: var(--accent-gold);
    box-shadow: 0 0 8px rgba(232, 184, 75, 0.4);
}

.sidebar-footer {
    display: flex;
    justify-content: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(108, 117, 125, 0.15);
}

/* ===== Mobile Nav Toggle ===== */
#nav-toggle {
    display: none;
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 200;
    width: 44px;
    height: 44px;
    background: rgba(26, 26, 46, 0.9);
    border: 1px solid rgba(74, 144, 217, 0.2);
    border-radius: 4px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--warm-white);
    transition: all 0.3s ease;
    border-radius: 1px;
}

#nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

#nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Main Content ===== */
#main-content {
    margin-left: var(--sidebar-width);
    position: relative;
    z-index: 2;
}

.content-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 4rem;
}

.section-inner {
    max-width: 900px;
    width: 100%;
}

/* ===== Wabi-Sabi Border Treatment ===== */
.wabi-border {
    border: 1px solid rgba(108, 117, 125, 0.25);
    border-radius: 2px 8px 2px 8px;
    position: relative;
}

.wabi-border::before {
    content: '';
    position: absolute;
    top: -1px;
    right: 20%;
    width: 40px;
    height: 1px;
    background: var(--accent-gold);
    opacity: 0.5;
}

.wabi-border::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 15%;
    width: 30px;
    height: 1px;
    background: var(--primary-blue);
    opacity: 0.4;
}

.wabi-border-heavy {
    border: 1px solid rgba(108, 117, 125, 0.3);
    border-radius: 3px 12px 3px 12px;
    position: relative;
}

.wabi-border-heavy::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 10%;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-gold), transparent);
    opacity: 0.6;
}

.wabi-border-heavy::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 10%;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-blue));
    opacity: 0.5;
}

/* ===== Section Labels ===== */
.section-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* ===== Variable Fluid Typography ===== */
.fluid-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--warm-white);
    margin-bottom: 1.5rem;
}

.fluid-title .title-line {
    display: block;
}

.fluid-title .title-line.accent {
    color: var(--primary-blue);
    font-style: italic;
}

.fluid-heading {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--warm-white);
    margin-bottom: 2.5rem;
}

/* ===== Hero Section ===== */
#hero .section-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3rem;
}

.hero-border {
    padding: 3rem;
    background: rgba(26, 26, 46, 0.3);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    color: var(--muted-gray);
    max-width: 550px;
    line-height: 1.8;
    font-weight: 300;
}

.hero-scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    align-self: center;
    animation: bobDown 3s ease-in-out infinite;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--primary-blue), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-text {
    font-family: var(--font-body);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--muted-gray);
}

@keyframes bobDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ===== Depths Section ===== */
.depth-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.depth-card {
    padding: 2rem 1.5rem;
    background: rgba(26, 26, 46, 0.4);
    transition: all 0.4s ease;
    overflow: hidden;
}

.depth-card:hover {
    background: rgba(26, 26, 46, 0.6);
    transform: translateY(-4px);
    border-color: rgba(74, 144, 217, 0.3);
}

.card-depth-indicator {
    margin-bottom: 1.5rem;
}

.depth-number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    opacity: 0.6;
}

.depth-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--warm-white);
    margin-bottom: 0.75rem;
}

.depth-card p {
    font-size: 0.85rem;
    color: var(--muted-gray);
    line-height: 1.7;
    font-weight: 300;
}

.depth-card[data-depth='1'] { border-top: 2px solid rgba(74, 144, 217, 0.4); }
.depth-card[data-depth='2'] { border-top: 2px solid rgba(74, 144, 217, 0.25); }
.depth-card[data-depth='3'] { border-top: 2px solid rgba(74, 144, 217, 0.12); }

/* ===== Nature Section ===== */
.nature-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: start;
}

.nature-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.nature-svg {
    width: 100%;
    max-width: 250px;
    height: auto;
    opacity: 0.7;
}

.nature-panel-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nature-text-block {
    padding: 1.5rem 2rem;
    background: rgba(26, 26, 46, 0.3);
    transition: all 0.3s ease;
}

.nature-text-block:hover {
    background: rgba(26, 26, 46, 0.5);
    border-color: rgba(232, 184, 75, 0.2);
}

.nature-text-block h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.nature-text-block p {
    font-size: 0.85rem;
    color: var(--muted-gray);
    line-height: 1.7;
    font-weight: 300;
}

/* ===== Wabi-Sabi Section ===== */
.wabi-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.wabi-item {
    padding: 2.5rem 2rem;
    background: rgba(26, 26, 46, 0.35);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.wabi-item:hover {
    background: rgba(26, 26, 46, 0.55);
}

.wabi-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.05;
}

.texture-crack {
    background-image:
        linear-gradient(135deg, transparent 40%, var(--muted-gray) 40.5%, transparent 41%),
        linear-gradient(225deg, transparent 60%, var(--muted-gray) 60.5%, transparent 61%),
        linear-gradient(45deg, transparent 70%, var(--muted-gray) 70.5%, transparent 71%);
}

.texture-moss {
    background-image:
        radial-gradient(circle at 20% 30%, var(--primary-blue) 1px, transparent 1px),
        radial-gradient(circle at 60% 70%, var(--primary-blue) 1.5px, transparent 1.5px),
        radial-gradient(circle at 80% 20%, var(--primary-blue) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, var(--primary-blue) 2px, transparent 2px);
    background-size: 100px 100px;
}

.wabi-content {
    position: relative;
    z-index: 1;
}

.wabi-kanji {
    font-size: 4rem;
    color: var(--primary-blue);
    opacity: 0.15;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.wabi-item h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--warm-white);
    margin-bottom: 0.75rem;
}

.wabi-item p {
    font-size: 0.85rem;
    color: var(--muted-gray);
    line-height: 1.8;
    font-weight: 300;
}

.wabi-quote {
    padding: 2rem 2.5rem;
    background: rgba(74, 144, 217, 0.05);
    border-left: 3px solid var(--accent-gold);
}

.wabi-quote blockquote p {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--warm-white);
    line-height: 1.8;
    opacity: 0.85;
}

/* ===== Explore Section ===== */
.explore-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.explore-tile {
    padding: 2rem;
    background: rgba(26, 26, 46, 0.35);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.explore-tile:hover {
    background: rgba(26, 26, 46, 0.55);
    transform: translateY(-3px);
    border-color: rgba(74, 144, 217, 0.3);
}

.tile-depth-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: linear-gradient(to bottom, var(--primary-blue), var(--accent-gold));
    transition: height 0.6s ease;
}

.explore-tile:hover .tile-depth-line {
    height: 100%;
}

.tile-number {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    opacity: 0.15;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.explore-tile h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--warm-white);
    margin-bottom: 0.5rem;
}

.explore-tile p {
    font-size: 0.85rem;
    color: var(--muted-gray);
    line-height: 1.7;
    font-weight: 300;
}

.explore-cta {
    display: flex;
    justify-content: center;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    color: var(--accent-gold);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: rgba(232, 184, 75, 0.05);
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: rgba(232, 184, 75, 0.12);
    border-color: rgba(232, 184, 75, 0.4);
    transform: translateY(-2px);
}

.cta-button svg {
    transition: transform 0.3s ease;
}

.cta-button:hover svg {
    transform: translateY(-3px);
}

/* ===== Scroll Reveal Animations ===== */
.content-section .section-inner {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.content-section.visible .section-inner {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .depth-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .nature-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .nature-panel-left {
        display: flex;
        justify-content: center;
    }

    .wabi-showcase {
        grid-template-columns: 1fr;
    }

    .explore-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #nav-toggle {
        display: flex;
    }

    #main-content {
        margin-left: 0;
    }

    .content-section {
        padding: 4rem 2rem;
    }

    .hero-border {
        padding: 2rem;
    }

    .fluid-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

    .fluid-heading {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
}

@media (max-width: 480px) {
    .content-section {
        padding: 3rem 1.25rem;
    }

    .hero-border {
        padding: 1.5rem;
    }

    .depth-card {
        padding: 1.5rem 1.25rem;
    }

    .wabi-item {
        padding: 1.75rem 1.5rem;
    }

    .explore-tile {
        padding: 1.5rem;
    }
}
