:root {
    color-scheme: dark;
    color: #f7f2ec;
    background: #0f1014;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
}

body {
    min-height: 100%;
    background: radial-gradient(circle at top left, rgba(255, 206, 100, 0.08), transparent 24%),
                radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.04), transparent 20%),
                #0f1014;
    color: #f7f2ec;
}

.page-shell {
    min-height: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 32px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: #b8a16c;
    margin-bottom: 56px;
}

/* Vintage manila-folder tabs for header navigation */
.vintage-tabs {
    position: relative;
    display: flex;
    align-items: flex-end;
    margin-left: 12px;
    gap: 14px;
}

.vintage-tabs .tab {
    position: relative;
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    min-width: 120px;
    padding: 20px 20px 14px;
    font-family: 'Special Elite', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    text-decoration: none;
    color: #241d10;
    background-image: linear-gradient(180deg, #b9a274 0%, #9c8557 100%);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: filter 160ms ease, box-shadow 160ms ease;
}

/* the folder tab poking up above the body, flush and offset to the right like a hanging file */
.vintage-tabs .tab::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 12%;
    width: 42%;
    min-width: 40px;
    height: 8px;
    background: linear-gradient(180deg, #ab9469 0%, #9c8557 100%);
    border-radius: 3px 4px 0 0;
    pointer-events: none;
}

.vintage-tabs .tab:hover {
    filter: brightness(1.08);
}

.vintage-tabs .tab.active {
    z-index: 2;
    color: #1c1608;
    background-image: linear-gradient(180deg, #c7b183 0%, #a6905f 100%);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35), inset 0 -3px 0 rgba(215, 170, 87, 0.9);
}

.vintage-tabs .tab.active::before {
    background: linear-gradient(180deg, #b9a274 0%, #a6905f 100%);
}

@media (max-width: 640px) {
    .vintage-tabs { gap: 8px; flex-wrap: wrap; }
    .vintage-tabs .tab { min-width: 0; padding: 16px 14px 10px; font-size: 0.68rem; }
    .vintage-tabs .tab::before { width: 46%; right: 8%; }
}

.page-content {
    flex: 1;
}

.about-hero-image {
    display: block;
    width: 33%;
    height: auto;
    object-fit: contain;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0 auto;
}

.about-statement {
    max-width: 42rem;
    margin: 32px auto 0;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #d8d1c7;
    text-align: center;
}

.requests-page {
    max-width: 42rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.form-field input:not([type="file"]),
.form-field textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(216, 201, 163, 0.2);
    border-radius: 4px;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 1rem;
    color: #f4efe4;
    resize: vertical;
}

.form-field input:not([type="file"]):focus,
.form-field textarea:focus {
    outline: none;
    border-color: #c59e3f;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c9b376;
    margin-bottom: 8px;
}

.form-field input[type="file"] {
    width: 100%;
    color: #d8d1c7;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 10px 0;
}

.form-error {
    color: #d97a6c;
    font-size: 0.85rem;
    margin: 6px 0 0;
}

.form-status,
.form-success {
    color: #c9b376;
    font-size: 0.95rem;
    margin: 16px 0 0;
}

.signup-block {
    margin-top: 32px;
    max-width: 42rem;
}

.signup-form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
}

.signup-form .form-field {
    flex: 1 1 220px;
}

.signup-form .btn {
    align-self: stretch;
}

.contact-form .btn {
    align-self: flex-start;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.articles-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.articles-teaser {
    max-width: 42rem;
    font-size: 1.3rem;
    line-height: 1.8;
    color: #d8d1c7;
    text-align: center;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 48px;
    align-items: start;
}

.hero-copy {
    max-width: 760px;
}

.hero-caption {
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #c9b376;
    margin-bottom: 1.25rem;
}

h1 {
    margin: 0;
    font-size: clamp(3rem, 5vw, 5.5rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    max-width: 14ch;
}

.accent {
    color: #d7aa57;
    font-style: italic;
}

.hero-text {
    max-width: 42rem;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #d8d1c7;
    margin: 32px 0 42px;
}

.dispatch-feed {
    max-width: 42rem;
    max-height: 260px;
    overflow-y: auto;
    margin: 0 0 42px;
    padding-right: 12px;
    border-left: 2px solid rgba(197, 158, 63, 0.3);
}

.dispatch-entry {
    padding: 0 0 20px 20px;
    border-bottom: 1px solid rgba(216, 201, 163, 0.12);
    margin-bottom: 20px;
}

.dispatch-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.dispatch-date {
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #c9b376;
    margin-bottom: 6px;
}

.dispatch-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #d8d1c7;
    margin: 0;
}

.dispatch-feed::-webkit-scrollbar {
    width: 6px;
}

.dispatch-feed::-webkit-scrollbar-thumb {
    background: rgba(197, 158, 63, 0.4);
}

.dispatch-feed::-webkit-scrollbar-track {
    background: transparent;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.btn,
.link-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.primary-btn {
    background: #c59e3f;
    color: #0f1014;
    padding: 16px 26px;
    border-radius: 0;
    letter-spacing: 0.08em;
}

.link-btn {
    color: #d8c9a3;
    border-bottom: 1px solid rgba(216, 201, 163, 0.2);
    padding: 16px 0;
}

.hero-right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    justify-self: end;
    gap: 20px;
    width: 100%;
    max-width: 280px;
}

.hero-qr-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

.preview-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    padding: 18px;
    border-radius: 20px;
    width: 100%;
}

.preview-card.preview-qr {
    text-align: center;
    padding: 16px;
}

.preview-card.preview-qr .qr-link {
    display: inline-block;
    margin: 0 auto 1rem;
}

.footer-panel-right {
    position: relative;
    z-index: 0;
    overflow: hidden;
}

.footer-panel-right .hud-header,
.footer-panel-right .graph-wrap {
    position: relative;
    z-index: 1;
}

.seal-stamp {
    position: absolute;
    left: 50%;
    top: 50%;
    width: auto;
    height: 60%;
    max-width: 60%;
    max-height: 220px;
    opacity: 0.45;
    filter: invert(1) brightness(1.8) contrast(1.4);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    mask-image: radial-gradient(circle, #000 35%, transparent 72%);
    -webkit-mask-image: radial-gradient(circle, #000 35%, transparent 72%);
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
}

.preview-series-image-swap {
    position: relative;
    margin-bottom: 1rem;
}

.preview-series-image {
    width: 100%;
    display: block;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0;
}

.preview-series-image-hover {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.preview-series-image-swap:hover .preview-series-image-hover {
    opacity: 1;
}

.qr-image {
    width: 100%;
    max-width: 120px;
    display: block;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-label {
    margin: 0 0 1.5rem;
    color: #e8e2d7;
    line-height: 1.9;
}

.redact {
    color: #0f1014;
    background: #d7aa57;
    padding: 0 0.4rem;
    border-radius: 3px;
}

.preview-meta {
    color: #9e9377;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #7f7a70;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-top: 56px;
    margin-bottom: 0;
    align-items: flex-end;
}

.weather-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.weather-title {
    color: #d7aa57;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
}

.page-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.home-dashboard-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(150px, 0.7fr);
    gap: 24px;
    margin-top: 24px;
    min-height: 0;
}

.facility-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.facility-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.facility-tag {
    flex: 0 0 auto;
    min-width: 34px;
    padding: 5px 7px;
    background: linear-gradient(180deg, #f2c369 0%, #dba949 100%);
    color: #241a06;
    font-weight: 800;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    text-align: center;
    border-radius: 4px;
}

.facility-tag span {
    display: block;
    font-size: 0.8rem;
}

.facility-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.facility-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #f3d98b;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.facility-meta {
    font-size: 0.7rem;
    color: #a79a7c;
}

.footer-panel-status {
    align-items: stretch;
}

.status-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8c7f5e;
}

.status-list li::before {
    content: '◇';
    margin-right: 6px;
    font-size: 0.6rem;
}

.status-list li.on {
    color: #f3d98b;
}

.dial-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.dial {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: conic-gradient(#f2a93b calc(var(--pct) * 1%), rgba(255, 255, 255, 0.08) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.dial::before {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: #14151c;
}

.dial span {
    position: relative;
    z-index: 1;
    font-size: 0.68rem;
    font-weight: 700;
    color: #f3d98b;
}

.dial label {
    position: relative;
    z-index: 1;
    font-size: 0.52rem;
    color: #a97c33;
    letter-spacing: 0.06em;
}

@media (max-width: 960px) {
    .home-hero {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero-right {
        justify-content: stretch;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding: 24px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

.footer-panel {
    background: rgba(14, 15, 20, 0.76);
    padding: 14px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    max-height: 300px;
    position: relative;
    background-image:
        linear-gradient(rgba(255, 199, 47, 0.28), rgba(255, 199, 47, 0.28)),
        linear-gradient(rgba(255, 199, 47, 0.28), rgba(255, 199, 47, 0.28)),
        linear-gradient(rgba(255, 199, 47, 0.28), rgba(255, 199, 47, 0.28)),
        linear-gradient(rgba(255, 199, 47, 0.28), rgba(255, 199, 47, 0.28));
    background-size:
        calc(100% - 60px) 1px,
        calc(100% - 60px) 1px,
        1px calc(100% - 80px),
        1px calc(100% - 80px);
    background-position:
        30px 40px,
        30px calc(100% - 40px),
        0 40px,
        100% 40px;
    background-repeat: no-repeat;
}

.footer-panel .panel-body,
.footer-panel .panel-row,
.footer-panel .world-graph,
.footer-panel .graph-wrap {
    overflow: auto;
    max-height: calc(100vh / 5);
    min-height: 0;
}

.panel-header {
    font-size: 0.76rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #f3d98b;
}

.panel-body {
    display: grid;
    gap: 10px;
}

.panel-body p {
    margin: 0;
    color: #d7d0c1;
    line-height: 1.7;
}

.panel-stats,
.panel-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
    color: #b8ae9d;
}

.stat-tag {
    color: #f7f2ec;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.panel-row {
    display: grid;
    gap: 14px;
}

.panel-item {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
}

.panel-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #f3d98b;
    margin-bottom: 10px;
}

.panel-item-copy {
    font-size: 0.9rem;
    color: #cfc6b8;
    line-height: 1.7;
}

.panel-item-keyline {
    border-left: 4px solid rgba(197, 158, 75, 0.9);
}

.panel-footer-note {
    color: #8c7f5e;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.world-graph {
    display: grid;
    gap: 16px;
}

.world-graph {
    display: grid;
    gap: 12px;
}

.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hud-header .left {
    color: #f2a93b;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hud-header .left span {
    display: block;
    font-size: 0.68rem;
    color: #a97c33;
    font-weight: 400;
    margin-top: 4px;
}

.hud-header .right {
    text-align: right;
    color: #f2a93b;
    line-height: 1.6;
    max-width: 65%;
}

.hud-header .right .dim {
    display: block;
    color: #a97c33;
}

.graph-wrap {
    position: relative;
    width: 100%;
    padding-top: 4px;
    max-height: 320px;
    height: 320px;
    overflow: hidden;
}

.graph-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
    max-height: 100%;
}

.draggable-node {
    cursor: grab;
    touch-action: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(1.18); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes flow {
    to { stroke-dashoffset: -24; }
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.25; }
    94% { opacity: 1; }
    97% { opacity: 0.5; }
    98% { opacity: 1; }
}

@keyframes reveal {
    from { stroke-dashoffset: var(--len); }
    to { stroke-dashoffset: 0; }
}

.pulse-ring {
    transform-origin: center;
    transform-box: fill-box;
    animation: pulse 2.4s ease-in-out infinite;
}

.spin-ring {
    transform-origin: center;
    transform-box: fill-box;
    animation: spin 7s linear infinite;
}

.flow-line {
    stroke-dasharray: 6 6;
    animation: flow 1.1s linear infinite;
}

.hud-text {
    animation: flicker 5s ease-in-out infinite;
}

.draw-in {
    stroke-dasharray: var(--len);
    animation: reveal 1.4s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
    .pulse-ring, .spin-ring, .flow-line, .hud-text, .draw-in {
        animation: none !important;
        opacity: 1;
        stroke-dashoffset: 0 !important;
    }
}

.world-footer-note {
    color: #b8aa83;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 960px) {
    .home-dashboard-footer {
        grid-template-columns: 1fr;
    }
}
