/* ==========================================================================
   BLUE LOTUS DEN — CORE DESIGN SYSTEM (style.css)
   ========================================================================== */

:root {
    /* Color Palette matching F298 exactly */
    --color-bg: #ffffff;
    --color-text: rgba(0, 0, 0, 0.85);       /* F298 main body color */
    --color-text-dim: rgba(0, 0, 0, 0.75);   /* F298 caption color */
    --color-text-muted: rgba(0, 0, 0, 0.4);  /* F298 sub text / digital-clock */
    --color-border: rgba(0, 0, 0, 0.15);     /* F298 border lines */
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: var(--font-sans);
    
    /* Spacing & Layout */
    --spacing-xs: 0.25rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.4rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;
    --sidebar-width: 44%; /* Desktop profile page width constraint */
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

:focus {
    outline: 0;
}

html {
    font-size: 14.4px; /* Set baseline to 90% zoom scale */
}

html, body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.2;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: none;
}

sup {
    font-size: 0.6em;
    position: relative;
    vertical-align: baseline;
    top: -0.4em;
    font-weight: normal;
}

body {
    overflow-x: hidden;
}

/* ==========================================================================
   TYPOGRAPHY (Matching F298 Stylesheet)
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: normal;
    margin: 0;
}

/* h1 / logo-link */
.site-title {
    font-family: var(--font-sans);
    font-size: 1.15rem; /* Same size as bodycopy, bold, single-line */
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    margin-bottom: var(--spacing-lg);
}

.site-title a {
    color: rgba(0, 0, 0, 0.8);
    text-decoration: none;
}

/* italic-intro sans serif */
.italic-intro {
    font-family: var(--font-sans);
    font-style: italic;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

/* bodycopy paragraphs and links */
.body-copy {
    font-size: 1.15rem; /* F298 standard bodycopy size */
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

.body-copy a {
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 0px solid rgba(127, 127, 127, 0.2);
}

/* captions (smaller description texts) */
.caption {
    font-size: 0.833rem; /* F298 exact caption size */
    font-weight: 400;
    color: var(--color-text-dim);
    line-height: 1.2;
    letter-spacing: -0.009em;
    display: block;
}

.caption a {
    color: var(--color-text-dim);
    text-decoration: none;
}

/* small-caps lowercase */
.small-caps {
    font-variant: small-caps;
    text-transform: lowercase;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.03em;
    color: var(--color-text-dim);
}

a {
    transition: opacity 0.1s ease-in-out;
}

a:active {
    opacity: 0.7; /* F298 click opacity active feedback */
}

/* separators */
hr {
    background: rgba(0, 0, 0, 0.7); /* F298 hr rule color */
    border: 0;
    height: 1px;
    display: block;
    margin-top: 1.4rem;
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   LIVE DIGITAL CLOCK (Top Right)
   ========================================================================== */

.pinned-top-right {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 1000;
    text-align: right;
    pointer-events: none;
}

.digital-clock {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ==========================================================================
   LAYOUT STRUCTURE (Profile sidebar)
   ========================================================================== */

.content-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

.profile-section {
    width: var(--sidebar-width);
    padding: var(--spacing-lg);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start; /* Aligns left column to left, F298 style */
    z-index: 100;
}

.sidebar-layout {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    width: 100%;
}

.navigation-unit {
    grid-column: span 4; /* Spans 4/12 of profile section width */
}

.site-nav ul {
    list-style: none;
}

.site-nav li {
    font-size: 1.15rem;
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.site-nav li a {
    color: var(--color-text);
    font-weight: 500;
    text-decoration: none;
}

.site-nav li a.active {
    font-weight: 700;
}

.site-nav .nav-spacer {
    height: var(--spacing-lg);
}

.intro-unit {
    grid-column: span 8; /* Spans 8/12 of profile section width */
    padding-top: 0.1rem;
}

/* ==========================================================================
   DYNAMIC PANELS (F298 64% width desktop right alignment)
   ========================================================================== */

.overlay-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 500;
    pointer-events: none; /* Let clicks pass to the backdrop link */
    display: flex;
    justify-content: flex-end; /* Aligns page content to the right edge */
    visibility: hidden;
    transition: visibility 0.4s step-end; /* Delay hidden visibility until slide-out finishes */
}

.overlay-panel.active {
    visibility: visible;
    transition: visibility 0s step-start; /* Instantly visible when opened */
}

/* Transparent backdrop behind the panel for clickout detection */
.panel-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    pointer-events: none; /* Blocked when inactive */
}

.overlay-panel.active .panel-backdrop {
    pointer-events: auto; /* Enabled only when panel is active */
}

/* 64% layout wrapper with 10rem left margin padding */
.panel-wrapper {
    width: 64vw;
    height: 100%;
    padding-left: 10rem; /* Transparent offset spacing revealing sidebar */
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    pointer-events: none; /* Let backdrop click work through layout edges */
    
    /* Animation state (Translates out off-screen to the right, fades and blurs out) */
    transform: translateX(100%);
    opacity: 0;
    filter: blur(10px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.overlay-panel.active .panel-wrapper {
    transform: translateX(0);
    opacity: 1;
    filter: blur(0);
}

/* Actual white panel content with solid border line */
.panel-content-inner {
    background-color: #ffffff;
    border-left: 0.1rem solid var(--color-border);
    width: 100%;
    height: 100%;
    overflow-y: auto;
    pointer-events: auto; /* Handles its own scrolling and clicks */
    padding: 1.5rem;
    scrollbar-width: none; /* Hide scrollbars, F298 style */
    -ms-overflow-style: none;
}

.panel-content-inner::-webkit-scrollbar {
    display: none; /* Hide scrollbars in Chrome/Safari */
}

/* Close button inside overlays (Back/Close links) */
.panel-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--spacing-lg);
}

/* ==========================================================================
   PROJECTS GALLERY GRID (Uneven Mixed Aspect Ratios)
   ========================================================================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    margin-bottom: var(--spacing-lg);
}

.image-wrapper {
    width: 100%;
    overflow: hidden;
    background-color: #f7f7f7;
    position: relative;
    margin-bottom: 0.6rem;
}

/* Aspect ratio helpers for gallery items matching F298 ratios */
.image-wrapper.portrait {
    aspect-ratio: 2 / 3;
}

.image-wrapper.landscape {
    aspect-ratio: 3 / 2;
}

.image-wrapper.square {
    aspect-ratio: 1 / 1;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.1s ease-in-out;
}

.gallery-item:active .gallery-image {
    opacity: 0.7; /* F298 active image state */
}

/* ==========================================================================
   INFORMATION PAGE COLUMNS
   ========================================================================== */

.info-content {
    display: flex;
    flex-direction: column;
}

.info-intro {
    max-width: 100%;
    margin-bottom: var(--spacing-lg);
}

.info-image-wrapper {
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background-color: #f7f7f7;
    margin-bottom: var(--spacing-xl);
}

.info-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.info-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.info-column {
    display: flex;
    flex-direction: column;
}

.info-item {
    font-size: 1.15rem;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    padding-top: var(--spacing-xs);
}

.info-item em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 500;
}

/* ==========================================================================
   PROJECT DETAIL LAYOUT (Inline Scrolling, F298 Style)
   ========================================================================== */

.detail-inline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
}

.detail-header-left {
    flex-grow: 1;
    margin-right: 1.5rem;
}

.detail-header-right {
    flex-shrink: 0;
}

.detail-title-work {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
    display: block;
}

.detail-completed-time {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--color-text-muted);
    display: block;
}

.detail-back-link {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
}

.detail-hero-section {
    display: flex;
    gap: var(--spacing-lg);
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
}

.detail-hero-wrapper {
    width: 300px;
    max-width: 100%;
    aspect-ratio: 3 / 4; /* Portrait 600x800 aspect ratio */
    overflow: hidden;
    background-color: #f7f7f7;
    flex-shrink: 0;
}

.detail-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.detail-hero-image:hover {
    filter: grayscale(0%);
}

.detail-hero-wrapper a {
    display: block;
    width: 100%;
    height: 100%;
}

.detail-overview-set {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.detail-overview-label {
    display: block;
}

.detail-overview-body {
    display: block;
}

/* Custom Close Button & Top Link */
.close-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    cursor: pointer;
    text-decoration: none;
    line-height: inherit;
    white-space: nowrap;
}

.close-btn:hover {
    opacity: 0.7;
}

.top-link-wrapper {
    margin-top: var(--spacing-xl);
    display: flex;
    justify-content: flex-start;
}

.top-link {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
}

.top-link:hover {
    opacity: 0.7;
}

.detail-grid-title {
    margin-top: var(--spacing-lg);
    margin-bottom: 0.6rem;
}

.detail-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: var(--spacing-xl);
}

.detail-thumbnails-grid .image-wrapper {
    margin-bottom: 0;
}

/* Centered Quote Block */
.detail-quote-section {
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.detail-quote-italic {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 300;
    font-style: italic;
    line-height: 1.2;
    color: rgba(0, 0, 0, 0.8);
    max-width: 600px;
    margin: 0 auto;
}

.detail-footer-image-wrapper {
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background-color: #f7f7f7;
    margin-bottom: 0.6rem;
}

.detail-footer-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-footer-caption {
    margin-bottom: var(--spacing-xl);
}

.detail-footer-caption .caption {
    color: var(--color-text-muted);
}

/* ==========================================================================
   SOUNDTRACK / CUSTOM MP3 PLAYER
   ========================================================================== */

.soundtrack-divider {
    background: rgba(0, 0, 0, 0.7); /* Matching credits column hr line */
    border: 0;
    height: 1px;
    display: block;
    margin-top: 1.4rem;
    margin-bottom: var(--spacing-lg);
}

.soundtrack-section {
    margin-bottom: var(--spacing-xl);
    display: flex;
    flex-direction: column;
}

.audio-player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.audio-player-row:last-child {
    border-bottom: none;
}

.audio-track-title {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--color-text);
    flex-grow: 1;
    margin-right: 2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    width: 320px;
    flex-shrink: 0;
}

.audio-play-btn {
    background: none;
    border: none;
    padding: 0;
    width: 24px;
    height: 24px;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.1s ease-in-out;
}

.audio-play-btn:hover {
    opacity: 0.7;
}

.play-icon-inner {
    width: 14px;
    height: 14px;
    background-color: rgba(0, 0, 0, 0.85); /* Explicit visible color matching --color-text */
    display: block;
    transition: clip-path 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                -webkit-clip-path 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-clip-path: polygon(20% 10%, 20% 90%, 20% 90%, 20% 90%, 20% 90%, 80% 50%, 80% 50%, 80% 50%); /* Play Triangle */
    clip-path: polygon(20% 10%, 20% 90%, 20% 90%, 20% 90%, 20% 90%, 80% 50%, 80% 50%, 80% 50%); /* Play Triangle */
}

.audio-play-btn.playing .play-icon-inner {
    -webkit-clip-path: polygon(20% 10%, 20% 90%, 40% 90%, 40% 10%, 60% 10%, 60% 90%, 80% 90%, 80% 10%); /* Pause Bars */
    clip-path: polygon(20% 10%, 20% 90%, 40% 90%, 40% 10%, 60% 10%, 60% 90%, 80% 90%, 80% 10%); /* Pause Bars */
}

.audio-progress-container {
    flex-grow: 1;
    height: 20px; /* large interactive hit target */
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.audio-progress-bg {
    width: 100%;
    height: 2px;
    background-color: rgba(0, 0, 0, 0.1);
    position: relative;
}

.audio-progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--color-text);
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.1s linear;
}

/* Disable transition during active dragging/scrubbing for instant response */
.audio-progress-container.dragging .audio-progress-fill {
    transition: none;
}

.audio-progress-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-text);
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}

.audio-progress-container:hover .audio-progress-fill::after,
.audio-progress-container.dragging .audio-progress-fill::after {
    opacity: 1;
}

.audio-timestamp {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: 500;
    width: 38px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   RESPONSIVE DESIGN (F298 Vertical Stack on Mobile)
   ========================================================================== */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 50%;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-md: 1rem;
        --spacing-lg: 1rem;
        --spacing-xl: 2rem;
    }
    
    html, body {
        font-size: 15px; /* Adjust slightly for mobile readability */
    }
    
    /* Live Clock Top Right mobile placement */
    .pinned-top-right {
        top: 0.8rem;
        right: 1rem;
    }
    
    .digital-clock {
        font-size: 1rem;
    }

    /* Stack Profile page vertically */
    .profile-section {
        position: relative;
        width: 100%;
        height: auto;
        padding: var(--spacing-xl) 1rem 1rem 1rem;
    }
    
    .sidebar-layout {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    .navigation-unit, .intro-unit {
        width: 100%;
    }
    
    .site-title {
        font-size: 2.75rem;
        margin-bottom: var(--spacing-md);
    }
    
    .site-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
    
    .site-nav li {
        margin-bottom: 0;
    }
    
    .site-nav .nav-spacer {
        display: none;
    }
    
    .editorial-heading {
        font-size: 1.8rem;
    }

    /* Mobile Overlays: Full View slide-ups from bottom */
    .overlay-panel {
        z-index: 1200;
        pointer-events: auto; /* Active panel controls its overlay space */
    }
    
    .panel-backdrop {
        /* Backdrop darkens slightly on mobile view or stays clean */
        background-color: rgba(255, 255, 255, 0.9);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
    
    .overlay-panel.active .panel-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    
    .panel-wrapper {
        width: 100vw;
        height: 100%;
        padding-left: 0; /* Remove 10rem gap for full mobile width */
        padding-top: 0;
        padding-bottom: 0;
        transform: translateY(100%); /* Slide up from bottom on mobile */
        opacity: 0;
        filter: blur(10px);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                    filter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .overlay-panel.active .panel-wrapper {
        transform: translateY(0);
        opacity: 1;
        filter: blur(0);
    }
    
    .panel-content-inner {
        border-left: none;
        width: 100%;
        height: 100%;
        padding: 1rem;
        padding-bottom: var(--spacing-xl);
    }

    /* Stack grids vertically on mobile */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .gallery-item {
        margin-bottom: 0;
    }
    
    .image-wrapper.portrait,
    .image-wrapper.landscape,
    .image-wrapper.square {
        aspect-ratio: 4 / 3; /* Unified ratio for cleaner mobile flow */
    }
    
    .info-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Detail Page Mobile Refinements */
    .detail-inline-header {
        margin-top: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .detail-title-work {
        font-size: 1.1rem;
    }
    
    .detail-completed-time {
        font-size: 1.1rem;
    }
    
    .detail-hero-section {
        flex-direction: column;
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }

    .detail-hero-wrapper {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .detail-overview-set {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        margin-bottom: 1rem;
    }
    
    .detail-thumbnails-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .detail-quote-italic {
        font-size: 1.4rem;
        padding: 0 1rem;
    }

    /* Soundtrack mobile adjustments */
    .audio-player-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
        padding: 1.2rem 0;
    }
    
    .audio-track-title {
        margin-right: 0;
        width: 100%;
        font-size: 1.1rem;
    }
    
    .audio-controls {
        width: 100%;
        gap: 1rem;
    }
    
    .audio-play-btn {
        width: 38px;
        height: 38px;
    }
    
    .play-icon-inner {
        width: 20px;
        height: 20px;
    }
}
