/* ===================================
   monopole.news - Frutiger Aero HUD
   Gold-Black Luxury News Interface
   =================================== */

/* --- Palette Reference ---
   Void Black:      #080604
   Panel Dark:      #1a140a
   Warm Charcoal:   #2a2218
   Gold Primary:    #d4af37
   Gold Soft:       #b8943a
   Parchment Light: #f5e6c8
   Amber Read:      #c8b89a
   Instrument Dim:  #8a7a5a
   Signal Glow:     #ffd700
   Alert Amber:     #e8a020
   --- */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Source Sans 3', sans-serif;
    background: #080604;
    color: #c8b89a;
}

/* --- Particle Canvas --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Ticker Rail --- */
#ticker-rail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: rgba(10, 8, 4, 0.85);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    z-index: 100;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
    opacity: 0;
    transition: opacity 400ms ease;
}

#ticker-rail.visible {
    opacity: 1;
}

#ticker-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a7a5a;
    cursor: pointer;
    transition: color 300ms ease, text-shadow 300ms ease;
}

.ticker-item.active {
    color: #f5e6c8;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.ticker-item.active .ticker-underline {
    transform: scaleX(1);
}

.ticker-text {
    position: relative;
    display: inline-block;
}

.ticker-text::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background: #d4af37;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ticker-item.active .ticker-text::after {
    transform: scaleX(1);
}

.ticker-diamond {
    color: #d4af37;
    margin: 0 16px;
    font-size: 0.6rem;
    opacity: 0.5;
}

/* --- HUD Container --- */
#hud-container {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 36px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    z-index: 10;
    padding: 16px;
    gap: 12px;
}

/* --- Side Instruments --- */
.side-instrument {
    width: 18%;
    min-width: 140px;
    max-width: 220px;
    background: rgba(16, 12, 6, 0.75);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 400ms ease;
    overflow: hidden;
}

.side-instrument.visible {
    opacity: 1;
}

.instrument-border-top {
    width: 100%;
    height: 2px;
    background: rgba(212, 175, 55, 0.35);
    transition: background 600ms ease;
}

.instrument-border-top.live {
    background: rgba(212, 175, 55, 0.8);
    animation: livePulse 3s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { background: rgba(212, 175, 55, 0.5); }
    50% { background: rgba(212, 175, 55, 0.9); }
}

.instrument-content {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.instrument-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.instrument-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.6rem, 0.7vw, 0.72rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8a7a5a;
    opacity: 0.7;
}

.instrument-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b8943a;
}

.live-indicator {
    color: #ffd700;
    animation: liveText 2s ease-in-out infinite;
}

@keyframes liveText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Primary Panel --- */
#primary-panel {
    position: relative;
    flex: 1;
    max-width: 60%;
    background: linear-gradient(145deg, rgba(26, 20, 10, 0.92), rgba(10, 8, 4, 0.96));
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: inset 0 0 60px rgba(212, 175, 55, 0.04), 0 0 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
}

#primary-panel.visible {
    opacity: 1;
}

#primary-panel.border-visible {
    border-color: rgba(212, 175, 55, 0.25);
}

/* --- Corner Brackets --- */
.corner-bracket {
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 5;
    opacity: 0;
    transition: opacity 400ms ease;
}

.corner-bracket.visible {
    animation: bracketBreathe 6s ease-in-out infinite;
}

@keyframes bracketBreathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

.corner-tl {
    top: 8px;
    left: 8px;
    border-top: 1px solid #d4af37;
    border-left: 1px solid #d4af37;
}

.corner-tr {
    top: 8px;
    right: 8px;
    border-top: 1px solid #d4af37;
    border-right: 1px solid #d4af37;
}

.corner-bl {
    bottom: 8px;
    left: 8px;
    border-bottom: 1px solid #d4af37;
    border-left: 1px solid #d4af37;
}

.corner-br {
    bottom: 8px;
    right: 8px;
    border-bottom: 1px solid #d4af37;
    border-right: 1px solid #d4af37;
}

/* --- Targeting Reticles --- */
.reticle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.2);
    z-index: 5;
    animation: reticlePulse 4s ease-in-out infinite;
}

@keyframes reticlePulse {
    0%, 100% { border-color: rgba(212, 175, 55, 0.15); }
    50% { border-color: rgba(212, 175, 55, 0.25); }
}

.reticle-top {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.reticle-right {
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.reticle-bottom {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.reticle-left {
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* --- Scan Line --- */
#scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(212, 175, 55, 0.06);
    z-index: 4;
    transform: translateY(-100%);
    pointer-events: none;
}

#scan-line.sweeping {
    animation: scanSweep 3s linear forwards;
}

@keyframes scanSweep {
    0% { top: 0; }
    100% { top: 100%; }
}

/* --- Story Content --- */
#story-content {
    position: relative;
    z-index: 3;
    padding: 48px 40px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    overflow-y: auto;
    transition: opacity 300ms ease, transform 300ms ease, filter 300ms ease;
}

#story-content.exiting {
    opacity: 0;
    transform: scale(0.97);
    filter: blur(4px);
}

#story-content.entering {
    opacity: 0;
    transform: scale(1.03);
}

#story-content.entered {
    opacity: 1;
    transform: scale(1);
    filter: none;
    transition: opacity 400ms cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 400ms cubic-bezier(0.22, 0.61, 0.36, 1),
                filter 400ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Story content scrollbar */
#story-content::-webkit-scrollbar {
    width: 4px;
}

#story-content::-webkit-scrollbar-track {
    background: transparent;
}

#story-content::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.15);
    border-radius: 2px;
}

.headline {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: clamp(2.2rem, 4.5vw, 3.8rem);
    letter-spacing: -0.02em;
    color: #f5e6c8;
    line-height: 1.15;
}

.headline .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px);
}

.headline .char.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 250ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Breaking news cursor */
.headline .breaking-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #ffd700;
    vertical-align: baseline;
    margin-left: 2px;
    animation: cursorBlink 530ms step-end infinite;
}

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

.headline .char.breaking-char {
    display: inline-block;
    opacity: 0;
    transform: scale(1.1);
}

.headline .char.breaking-char.revealed {
    opacity: 1;
    transform: scale(1);
    transition: opacity 80ms ease, transform 80ms ease;
}

.subhead {
    font-family: 'Exo 2', sans-serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: #c8b89a;
    line-height: 1.35;
    opacity: 0;
    transition: opacity 600ms ease;
}

.subhead.visible {
    opacity: 1;
}

.body-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.72;
    color: #c8b89a;
    max-width: 42ch;
    opacity: 0;
    transition: opacity 600ms ease;
}

.body-text.visible {
    opacity: 1;
}

.body-text strong, .body-text em {
    font-weight: 600;
    color: #f5e6c8;
}

/* --- Brief View --- */
#brief-view {
    position: relative;
    z-index: 3;
    padding: 20px 40px 40px;
    flex: 1;
    overflow: hidden;
}

#brief-view.hidden {
    display: none;
}

.brief-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    height: 100%;
}

.brief-card {
    background: rgba(26, 20, 10, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    padding: 24px 20px;
    cursor: pointer;
    transition: border-color 300ms ease, box-shadow 300ms ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.brief-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.06);
}

.brief-headline {
    font-family: 'Exo 2', sans-serif;
    font-weight: 500;
    font-size: clamp(0.95rem, 1.2vw, 1.2rem);
    color: #f5e6c8;
    line-height: 1.3;
}

.brief-summary {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 0.95vw, 0.95rem);
    color: #8a7a5a;
    line-height: 1.55;
}

/* --- Primary Panel in Brief Mode --- */
#primary-panel.brief-mode #story-content {
    max-height: 40%;
    overflow: hidden;
}

#primary-panel.brief-mode #brief-view {
    display: flex;
    flex-direction: column;
}

#primary-panel.brief-mode .headline {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

#primary-panel.brief-mode .body-text {
    display: none;
}

/* --- Status Bar --- */
#status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 36px;
    background: rgba(10, 8, 4, 0.85);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-top: 1px solid rgba(212, 175, 55, 0.08);
    opacity: 0;
    transition: opacity 400ms ease;
}

#status-bar.visible {
    opacity: 1;
}

#status-left, #status-center, #status-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

#utc-time {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.06em;
    color: #8a7a5a;
}

#domain-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b8943a;
    font-variant: small-caps;
}

.signal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8a7a5a;
    transition: background 300ms ease;
}

.signal-dot.active {
    background: #d4af37;
}

/* --- Keyboard Hint --- */
#keyboard-hint {
    position: fixed;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 24px;
    z-index: 50;
    opacity: 0;
    transition: opacity 800ms ease;
}

#keyboard-hint.visible {
    opacity: 1;
}

#keyboard-hint.fading {
    opacity: 0;
    transition: opacity 2000ms ease;
}

#keyboard-hint span {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a7a5a;
    opacity: 0.5;
}

/* --- Category Border Hue Variants --- */
.border-warm {
    border-color: #e8a020;
}

.border-cool {
    border-color: #2a2218;
}

/* --- Panel Depth Layers --- */
.panel-dark-fill {
    background: #1a140a;
}

.charcoal-fill {
    background: #2a2218;
}

.alert-accent {
    color: #e8a020;
}

/* --- Utility --- */
.hidden {
    display: none;
}
