@font-face {
    font-family: 'GeistPixel Square';
    src: url('fonts/GeistPixel-Square.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'GeistPixel Grid';
    src: url('fonts/GeistPixel-Grid.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'GeistPixel Circle';
    src: url('fonts/GeistPixel-Circle.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'GeistPixel Triangle';
    src: url('fonts/GeistPixel-Triangle.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'GeistPixel Line';
    src: url('fonts/GeistPixel-Line.woff2') format('woff2');
    font-display: swap;
}

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

:root {
    --neon-bg: #00ff41;
    --neon-glow: #66ff66;
    --neon-accent: #00cc33;
    --neon-text: #ffffff;
    --font-primary: 'Courier New', monospace;
}

body {
    font-family: var(--font-primary);
    background-color: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #ffffff;
    text-shadow: 0 0 10px var(--neon-glow);
}

.year-progress {
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-align: center;
}

.year-progress:last-of-type {
    margin-bottom: 20px;
}

.progress-value {
    display: block;
    font-weight: bold;
    color: var(--neon-glow);
    text-shadow: 0 0 15px var(--neon-glow);
    animation: pulse 2s infinite;
}

.remaining-value {
    display: block;
    font-weight: bold;
    color: var(--neon-accent);
    text-shadow: 0 0 15px var(--neon-accent);
    animation: pulse 2s infinite;
}

.progress-label, .remaining-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #cccccc;
}

.time-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.time-display:first-of-type {
    margin-bottom: 25px;
    padding: 15px;
    background-color: rgba(255, 107, 53, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.time-display:first-of-type .time-unit .value {
    color: #ff6b35;
    text-shadow: 0 0 20px #ff6b35;
}

.time-display:first-of-type .time-unit .label {
    color: #ffcc99;
}

.time-unit {
    text-align: center;
}

.time-unit .value {
    display: block;
    font-size: 3rem;
    font-weight: bold;
    color: var(--neon-glow);
    text-shadow: 0 0 20px var(--neon-glow);
    animation: pulse 2s infinite;
}

.time-unit .label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #cccccc;
}

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

main {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.matrix-section {
    text-align: center;
}

.matrix-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.months-section {
    margin-bottom: 40px;
}

.months-section h2 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--neon-glow);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

.months-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    max-width: 90%;
    margin: 0 auto;
}

.month-container {
    text-align: center;
    padding: 15px;
    transition: all 0.3s ease;
}

.month-container:hover {
    transform: translateY(-2px);
}

.month-container h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--neon-glow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.month-container .matrix {
    gap: 3px;
}

.month-container .matrix {
    gap: 3px;
}

.month-container .dot {
    width: 8px;
    height: 8px;
}

.matrix-container {
    display: inline-block;
    background-color: #1a1a1a;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 30px var(--neon-glow);
}

#daysMatrix .matrix-container {
    max-width: 90vw;
    padding: 30px;
}

.matrix {
    display: grid;
    gap: 4px;
    justify-content: center;
}

/* Specific matrix containers to restrict size */
#daysMatrix .matrix {
    grid-template-columns: repeat(23, 16px);
    grid-template-rows: repeat(16, 16px);
    width: fit-content;
    max-width: 90vw;
    justify-self: center;
}

#daysMatrix .matrix-container {
    width: fit-content;
    height: fit-content;
    max-width: 90vw;
}

#daysMatrix .dot {
    width: 16px;
    height: 16px;
}

#hoursMatrix .matrix {
    grid-template-columns: repeat(6, 12px);
    grid-template-rows: repeat(4, 12px);
    width: fit-content;
}

#hoursMatrix .matrix-container {
    width: fit-content;
    height: fit-content;
}

#minutesMatrix .matrix {
    grid-template-columns: repeat(10, 12px);
    grid-template-rows: repeat(6, 12px);
    width: fit-content;
}

#secondsMatrix .matrix {
    grid-template-columns: repeat(10, 12px);
    grid-template-rows: repeat(6, 12px);
    width: fit-content;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #2a2a2a;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.5);
}

.dot.active {
    background-color: var(--neon-bg);
    box-shadow: 0 0 15px var(--neon-glow), inset 0 0 3px rgba(255, 255, 255, 0.3);
    animation: dotPulse 1s infinite;
}

.dot.inactive {
    background-color: #2a2a2a;
    opacity: 0.3;
}

@keyframes dotPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Interactive features */
.minimal-mode .time-display {
    opacity: 0.3;
}

.minimal-mode .matrix-section h2 {
    opacity: 0.5;
}

.minimal-mode .year-progress:nth-child(3) {
    opacity: 0.3;
}

.dot {
    cursor: pointer;
    transition: all 0.2s ease;
}

.dot:hover {
    transform: scale(1.2);
    z-index: 10;
}

/* Color Picker Styles */
.color-picker-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: 2px solid var(--neon-glow);
    color: var(--neon-glow);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.color-picker-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--neon-glow);
}

.color-picker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.color-picker-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    padding-top: 30px;
}

.color-picker-header h3 {
    color: var(--neon-glow);
    font-size: 2rem;
    margin: 0;
    text-shadow: 0 0 20px var(--neon-glow);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: -60px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--neon-glow);
    color: var(--neon-glow);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 10;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.color-swatch {
    background: rgba(26, 26, 26, 0.8);
    border: 2px solid #333;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    --swatch-bg: var(--neon-bg);
    --swatch-glow: var(--neon-glow);
}

.color-swatch:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--swatch-glow);
    border-color: var(--swatch-glow);
}

.color-swatch.active {
    border-color: var(--swatch-glow);
    box-shadow: 0 0 20px var(--swatch-glow), inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.swatch-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--swatch-bg);
    margin: 0 auto 10px;
    box-shadow: 0 0 15px var(--swatch-glow);
}

.swatch-name {
    color: var(--neon-glow);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.color-controls {
    text-align: center;
    margin-top: 20px;
}

.keyboard-hint {
    color: #cccccc;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.current-theme {
    color: var(--neon-glow);
    font-size: 1.1rem;
    font-weight: bold;
}

/* Font Picker Styles */
.font-section-label {
    color: var(--neon-glow);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 25px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px var(--neon-glow);
}

.font-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.font-swatch {
    background: rgba(26, 26, 26, 0.8);
    border: 2px solid #333;
    border-radius: 10px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.font-swatch:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--neon-glow);
    border-color: var(--neon-glow);
}

.font-swatch.active {
    border-color: var(--neon-glow);
    box-shadow: 0 0 20px var(--neon-glow), inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.font-preview {
    color: var(--neon-glow);
    font-size: 1.4rem;
    margin-bottom: 6px;
    letter-spacing: 1px;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
    font-smooth: never;
    text-rendering: optimizeSpeed;
}

.font-name {
    color: #cccccc;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* GeistPixel font rendering — crisp pixel-perfect display */
.geist-pixel-active,
.geist-pixel-active * {
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
    font-smooth: never;
    text-rendering: optimizeSpeed;
}

.geist-pixel-active h1 {
    font-size: 3rem;
    font-weight: normal;
    letter-spacing: 6px;
    text-shadow: 0 0 4px var(--neon-glow);
}

.geist-pixel-active .time-unit .value {
    font-size: 3rem;
    font-weight: normal;
    text-shadow: 0 0 4px var(--neon-glow);
}

.geist-pixel-active .progress-value,
.geist-pixel-active .remaining-value {
    font-weight: normal;
    text-shadow: 0 0 4px var(--neon-glow);
}

.geist-pixel-active .time-display:first-of-type .time-unit .value {
    text-shadow: 0 0 4px #ff6b35;
}

.geist-pixel-active .year-progress {
    font-size: 2rem;
}

.geist-pixel-active .matrix-section h2,
.geist-pixel-active .months-section h2 {
    font-weight: normal;
    letter-spacing: 4px;
    text-shadow: 0 0 4px var(--neon-glow);
}

.geist-pixel-active .time-unit .label,
.geist-pixel-active .progress-label,
.geist-pixel-active .remaining-label {
    font-weight: normal;
    letter-spacing: 2px;
}

.geist-pixel-active .month-container h3 {
    font-weight: normal;
    text-shadow: 0 0 4px var(--neon-glow);
}

.geist-pixel-active .color-picker-header h3 {
    font-weight: normal;
    text-shadow: 0 0 4px var(--neon-glow);
}

.geist-pixel-active .swatch-name,
.geist-pixel-active .current-theme {
    font-weight: normal;
}

.geist-pixel-active .font-section-label {
    text-shadow: 0 0 4px var(--neon-glow);
}

/* Fullscreen styles */
:fullscreen {
    background-color: #0a0a0a;
}

:fullscreen .container {
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .month-container h3 {
        font-size: 1rem;
        color: var(--neon-glow);
        text-shadow: 0 0 10px var(--neon-glow);
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .time-display {
        gap: 15px;
    }
    
    .time-unit .value {
        font-size: 2rem;
    }
    
    .matrix-section h2 {
        font-size: 1.2rem;
    }
    
    .dot {
        width: 8px;
        height: 8px;
    }
    
    .matrix-container {
        padding: 15px;
    }
    
    #daysMatrix .matrix {
        grid-template-columns: repeat(23, 12px);
        grid-template-rows: repeat(16, 12px);
    }

    .months-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .month-container {
        padding: 10px;
    }

    .month-container h3 {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .month-container .dot {
        width: 6px;
        height: 6px;
    }

    .color-picker-btn {
        top: 10px;
        right: 10px;
        font-size: 1.2rem;
        padding: 6px 10px;
    }
    
    .color-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        max-width: 400px;
    }
    
    .color-swatch {
        padding: 10px;
    }
    
    .swatch-preview {
        width: 30px;
        height: 30px;
    }
    
    .swatch-name {
        font-size: 0.7rem;
    }

    .font-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-width: 400px;
    }

    .font-preview {
        font-size: 1.1rem;
    }
}

    h1 {
        font-size: 2rem;
    }
    
    .time-display {
        gap: 15px;
    }
    
    .time-unit .value {
        font-size: 2rem;
    }
    
    .matrix-section h2 {
        font-size: 1.2rem;
    }
    
    .dot {
        width: 8px;
        height: 8px;
    }
    
    #daysMatrix .dot {
        width: 12px;
        height: 12px;
    }
    
    .matrix-container {
        padding: 15px;
    }
    
    #daysMatrix .matrix {
        grid-template-columns: repeat(23, 12px);
        grid-template-rows: repeat(16, 12px);
    }

    .months-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .month-container {
        padding: 10px;
    }

    .month-container h3 {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .month-container .dot {
        width: 6px;
        height: 6px;
    }
}

@media (max-width: 480px) {
    .time-unit .value {
        font-size: 1.5rem;
    }
    
    .dot {
        width: 6px;
        height: 6px;
    }
    
    .matrix-container {
        padding: 10px;
    }
    
    .months-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .month-container {
        padding: 8px;
    }

    .month-container h3 {
        font-size: 0.7rem;
        margin-bottom: 6px;
    }

    .month-container .dot {
        width: 5px;
        height: 5px;
    }
    
    .color-picker-btn {
        display: none; /* Hide on very small screens */
    }
    
    .color-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        max-width: 250px;
    }
    
    .color-swatch {
        padding: 8px;
    }
    
    .swatch-preview {
        width: 25px;
        height: 25px;
    }
    
    .swatch-name {
        font-size: 0.6rem;
    }

    .font-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        max-width: 250px;
    }

    .font-preview {
        font-size: 1rem;
    }

    .font-name {
        font-size: 0.6rem;
    }
}