@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/public/fonts/CormorantGaramond-Light300.ttf') format('truetype');
}
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/public/fonts/CormorantGaramond-Regular400.ttf') format('truetype');
}
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/public/fonts/CormorantGaramond-SemiBold600.ttf') format('truetype');
}
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('/public/fonts/CormorantGaramond-Italic400.ttf') format('truetype');
}
@font-face {
    font-family: 'Space Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/public/fonts/SpaceMono-Regular400.ttf') format('truetype');
}
@font-face {
    font-family: 'Space Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/public/fonts/SpaceMono-Bold700.ttf') format('truetype');
}

:root {
    /* Palette: Washi (Paper) & Sumi (Ink) - Japanese Contemporary */
    --c-bg: #E8E6E2;
    --c-text: #111111;
    --c-sub: #3A3A3A;
    --c-accent: #C0392B; /* deeper vermilion */
    --c-line: rgba(0,0,0,0.18);
    --c-card-hover: #FFFFFF;
    
    /* Typography */
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Inter', 'Helvetica Neue', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    --grid-col: 1fr 1fr 1fr 1fr;
    --pad: 4vw;
}

* { 
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body {
    background-color: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-sans);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    font-size: 18px;
    line-height: 1.75;
}

/* Allow text selection in form inputs and textareas */
input,
textarea,
[contenteditable] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Japanese Grid Overlay */
.grid-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: var(--grid-col);
    pointer-events: none;
    z-index: 9999;
    padding: 0 var(--pad);
    gap: 20px;
    opacity: 0.3;
}
.col-guide { border-left: 1px solid var(--c-line); height: 100%; }
.col-guide:last-child { border-right: 1px solid var(--c-line); }

/* WebGL Background - Behind content but clickable */
#webgl {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Above background, below content */
    opacity: 1;
    pointer-events: auto; /* Allow interaction */
}

/* Navigation - Base styles, overridden by desktop/mobile */
.nav-side {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    background: rgba(245, 243, 239, 0.8);
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

.logo-vert {
    font-family: var(--font-mono);
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--c-text);
}

.menu-btn {
    width: 48px;
    height: 48px;
    border: 1px solid var(--c-text);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.menu-btn:hover { background: var(--c-text); color: var(--c-bg); transform: scale(1.1); }

/* Hero Section - Base styles */
.hero-sec {
    min-height: 80vh;
    padding: 0 var(--pad);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.hero-main { 
    pointer-events: none; /* Text should not block 3D interaction */
}

.headline {
    font-family: var(--font-serif);
    font-size: clamp(4rem, 11vw, 9rem);
    line-height: 0.85;
    font-weight: 300;
    margin: 0;
    color: var(--c-text);
    letter-spacing: -0.04em;
    mix-blend-mode: multiply; /* Interaction with bg */
}

.headline span { display: block; }
.headline .indent { font-style: italic; color: var(--c-sub); }

/* Capabilities - Single Glassmorphic Tile */
.capabilities-sec {
    padding: 6rem var(--pad);
    position: relative;
    z-index: 2;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.capability-tile {
    max-width: 900px;
    width: 100%;
    padding: 6rem 5rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    will-change: auto;
}

.capability-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    pointer-events: none;
    z-index: 0;
}

.capability-tile:hover {
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.45);
}

.capability-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.capability-headline {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 6vw, 5.5rem);
    line-height: 1.1;
    font-weight: 300;
    color: #ffffff;
    margin: 0 0 2rem 0;
    letter-spacing: -0.02em;
}

.capability-description {
    font-family: var(--font-mono);
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
    font-weight: 400;
}


/* Section Labels */
.sec-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--c-sub);
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--c-line);
    font-weight: 700;
}

/* Clients Grid */
.clients-sec {
    padding: 6rem var(--pad);
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.client-grid {
    display: grid;
    gap: 1px;
    background: var(--c-line);
    border: 1px solid var(--c-line);
}

.client-cell {
    background: #F5F3EF;
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
    transition: background 0.3s;
}
.client-cell:hover { background: #F0EDE8; }

.logo-container {
    height: 60px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.client-cell img {
    max-width: 80%;
    max-height: 100%;
    object-fit: contain;
    filter: none;
    opacity: 0.9;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.client-cell:hover img { opacity: 1; transform: scale(1.05); }

.client-cat {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #000000;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.08em;
}

.client-name {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: #000000;
    letter-spacing: 0.05em;
}

.team-sec {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    transform: translateZ(0);
    will-change: scroll-position;
    scroll-margin-top: 0;
}

.team-grid {
    display: grid;
    gap: 2rem;
}

.team-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.team-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    transform: translateZ(0);
    backface-visibility: hidden;
}

.team-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    min-height: 180px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.team-info h3 {
    margin: 0 0 1rem 0;
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 400;
}

.team-bio {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--c-sub);
    font-weight: 400;
    flex: 1;
    overflow: visible;
}

/* Designers Cover - Hide when config.hideDesigners is true */
.team-sec.designers-hidden .team-card {
    position: relative;
    overflow: hidden;
}

.team-sec.designers-hidden .team-card img,
.team-sec.designers-hidden .team-card .team-info {
    opacity: 0;
    pointer-events: none;
    user-select: none;
}

/* Metal door base */
.team-sec.designers-hidden .team-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 85% 50%, rgba(0, 0, 0, 0.15) 0%, transparent 8%),
        linear-gradient(
            135deg,
            #e8e8e8 0%,
            #d4d4d4 25%,
            #c0c0c0 50%,
            #d4d4d4 75%,
            #e8e8e8 100%
        );
    background-size: 200% 200%, 200% 200%;
    border-radius: 12px;
    z-index: 10;
    pointer-events: auto;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.6),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Metal door texture overlay */
.team-sec.designers-hidden .team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        );
    border-radius: 12px;
    z-index: 11;
    pointer-events: none;
    opacity: 0.4;
}

/* Address Section */
.address-sec {
    padding: 6rem var(--pad) 1.2rem var(--pad);
    position: relative;
    z-index: 2;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.address-tile {
    max-width: 600px;
    width: 100%;
    padding: 3rem 4rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    will-change: auto;
}

.address-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    pointer-events: none;
    z-index: 0;
}

.address-tile:hover {
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.45);
}

.address-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.address-building {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.building-logo {
    height: 180px;
    width: auto;
    transition: opacity 0.3s ease;
    filter: brightness(0) invert(1);
}

.address-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.address-line {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: #ffffff;
    line-height: 1.8;
    letter-spacing: 0.05em;
}

.address-line:first-child {
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

/* Photography Section */
.photography-sec {
    padding: 0;
    position: relative;
    height: 500px;
    overflow: hidden;
    z-index: 2;
}

.photography-sec img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    display: block;
}

.photography-label {
    position: absolute;
    bottom: 2rem;
    left: 6vw;
    background: #fff;
    padding: 1rem;
}

.photography-label div {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* Contact */
.contact-sec {
    padding: 1.2rem var(--pad) 6rem var(--pad);
    background: #2A2824;
    color: var(--c-bg);
    position: relative;
    z-index: 2;
    pointer-events: auto;
    min-height: 600px;
    display: flex;
    align-items: center;
}

.contact-sec .sec-label {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.contact-layout {
    display: grid;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.contact-head {
    font-family: var(--font-serif);
    font-size: 6rem;
    line-height: 0.9;
    margin-bottom: 2rem;
    font-weight: 300;
}

.contact-sub {
    font-family: var(--font-mono);
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding: 2rem 0;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
    margin-bottom: 0;
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--c-accent);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    margin-top: 3rem;
    background: var(--c-bg);
    color: var(--c-text);
    border: none;
    padding: 1.2rem 4rem;
    font-family: var(--font-mono);
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    align-self: flex-start;
    width: auto;
}
.submit-btn:hover {
    background: var(--c-accent);
    color: #fff;
}

/* =====================================================
   JELLY SWITCH - Top Right, Vertical Orientation
   ===================================================== */
.jelly-switch-container {
    position: fixed;
    top: 20px;
    right: -30px;
    z-index: 100;
    transform: rotate(-90deg);
    transform-origin: center center;
    pointer-events: auto;
}

#jelly-switch-canvas {
    width: 240px;
    height: 120px;
    display: block;
    cursor: pointer;
    /* Subtle glow effect on hover handled by WebGPU shader */
}

/* Fallback styles for browsers without WebGPU */
.jelly-switch-fallback {
    transform: rotate(-90deg);
    transform-origin: center center;
}

.jelly-switch-label {
    display: block;
    cursor: pointer;
    user-select: none;
}

.jelly-switch-label input {
    display: none;
}

.jelly-switch-track {
    display: block;
    width: 56px;
    height: 28px;
    background: rgba(200, 198, 194, 0.9);
    border-radius: 14px;
    position: relative;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(255, 255, 255, 0.8);
}

.jelly-switch-label input:checked + .jelly-switch-track {
    background: var(--c-accent);
}

.jelly-switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

.jelly-switch-label input:checked + .jelly-switch-track .jelly-switch-knob {
    transform: translateX(28px);
}

.jelly-switch-label:active .jelly-switch-knob {
    transform: scaleX(1.1) scaleY(0.95);
}

.jelly-switch-label input:checked + .jelly-switch-track:active .jelly-switch-knob {
    transform: translateX(28px) scaleX(1.1) scaleY(0.95);
}

/* Desktop adjustments */
@media (min-width: 769px) {
    .jelly-switch-container {
        top: 24px;
        right: -30px;
    }
    
    #jelly-switch-canvas {
        width: 160px;
        height: 80px;
    }
}

