/* ============================================
   tanso.club - Terracotta Villa Design System
   ============================================ */

/* CSS Custom Properties */
:root {
    /* Palette */
    --primary-terracotta: #C4572A;
    --secondary-terracotta: #D4845A;
    --dark-ground: #3D1F14;
    --sidebar-bg: #6B3A2A;
    --light-ground: #FFF5E6;
    --accent-gold: #E8A84C;
    --text-dark: #2B1810;
    --muted-sand: #EBD9C4;
    --wave-teal: #3A7D7B;
    --warm-parchment: #FFF0D9;

    /* Animation Timing */
    --wave-duration: 6s;
    --reveal-duration: 0.6s;
    --stagger-delay: 0.15s;

    /* Layout */
    --sidebar-width: 280px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    color: var(--text-dark);
    background: var(--light-ground);
    overflow-x: hidden;
}

/* Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ============================================
   Sidebar Navigation
   ============================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 100;
    overflow: hidden;
}

.sidebar-wave-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 30px,
        rgba(232, 168, 76, 0.05) 30px,
        rgba(232, 168, 76, 0.05) 32px
    );
    pointer-events: none;
}

.sidebar-content {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2.5rem 1.5rem;
    z-index: 1;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
}

.logo-mark {
    margin-bottom: 1rem;
    opacity: 0.8;
}

.logo-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    color: var(--light-ground);
    text-transform: uppercase;
}

.nav-items {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-item span {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--light-ground);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 245, 230, 0.08);
}

.nav-item:hover span {
    opacity: 1;
}

.nav-item.active {
    background: rgba(255, 245, 230, 0.12);
}

.nav-item.active span {
    font-weight: 600;
    opacity: 1;
    color: var(--accent-gold);
}

.nav-icon {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(232, 168, 76, 0.2);
}

.members-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-gold);
    opacity: 0.6;
}

/* ============================================
   Mobile Bottom Tab Bar
   ============================================ */

.mobile-tabs {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--sidebar-bg);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--light-ground);
    opacity: 0.5;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.tab-btn.active {
    opacity: 1;
    color: var(--accent-gold);
    background: rgba(255, 245, 230, 0.1);
}

.tab-btn:hover {
    opacity: 0.8;
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ============================================
   Room Base Styles
   ============================================ */

.room {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ============================================
   Section Wave Dividers
   ============================================ */

.wave-section-divider {
    width: 100%;
    height: 60px;
    overflow: hidden;
}

.section-wave {
    width: 100%;
    height: 100%;
}

/* ============================================
   Progressive Disclosure
   ============================================ */

.reveal-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--reveal-duration) ease, transform var(--reveal-duration) ease;
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Section 1: Entrance Hall (Hero)
   ============================================ */

.entrance {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--light-ground);
    position: relative;
}

.wave-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-waves {
    width: 100%;
    height: 60%;
    position: absolute;
    top: 20%;
}

.entrance-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: clamp(2.8rem, 8vw, 5.5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-terracotta);
    margin-bottom: 1.5rem;
    animation: fadeInDown 1.2s ease forwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2em;
    margin-bottom: 2rem;
}

.hero-subtitle {
    font-family: 'EB Garamond', serif;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--text-dark);
    font-style: italic;
    letter-spacing: 0.02em;
}

.typewriter-cursor {
    display: inline-block;
    font-family: 'EB Garamond', serif;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--primary-terracotta);
    animation: cursorBlink 0.8s infinite;
    margin-left: 2px;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.entrance-wave-divider {
    margin: 2rem auto;
    width: 60%;
    max-width: 600px;
}

.divider-wave {
    width: 100%;
    height: 40px;
}

.entrance-tagline {
    font-family: 'EB Garamond', serif;
    font-size: 1.1rem;
    color: var(--secondary-terracotta);
    font-weight: 500;
    letter-spacing: 0.03em;
}

/* ============================================
   Section 2: The Gallery
   ============================================ */

.gallery {
    background: var(--light-ground);
    padding: 4rem 3rem 6rem;
}

.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    letter-spacing: 0.04em;
    color: var(--primary-terracotta);
    text-align: center;
    margin-bottom: 1rem;
}

.section-intro {
    font-family: 'EB Garamond', serif;
    font-size: 1.1rem;
    color: var(--text-dark);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
    opacity: 0.8;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.gallery-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 1rem;
    background: rgba(235, 217, 196, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(196, 87, 42, 0.15);
    background: rgba(235, 217, 196, 0.5);
}

.tile-icon-frame {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-icon {
    transition: transform 0.3s ease;
}

.gallery-tile:hover .tile-icon {
    transform: scale(1.05);
}

.icon-ring {
    stroke-dasharray: 176;
    stroke-dashoffset: 176;
    transition: stroke-dashoffset 0.6s ease;
}

.gallery-tile:hover .icon-ring {
    stroke-dashoffset: 0;
}

.tile-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dark);
    text-align: center;
}

/* ============================================
   Section 3: The Library
   ============================================ */

.library {
    background: var(--light-ground);
    padding: 4rem 3rem 6rem;
}

.library-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1000px;
    margin: 2rem auto 0;
}

.library-col p {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.wave-mini-divider {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.pull-quote {
    border-left: 3px solid transparent;
    border-image: linear-gradient(to bottom, var(--primary-terracotta), var(--accent-gold)) 1;
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    margin: 2rem 0;
    background: rgba(235, 217, 196, 0.2);
}

.pull-quote p {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.35rem;
    line-height: 1.6;
    color: var(--primary-terracotta);
    margin-bottom: 0;
}

/* ============================================
   Section 4: The Terrace
   ============================================ */

.terrace {
    background: var(--warm-parchment);
    padding: 4rem 3rem 6rem;
}

.terrace-content {
    max-width: 600px;
    margin: 0 auto;
}

.terrace .section-title {
    text-align: left;
}

.terrace-featured {
    margin-top: 2rem;
}

.featured-icon {
    text-align: center;
    margin-bottom: 2rem;
}

.featured-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 1.6rem;
    color: var(--primary-terracotta);
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.terrace-featured p {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.terrace-wave-separator {
    margin: 2rem 0;
    height: 30px;
}

/* ============================================
   Section 5: The Cellar (Footer)
   ============================================ */

.cellar {
    background: var(--dark-ground);
    padding: 6rem 3rem 4rem;
    min-height: auto;
}

.cellar-wave-animation {
    width: 100%;
    height: 80px;
    overflow: hidden;
    margin-bottom: 3rem;
}

.cellar-waves {
    width: 100%;
    height: 100%;
}

.cellar-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.cellar-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--light-ground);
    letter-spacing: 0.06em;
    margin-bottom: 2rem;
}

.cellar-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.cellar-link {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted-sand);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.cellar-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--wave-teal);
    transition: width 0.3s ease;
}

.cellar-link:hover {
    color: var(--light-ground);
}

.cellar-link:hover::after {
    width: 100%;
}

.cellar-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.cellar-members-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-gold);
}

.cellar-copyright {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--muted-sand);
    opacity: 0.4;
}

/* ============================================
   Responsive: Mobile
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .mobile-tabs {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding-bottom: 60px;
    }

    .gallery {
        padding: 3rem 1.5rem 4rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .library {
        padding: 3rem 1.5rem 4rem;
    }

    .library-columns {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .terrace {
        padding: 3rem 1.5rem 4rem;
    }

    .cellar {
        padding: 4rem 1.5rem 3rem;
    }

    .cellar-nav {
        gap: 1rem;
    }

    .hero-title {
        letter-spacing: 0.05em;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .gallery-tile {
        padding: 1.25rem 0.75rem;
    }

    .tile-icon {
        width: 48px;
        height: 48px;
    }
}

/* ============================================
   Wave-form Background Texture
   ============================================ */

.entrance::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 60px,
            rgba(232, 168, 76, 0.03) 60px,
            rgba(232, 168, 76, 0.03) 62px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 80px,
            rgba(58, 125, 123, 0.02) 80px,
            rgba(58, 125, 123, 0.02) 82px
        );
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Tile-pattern Background for Gallery
   ============================================ */

.gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(45deg, rgba(196, 87, 42, 0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(196, 87, 42, 0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(196, 87, 42, 0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(196, 87, 42, 0.03) 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    pointer-events: none;
    z-index: 0;
}

.gallery {
    position: relative;
}

.gallery > * {
    position: relative;
    z-index: 1;
}

/* ============================================
   Gradient Borders for Cards
   ============================================ */

.pull-quote {
    border-left: 3px solid var(--primary-terracotta);
    border-image: linear-gradient(180deg, var(--primary-terracotta), var(--accent-gold)) 1;
}
