/* BAJA DIVIDE — JetBrains Mono, terminal aesthetic */

:root {
    --bg:      #000;
    --fg:      #fff;
    --fg-dim:  rgba(255, 255, 255, 0.55);
    --border:  rgba(255, 255, 255, 0.14);
    --mono:    'JetBrains Mono', 'Courier New', monospace;
}

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

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   LOADING SCREEN
   ============================================ */

#loading-screen {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100;
    overflow: hidden;
}

#loading-canvas-container {
    position: absolute;
    inset: 0;
}
#loading-canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Custom ENTER cursor */
#cursor-text {
    position: fixed;
    display: none;
    pointer-events: none;
    z-index: 200;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.35em;
    color: rgba(255, 255, 255, 0.88);
    transform: translate(-50%, 18px);
    white-space: nowrap;
}

/* Title + dates — inside bottom-left */
.loading-title {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    color: rgba(255, 255, 255, 0.88);
}
.loading-dates {
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 300;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.5);
}

/* Bottom panel */
.loading-bottom {
    position: absolute;
    bottom: 32px;
    left: 34px;
    right: 34px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.loading-bottom-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.loading-bottom-right {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: flex-end;
}
.loading-info-row {
    display: flex;
    gap: 14px;
    align-items: baseline;
}
.loading-label {
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.42);
    text-transform: uppercase;
    min-width: 88px;
}
.loading-value {
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.65);
}
.loading-value a { color: inherit; text-decoration: none; }
.loading-value a:hover { color: rgba(255, 255, 255, 0.7); }

/* ============================================
   GALLERY — 2-column grid
   ============================================ */

#gallery {
    display: none;
    width: 100%;
    height: 100%;
}
#gallery.active {
    display: grid;
    grid-template-columns: 1fr 420px;
    height: 100%;
}

/* ── Left: Photo column ── */
.gallery-photo-section {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #000;
    overflow: hidden;
}
/* Column divider — child of photo section so it fades in with chrome */
.col-divider {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
    pointer-events: none;
}

/* Top bar: sound button left, city+weather right */
.photo-info-top {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 22px;
    min-height: 50px;
}

#sound-btn {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--mono);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}
#sound-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.82);
}
#sound-btn.muted {
    color: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.12);
}
.photo-top-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
#photo-index-counter {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.22);
    user-select: none;
    pointer-events: none;
}
.photo-top-right {
    display: flex;
    align-items: center;
}
#photo-top-info {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.7);
}

/* Photo container — centered, object-fit contain */
.photo-container {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
    min-height: 0;
}
.photo-container img,
.photo-container video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
}
.photo-container img.active,
.photo-container video.active {
    opacity: 1;
}

/* Expand to photo-fullscreen button */
.photo-expand-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, border-color 0.2s, color 0.2s;
    z-index: 5;
    padding: 0;
}
.photo-container:hover .photo-expand-btn {
    opacity: 1;
}
.photo-expand-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* Bottom bar: day label + optional description */
.photo-info-bottom {
    flex-shrink: 0;
    padding: 13px 22px;
    min-height: 44px;
}
.photo-day-label {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.6;
}

/* ── Gallery hint overlay ── */
#gallery-hint {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    pointer-events: none;
    transition: background 0.5s ease, opacity 0.5s ease;
}
#gallery-hint.active {
    background: rgba(0, 0, 0, 0.78);
    opacity: 1;
    pointer-events: all;
    cursor: pointer;
}
.gallery-hint-content {
    text-align: center;
}
.gallery-hint-line {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 1.0);
    line-height: 2.4;
}

/* ── Right: Map column ── */
.map-section {
    position: relative;
    height: 100%;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

/* Baja map — takes most of the vertical space */
#gallery-map {
    flex: 1;
    position: relative;
    cursor: crosshair;
    min-height: 0;
}
#gallery-map-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Elevation profile strip */
.elevation-section {
    flex-shrink: 0;
    height: 82px;
    border-top: 1px solid var(--border);
    position: relative;
    cursor: default;
    pointer-events: none;
}
#elevation-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Info panel — pinned to bottom */
.map-info-panel {
    flex-shrink: 0;
    padding: 18px 24px;
    border-top: 1px solid var(--border);
}
.map-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    margin-bottom: 10px;
}
.map-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.map-info-label {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    font-weight: 400;
}
.map-info-value {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
}
.map-info-coords {
    font-family: var(--mono);
    font-size: 8px;
    color: rgba(255, 255, 255, 0.38);
    letter-spacing: 0.08em;
    font-weight: 300;
}

/* ============================================
   MILESTONE OVERLAY
   ============================================ */

#milestone-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 50;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
#milestone-overlay.active { display: flex; }

.milestone-content { max-width: 460px; padding: 60px; }
.milestone-title {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5em;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 26px;
}
.milestone-stats {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.55);
    line-height: 2;
    margin-bottom: 26px;
}
.milestone-note {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.48);
    margin-bottom: 48px;
}
.milestone-hint {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.28em;
    color: rgba(255, 255, 255, 0.32);
    font-weight: 300;
}

/* ============================================
   ENDING SCREEN
   ============================================ */

#ending {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
    cursor: none;
}
#ending.active { display: flex; }

#ending-cursor {
    position: fixed;
    pointer-events: none;
    transform: translate(-50%, -50%);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.75);
    display: none;
    z-index: 110;
    white-space: nowrap;
}

.ending-content {
    position: relative;
    z-index: 10;
    text-align: center;
}
.ending-title {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.4em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 32px;
}
.ending-link { font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; }
.ending-link a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}
.ending-link a:hover { color: rgba(255, 255, 255, 0.82); }

/* ============================================
   PHOTO FULLSCREEN OVERLAY
   ============================================ */

#photo-fullscreen {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 300;
    display: none;
    justify-content: center;
    align-items: center;
}
#photo-fullscreen.active { display: flex; }

#photo-fullscreen-media {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
#photo-fullscreen-media img,
#photo-fullscreen-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
#photo-fullscreen-counter {
    position: absolute;
    bottom: 28px;
    right: 36px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}
#photo-fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s, border-color 0.2s, color 0.2s;
    padding: 0;
}
#photo-fullscreen-close.visible {
    opacity: 1;
}
#photo-fullscreen-close:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* ============================================
   ABOUT OVERLAY
   ============================================ */

#about-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--mono);
    font-size: 11px;
    cursor: pointer;
    z-index: 50;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#about-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.82);
}

#about-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
#about-overlay.active { display: flex; }

.about-content {
    max-width: 460px;
    padding: 60px;
    cursor: default;
}
.about-title {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.32em;
    margin-bottom: 36px;
    color: rgba(255, 255, 255, 0.82);
}
.about-text {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 300;
    line-height: 2;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 26px;
}
.about-text a { color: rgba(255, 255, 255, 0.72); text-decoration: none; }
.about-credits {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.32);
    margin-top: 38px;
}
.about-credits a { color: rgba(255, 255, 255, 0.38); text-decoration: none; }
.about-close {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.22em;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 44px;
    font-weight: 300;
}

/* ============================================
   MOBILE
   ============================================ */

#mobile-message {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
}
.mobile-text {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    line-height: 2;
    color: rgba(255, 255, 255, 0.32);
    max-width: 280px;
    font-weight: 300;
}

@media (max-width: 1024px) {
    #mobile-message { display: flex; }
    #loading-screen, #gallery, #about-btn { display: none !important; }
}
