/* ═══════════════════════════════════════════════
   TIME — Möbius Helix  v12.0
   ═══════════════════════════════════════════════ */

:root {
    --t-void:        #050810;
    --t-text:        #cdd2e4;
    --t-text-dim:    rgba(160, 170, 200, 0.4);
    --t-text-bright: #eaecf5;
    --t-silencio:    rgba(120, 130, 165, 0.22);
    --t-gold:        rgba(220, 190, 110, 0.9);
    --t-gold-dim:    rgba(220, 190, 110, 0.15);
    --t-font-body:   'Cormorant Garamond', Georgia, serif;
    --t-font-mono:   'Space Mono', 'IBM Plex Mono', monospace;
}

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

body.page-template-page-time {
    background: var(--t-void) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
}
body.page-template-page-time #wrapper-navbar,
body.page-template-page-time .site-banner,
body.page-template-page-time #wrapper-footer {
    display: none !important;
}

/* ── Three.js canvas ── */
#three-canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: block;
}

/* ── Scanlines overlay ── */
.scanlines {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.02) 2px,
        rgba(0,0,0,0.02) 4px
    );
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: multiply;
}

/* ── Header ── */
.time-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 20;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    pointer-events: none;
    background: linear-gradient(to bottom, var(--t-void) 0%, rgba(5,8,16,0.6) 60%, transparent 100%);
}
.time-title {
    font-family: var(--t-font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--t-text-dim);
}
.time-nav-back {
    font-family: var(--t-font-mono);
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--t-text-dim);
    text-decoration: none;
    pointer-events: auto;
    transition: color 0.3s ease;
    cursor: pointer;
}
.time-nav-back:hover { color: var(--t-text); }

/* ── Quote stage ── */
.time-quote-stage {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 90%;
    max-width: 560px;
    text-align: center;
    pointer-events: none;
}
.time-quote-card {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 1s ease, transform 1s ease;
}
.time-quote-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.time-quote-card.exiting {
    opacity: 0;
    transform: translateY(-14px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.time-quote-text {
    font-family: var(--t-font-body);
    font-size: clamp(15px, 2.4vw, 22px);
    font-weight: 300;
    line-height: 1.65;
    color: var(--t-text);
    letter-spacing: 0.015em;
    white-space: pre-line;
}
.time-quote-text em {
    font-style: italic;
    color: var(--t-text-bright);
}
.time-quote-divider {
    display: block;
    margin: 14px auto;
    font-family: var(--t-font-mono);
    font-size: 10px;
    letter-spacing: 6px;
    color: var(--t-silencio);
}
.time-quote-silencio {
    font-family: var(--t-font-mono);
    font-size: 9px;
    letter-spacing: 4px;
    color: var(--t-silencio);
    text-transform: lowercase;
}
.time-quote-counter {
    margin-top: 20px;
    font-family: var(--t-font-mono);
    font-size: 8px;
    letter-spacing: 2px;
    color: var(--t-text-dim);
}

/* ── TOC rail ── */
.time-toc-rail {
    position: fixed;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: auto;
    padding: 6px 3px;
    max-height: 70vh;
}
.time-toc-pip {
    width: 3px;
    min-height: 3px;
    border-radius: 1px;
    background: rgba(120, 150, 200, 0.12);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
.time-toc-pip:hover {
    background: rgba(160, 180, 220, 0.35);
    transform: scaleX(2.5) translateX(-1px);
}
.time-toc-pip.active {
    background: var(--t-gold);
    box-shadow: 0 0 6px rgba(220, 190, 110, 0.5);
    transform: scaleX(3) translateX(-1.5px);
}
.time-toc-pip.silencio {
    background: rgba(80, 95, 130, 0.08);
    min-height: 2px;
}
.time-toc-pip.silencio.active {
    background: var(--t-gold-dim);
    box-shadow: none;
}
.time-toc-pip.core {
    background: rgba(200, 180, 120, 0.2);
}

/* ── Hourglass ── */
.time-hourglass-zone {
    position: fixed;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 28px;
    z-index: 18;
    pointer-events: none;
}
#timeHourglassCanvas {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.time-hourglass-zone.flipped #timeHourglassCanvas {
    transform: rotate(180deg);
}

/* ── Hint ── */
.time-hint {
    position: fixed;
    bottom: 32px; left: 0; right: 0;
    z-index: 10;
    text-align: center;
    font-family: var(--t-font-mono);
    font-size: 8px; letter-spacing: 3px;
    color: var(--t-text-dim); text-transform: uppercase;
    pointer-events: none;
    transition: opacity 2s ease;
    animation: hintPulse 3s ease-in-out infinite;
}
.time-hint.hidden { opacity: 0; }
@keyframes hintPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* ── Edge fades ── */
.time-fade-top, .time-fade-bottom {
    position: fixed;
    left: 0; right: 0;
    z-index: 5;
    pointer-events: none;
}
.time-fade-top {
    top: 0;
    height: 100px;
    background: linear-gradient(to bottom, var(--t-void) 0%, transparent 100%);
}
.time-fade-bottom {
    bottom: 0;
    height: 80px;
    background: linear-gradient(to top, var(--t-void) 0%, transparent 100%);
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .time-header { padding: 10px 14px; }
    .time-title { font-size: 7px; letter-spacing: 3px; }
    .time-nav-back { font-size: 7px; }
    .time-quote-text { font-size: 14px; line-height: 1.5; }
    .time-quote-counter { font-size: 7px; }
    .time-toc-rail {
        right: 4px;
        gap: 1.5px;
        max-height: 60vh;
        padding: 4px 2px;
    }
    .time-toc-pip { width: 2.5px; min-height: 2.5px; }
    .time-hourglass-zone { top: 34px; width: 30px; height: 22px; }
    .time-hint { font-size: 6px; bottom: 20px; }
}
