/* xity.bar - Anti-Design / Brutalist */
/* Monospace exclusive, institutional gray palette, prime-number grid */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0;
}

html {
    font-size: 14px;
    background: #FAFAFA;
    color: #2B2B2B;
}

body {
    font-family: 'Courier Prime', monospace;
    letter-spacing: 0.5px;
    line-height: 1.6;
    background: #FAFAFA;
    min-height: 100vh;
}

/* Page wrapper - deliberate dead space on right */
.page-wrapper {
    max-width: 1027px; /* 7 * 137 + 6 * 11 = 959 + 68 = 1027 */
    margin: 0;
    padding: 35px 21px 35px 35px;
}

/* --- HEADER --- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 0 11px 0;
}

.site-title {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 72px;
    letter-spacing: 2px;
    line-height: 1.1;
    text-transform: uppercase;
    color: #1A1A1A;
}

.header-right {
    display: flex;
    gap: 21px;
}

.header-meta {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 1px;
    color: #999999;
}

/* --- HORIZONTAL RULES --- */
.rule-full {
    border: none;
    border-top: 1px solid #B8B8B8;
    margin: 11px 0;
    width: 100%;
}

.rule-section {
    border: none;
    border-top: 1px solid #B8B8B8;
    margin: 5px 0 11px 0;
    width: 100%;
}

/* --- STATUS BAR --- */
.status-bar {
    display: flex;
    gap: 35px;
    padding: 7px 0;
}

.status-item {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 1px;
    color: #666666;
}

/* --- CONTENT GRID --- */
/* 7-column grid with 137px columns, 11px gutters */
.content-grid {
    display: grid;
    grid-template-columns: repeat(7, 137px);
    gap: 11px;
    padding: 11px 0;
}

/* --- SECTION BLOCKS --- */
.section-block {
    border-left: 2px solid #1A1A1A;
    border-right: 3px solid #1A1A1A;
    border-top: 1px solid #1A1A1A;
    border-bottom: 2px solid #1A1A1A;
    padding: 11px;
    background: #FAFAFA;
    position: relative;
    transform: skew(0.5deg);
}

/* Inner border via pseudo-element */
.section-block::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 1px solid #B8B8B8;
    pointer-events: none;
}

.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #1A1A1A;
    position: relative;
    z-index: 1;
}

/* --- BODY TEXT --- */
.body-text {
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    letter-spacing: 0.5px;
    line-height: 1.6;
    color: #2B2B2B;
    max-width: 80ch;
    position: relative;
    z-index: 1;
}

/* --- DATA TABLE --- */
.data-table {
    position: relative;
    z-index: 1;
}

.table-content {
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    letter-spacing: 0.5px;
    line-height: 1.6;
    color: #1A1A1A;
    white-space: pre;
    overflow-x: auto;
}

/* --- LOG ENTRIES --- */
.log-entries {
    max-height: 210px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.log-entry {
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #2B2B2B;
    padding: 3px 0;
    border-bottom: 1px solid #E8E8E8;
}

.log-time {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
    font-size: 11px;
    color: #999999;
    letter-spacing: 1px;
    margin-right: 11px;
}

.log-msg {
    color: #4D4D4D;
}

/* --- PROGRESS BARS --- */
.progress-row {
    display: flex;
    align-items: baseline;
    gap: 11px;
    padding: 5px 0;
    position: relative;
    z-index: 1;
}

.progress-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 2px;
    color: #1A1A1A;
    min-width: 42px;
}

.progress-bar {
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    color: #2B2B2B;
    white-space: nowrap;
}

.bar-fill {
    color: #3A3A3A;
    transition: width 300ms ease-out;
}

.bar-pct {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
    font-size: 11px;
    color: #666666;
    letter-spacing: 1px;
}

/* --- FORMS --- */
.form-block {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin-top: 11px;
    position: relative;
    z-index: 1;
}

.form-label {
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    color: #2B2B2B;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.form-input,
.form-select,
.form-textarea {
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: #2B2B2B;
    background: #FAFAFA;
    border: 1px solid #B8B8B8;
    padding: 5px 7px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border: 3px solid #1A1A1A;
    background: #FAFAFA;
    padding: 3px 5px;
}

.form-input {
    width: 200px;
}

.form-textarea {
    width: 100%;
    resize: vertical;
    line-height: 1.6;
}

.form-button {
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: #2B2B2B;
    background: #FAFAFA;
    border: 2px solid #1A1A1A;
    padding: 5px 11px;
    cursor: pointer;
    white-space: nowrap;
}

.form-button:hover {
    opacity: 0.6;
}

.form-button:active {
    background: #E8E8E8;
}

/* --- CONFIG FORM --- */
.config-form {
    position: relative;
    z-index: 1;
}

.config-row {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin-bottom: 7px;
}

.config-row .form-label {
    min-width: 77px;
}

.config-row .form-input,
.config-row .form-select {
    flex: 1;
    max-width: 200px;
}

/* --- NOTICES --- */
.notice-box {
    display: flex;
    gap: 11px;
    align-items: baseline;
    padding: 7px 0;
    border-bottom: 1px solid #E8E8E8;
    position: relative;
    z-index: 1;
}

.notice-icon {
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    white-space: nowrap;
}

.notice-info .notice-icon {
    color: #666666;
}

.notice-warn .notice-icon {
    color: #D32F2F;
}

.notice-ok .notice-icon {
    color: #1B5E20;
}

.notice-text {
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #2B2B2B;
    max-width: 80ch;
}

.validation-msg {
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    color: #D32F2F;
    padding: 5px 0;
    position: relative;
    z-index: 1;
    min-height: 0;
}

/* --- FOOTER --- */
.site-footer {
    padding: 11px 0 0 0;
}

.footer-nav {
    display: flex;
    gap: 21px;
    padding: 7px 0;
}

.nav-link {
    font-family: 'Courier Prime', monospace;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: #666666;
    text-decoration: none;
}

.nav-link:hover {
    opacity: 0.6;
}

.footer-meta {
    padding: 7px 0;
}

.meta-text {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 1px;
    color: #999999;
}

/* --- LINKS --- */
a {
    color: #2B2B2B;
    text-decoration: none;
}

a:hover {
    opacity: 0.6;
}

/* --- SCROLLBAR (minimal) --- */
.log-entries::-webkit-scrollbar {
    width: 3px;
}

.log-entries::-webkit-scrollbar-track {
    background: #FAFAFA;
}

.log-entries::-webkit-scrollbar-thumb {
    background: #B8B8B8;
}

/* --- DISABLED STATES --- */
button:disabled {
    opacity: 0.3;
    cursor: default;
}

/* --- SECTION HEIGHT VARIATION --- */
/* Ensuring no two adjacent sections share the same height */
.section-intro {
    min-height: 181px; /* prime-adjacent */
}

.section-metrics {
    min-height: 251px;
}

.section-log {
    min-height: 263px;
}

.section-progress {
    min-height: 197px;
}

.section-form {
    min-height: 277px;
}

.section-notices {
    min-height: 167px;
}

/* --- RESPONSIVE FALLBACK --- */
@media (max-width: 1040px) {
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .section-block {
        grid-column: span 3 !important;
    }

    .site-title {
        font-size: 48px;
    }
}

@media (max-width: 520px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .section-block {
        grid-column: span 1 !important;
    }

    .site-title {
        font-size: 32px;
    }

    .status-bar {
        flex-direction: column;
        gap: 5px;
    }

    .footer-nav {
        flex-wrap: wrap;
    }
}
