/* ============================================
   STUDIO WHITE — CM HOME DECOR
   Apple-grade high-luminance spatial UI
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
    --surface-base: #FFFFFF;
    --surface-secondary: #F5F5F7;
    --surface-tertiary: #E8E8ED;
    --text-primary: #1D1D1F;
    --text-secondary: #424245;
    --text-tertiary: #86868B;
    --accent: #FF3B30;
    --accent-hover: #E0342B;
    --accent-glow: rgba(255, 59, 48, 0.15);
    --wireframe-stroke: #D2D2D7;
    --card-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.10);
    --card-border: rgba(0, 0, 0, 0.06);
    --header-glass: rgba(255, 255, 255, 0.72);
    --header-glass-scrolled: rgba(255, 255, 255, 0.85);
    --header-border: rgba(0, 0, 0, 0.08);
    --lift-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

/* === BASE TYPOGRAPHY === */
body.studio-white {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--surface-base);
    color: var(--text-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body.studio-white .font-headline,
body.studio-white h1,
body.studio-white h2 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    color: var(--text-primary);
    letter-spacing: -0.04em;
    font-weight: 700;
}

body.studio-white h3 {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-weight: 600;
}

/* Scrollbar — minimal, Apple-style */
body.studio-white::-webkit-scrollbar { width: 8px; }
body.studio-white::-webkit-scrollbar-track { background: var(--surface-base); }
body.studio-white::-webkit-scrollbar-thumb { background: #C7C7CC; border-radius: 10px; }
body.studio-white::-webkit-scrollbar-thumb:hover { background: #A1A1A6; }

/* === GLOBAL HEADER (White Glassmorphism Pill) === */
#spatial-header {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) scale(1);
    z-index: 1000;
    width: calc(100% - 48px);
    max-width: 1200px;
    padding: 12px 32px;
    border-radius: 100px;
    background: var(--header-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--header-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                backdrop-filter 0.4s ease,
                background 0.4s ease,
                box-shadow 0.4s ease,
                padding 0.3s ease;
    will-change: transform;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

#spatial-header.scrolled {
    transform: translateX(-50%) scale(0.98);
    background: var(--header-glass-scrolled);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 10px 32px;
}

/* Logo — dark standout on white bg */
.header-logo {
    height: 42px;
    width: auto;
    filter: brightness(0) saturate(100%);
    opacity: 0.9;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.header-logo:hover {
    opacity: 1;
    filter: brightness(0) saturate(100%);
}

/* Nav links */
.header-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-nav a {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
    padding-bottom: 4px;
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.3s ease;
}

.header-nav a:hover {
    color: var(--text-primary);
}

.header-nav a.active::after,
.header-nav a:hover::after {
    background: var(--accent);
}

.header-nav a.active {
    color: var(--text-primary);
    font-weight: 600;
}

#spatial-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

/* Mobile menu */
#spatial-mobile-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 16px;
    z-index: 999;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--card-shadow-hover);
}

#spatial-mobile-menu.active {
    display: flex;
}

#spatial-mobile-menu a {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 12px;
    transition: background 0.2s ease, color 0.2s ease;
    text-align: center;
}

#spatial-mobile-menu a:hover {
    background: var(--accent-glow);
    color: var(--accent);
}

/* === HERO SECTION (Studio White Spatial Canvas) === */
#spatial-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 700px;
    background: var(--surface-base);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Giant Wireframe Logo — 150% scale, #D2D2D7 */
#wireframe-logo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 1200px;
    height: auto;
    z-index: 5;
    pointer-events: none;
    will-change: transform;
}

#wireframe-logo {
    width: 100%;
    height: auto;
}

#wireframe-logo path,
#wireframe-logo line,
#wireframe-logo polyline,
#wireframe-logo polygon,
#wireframe-logo rect {
    fill: none;
    stroke: var(--wireframe-stroke);
    stroke-width: 1;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawWireframe 3s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes drawWireframe {
    to {
        stroke-dashoffset: 0;
        stroke: var(--wireframe-stroke);
    }
}

/* Subtle face animations */
#wireframe-logo .logo-face-top {
    animation: drawWireframe 3s cubic-bezier(0.65, 0, 0.35, 1) 0.2s forwards;
}

#wireframe-logo .logo-face-right {
    animation: drawWireframe 3s cubic-bezier(0.65, 0, 0.35, 1) 0.4s forwards;
}

/* Pulse on CTA hover */
#spatial-hero.logo-pulse #wireframe-logo-container {
    animation: logoPulse 0.6s ease-in-out;
}

@keyframes logoPulse {
    0% { transform: translate(-50%, -50%) translateZ(0); }
    50% { transform: translate(-50%, -50%) translateZ(20px) scale(1.02); }
    100% { transform: translate(-50%, -50%) translateZ(0); }
}

/* Hero Content — Occlusion Z-Index Layers */
#hero-content-layer {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 900px;
    padding: 0 24px;
}

/* "Design" is IN FRONT of wireframe (z:12), "Sanctuary" is BEHIND (z:2) */
.hero-headline {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    margin-bottom: 24px;
    position: relative;
}

.hero-headline .occlude-front {
    position: relative;
    z-index: 12;
    display: inline;
}

.hero-headline .occlude-behind {
    position: relative;
    z-index: 2;
    display: inline;
    opacity: 0.7;
}

/* Sub-headline */
.hero-subheadline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 48px;
    margin-top: 20px;
}

/* CTA */
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    color: #fff;
    background: var(--accent);
    padding: 16px 40px;
    border-radius: 100px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    z-index: 15;
}

.hero-cta:hover {
    transform: scale(1.05);
    background: var(--accent-hover);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.hero-cta svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.hero-cta:hover svg {
    transform: translateX(4px);
}

/* Cursor light — warm subtle on white */
#cursor-light {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 59, 48, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 2;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    will-change: left, top;
}

/* Ambient particles — light grey */
.ambient-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
    animation: particleDrift linear infinite;
}

@keyframes particleDrift {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(50px); opacity: 0; }
}

/* Entrance animations */
.hero-headline {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 2.5s forwards;
}

.hero-subheadline {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 3s forwards;
}

.hero-cta {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 3.3s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === IMAGE LIFT EFFECT (scroll into view) === */
.lift-on-scroll {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.6s ease;
}

.lift-on-scroll.lifted {
    transform: translateY(-10px);
    box-shadow: var(--lift-shadow);
}

/* === ELASTIC SCROLL TRANSITIONS === */
html.studio-white-scroll {
    scroll-behavior: smooth;
}

/* Spring-like cubic-bezier for scroll-triggered animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* === PRODUCT CARDS (White Surface) === */
.product-card-white {
    position: relative;
    background: var(--surface-base);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease;
    box-shadow: var(--card-shadow);
}

.product-card-white:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
}

/* === CATEGORY CARDS (White Card Body) === */
.category-card-white {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: var(--surface-base);
    border: 1px solid var(--card-border);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
}

.category-card-white:hover {
    transform: translateY(-10px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(255, 59, 48, 0.15);
}

.category-card-white-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    flex-shrink: 0;
}

.category-card-white-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.category-card-white:hover .category-card-white-img {
    transform: scale(1.06);
}

.category-card-white-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-card-white-body h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    color: #1D1D1F;
    letter-spacing: -0.02em;
    margin: 0;
}

.category-card-white-body .cat-price {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #F97316;
    margin: 2px 0 0;
}

.category-card-white-body .cat-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #86868B;
    line-height: 1.4;
    margin: 4px 0 0;
}

.category-card-white .explore-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    width: 100%;
    padding: 10px 20px;
    background: #1D1D1F;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-card-white .explore-btn:hover {
    background: #FF3B30;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

/* === CONTACT FORM (Clean-Room) === */
.clean-room-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: var(--text-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    outline: none;
}

.clean-room-input::placeholder {
    color: var(--text-tertiary);
}

.clean-room-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--surface-base);
}

/* === BENTO GRID (About Page) === */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.bento-text {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.bento-image {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--card-shadow-hover);
}

.bento-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === FOOTER (White) === */
.footer-white {
    background: var(--surface-secondary);
    color: var(--text-secondary);
    padding: 64px 0;
}

.footer-white h3,
.footer-white h4 {
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.footer-white a {
    color: var(--text-tertiary);
    transition: color 0.3s ease;
}

.footer-white a:hover {
    color: var(--accent);
}

.footer-white .footer-divider {
    border-top: 1px solid rgba(0, 0, 0, 0.08); /* slightly darker border */
    margin-top: 48px;
    padding-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    gap: 16px;
}

.footer-white .footer-logo {
    height: 32px;
    width: auto;
    filter: invert(1); /* makes the logo dark if it's currently white/translucent, or just leave it for cm decorrr.png which is already white/dark based on the filter used in header */
    opacity: 0.9;
}

.footer-white .footer-copyright {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #111111; /* dark font */
}

/* === FOOTER SOCIAL BUTTONS (Interactive) === */
.footer-social-btn:hover {
    background: #FFFFFF !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.footer-social-btn:active {
    transform: translateY(0) scale(0.98);
}

/* === OFFCANVAS (White Glass) === */
.offcanvas-white {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 90vh;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-top: 1px solid var(--card-border);
    z-index: 999;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-y: auto;
    color: var(--text-primary);
}

.offcanvas-white.active {
    transform: translateY(0);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #spatial-header {
        width: calc(100% - 32px);
        padding: 10px 20px;
    }

    .header-nav {
        display: none;
    }

    #spatial-menu-btn {
        display: block;
    }

    #wireframe-logo-container {
        width: 120vw;
    }

    .hero-subheadline {
        letter-spacing: 0.1em;
    }

    .hero-cta {
        padding: 14px 32px;
        font-size: 14px;
    }

    #cursor-light {
        display: none;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}
