/* yamichika.bar — 闇近 */
/* Colors: #0D0D0D, #141210, #1F1A14, #C8530A, #8B4B1A, #6B4A2A, #A07850, #E8C97E */

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

:root {
    --bg-primary:       #0D0D0D;
    --bg-secondary:     #141210;
    --bg-card:          #1F1A14;
    --accent-orange:    #C8530A;
    --accent-amber:     #8B4B1A;
    --accent-deep:      #6B4A2A;
    --text-mid:         #A07850;
    --text-gold:        #E8C97E;
    --font-serif:       'Cormorant Garamond', 'Cormorant', Georgia, serif;
    --font-mono:        'JetBrains Mono', 'Courier New', monospace;
    --font-sans:        'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-gold);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ─────────────────────────── Pane Dividers ─────────────────────────── */
.pane-divider {
    border: none;
    border-top: 1px solid #1F1A14;
    margin: 0;
}

/* ─────────────────────────── Pane Common ─────────────────────────── */
.pane {
    position: relative;
    overflow: hidden;
    padding: 0;
}

.pane-content {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 80px 60px 40px;
}

.pane-label {
    position: absolute;
    bottom: 16px;
    right: 24px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: #1F1A14;
    letter-spacing: 0.12em;
    user-select: none;
    z-index: 1;
}

.pane-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 48px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1F1A14;
}

.pane-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-deep);
    letter-spacing: 0.1em;
}

.pane-name {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-orange);
    letter-spacing: 0.18em;
}

.pane-desc {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-deep);
}

/* ─────────────────────────── Floating Background Elements ─────────────────────────── */
.floating-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* Scatter plots */
.float-scatter {
    position: absolute;
    fill: var(--accent-orange);
    opacity: 0.12;
}

.float-scatter--1 {
    width: 200px;
    height: 200px;
    top: 10%;
    right: 5%;
    animation: float-drift 18s ease-in-out infinite;
    animation-delay: -3s;
}

.float-scatter--2 {
    width: 160px;
    height: 160px;
    bottom: 15%;
    right: 8%;
    animation: float-drift 20s ease-in-out infinite;
    animation-delay: -11s;
}

.float-scatter--3 {
    width: 180px;
    height: 180px;
    top: 20%;
    right: 3%;
    animation: float-drift 16s ease-in-out infinite;
    animation-delay: -7s;
}

/* Hexagonal rings */
.float-hex {
    position: absolute;
    opacity: 0.08;
}

.float-hex--1 {
    width: 150px;
    height: 150px;
    top: 8%;
    left: 3%;
    animation: float-drift 22s ease-in-out infinite;
    animation-delay: -5s;
}

.float-hex--2 {
    width: 180px;
    height: 180px;
    top: 10%;
    left: 2%;
    animation: float-drift 25s ease-in-out infinite;
    animation-delay: -9s;
}

.float-hex--3 {
    width: 120px;
    height: 120px;
    bottom: 15%;
    left: 6%;
    animation: float-drift 14s ease-in-out infinite;
    animation-delay: -4s;
}

@keyframes float-drift {
    0%,   100% { transform: translateY(0px)  translateX(0px); }
    25%         { transform: translateY(-6px) translateX(4px); }
    50%         { transform: translateY(-10px) translateX(-3px); }
    75%         { transform: translateY(4px)  translateX(-6px); }
}

/* ─────────────────────────── Block Cursor ─────────────────────────── */
.block-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background-color: var(--accent-orange);
    vertical-align: middle;
    animation: blink 1.2s step-end infinite;
}

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

/* ─────────────────────────── Pane 00 / INIT ─────────────────────────── */
.pane--init {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background-color: var(--bg-primary);
}

.init-terminal {
    position: relative;
    z-index: 2;
    padding: 0 80px 0 80px;
    max-width: 700px;
}

.cursor-line {
    margin-bottom: 24px;
    min-height: 20px;
}

#cursor-initial {
    display: block;
    margin-bottom: 16px;
}

.prompt-line {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--accent-orange);
    margin-bottom: 32px;
    min-height: 24px;
    display: flex;
    align-items: center;
}

.prompt-prefix {
    color: var(--accent-orange);
    user-select: none;
}

.prompt-text {
    color: var(--accent-orange);
}

#prompt-cursor {
    margin-left: 2px;
}

.bar-name-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.6s ease;
    margin-bottom: 16px;
}

.bar-name-display.visible {
    opacity: 1;
}

.bar-name-kanji {
    font-family: var(--font-serif);
    font-size: 80px;
    font-weight: 300;
    color: var(--text-gold);
    line-height: 1;
    letter-spacing: 0.05em;
}

.bar-name-romaji {
    font-family: var(--font-serif);
    font-size: 48px;
    font-weight: 300;
    color: var(--text-gold);
    letter-spacing: 0.1em;
    line-height: 1;
}

.bar-tagline {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-deep);
    letter-spacing: 0.2em;
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
}

.bar-tagline.visible {
    opacity: 1;
}

/* ─────────────────────────── Pane 01 / CATALOG ─────────────────────────── */
.pane--catalog {
    min-height: 120vh;
    background-color: var(--bg-secondary);
}

.catalog-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.catalog-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 24px 0;
    align-items: start;
}

.catalog-divider {
    height: 1px;
    background-color: #1F1A14;
}

.catalog-ingredients {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ingredient {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-deep);
    letter-spacing: 0.06em;
}

.catalog-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.catalog-drink-name {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 400;
    color: var(--text-gold);
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.catalog-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-amber);
    letter-spacing: 0.08em;
}

.sparkline {
    width: 120px;
    height: 30px;
    opacity: 0.2;
}

.catalog-footer {
    display: flex;
    gap: 40px;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #1F1A14;
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-deep);
    letter-spacing: 0.08em;
}

.mono-value {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-amber);
    letter-spacing: 0.08em;
}

/* ─────────────────────────── Pane 02 / SIGNAL ─────────────────────────── */
.pane--signal {
    min-height: 100vh;
    background-color: var(--bg-primary);
}

.signal-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 60px;
    align-items: center;
}

.signal-chart-container {
    max-width: 420px;
}

#polar-chart {
    width: 100%;
    height: auto;
}

.flavor-polygon {
    transition: opacity 0.3s ease;
}

.chart-axes line {
    opacity: 0.4;
}

.chart-rings circle {
    opacity: 0.3;
}

.signal-legend {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 180px;
}

.legend-header {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-orange);
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1F1A14;
}

.legend-entry {
    display: flex;
    align-items: center;
    gap: 12px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot--1 { background-color: var(--accent-orange); }
.legend-dot--2 { background-color: var(--accent-amber); }
.legend-dot--3 { background-color: var(--accent-deep); }

.legend-label {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 300;
    color: var(--text-gold);
}

.legend-note {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-deep);
    letter-spacing: 0.08em;
    margin-top: 4px;
}

/* ─────────────────────────── Pane 03 / HOURS ─────────────────────────── */
.pane--hours {
    min-height: 80vh;
    background-color: var(--bg-secondary);
}

.hours-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 80px;
    align-items: start;
}

.hours-table {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 480px;
}

.hours-row {
    display: grid;
    grid-template-columns: 40px 80px 80px 1fr;
    gap: 24px;
    padding: 10px 0;
    border-bottom: 1px solid #1F1A14;
    font-family: var(--font-mono);
    font-size: 13px;
    align-items: center;
}

.hours-row--header {
    color: var(--accent-deep);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hours-row--current .hours-day {
    color: var(--accent-orange);
}

.hours-day {
    color: var(--text-gold);
}

.hours-open,
.hours-close {
    color: var(--accent-amber);
}

.hours-status {
    font-size: 11px;
    letter-spacing: 0.1em;
}

.hours-status--open {
    color: var(--accent-orange);
}

.hours-status--closed {
    color: var(--accent-deep);
}

.hours-flame-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
    padding-top: 8px;
}

.hours-note {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lottie-flame-container {
    margin-top: 24px;
    width: 60px;
    cursor: default;
}

/* SVG Flame fallback */
.flame-svg {
    width: 60px;
    height: 100px;
    overflow: visible;
}

.flame-outer {
    transform-origin: 30px 88px;
    animation: flame-flicker 1.4s ease-in-out infinite;
}

.flame-inner {
    transform-origin: 30px 84px;
    animation: flame-flicker-inner 1.1s ease-in-out infinite;
    animation-delay: -0.3s;
}

@keyframes flame-flicker {
    0%,  100% { transform: scaleX(1)    scaleY(1)    rotate(0deg); }
    20%        { transform: scaleX(0.92) scaleY(1.04) rotate(-1deg); }
    40%        { transform: scaleX(1.06) scaleY(0.97) rotate(1.5deg); }
    60%        { transform: scaleX(0.95) scaleY(1.06) rotate(-0.5deg); }
    80%        { transform: scaleX(1.02) scaleY(0.98) rotate(1deg); }
}

@keyframes flame-flicker-inner {
    0%,  100% { transform: scaleX(1)    scaleY(1)    rotate(0deg); opacity: 0.6; }
    30%        { transform: scaleX(0.88) scaleY(1.08) rotate(-2deg); opacity: 0.7; }
    60%        { transform: scaleX(1.08) scaleY(0.95) rotate(2deg); opacity: 0.5; }
}

/* Flame speed on hours pane hover */
.pane--hours:hover .flame-outer {
    animation-duration: 0.93s;
}

.pane--hours:hover .flame-inner {
    animation-duration: 0.73s;
}

/* ─────────────────────────── Pane 04 / CLOSE ─────────────────────────── */
.pane--close {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background-color: var(--bg-primary);
}

.close-terminal {
    position: relative;
    z-index: 2;
    padding: 0 80px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.close-serif-line {
    display: flex;
    align-items: baseline;
    gap: 24px;
}

.close-kanji {
    font-family: var(--font-serif);
    font-size: 96px;
    font-weight: 300;
    color: var(--text-gold);
    line-height: 1;
}

.close-address {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.address-line {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-deep);
    letter-spacing: 0.08em;
}

.close-prompt {
    display: flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--accent-orange);
    margin-top: 8px;
}

.close-cursor {
    margin-left: 2px;
}

/* ─────────────────────────── Scrollbar ─────────────────────────── */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-deep);
    border-radius: 2px;
}

/* ─────────────────────────── Mobile ─────────────────────────── */
@media (max-width: 768px) {
    .pane-content {
        padding: 40px 24px;
    }

    .init-terminal {
        padding: 0 24px;
    }

    .bar-name-kanji {
        font-size: 56px;
    }

    .bar-name-romaji {
        font-size: 32px;
    }

    .catalog-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

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

    .signal-chart-container {
        max-width: 100%;
    }

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

    .hours-row {
        grid-template-columns: 36px 60px 60px 1fr;
        gap: 12px;
        font-size: 12px;
    }

    .close-terminal {
        padding: 0 24px;
    }

    .close-kanji {
        font-size: 64px;
    }

    .float-scatter--1,
    .float-scatter--2,
    .float-scatter--3 {
        width: 100px;
        height: 100px;
    }

    .float-hex--1,
    .float-hex--2,
    .float-hex--3 {
        width: 80px;
        height: 80px;
    }
}
