/* ====================================================
   eyes.team — styles.css
   Zen-contemplative observatory design system
   ==================================================== */

/* --- Custom Properties (Palette from DESIGN.md) --- */
:root {
    --void-black: #0A0A0F;
    --bone-white: #F0EDE8;
    --mist-gray: #B0B8C1;
    --ink-charcoal: #1A1A22;
    --obsidian-edge: #2A2A35;
    --slate-dim: #5A6170;
    --cerulean-pulse: #0094D4;
    --cerulean-bright: #00B4FF;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--void-black);
    color: var(--bone-white);
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3, .section-title {
    font-family: 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 300;
    letter-spacing: 0.06em;
    line-height: 1.15;
    color: var(--bone-white);
}

.section-title {
    text-transform: uppercase;
    font-size: clamp(2rem, 5vw, 4rem);
}

.caption, .data-label {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--slate-dim);
}

/* --- Fade-Reveal Animation System --- */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal[data-delay="400"] {
    transition-delay: 400ms;
}

.reveal[data-delay="800"] {
    transition-delay: 800ms;
}

.reveal[data-delay="1200"] {
    transition-delay: 1200ms;
}

/* --- Persistent Sidebar --- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 240px;
    background-color: var(--void-black);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--obsidian-edge);
    transition: width 0.4s ease;
}

.sidebar-icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 64px;
}

.sidebar-icon {
    color: var(--slate-dim);
    opacity: 0;
    transition: color 0.4s ease, opacity 0.6s ease;
    cursor: default;
    position: relative;
}

.sidebar-icon.visible {
    opacity: 1;
}

.sidebar-icon.active {
    color: var(--cerulean-pulse);
}

.sidebar-icon:hover {
    color: var(--mist-gray);
}

.sidebar-icon.active:hover {
    color: var(--cerulean-bright);
}

.sidebar-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.sidebar-icon::after {
    content: attr(data-label);
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.625rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--slate-dim);
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

.sidebar-icon:hover::after {
    opacity: 1;
}

/* --- Main Content Area --- */
.main-content {
    margin-left: 240px;
    position: relative;
    min-height: 100vh;
}

/* --- Threshold Section --- */
.threshold {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--void-black);
    position: relative;
    overflow: hidden;
}

.threshold-title {
    text-align: center;
    opacity: 0;
}

.threshold-title .title-text {
    font-family: 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.06em;
    color: var(--bone-white);
    display: inline-block;
    transition: font-size 3s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.threshold-title.fade-in {
    opacity: 1;
    transition: opacity 1.5s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.threshold-title.contracted .title-text {
    font-size: 2rem;
}

.threshold-title.settled {
    position: relative;
    transform: translateY(-30vh);
    transition: opacity 1.5s cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 3s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* --- Observation Plate --- */
.observation-plate {
    max-width: 960px;
    margin: 0 auto;
    padding: 120px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (min-width: 1440px) {
    .observation-plate {
        padding-top: 180px;
        padding-bottom: 180px;
    }
}

.observation-icon {
    margin-bottom: 48px;
    color: var(--mist-gray);
}

.observation-icon svg {
    display: block;
}

.observation-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.125rem);
    line-height: 1.75;
    color: var(--mist-gray);
    max-width: 62ch;
    margin: 0 auto 48px;
    letter-spacing: 0.01em;
}

.observation-rule {
    width: 60%;
    max-width: 576px;
    height: 1px;
    position: relative;
    overflow: hidden;
}

.rule-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background-color: var(--obsidian-edge);
    transition: width 1.2s ease-out, left 1.2s ease-out;
}

.observation-rule.revealed .rule-line {
    width: 100%;
    left: 0;
}

/* --- Data Window --- */
.data-window {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 40px;
}

.data-window-border {
    position: relative;
    border-radius: 2px;
    padding: 48px;
}

.data-window-border .border-draw {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.data-window-border .border-draw rect {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.5s ease;
}

.data-window.revealed .border-draw rect {
    stroke-dashoffset: 0;
}

.data-window-content {
    position: relative;
    z-index: 1;
}

.data-row {
    display: flex;
    align-items: baseline;
    padding: 16px 0;
}

.data-row + .data-row {
    margin-top: 16px;
}

.data-label {
    width: 40%;
    flex-shrink: 0;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--slate-dim);
}

.data-value {
    width: 60%;
    font-family: 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    letter-spacing: 0.02em;
    color: var(--bone-white);
    line-height: 1.4;
}

/* --- Void Space (Between sections) --- */
.void-space {
    height: 120px;
}

@media (min-width: 1440px) {
    .void-space {
        height: 180px;
    }
}

/* --- Stillness Frame --- */
.stillness-frame {
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 120px 40px;
    max-width: 960px;
    margin: 0 auto;
}

@media (min-width: 1440px) {
    .stillness-frame {
        padding-top: 180px;
        padding-bottom: 180px;
    }
}

.stillness-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Dot Grid Background --- */
.dot-grid-bg {
    position: absolute;
    top: 0;
    left: -120px;
    right: -120px;
    bottom: 0;
    background-image: radial-gradient(circle, var(--ink-charcoal) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* --- Enso Circle Animation --- */
.enso-svg {
    position: relative;
    z-index: 1;
}

.enso-circle {
    stroke-dasharray: 628.318;
    stroke-dashoffset: 628.318;
    animation: enso-draw 18s linear infinite;
}

@keyframes enso-draw {
    /* Draw the circle: 0% -> 44.44% (8 seconds) */
    0% {
        stroke-dashoffset: 628.318;
        opacity: 1;
    }
    /* Circle fully drawn, pause: 44.44% -> 55.55% (2 seconds) */
    44.44% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    55.55% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    /* Erase the circle: 55.55% -> 100% (8 seconds) */
    100% {
        stroke-dashoffset: -628.318;
        opacity: 1;
    }
}

/* --- Ripple Animation --- */
.ripple-svg {
    position: relative;
    z-index: 1;
    margin-bottom: 80px;
}

.ripple-center {
    opacity: 1;
}

.ripple-ring {
    opacity: 0;
    transform-origin: center;
}

.ripple-ring-1 {
    animation: ripple-expand 6s ease-out infinite;
    animation-delay: 0s;
}

.ripple-ring-2 {
    animation: ripple-expand 6s ease-out infinite;
    animation-delay: 2s;
}

.ripple-ring-3 {
    animation: ripple-expand 6s ease-out infinite;
    animation-delay: 4s;
}

@keyframes ripple-expand {
    0% {
        opacity: 0.8;
        r: 10;
    }
    100% {
        opacity: 0;
        r: 110;
    }
}

/* --- Contact Line --- */
.contact-line {
    text-align: center;
    margin-top: 40px;
}

.contact-email {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    color: var(--mist-gray);
    text-decoration: none;
    position: relative;
    display: inline-block;
    cursor: default;
}

.contact-email::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--cerulean-pulse);
    transition: width 0.6s ease;
}

.contact-email:hover::after {
    width: 100%;
}

/* --- Scan Line — Ambient monitor sweep --- */
.scan-line {
    position: fixed;
    top: 0;
    left: 240px;
    right: 0;
    height: 1px;
    background-color: var(--obsidian-edge);
    z-index: 50;
    pointer-events: none;
    animation: scanline 60s linear infinite;
    opacity: 0;
}

@keyframes scanline {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(100vh);
    }
}

/* --- Responsive: Tablet (sidebar collapses to 56px icon strip) --- */
@media (max-width: 1024px) {
    .sidebar {
        width: 56px;
    }

    .sidebar-icon::after {
        display: none;
    }

    .main-content {
        margin-left: 56px;
    }

    .scan-line {
        left: 56px;
    }

    .observation-plate,
    .data-window,
    .stillness-frame {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: 56px;
        bottom: 0;
        top: auto;
        left: 0;
        border-right: none;
        border-top: 1px solid var(--obsidian-edge);
        flex-direction: row;
    }

    .sidebar-icons {
        flex-direction: row;
        gap: 32px;
    }

    .sidebar-icon::after {
        display: none;
    }

    .main-content {
        margin-left: 0;
        margin-bottom: 56px;
    }

    .scan-line {
        left: 0;
    }

    .observation-plate {
        padding: 80px 20px;
    }

    .data-window {
        padding: 0 20px;
    }

    .data-window-border {
        padding: 32px 24px;
    }

    .data-row {
        flex-direction: column;
        gap: 8px;
    }

    .data-label,
    .data-value {
        width: 100%;
    }

    .stillness-frame {
        padding: 80px 20px;
        min-height: 400px;
    }

    .enso-svg,
    .ripple-svg {
        width: 180px;
        height: 180px;
    }

    .void-space {
        height: 80px;
    }

    .threshold-title .title-text {
        font-size: clamp(2rem, 8vw, 4rem);
    }
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--void-black);
}

::-webkit-scrollbar-thumb {
    background: var(--obsidian-edge);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-dim);
}

/* --- Selection --- */
::selection {
    background-color: var(--cerulean-pulse);
    color: var(--bone-white);
}
