:root {
    /* Colors */
    --bg: #ffffff;
    --text: #1a1a1a;
    --accent: #6366f1;
    
    /* Dynamic track color for sliders */
    --track-color: rgba(0, 0, 0, 0.2);

    /* Fonts */
    --font-title: 'Lexend', sans-serif;
    --font-mono: 'SF Mono', 'Segoe UI Mono', 'Consolas', 'Menlo', monospace;

    /* Shape consistency */
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-mono); 
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}
a:hover {
    opacity: 0.8;
}

.app-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; 
    width: 100%;
    max-width: 1200px;
    gap: 5rem;
    align-items: stretch; 
}

/* --- Left Column --- */
.preview-area {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3rem; 
    align-items: flex-start;
}

.header-content {
    width: 100%;
}

.title {
    font-family: var(--font-title);
    font-weight: 500;
    font-size: clamp(4rem, 9vw, 7.5rem); 
    line-height: 1.05;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.description {
    font-size: 1.3rem;
    opacity: 0.9;
    line-height: 1.6;
    max-width: 100%; 
    font-family: var(--font-mono);
}

/* --- THE CRISPY COLOR CARD --- */
.stats-row {
    background: var(--accent);
    padding: 3rem 2.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    color: var(--bg); 
    border-radius: var(--radius);
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.1s ease;
    width: 100%; 
    
    /* 1. Border is Text Color */
    border: 3px solid var(--text);
    
    /* 2. Elongated Bottom (Hard Shadow) is Text Color */
    box-shadow: 0 8px 0 var(--text);
}

/* Optional: Subtle press effect on the card */
.stats-row:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 var(--text);
}

.stat-card {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.label { 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    opacity: 0.9; 
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.hex-value { 
    font-family: var(--font-mono);
    font-size: 1.8rem; 
    font-weight: bold; 
}

/* --- Right Column (Controls) --- */
.controls {
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    height: 100%; 
    gap: 2rem;
    width: 100%;
}

.controls-top {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    width: 100%;
}

.control-group {
    width: 100%;
}

.control-group label { 
    font-weight: 600;
    font-size: 1.1rem; 
}

.label-row { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 0.75rem; 
    font-family: var(--font-mono);
    font-size: 1.1rem;
}

/* --- Fixed Slider CSS --- */
input[type="range"] {
    -webkit-appearance: none; 
    width: 100%;
    background: transparent; 
    cursor: pointer;
    margin-top: 0.5rem; 
    display: block;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: var(--track-color); 
    border-radius: 5px;
    border: none;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 4px;
    background: var(--track-color);
    border-radius: 5px;
    border: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 26px;
    width: 26px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: -11px;
    box-shadow: 0 0 0 4px var(--bg); 
    border: 2px solid var(--text); /* Added border to match theme */
}

input[type="range"]::-moz-range-thumb {
    height: 26px;
    width: 26px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--bg);
    border: 2px solid var(--text);
}

/* --- THE HOLLOW TO FILLED BUTTON --- */
button {
    padding: 1.5rem; 
    
    /* Default State: Hollow */
    background: transparent;
    color: var(--text);
    border: 3px solid var(--text);
    
    /* 3D Effect for consistency */
    box-shadow: 0 6px 0 var(--text);
    
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
    display: block;
}

/* Hover State: Filled */
button:hover {
    background: var(--text);
    color: var(--bg);
    /* We keep the shadow on hover for a solid look */
}

/* Click State: Presses down */
button:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--text);
}

/* --- THE CRISPY CODE CARD --- */
.code-output {
    background: rgba(0,0,0,0.03); /* Very subtle background */
    padding: 2rem;
    font-size: 1rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    overflow-x: auto;
    width: 100%;
    
    /* 1. Border is Accent Color */
    border: 3px solid var(--accent);
    
    /* 2. Elongated Bottom (Hard Shadow) is Accent Color */
    box-shadow: 0 8px 0 var(--accent);
}

/* --- Mobile / Tablet Responsive --- */
@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
        gap: 4rem;
        height: auto;
    }

    .preview-area {
        align-items: center; 
        text-align: center; 
        gap: 2rem;
    }

    .stats-row {
        justify-content: center;
        gap: 3rem;
    }
    
    .stat-card {
        align-items: center;
    }

    .controls {
        height: auto; 
        justify-content: flex-start;
        gap: 3rem;
    }
}
