/* =============================================
   hanun.ai — Design Language Stylesheet
   Contemplative AI Research Studio
   ============================================= */

/* --- CSS Custom Properties (Palette) --- */
:root {
    /* Backgrounds */
    --ink-stone: #14161A;
    --charcoal-slate: #1C1E22;
    --dusk-ash: #252830;

    /* Text */
    --fog-white: #D1D5DB;
    --mist-gray: #8B9DAF;
    --stone: #5A6270;

    /* Accents */
    --celadon: #7BA69E;
    --celadon-bright: #95BDB5;
    --ember: #C4956A;

    /* Body text alternates */
    --body-on-dark: #B8C0CC;
    --body-on-light: #3A3F47;

    /* Typography */
    --font-heading: 'Source Serif 4', 'Georgia', serif;
    --font-body: 'Source Sans 3', 'Helvetica Neue', sans-serif;
    --font-sidebar: 'IBM Plex Sans', 'Arial', sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    /* Spacing */
    --sidebar-width: 280px;
    --sidebar-collapsed: 56px;
    --section-gap: 120px;
    --content-max-width: 900px;

    /* Animation */
    --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1.0);
    --duration-reveal: 800ms;
    --duration-slow: 1200ms;
}

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--ink-stone);
    color: var(--fog-white);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.125rem);
    line-height: 1.75;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Dot Grid Background (subtle structure) --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, #1C1E22 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, rgba(0,0,0,0.6) 0%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, rgba(0,0,0,0.6) 0%, transparent 100%);
}

/* =============================================
   SIDEBAR (the maru)
   ============================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--charcoal-slate);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    border-right: 1px solid var(--dusk-ash);
    border-image: linear-gradient(to bottom, transparent 0%, #2A2D33 20%, #2A2D33 80%, transparent 100%) 1;
}

.sidebar-header {
    padding: 32px 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header .icon-pulse {
    color: var(--celadon);
    width: 32px;
    height: 32px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    flex: 1;
    padding-top: 40px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--stone);
    position: relative;
    transition: color 400ms var(--ease-out);
    cursor: pointer;
}

.nav-item .icon {
    width: 24px;
    height: 24px;
    transition: color 400ms var(--ease-out);
}

.nav-label {
    font-family: var(--font-sidebar);
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
    color: var(--mist-gray);
    white-space: nowrap;
}

.nav-item:hover .nav-label,
.nav-item.active .nav-label {
    opacity: 1;
    transform: translateY(0);
}

.nav-item:hover,
.nav-item.active {
    color: var(--celadon);
}

/* Active indicator bar */
.nav-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 24px;
    background-color: var(--mist-gray);
    border-radius: 0 2px 2px 0;
    transition: top 400ms var(--ease-out);
    z-index: 101;
}

.sidebar-footer {
    padding: 32px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Heartbeat dot */
.heartbeat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--celadon);
    animation: heartbeat 3s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* =============================================
   MOBILE BOTTOM BAR
   ============================================= */
.mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: rgba(28, 30, 34, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 200;
    justify-content: space-around;
    align-items: center;
    padding: 0 16px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--stone);
    transition: color 400ms var(--ease-out);
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--celadon);
}

/* =============================================
   MAIN CONTENT AREA (the bang)
   ============================================= */
.content {
    margin-left: var(--sidebar-width);
    position: relative;
    z-index: 1;
}

.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    scroll-snap-align: start;
    padding: 0 48px;
}

.section-inner {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 15vh 0;
}

/* =============================================
   SECTION 1: OPENING BREATH
   ============================================= */
.section-opening {
    min-height: 100vh;
}

.opening-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.site-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: var(--fog-white);
    margin-bottom: 24px;
}

.site-tagline {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.125rem);
    color: var(--mist-gray);
    line-height: 1.75;
}

/* Breathing gradient */
.breathing-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.breathing-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 40% 45%, rgba(196, 149, 106, 0.03) 0%, transparent 60%);
    animation: breathingGlow 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes breathingGlow {
    0%, 100% { opacity: 0.67; }
    50% { opacity: 1.33; }
}

/* =============================================
   SECTION 2: THE THOUGHT
   ============================================= */
.thought-inner {
    display: flex;
    gap: 64px;
    align-items: flex-start;
}

.thought-decoration {
    flex-shrink: 0;
    color: var(--dusk-ash);
    opacity: 0.5;
    padding-top: 8px;
}

.icon-decoration {
    width: 64px;
    height: 64px;
}

.thought-content {
    flex: 1;
}

.section-heading {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(1.75rem, 3vw, 2.75rem);
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: var(--fog-white);
    margin-bottom: 40px;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.125rem);
    line-height: 1.75;
    letter-spacing: 0.005em;
    color: var(--body-on-dark);
    margin-bottom: 24px;
}

.body-text:last-child {
    margin-bottom: 0;
}

/* =============================================
   SECTION 3: THE GRID
   ============================================= */
.grid-inner {
    padding-top: 10vh;
    padding-bottom: 10vh;
}

.concept-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 48px 64px;
    margin-top: 48px;
}

.concept-card {
    padding: 24px 0;
    border-bottom: 1px solid transparent;
    transition: border-color 400ms var(--ease-out);
}

.concept-card:hover {
    border-bottom-color: rgba(123, 166, 158, 0.4);
}

.card-icon {
    display: block;
    margin: 0 auto 20px;
    color: var(--stone);
    transition: color 400ms var(--ease-out);
}

.concept-card:hover .card-icon {
    color: var(--celadon);
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.125rem;
    line-height: 1.25;
    color: var(--fog-white);
    text-align: center;
    margin-bottom: 12px;
}

.card-desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--mist-gray);
    text-align: center;
}

/* =============================================
   SECTION 4: THE BREATH
   ============================================= */
.section-breath {
    min-height: 100vh;
}

.breath-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.breath-wave {
    color: var(--dusk-ash);
    opacity: 0.3;
    transition: opacity 600ms var(--ease-out);
    width: 120px;
    height: 40px;
}

/* =============================================
   SECTION 5: THE NAMES
   ============================================= */
.names-inner {
    padding-top: 10vh;
    padding-bottom: 10vh;
}

.names-list {
    margin-top: 48px;
}

.name-item {
    padding: 32px 0;
    position: relative;
}

.name-item + .name-item {
    margin-top: 32px;
}

.name-line {
    height: 1px;
    background-color: var(--dusk-ash);
    margin-bottom: 24px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 800ms var(--ease-out);
}

.name-item.revealed .name-line {
    transform: scaleX(1);
}

.name-content {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
}

.name-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(1.125rem, 1.5vw, 1.375rem);
    color: var(--fog-white);
    line-height: 1.4;
}

.name-meta {
    font-family: var(--font-sidebar);
    font-weight: 400;
    font-size: 0.8125rem;
    color: var(--stone);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

/* =============================================
   SECTION 6: THE CLOSE
   ============================================= */
.section-close {
    min-height: 100vh;
}

.close-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.site-title-close {
    font-size: clamp(1.75rem, 3vw, 2.75rem);
    margin-bottom: 20px;
}

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

.breathing-gradient-close::before {
    background: radial-gradient(ellipse at 50% 50%, rgba(196, 149, 106, 0.03) 0%, transparent 60%);
}

/* Contact link */
.contact-link {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    cursor: pointer;
}

.contact-text {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.125rem);
    color: var(--celadon);
    transition: color 300ms var(--ease-out);
}

.contact-link:hover .contact-text {
    color: var(--celadon-bright);
}

.contact-underline {
    display: block;
    width: 100%;
    height: 1px;
    background-color: var(--celadon);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 300ms var(--ease-out);
    margin-top: 4px;
}

.contact-link:hover .contact-underline {
    transform: scaleX(1);
}

/* =============================================
   REVEAL ANIMATION SYSTEM
   ============================================= */
.reveal-item {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--duration-reveal) var(--ease-out),
                transform var(--duration-reveal) var(--ease-out);
}

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

/* Opening section has slower, more dramatic reveal */
.section-opening .reveal-item {
    transform: translateY(20px);
    transition-duration: var(--duration-slow);
}

/* Stagger delays for sequential reveals */
.reveal-item:nth-child(1) { transition-delay: 0ms; }
.reveal-item:nth-child(2) { transition-delay: 200ms; }
.reveal-item:nth-child(3) { transition-delay: 400ms; }
.reveal-item:nth-child(4) { transition-delay: 600ms; }
.reveal-item:nth-child(5) { transition-delay: 800ms; }
.reveal-item:nth-child(6) { transition-delay: 1000ms; }

/* Concept card stagger (100ms intervals) */
.concept-grid .reveal-item:nth-child(1) { transition-delay: 0ms; }
.concept-grid .reveal-item:nth-child(2) { transition-delay: 100ms; }
.concept-grid .reveal-item:nth-child(3) { transition-delay: 200ms; }
.concept-grid .reveal-item:nth-child(4) { transition-delay: 300ms; }
.concept-grid .reveal-item:nth-child(5) { transition-delay: 400ms; }
.concept-grid .reveal-item:nth-child(6) { transition-delay: 500ms; }

/* Name item stagger */
.names-list .reveal-item:nth-child(1) { transition-delay: 0ms; }
.names-list .reveal-item:nth-child(2) { transition-delay: 150ms; }
.names-list .reveal-item:nth-child(3) { transition-delay: 300ms; }
.names-list .reveal-item:nth-child(4) { transition-delay: 450ms; }
.names-list .reveal-item:nth-child(5) { transition-delay: 600ms; }

/* =============================================
   RESPONSIVE — TABLET (< 1024px)
   ============================================= */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 56px;
    }

    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .nav-label {
        display: none;
    }

    .nav-indicator {
        display: block;
    }

    .content {
        margin-left: var(--sidebar-collapsed);
    }

    body::before {
        left: var(--sidebar-collapsed);
    }

    .section {
        padding: 0 32px;
    }

    .thought-inner {
        gap: 32px;
    }

    .thought-decoration {
        display: none;
    }

    .concept-grid {
        gap: 32px 40px;
    }
}

/* =============================================
   RESPONSIVE — MOBILE (< 768px)
   ============================================= */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    html {
        scroll-snap-type: none;
    }

    .sidebar {
        display: none;
    }

    .mobile-bar {
        display: flex;
    }

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

    body::before {
        left: 0;
    }

    .section {
        min-height: auto;
        padding: 0 24px;
        scroll-snap-align: none;
    }

    .section-opening,
    .section-breath,
    .section-close {
        min-height: 100vh;
    }

    .section + .section {
        margin-top: 64px;
    }

    .section-inner {
        padding: 10vh 0;
    }

    .concept-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .thought-inner {
        flex-direction: column;
        gap: 24px;
    }

    .thought-decoration {
        display: none;
    }

    .name-content {
        flex-direction: column;
        gap: 8px;
    }

    .site-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }

    .section-heading {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }
}

/* =============================================
   SCROLLBAR STYLING (subtle)
   ============================================= */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--ink-stone);
}

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

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