/* ========================================
   調香工房 (Perfume Workshop)
   Hand-Coded CSS - Clean & Maintainable
   ======================================== */

/* ----------------------------------------
   CSS Variables
   ---------------------------------------- */
:root {
    /* Colors */
    --color-bg: #0f0f14;
    --color-bg-card: rgba(255, 255, 255, 0.03);
    --color-text: #fafafa;
    --color-text-muted: rgba(250, 250, 250, 0.6);
    --color-text-subtle: rgba(250, 250, 250, 0.4);
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-light: rgba(255, 255, 255, 0.15);
    --color-accent: hsl(40, 90%, 55%);
    --color-secondary: rgba(255, 255, 255, 0.06);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-blur: 12px;
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Typography */
    --font-serif: "Zen Old Mincho", serif;
    --font-sans: "Noto Sans JP", sans-serif;
    --line-height-ja: 1.8;
    --letter-spacing-ja: 0.05em;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
}

/* ----------------------------------------
   Reset & Base
   ---------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: var(--line-height-ja);
    letter-spacing: var(--letter-spacing-ja);
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Noise texture overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    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.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
}

/* ----------------------------------------
   Typography
   ---------------------------------------- */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 500;
    letter-spacing: 0.08em;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ----------------------------------------
   Header
   ---------------------------------------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(to bottom, var(--color-bg), transparent);
}

.header-container {
    max-width: 80rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.5rem;
    color: var(--color-text);
    letter-spacing: 0.1em;
}

.brand-tagline {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
    display: none;
}

@media (min-width: 640px) {
    .brand-tagline {
        display: block;
    }
    
    .brand-title {
        font-size: 1.75rem;
    }
}

/* Language Toggle */
.language-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    transition: border-color var(--transition-base);
}

.language-toggle:hover {
    border-color: var(--color-border-light);
}

.lang-option {
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    transition: color var(--transition-base);
}

.lang-option.active {
    color: var(--color-text);
    font-weight: 500;
}

.toggle-track {
    position: relative;
    width: 2.5rem;
    height: 1.25rem;
    background-color: var(--color-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.toggle-thumb {
    position: absolute;
    top: 0.125rem;
    right: 0.125rem;
    width: 1rem;
    height: 1rem;
    background-color: var(--color-text);
    border-radius: 50%;
    transition: transform var(--transition-base);
}

/* ----------------------------------------
   Main Content
   ---------------------------------------- */
.main-content {
    position: relative;
    padding: 7rem var(--space-md) var(--space-xl);
    max-width: 80rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .main-content {
        padding-top: 8rem;
        padding-left: var(--space-lg);
        padding-right: var(--space-lg);
    }
}

/* Workshop Layout */
.workshop-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

@media (min-width: 1024px) {
    .workshop-layout {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 4rem;
    }
}

/* ----------------------------------------
   Mixing Station (Bottle)
   ---------------------------------------- */
.mixing-station {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bottle-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.perfume-bottle {
    width: 10rem;
    height: 20rem;
    overflow: visible;
}

@media (min-width: 768px) {
    .perfume-bottle {
        width: 14rem;
        height: 26.25rem;
    }
}

@media (min-width: 1024px) {
    .perfume-bottle {
        width: 16rem;
        height: 30rem;
    }
}

.bottle-status {
    margin-top: var(--space-md);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    background-color: var(--color-secondary);
}

@media (min-width: 1024px) {
    .bottle-status {
        display: none;
    }
}

.status-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: var(--color-text-muted);
}

.status-text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ----------------------------------------
   Glass Panel (Glassmorphism)
   ---------------------------------------- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

/* ----------------------------------------
   Recipe Panel
   ---------------------------------------- */
.recipe-panel {
    width: 100%;
    max-width: 20rem;
    padding: var(--space-lg);
    display: none;
}

@media (min-width: 1024px) {
    .recipe-panel {
        display: block;
    }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.panel-title {
    font-size: 1.125rem;
    color: var(--color-text);
    letter-spacing: 0.1em;
}

.icon-droplets {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-text-muted);
}

/* Volume Meter */
.volume-meter {
    margin-bottom: var(--space-lg);
}

.volume-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
}

.volume-labels span:first-child {
    color: var(--color-text-muted);
}

.volume-value {
    color: var(--color-text);
    font-weight: 500;
}

.progress-track {
    height: 0.5rem;
    background-color: var(--color-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--color-accent) 0%, hsl(40, 90%, 60%) 100%);
    transition: width var(--transition-base);
}

/* Recipe Empty State */
.recipe-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 12.5rem;
    text-align: center;
}

.empty-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.empty-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--color-text-subtle);
}

.empty-title {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.empty-hint {
    font-size: 0.75rem;
    color: var(--color-text-subtle);
    margin-top: var(--space-xs);
}

/* ----------------------------------------
   Action Buttons
   ---------------------------------------- */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 28rem;
    margin: var(--space-lg) auto var(--space-2xl);
    padding: 0 var(--space-md);
}

@media (min-width: 640px) {
    .action-buttons {
        flex-direction: row;
    }
}

.btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: 3rem;
    padding: 0 var(--space-lg);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-icon {
    width: 1rem;
    height: 1rem;
}

.btn-outline {
    border: 1px solid var(--color-border-light);
    color: var(--color-text);
    background: transparent;
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--color-text);
    color: var(--color-bg);
}

.btn-primary {
    background-color: var(--color-text);
    color: var(--color-bg);
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
}

/* ----------------------------------------
   Essences Section
   ---------------------------------------- */
.essences-section {
    width: 100%;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    margin-bottom: var(--space-md);
}

.section-title {
    font-size: 1.5rem;
    color: var(--color-text);
}

.section-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.scroll-hint {
    display: none;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.scroll-hint svg {
    width: 1rem;
    height: 1rem;
}

@media (max-width: 767px) {
    .scroll-hint {
        display: flex;
    }
}

/* Essence Carousel */
.essence-carousel {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-md);
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.essence-carousel::-webkit-scrollbar {
    height: 6px;
}

.essence-carousel::-webkit-scrollbar-track {
    background: transparent;
}

.essence-carousel::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

.essence-list {
    display: flex;
    gap: var(--space-sm);
    padding: 0 var(--space-md);
}

@media (min-width: 768px) {
    .essence-list {
        gap: var(--space-md);
        justify-content: center;
    }
}

/* Essence Card */
.essence-card {
    scroll-snap-align: center;
    flex-shrink: 0;
}

.essence-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    min-width: 6.25rem;
    border-radius: var(--radius-lg);
    transition: background-color var(--transition-base);
}

.essence-button:hover {
    background-color: var(--color-secondary);
}

/* Essence Orb */
.essence-orb {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 -4px 8px rgba(0, 0, 0, 0.1),
        inset 0 4px 8px rgba(255, 255, 255, 0.2);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

@media (min-width: 768px) {
    .essence-orb {
        width: 5rem;
        height: 5rem;
    }
}

.essence-button:hover .essence-orb {
    transform: scale(1.05);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 -4px 8px rgba(0, 0, 0, 0.1),
        inset 0 4px 8px rgba(255, 255, 255, 0.2);
}

/* Essence Info */
.essence-info {
    text-align: center;
}

.essence-name {
    display: block;
    font-family: var(--font-serif);
    font-size: 0.875rem;
    color: var(--color-text);
    letter-spacing: 0.1em;
}

.essence-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.essence-note {
    font-size: 0.625rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-subtle);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    background-color: var(--color-secondary);
}

/* ----------------------------------------
   Footer
   ---------------------------------------- */
.site-footer {
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-text-subtle);
    border-top: 1px solid var(--color-border);
}

/* ----------------------------------------
   Mobile Recipe Panel
   (Shown on smaller screens below essences)
   ---------------------------------------- */
@media (max-width: 1023px) {
    .main-content::after {
        content: "";
        display: block;
        margin-top: var(--space-xl);
    }
    
    /* Additional mobile recipe panel can be added here if needed */
}
