/* dilemma.studio - Analog Relics in Orbit */

:root {
    --deep-hull: #0B1628;
    --aurora-green: #3DFFA2;
    --aurora-violet: #A855F7;
    --aurora-teal: #2DD4BF;
    --frost-white: #E8F5E9;
    --silver-fog: #C5D0DC;
    --warm-sepia: #D4A574;
    --amber-memory: #E8A849;
    --hull-blue: #1B2838;

    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
    --base-unit: 6px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-hull);
    color: var(--silver-fog);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ==============================
   SIDEBAR - Spacecraft Instrument Panel
   ============================== */

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: rgba(11, 22, 40, 0.92);
    border-right: 1px solid rgba(61, 255, 162, 0.2);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.8s var(--spring-ease);
    display: flex;
    flex-direction: column;
}

#sidebar.visible {
    opacity: 1;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 32px 20px;
}

/* Mission Clock */
.mission-clock {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(61, 255, 162, 0.1);
}

.system-label {
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--aurora-green);
    opacity: 0.7;
}

.clock-display {
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--aurora-green);
    opacity: 0.5;
}

/* ==============================
   FILMSTRIP NAVIGATION
   ============================== */

.filmstrip-nav {
    flex: 1;
    display: flex;
    gap: 0;
    overflow-y: auto;
    position: relative;
}

.filmstrip-nav::-webkit-scrollbar {
    width: 4px;
}

.filmstrip-nav::-webkit-scrollbar-track {
    background: transparent;
}

.filmstrip-nav::-webkit-scrollbar-thumb {
    background: var(--aurora-green);
    border-radius: 2px;
}

.filmstrip-perforation {
    width: 12px;
    flex-shrink: 0;
    background: repeating-linear-gradient(
        to bottom,
        var(--hull-blue) 0px,
        var(--hull-blue) 4px,
        transparent 4px,
        transparent 8px
    );
}

.filmstrip-frames {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 6px;
    flex: 1;
}

.film-frame {
    position: relative;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(212, 165, 116, 0.4);
    background: var(--hull-blue);
    cursor: pointer;
    transition: transform 0.3s var(--spring-ease), box-shadow 0.3s var(--spring-ease);
    flex-shrink: 0;
    display: block;
    padding: 0;
    outline: none;
    border-radius: 0;
    -webkit-appearance: none;
}

.film-frame:hover {
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(61, 255, 162, 0.4);
    border-color: var(--aurora-green);
}

.frame-thumb {
    width: 100%;
    height: 100%;
}

.thumb-1 { background: linear-gradient(135deg, #4a3728, #6b5240); }
.thumb-2 { background: linear-gradient(135deg, #3a4a5c, #5a6a7c); }
.thumb-3 { background: linear-gradient(135deg, #5a4030, #7a6050); }
.thumb-4 { background: linear-gradient(135deg, #2a3a4a, #4a5a6a); }
.thumb-5 { background: linear-gradient(135deg, #4a4030, #6a6050); }

.frame-indicator {
    position: absolute;
    left: -14px;
    top: 0;
    width: 3px;
    height: 0;
    background: linear-gradient(to bottom, var(--aurora-green), var(--aurora-teal), var(--aurora-violet));
    transition: height 0.4s var(--spring-ease);
}

.film-frame.active .frame-indicator {
    height: 48px;
}

/* Sidebar Status */
.sidebar-status {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(61, 255, 162, 0.1);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-value {
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--aurora-green);
}

/* ==============================
   MAIN CONTENT
   ============================== */

#main-content {
    margin-left: 280px;
    padding-left: 32px;
}

/* ==============================
   OBSERVATION WINDOWS (Sections)
   ============================== */

.observation-window {
    position: relative;
    min-height: 90vh;
    padding: 64px 40px 64px 40px;
    overflow: hidden;
}

.observation-window:first-child {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-content {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.text-block {
    width: 60%;
    max-width: 62ch;
}

.text-block p {
    margin-bottom: 18px;
    color: var(--silver-fog);
}

/* ==============================
   SECTION BRACKETS (HUD framing)
   ============================== */

.section-brackets {
    position: absolute;
    inset: 24px;
    pointer-events: none;
    z-index: 1;
}

.bracket {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0.3;
    transition: width 0.5s var(--spring-ease),
                height 0.5s var(--spring-ease),
                opacity 0.3s ease;
}

.bracket-tl {
    top: 0; left: 0;
    border-top: 2px solid var(--aurora-green);
    border-left: 2px solid var(--aurora-green);
}

.bracket-tr {
    top: 0; right: 0;
    border-top: 2px solid var(--aurora-green);
    border-right: 2px solid var(--aurora-green);
}

.bracket-bl {
    bottom: 0; left: 0;
    border-bottom: 2px solid var(--aurora-green);
    border-left: 2px solid var(--aurora-green);
}

.bracket-br {
    bottom: 0; right: 0;
    border-bottom: 2px solid var(--aurora-green);
    border-right: 2px solid var(--aurora-green);
}

.observation-window.visible .bracket {
    width: 24px;
    height: 24px;
    opacity: 0.3;
}

.observation-window.visible:hover .bracket,
.observation-window.bracket-hover .bracket {
    width: 32px;
    height: 32px;
    opacity: 0.6;
}

/* ==============================
   TYPOGRAPHY
   ============================== */

.site-title {
    font-family: 'Fira Sans', sans-serif;
    font-weight: 600;
    font-size: 72px;
    letter-spacing: -0.02em;
    color: var(--frost-white);
    line-height: 1.05;
    margin-bottom: 24px;
    opacity: 0;
}

.site-title.visible {
    opacity: 1;
}

.site-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
}

.site-title span.char-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.5s var(--spring-ease);
}

.hero-tagline {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    color: var(--silver-fog);
    max-width: 50ch;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-tagline.visible {
    opacity: 1;
}

h2 {
    font-family: 'Fira Sans', sans-serif;
    font-weight: 600;
    font-size: 48px;
    letter-spacing: -0.02em;
    color: var(--frost-white);
    line-height: 1.1;
    margin-bottom: 24px;
}

.section-number {
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--aurora-green);
    opacity: 0.7;
    display: block;
    margin-bottom: 12px;
    text-transform: uppercase;
}

/* ==============================
   PHOTO ELEMENTS - Vintage Photography
   ============================== */

.photo-element {
    position: relative;
    flex-shrink: 0;
}

.photo-float-right {
    margin-left: auto;
    margin-top: 24px;
}

.photo-frame {
    border: 1px solid var(--warm-sepia);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(11, 22, 40, 0.4);
    transition: box-shadow 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                filter 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    filter: sepia(0.3) contrast(1.1) brightness(0.95) saturate(0.85);
}

.photo-element:hover .photo-frame {
    filter: sepia(0.05) contrast(1.1) brightness(0.95) saturate(0.85);
    box-shadow: 0 12px 48px rgba(11, 22, 40, 0.55);
    transform: scale(1.03);
}

.photo-surface {
    width: 240px;
    height: 180px;
}

.photo-large .photo-surface {
    width: 320px;
    height: 240px;
}

.photo-final .photo-surface {
    width: 260px;
    height: 200px;
}

/* Vintage photo gradients */
.photo-gradient-1 { background: linear-gradient(145deg, #8B7355, #A08060, #6B5340, #9B8365); }
.photo-gradient-2 { background: linear-gradient(120deg, #5A6A7C, #7A8A9C, #4A5A6C, #6A7A8C); }
.photo-gradient-3 { background: linear-gradient(160deg, #7A6050, #9A8070, #5A4030, #8A7060); }
.photo-gradient-4 { background: linear-gradient(135deg, #6B5A40, #8B7A60, #4B3A20, #7B6A50); }
.photo-gradient-5 { background: linear-gradient(150deg, #5A5040, #7A7060, #3A3020, #6A6050); }
.photo-gradient-6 { background: linear-gradient(130deg, #3A5A6A, #5A7A8A, #2A4A5A, #4A6A7A); }
.photo-gradient-7 { background: linear-gradient(140deg, #4A4A5A, #6A6A7A, #3A3A4A, #5A5A6A); }

/* Photo Rotations */
.photo-tilted-left {
    transform: rotate(-1.2deg);
}

.photo-tilted-right {
    transform: rotate(2.1deg);
}

.photo-tilted-slight {
    transform: rotate(0.8deg);
}

/* Photo Captions */
.photo-caption {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: 12px;
    color: var(--amber-memory);
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.photo-element:hover .photo-caption {
    opacity: 1;
}

.loupe-icon {
    flex-shrink: 0;
    vertical-align: middle;
}

/* Photo Clusters */
.photo-cluster {
    display: flex;
    gap: 24px;
    flex-shrink: 0;
    margin-left: auto;
    margin-top: 40px;
}

/* ==============================
   AURORA WASH BACKGROUNDS
   ============================== */

.aurora-wash {
    position: absolute;
    top: 50%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(
        ellipse at center,
        rgba(61, 255, 162, 0.05) 0%,
        rgba(168, 85, 247, 0.03) 50%,
        transparent 70%
    );
    pointer-events: none;
    transform: translateY(-50%);
    z-index: 0;
}

/* ==============================
   SECTION DIVIDERS
   ============================== */

.section-divider {
    padding: 0 40px;
    margin-left: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scissors-icon {
    flex-shrink: 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--aurora-green), var(--aurora-teal), var(--aurora-violet), transparent);
    background-size: 200% 100%;
    animation: shimmerDivider 12s linear infinite;
    will-change: background-position;
}

@keyframes shimmerDivider {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

/* ==============================
   ANNOTATION ARROWS
   ============================== */

.annotation-arrow {
    position: absolute;
    z-index: 3;
    pointer-events: none;
}

.arrow-1 {
    bottom: 30%;
    left: 55%;
}

.arrow-2 {
    top: 35%;
    left: 50%;
}

/* ==============================
   CONTENT REVEAL ANIMATIONS
   ============================== */

.observation-window .text-block {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s var(--spring-ease);
}

.observation-window .photo-element {
    opacity: 0;
    transform: translateX(40px) rotate(3deg);
    transition: opacity 0.6s ease 0.08s, transform 0.6s var(--spring-ease) 0.08s;
}

.observation-window .photo-cluster .photo-element:nth-child(2) {
    transition-delay: 0.16s;
}

.observation-window.visible .text-block {
    opacity: 1;
    transform: translateY(0);
}

.observation-window.visible .photo-element {
    opacity: 1;
    transform: translateX(0) rotate(var(--photo-rot, 0deg));
}

.photo-tilted-left { --photo-rot: -1.2deg; }
.photo-tilted-right { --photo-rot: 2.1deg; }
.photo-tilted-slight { --photo-rot: 0.8deg; }
.photo-float-right { --photo-rot: 0deg; }
.photo-final { --photo-rot: 0deg; }

/* ==============================
   RESPONSIVE
   ============================== */

@media (max-width: 900px) {
    #sidebar {
        width: 60px;
        overflow: hidden;
    }

    .sidebar-inner {
        padding: 16px 6px;
        align-items: center;
    }

    .mission-clock {
        display: none;
    }

    .sidebar-status {
        display: none;
    }

    .filmstrip-perforation {
        width: 6px;
    }

    .filmstrip-frames {
        padding: 4px 2px;
    }

    .film-frame {
        width: 36px;
        height: 36px;
    }

    .film-frame.active .frame-indicator {
        height: 36px;
    }

    .frame-indicator {
        left: -8px;
    }

    #main-content {
        margin-left: 60px;
        padding-left: 16px;
    }

    .observation-window {
        padding: 40px 20px;
    }

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

    h2 {
        font-size: 36px;
    }
}

@media (max-width: 600px) {
    #sidebar {
        display: none;
    }

    #main-content {
        margin-left: 0;
        padding-left: 0;
    }

    .observation-window {
        padding: 32px 16px;
        min-height: auto;
    }

    .section-content {
        flex-direction: column;
    }

    .text-block {
        width: 100%;
    }

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

    h2 {
        font-size: 28px;
    }

    .photo-surface {
        width: 100%;
        height: 200px;
    }

    .photo-large .photo-surface,
    .photo-final .photo-surface {
        width: 100%;
        height: 220px;
    }

    .photo-cluster {
        flex-direction: column;
        margin-left: 0;
    }

    .photo-float-right {
        margin-left: 0;
    }

    .annotation-arrow {
        display: none;
    }

    .section-divider {
        padding: 0 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .observation-window .text-block,
    .observation-window .photo-element {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .bracket {
        width: 24px;
        height: 24px;
        transition: none;
    }

    .divider-line {
        animation: none;
    }

    .site-title {
        opacity: 1;
    }

    .site-title span {
        opacity: 1;
        transform: none;
    }

    .hero-tagline {
        opacity: 1;
        transition: none;
    }

    .film-frame {
        opacity: 1;
        transform: none;
    }
}
