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

:root {
    --bg-color: #FF5500;
    --text-color: #000000;
    /* Black */
    --grid-color: rgba(0, 0, 0, 0.2);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    /* Prevent scrolling */
    height: 100dvh;
    /* Use dynamic viewport height */
    width: 100vw;
    border: 5px solid var(--text-color);
    /* 5px Black Border */
    position: relative;
}

#canvas {
    position: fixed;
    /* Fixed background */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Main Content - Pushes footer down */
.main-content {
    flex-grow: 1;
}

/* Layout Container */
.layout-container {
    position: relative;
    /* Allow flow */
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    /* Fixed full height */
    z-index: 2;
    pointer-events: none;
    /* Let clicks pass through */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    /* Adjust padding to account for border if needed, but border-box handles it */
}

/* Header */
.site-header {
    display: block;
    width: 100%;
    padding: 0;
    /* Remove padding to align with edge if needed, or keep minimal */
    pointer-events: auto;
    line-height: 0.8;
}

.main-title {
    font-family: Inter, sans-serif;
    font-weight: 900;
    /* Maximize font size for single line on desktop */
    /* Reduced from 15.5vw to 11.5vw to ensure it fits */
    font-size: 11.5vw;
    line-height: 0.8;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    margin: 0;
    user-select: none;
    white-space: nowrap;
    /* Force single line on desktop */
    color: var(--text-color);
}

/* Info Bar */
/* Info Bar */
.info-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    align-items: center;
    border-top: 2px solid var(--text-color);
    /* border-bottom removed to avoid double line with footer */
    padding: 1rem 2rem;
    /* Reduced padding */
    margin-bottom: 0;
    /* Remove margin */
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    /* Reduced from 1.2rem to fit 4 cols */
    text-transform: uppercase;
    pointer-events: auto;
}

/* Disable selection for "Built to last" */
.info-bar .info-item:first-child {
    user-select: none;
}

/* Align Grid Items */
.info-item:nth-child(1) {
    justify-self: start;
}

#legal-container {
    justify-self: center;
    /* Or start/center depending on preference, let's try center/distributed */
    text-align: left;
}

#id-container {
    justify-self: center;
    text-align: left;
}

#location-container {
    justify-self: end;
    text-align: left;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.info-label {
    font-weight: 400;
    opacity: 0.6;
}

.info-value {
    font-weight: 700;
    font-size: 4rem;
}

.info-value-normal {
    font-weight: 700;
    min-height: 1.2em;
    display: inline-block;
    /* Ensure min-height works */
}

#location-text {
    min-width: 15ch;
    /* Reserve space for "Madrid / SPAIN" */
}

#id-text {
    min-width: 10ch;
    /* Reserve space for "B01682616" */
}

#legal-text {
    min-width: 15ch;
}

#location-label,
#id-label,
#legal-label {
    visibility: hidden;
}

/* Footer */
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Changed to center for vertical alignment */
    border-top: 2px solid var(--text-color);
    padding-top: 0.5rem;
    /* Reduced padding */
    padding-right: 2rem;
    padding-left: 2rem;
    pointer-events: auto;
}

/* Clock (Footer Left) - Adjusted Sizes */
.footer-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-family: 'JetBrains Mono', monospace;
    text-align: left;
    gap: 0.2rem;
}

.clock-time {
    font-size: 0.75rem;
    /* Same size as SYSTEM ACTIVE */
    font-weight: 700;
    letter-spacing: 0.05em;
}

.clock-date {
    font-size: 0.7rem;
    /* Same font as ESTABLISHED label */
    font-weight: 400;
    text-transform: uppercase;
    opacity: 0.6;
    min-height: 1.2em;
}

.blink-colon {
    animation: blink 1s steps(2, start) infinite;
}

#timezone {
    margin-left: 0.2rem;
    opacity: 0.6;
}

/* Status Indicator (Footer Right) */
.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

#sync-dots {
    display: inline-block;
    width: 2ch;
    /* Reserve space for 3 dots approx */
    text-align: left;
}

.running-since {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    opacity: 0.6;
    min-height: 1.2em;
}



.blink-dot {
    width: 10px;
    height: 10px;
    background-color: var(--text-color);
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Responsive Adjustments */


@media (max-width: 768px) {
    .main-title {
        font-size: 19vw;
        /* Larger font for stacked words, reduced from 24vw */
        line-height: 0.8;
        white-space: normal;
        /* Allow wrapping on mobile */
        word-break: break-word;
    }



    .info-bar {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        font-size: 1rem;
        padding: 0;
    }

    .info-item {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    /* Reset Grid Alignment for Mobile */
    .info-item:nth-child(1),
    #location-container,
    #id-container,
    #legal-container {
        justify-self: auto;
        text-align: left;
        padding-bottom: 0.5rem;
    }

    .info-value {
        font-size: 2rem;
    }

    .site-footer {
        flex-direction: row;
        gap: 1rem;
        align-items: flex-start;
        padding-left: 0;
        padding-right: 0;
    }

    .footer-right {
        align-items: flex-start;
    }
}

.interactive-element {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
}

.interactive-element:hover {
    opacity: 0.8;
}

body.loading .interactive-element {
    pointer-events: none;
    cursor: default;
}