/* =========================================
   VARIABLES & DESIGN TOKENS
   ========================================= */
:root {
    --bg-void: #030407;
    --accent-glow: #D4AF37;
    --text-bright: #F5E6DA;
    --text-dim: #A88160;
    --border-light: rgba(212, 175, 55, 0.15);

    --font-display: 'Fraunces', serif;
    --font-body: 'Satoshi', sans-serif;

    --transition-smooth: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.3s ease;
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
}

html {
    scroll-behavior: initial;
}

body {
    font-family: var(--font-body);
    background-color: transparent; /* WebGL handles bg */
    color: var(--text-bright);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Cursor */
.cursor {
    width: 8px;
    height: 8px;
    background-color: var(--accent-glow);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    transition: width 0.3s, height 0.3s, background-color 0.3s;
    will-change: transform;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s;
    will-change: transform;
}

.cursor-follower.active {
    width: 60px;
    height: 60px;
    border-color: var(--accent-glow);
    background-color: rgba(212, 175, 55, 0.15);
}

/* Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* WebGL Canvas */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    background-color: var(--bg-void); /* Fallback */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
}

/* =========================================
   LAYOUT & COMPONENTS
   ========================================= */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(3, 4, 7, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.menu-links {
    display: flex;
    gap: 3rem;
}

.nav-link {
    color: var(--text-bright);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.btn-solid {
    background-color: var(--accent-glow);
    color: #000;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    border-radius: 2px;
    transition: var(--transition-fast);
}

.btn-solid:hover {
    background-color: #FFF;
}

/* Buttons */
.btn-outline {
    display: inline-block;
    padding: 1.2rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-bright);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.btn-outline:hover {
    background-color: var(--text-bright);
    color: var(--bg-void);
}

.btn-text {
    color: var(--text-dim);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.btn-text:hover {
    color: var(--text-bright);
}

/* =========================================
   SECTIONS
   ========================================= */

/* Hero */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 10vh;
}

.hero-container {
    width: 100%;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    max-width: 1200px;
}

.hero-badge {
    display: flex;
    gap: 1.5rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
    letter-spacing: 0.15em;
    border-left: 2px solid var(--accent-glow);
    padding-left: 1rem;
}

.hero-title {
    font-size: clamp(4rem, 9vw, 9rem);
    display: flex;
    flex-direction: column;
    line-height: 0.9;
    letter-spacing: -0.02em;
}


.hero-cta {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 500px;
}

.hero-subtext {
    font-size: 1.2rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* Category Showcase */
.categories {
    padding: 8rem 0;
    position: relative;
    z-index: 10;
}

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

.category-card {
    text-decoration: none;
    color: var(--text-bright);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.category-img-wrapper {
    aspect-ratio: 4/5;
    background-color: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    transition: var(--transition-fast);
}

.category-card:hover .category-img-wrapper {
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.1);
    transform: scale(1.02);
}

.category-tag {
    font-family: monospace;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--accent-glow);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* Archives / Best Sellers */
.archives {
    padding: 8rem 0;
    position: relative;
    z-index: 10;
    border-top: 1px solid var(--border-light);
}

.section-header {
    margin-bottom: 4rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.section-title {
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 1;
}

.product-carousel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.product-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.placeholder-wrapper {
    aspect-ratio: 3/4;
    background-color: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    transition: var(--transition-fast);
}

.product-card:hover .placeholder-wrapper {
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.1);
    transform: translateY(-5px);
}

.placeholder-tag {
    font-family: monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-meta h4 {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.product-meta .price {
    font-size: 0.95rem;
    color: var(--text-dim);
}

/* Craftsmanship / Anatomy */
.craftsmanship {
    padding: 10rem 0;
    position: relative;
    z-index: 10;
    background: linear-gradient(180deg, rgba(3,4,7,0) 0%, rgba(3,4,7,0.8) 50%, rgba(3,4,7,0) 100%);
}

.craft-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

.large-placeholder {
    aspect-ratio: 4/5;
}

.craft-content {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.craft-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.craft-list h3 {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    color: var(--accent-glow);
    margin-bottom: 1rem;
}

.craft-list p {
    font-size: 1.1rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* Ethos */
.ethos {
    padding: 12rem 0;
    position: relative;
    z-index: 10;
    border-top: 1px solid var(--border-light);
}

.ethos-container {
    display: flex;
    justify-content: center;
}

.ethos-content {
    max-width: 800px;
    text-align: center;
}

.ethos-heading {
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 1.1;
    margin-bottom: 3rem;
    font-weight: 500;
}

.ethos-body p {
    font-size: 1.25rem;
    color: var(--text-dim);
    line-height: 1.8;
    margin-bottom: 3rem;
}

/* Footer */
.footer {
    padding: 8rem 0 2rem;
    background-color: var(--bg-void);
    border-top: 1px solid var(--border-light);
    position: relative;
    z-index: 10;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-bottom: 6rem;
}

.logo-massive {
    font-size: clamp(3rem, 6vw, 6rem);
    line-height: 1;
    margin-bottom: 1rem;
}

.footer-tagline {
    color: var(--text-dim);
    max-width: 300px;
    line-height: 1.6;
}

.footer-links-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-col h4 {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

.footer-col a {
    display: block;
    color: var(--text-bright);
    text-decoration: none;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: var(--transition-fast);
}

.footer-col a:hover {
    color: var(--text-dim);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .product-carousel { grid-template-columns: repeat(2, 1fr); }
    .craft-container { grid-template-columns: 1fr; gap: 4rem; }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .menu-links, .cursor, .cursor-follower { display: none; }
    * { cursor: auto; }
    .category-grid, .product-carousel { grid-template-columns: 1fr; }
    .footer-links-wrapper { grid-template-columns: 1fr; gap: 4rem; }
    .hero-title { font-size: 4rem; }
}

/* =========================================
   AI CLOUD CHAT WIDGET
   ========================================= */
#cloud-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: var(--font-body);
}

#chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-glow);
    color: #000;
    border: none;
    cursor: pointer; /* Override cursor: none for interactivity */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transition: transform 0.3s ease;
}

#chat-toggle-btn:hover {
    transform: scale(1.1);
}

#cloud-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: rgba(10, 15, 25, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform-origin: bottom right;
}

.chat-header {
    padding: 15px 20px;
    background: rgba(212, 175, 55, 0.1);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin: 0;
    color: var(--accent-glow);
    letter-spacing: 0.05em;
}

#close-chat-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

#close-chat-btn:hover {
    color: var(--text-bright);
}

.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.chat-message.bot {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-bright);
    align-self: flex-start;
    border-left: 2px solid var(--accent-glow);
}

.chat-message.user {
    background: rgba(212, 175, 55, 0.15);
    color: var(--text-bright);
    align-self: flex-end;
    border-right: 2px solid var(--accent-glow);
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 10px 15px;
    color: var(--text-bright);
    font-family: var(--font-body);
}

#chat-input:focus {
    outline: none;
    border-color: var(--accent-glow);
}

#send-chat-btn {
    background: var(--accent-glow);
    color: #000;
    border: none;
    padding: 0 15px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

#send-chat-btn:hover {
    background: #FFF;
}