/* hwaglyul.com - Victorian-Korean Instrument Cabinet */

:root {
    --brass-dark: #8b7d3c;
    --navy-deep: #1a3355;
    --jade: #4a9e7a;
    --brass-light: #c9b87a;
    --midnight: #0a1628;
    --navy: #0f2242;
    --parchment: #e8d5a3;
    --steel-blue: #7a9bb5;
    --coral: #d4956a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--midnight);
    color: var(--parchment);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ornamental Frame */
.ornamental-frame {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
}

.corner-rosette {
    position: absolute;
    width: 80px;
    height: 80px;
    opacity: 0;
    animation: fadeInRosette 800ms ease-out forwards;
}

.corner-rosette.top-left { top: 10px; left: 10px; }
.corner-rosette.top-right { top: 10px; right: 10px; transform: scaleX(-1); }
.corner-rosette.bottom-left { bottom: 10px; left: 10px; }
.corner-rosette.bottom-right { bottom: 10px; right: 10px; transform: scaleX(-1); }

.frame-border {
    position: absolute;
    background: linear-gradient(90deg, transparent, var(--brass-dark), transparent);
    opacity: 0;
    animation: fadeInFrame 1200ms ease-out 400ms forwards;
}

.frame-border.top, .frame-border.bottom {
    height: 1px;
    left: 80px;
    right: 80px;
}

.frame-border.left, .frame-border.right {
    width: 1px;
    top: 80px;
    bottom: 80px;
    background: linear-gradient(180deg, transparent, var(--brass-dark), transparent);
}

.frame-border.top { top: 20px; }
.frame-border.bottom { bottom: 20px; }
.frame-border.left { left: 20px; }
.frame-border.right { right: 20px; }

@keyframes fadeInRosette {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.corner-rosette.top-right, .corner-rosette.bottom-right {
    animation: fadeInRosetteFlipped 800ms ease-out forwards;
}

@keyframes fadeInRosetteFlipped {
    from { opacity: 0; transform: scaleX(-1) scale(0.5); }
    to { opacity: 1; transform: scaleX(-1) scale(1); }
}

@keyframes fadeInFrame {
    from { opacity: 0; }
    to { opacity: 0.6; }
}

/* Instrument Cabinet */
.instrument-cabinet {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    opacity: 0;
    animation: cabinetReveal 1000ms ease-out 600ms forwards;
}

@keyframes cabinetReveal {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Panel Base */
.panel {
    background: linear-gradient(135deg, rgba(15, 34, 66, 0.8), rgba(10, 22, 40, 0.9));
    border: 1px solid rgba(139, 125, 60, 0.3);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: radial-gradient(ellipse at center, rgba(201, 184, 122, 0.03), transparent 70%);
    pointer-events: none;
}

.panel-bezel {
    padding: 20px;
    position: relative;
}

.panel-ornament {
    display: block;
    width: 120px;
    margin: 0 auto 8px;
    opacity: 0.5;
}

.panel-ornament.bottom {
    margin: 8px auto 0;
}

/* Header */
.header-panel {
    text-align: center;
    border-color: rgba(139, 125, 60, 0.5);
}

.site-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    color: var(--parchment);
    letter-spacing: 0.05em;
    margin: 8px 0 4px;
}

.site-subtitle {
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    color: var(--steel-blue);
    letter-spacing: 0.1em;
    text-transform: lowercase;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    flex: 1;
}

/* Gauge Panels */
.gauge-panel {
    display: flex;
    flex-direction: column;
}

.gauge-panel .panel-bezel {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.panel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    font-weight: 700;
    color: var(--brass-light);
    letter-spacing: -0.015em;
    margin-bottom: 12px;
    text-align: center;
}

.gauge-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 200px;
}

.gauge-svg {
    width: 100%;
    height: auto;
}

.gauge-reading {
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    color: var(--steel-blue);
    margin-top: 12px;
    letter-spacing: 0.05em;
}

/* Gauge needle animation */
.gauge-needle {
    transform-origin: 100px 100px;
    transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wide Panel */
.wide-panel {
    grid-column: span 3;
}

.botanical-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

.botanical-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border: 1px solid rgba(139, 125, 60, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}

.botanical-item:hover {
    border-color: rgba(201, 184, 122, 0.4);
    background: rgba(201, 184, 122, 0.03);
}

.botanical-item.active {
    border-color: var(--coral);
    background: rgba(212, 149, 106, 0.05);
}

.botanical-icon {
    width: 60px;
    height: 60px;
}

.botanical-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--steel-blue);
    text-align: center;
}

/* Lattice */
.lattice-container {
    max-width: 180px;
}

.lattice-svg {
    width: 100%;
    height: auto;
}

/* Clock */
.clock-svg .hour-hand,
.clock-svg .minute-hand {
    transform-origin: 100px 80px;
    transition: transform 0.5s ease;
}

.clock-svg .pendulum-arm,
.clock-svg .pendulum-bob {
    transform-origin: 100px 140px;
    animation: pendulumSwing 2s ease-in-out infinite;
}

@keyframes pendulumSwing {
    0%, 100% { transform: rotate(15deg); }
    50% { transform: rotate(-15deg); }
}

/* Status Bar */
.status-bar {
    border-color: rgba(139, 125, 60, 0.4);
}

.status-bezel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}

.status-item {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--steel-blue);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-item.mono {
    font-family: 'DM Mono', monospace;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brass-dark);
}

.status-dot.active {
    background: var(--jade);
    box-shadow: 0 0 6px var(--jade);
    animation: pulse 2s ease-in-out infinite;
}

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

/* Responsive */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .wide-panel {
        grid-column: span 2;
    }
    .botanical-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .instrument-cabinet {
        padding: 24px;
    }
}

@media (max-width: 600px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .wide-panel {
        grid-column: span 1;
    }
    .botanical-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .instrument-cabinet {
        padding: 16px;
    }
    .corner-rosette {
        width: 50px;
        height: 50px;
    }
}
