/* ----------------------------------------------------
   STEAMPUNK PORTAL DESIGN SYSTEM & STYLES
   Domain: dreamers.lat
   ---------------------------------------------------- */

/* Core variables */
:root {
    --color-bg-dark: #0a0908;
    --color-bg-panel: #161311;
    --color-iron-dark: #221f1d;
    --color-iron-light: #3e3a37;
    --color-brass: #C5A059;
    --color-brass-glow: #e5be79;
    --color-copper: #B87333;
    --color-bronze: #8C6239;
    --color-glow-orange: #FF7800;
    --color-glow-red: #E63946;
    --color-text-white: #ededed;
    --color-text-muted: #a69a90;
    
    --font-heading: 'Playfair Display', serif;
    --font-mono: 'Special Elite', monospace;
    --font-sans: 'Inter', sans-serif;
}

/* Base resets & setups */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-dark);
    background-image: linear-gradient(rgba(10, 9, 8, 0.75), rgba(10, 9, 8, 0.9)), url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: var(--font-sans);
    color: var(--color-text-white);
    overflow-x: hidden;
    position: relative;
}

/* Hide scrollbar */
::-webkit-scrollbar {
    display: none;
}

/* Ambient canvas for steam particles and falling leaves */
#steam-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

/* Grain/Noise overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: radial-gradient(circle, transparent 40%, rgba(0,0,0,0.7) 100%),
                url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.08;
    pointer-events: none;
}

/* Container */
.steampunk-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    z-index: 3;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(38,26,18,0.2) 0%, rgba(10,9,8,0.85) 85%);
}

/* Background gears decoration */
.background-gears {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    opacity: 0.06;
    color: var(--color-copper);
}

.gear {
    position: absolute;
    animation: rotateGear 60s linear infinite;
    transform-origin: center;
}

.gear-large {
    width: 400px;
    height: 400px;
    left: -100px;
    bottom: -100px;
}

.gear-medium {
    width: 280px;
    height: 280px;
    right: -50px;
    top: -50px;
    animation-direction: reverse;
    animation-duration: 40s;
}

@keyframes rotateGear {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ----------------------------------------------------
   THE MACHINE CARD (Main board)
   ---------------------------------------------------- */
.machine-card {
    position: relative;
    width: 100%;
    max-width: 580px;
    background-color: var(--color-bg-panel);
    border: 8px double var(--color-iron-light);
    border-radius: 4px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9),
                inset 0 0 40px rgba(0, 0, 0, 0.8),
                0 0 1px 1px var(--color-copper) inset;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow: hidden;
}

/* Rivets details */
.rivet {
    position: absolute;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 4px 4px, var(--color-iron-light) 0%, var(--color-bg-dark) 80%);
    border-radius: 50%;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.8), -0.5px -0.5px 1px rgba(255,255,255,0.1);
    z-index: 10;
}
.rivet::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 1px;
    width: 10px;
    height: 1.5px;
    background-color: rgba(0,0,0,0.6);
    transform: rotate(45deg);
}
.rivet-tl { top: 12px; left: 12px; }
.rivet-tr { top: 12px; right: 12px; }
.rivet-bl { bottom: 12px; left: 12px; }
.rivet-br { bottom: 12px; right: 12px; }

/* Copper piping border effect */
.pipe {
    position: absolute;
    background: linear-gradient(to right, #613813 0%, #B87333 30%, #ffd0a3 50%, #B87333 75%, #3d2005 100%);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2), 0 2px 4px rgba(0,0,0,0.7);
    z-index: 5;
}

.pipe-left {
    left: 20px;
    top: 25px;
    bottom: 25px;
    width: 6px;
}

.pipe-right {
    right: 20px;
    top: 25px;
    bottom: 25px;
    width: 6px;
}

.pipe-top {
    top: 20px;
    left: 20px;
    right: 20px;
    height: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pipe-joint {
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, var(--color-brass-glow) 0%, var(--color-bronze) 80%);
    border: 2px solid var(--color-iron-dark);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.6);
}

/* ----------------------------------------------------
   BRASS HEADER PLATE
   ---------------------------------------------------- */
.brass-plate {
    position: relative;
    background: linear-gradient(135deg, #dfbc80 0%, #C5A059 40%, #8c6a2e 100%);
    border: 3px solid #6b4d18;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6), inset 0 2px 4px rgba(255,255,255,0.3);
    border-radius: 2px;
    padding: 15px;
    text-align: center;
    color: #2b1f07;
    text-shadow: 0 1px 1px rgba(255,255,255,0.4);
}

.plate-screws {
    display: flex;
    justify-content: space-between;
    position: absolute;
    width: 94%;
    left: 3%;
    top: 4px;
}

.plate-screws span {
    width: 6px;
    height: 6px;
    background-color: #3b2c0f;
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset 0.5px 0.5px 1px rgba(255,255,255,0.3);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 2.3rem;
    font-weight: 900;
    letter-spacing: 5px;
    line-height: 1;
    margin-bottom: 2px;
}

.brand-subtitle {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 3px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(0,0,0,0.12);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.15);
}

.status-bulb {
    width: 8px;
    height: 8px;
    background-color: var(--color-glow-orange);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-glow-orange);
    animation: pulseBulb 1.5s infinite alternate;
}

.status-text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: bold;
    color: #3b2c0f;
}

@keyframes pulseBulb {
    from { opacity: 0.4; filter: brightness(0.6); }
    to { opacity: 1; filter: brightness(1.3); }
}

/* ----------------------------------------------------
   GAUGE & VACUUM TUBE PANEL
   ---------------------------------------------------- */
.gauge-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0,0,0,0.25);
    border: 2px solid var(--color-iron-dark);
    padding: 20px;
    border-radius: 3px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
    gap: 15px;
}

/* Manometer pressure gauge */
.manometer-container {
    flex: 0 0 130px;
    display: flex;
    justify-content: center;
}

.manometer {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, #e9d9b6 0%, #c4b38d 70%, #8a7854 100%);
    border: 6px solid #4a3e2a;
    box-shadow: 0 4px 8px rgba(0,0,0,0.6), inset 0 2px 5px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.manometer-face {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: #f7f2e1;
    border: 2px solid #5a4b33;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

.manometer-scale {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: repeating-conic-gradient(from -120deg, #443c2c 0deg 1deg, transparent 1deg 10deg);
    mask: radial-gradient(circle, transparent 32px, black 33px);
    -webkit-mask: radial-gradient(circle, transparent 32px, black 33px);
    opacity: 0.75;
}

.manometer-labels {
    position: absolute;
    width: 100%;
    height: 100%;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: #443c2c;
    font-weight: bold;
}

.manometer-labels span {
    position: absolute;
}
.manometer-labels span:nth-child(1) { bottom: 18px; left: 16px; }
.manometer-labels span:nth-child(2) { top: 10px; left: 34px; }
.manometer-labels span:nth-child(3) { bottom: 18px; right: 16px; }

.manometer-needle {
    position: absolute;
    width: 2px;
    height: 40px;
    background-color: var(--color-glow-red);
    left: 50%;
    bottom: 50%;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-120deg);
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1.25);
    box-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.manometer-needle::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -2px;
    width: 6px;
    height: 6px;
    background-color: var(--color-glow-red);
    border-radius: 50%;
}

.manometer-cap {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #3b2c0f;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.manometer-subtext {
    position: absolute;
    width: 100%;
    text-align: center;
    bottom: 25px;
    font-family: var(--font-mono);
    font-size: 0.45rem;
    color: #7c6d53;
    letter-spacing: 0.5px;
}

/* Vacuum glow tubes */
.vacuum-tubes-container {
    flex: 1;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 100px;
    border-bottom: 4px solid var(--color-iron-dark);
    padding-bottom: 4px;
}

.vacuum-tube {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45px;
}

.tube-glass {
    position: relative;
    width: 32px;
    height: 60px;
    background: linear-gradient(to right, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.15) 30%, rgba(255,255,255,0.02) 70%, rgba(255,255,255,0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: inset 1px 2px 4px rgba(255,255,255,0.15), inset -1px -1px 3px rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.tube-filament {
    position: absolute;
    width: 2px;
    height: 38px;
    background-color: #3a322c;
    border-radius: 2px;
    bottom: 4px;
    transition: all 0.3s ease;
}

.tube-filament::after {
    content: '';
    position: absolute;
    top: 5px;
    left: -3px;
    width: 8px;
    height: 12px;
    border: 1px solid #3a322c;
    border-bottom: none;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.tube-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--color-glow-orange);
    opacity: 0;
    filter: blur(10px);
    transition: opacity 0.4s ease;
    border-radius: 50%;
    pointer-events: none;
}

.tube-base {
    width: 36px;
    height: 14px;
    background: linear-gradient(to bottom, var(--color-iron-light) 0%, var(--color-bg-dark) 100%);
    border: 1px solid var(--color-iron-dark);
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.52rem;
    color: var(--color-brass);
    text-align: center;
    line-height: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
    font-weight: bold;
}

/* Glowing tube active state */
.vacuum-tube.active .tube-filament {
    background-color: #ff9d00;
    box-shadow: 0 0 8px #ff7800, 0 0 15px #ff5100;
}
.vacuum-tube.active .tube-filament::after {
    border-color: #ff9d00;
    box-shadow: 0 0 4px #ff5100;
}
.vacuum-tube.active .tube-glow {
    opacity: 0.45;
}

/* ----------------------------------------------------
   CONTROL LEVERS (Contact links)
   ---------------------------------------------------- */
.levers-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-iron-dark);
    padding-bottom: 5px;
    text-align: center;
}

.lever-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lever-item {
    display: flex;
    align-items: center;
    background-color: rgba(22, 19, 17, 0.85);
    border: 2px solid var(--color-iron-dark);
    border-radius: 3px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--color-text-white);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.05);
}

.lever-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--color-iron-light);
    transition: background-color 0.3s ease;
}

/* Lever mechanism slot */
.lever-mechanism {
    position: relative;
    width: 60px;
    height: 32px;
    background-color: #0b0a09;
    border: 2px solid var(--color-iron-light);
    border-radius: 16px;
    margin-right: 18px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
    overflow: hidden;
}

.lever-handle {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    transform: rotate(0deg);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1.15);
    transform-origin: 16px 16px;
}

.lever-shaft {
    position: absolute;
    width: 24px;
    height: 5px;
    background: linear-gradient(to bottom, #dcdcdc, #888, #444);
    left: 16px;
    top: 13.5px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.lever-knob {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    left: 32px;
    top: 9px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.6), inset 1px 1px 2px rgba(255,255,255,0.4);
    border: 1.5px solid rgba(0,0,0,0.4);
}

.knob-copper { background: radial-gradient(circle at 4px 4px, #f29c5a 0%, #B87333 70%, #5c2c04 100%); }
.knob-brass { background: radial-gradient(circle at 4px 4px, #f2db8c 0%, #C5A059 70%, #614611 100%); }
.knob-bronze { background: radial-gradient(circle at 4px 4px, #bda286 0%, #8C6239 70%, #442a11 100%); }

/* Lever label plate */
.lever-label-plate {
    display: flex;
    flex-direction: column;
}

.lever-title {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--color-brass);
    transition: color 0.3s ease;
}

.lever-desc {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    font-weight: 300;
    margin-top: 2px;
}

/* Hover effects */
.lever-item:hover {
    background-color: rgba(30, 26, 23, 0.95);
    border-color: var(--color-brass);
    box-shadow: 0 4px 12px rgba(0,0,0,0.6), 0 0 4px rgba(197, 160, 89, 0.2);
    transform: translateY(-1px);
}

.lever-item:hover::before {
    background-color: var(--color-brass);
}

.lever-item:hover .lever-handle {
    transform: rotate(35deg); /* Lever clicks down */
}

.lever-item:hover .lever-title {
    color: var(--color-text-white);
}

/* ----------------------------------------------------
   BRASS FOOTER & CONSOLE
   ---------------------------------------------------- */
.brass-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border-top: 2px solid var(--color-iron-dark);
    padding-top: 20px;
    text-align: center;
}

.cog-decor {
    font-size: 1.2rem;
    color: var(--color-brass);
    opacity: 0.7;
    animation: rotateGear 12s linear infinite;
    display: inline-block;
}

/* Terminal text display */
.terminal-display {
    width: 100%;
    background-color: #060505;
    border: 2px solid var(--color-iron-dark);
    border-radius: 2px;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--color-glow-orange);
    text-align: left;
    display: flex;
    align-items: center;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.9);
    min-height: 32px;
}

.terminal-text {
    flex: 1;
    letter-spacing: 0.5px;
    text-shadow: 0 0 2px var(--color-glow-orange);
}

.terminal-cursor {
    width: 6px;
    height: 10px;
    background-color: var(--color-glow-orange);
    animation: blinkCursor 0.8s steps(2) infinite;
    margin-left: 4px;
    box-shadow: 0 0 3px var(--color-glow-orange);
}

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

.copyright-info {
    font-family: var(--font-mono);
    font-size: 0.52rem;
    color: var(--color-text-muted);
    letter-spacing: 1px;
}

/* ----------------------------------------------------
   RESPONSIVE DESIGN (Media queries)
   ---------------------------------------------------- */
@media (max-width: 480px) {
    .machine-card {
        padding: 20px 15px;
        gap: 20px;
    }
    
    .brand-title {
        font-size: 1.8rem;
    }
    
    .gauge-panel {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }
    
    .vacuum-tubes-container {
        width: 100%;
        height: 85px;
    }
    
    .lever-item {
        padding: 8px 12px;
    }
    
    .lever-mechanism {
        margin-right: 12px;
    }
}
