/* ============================================================
   yami.cam — Styles
   Coastal-Blend palette, Expressive Variable font system
   Sidebar + Flat Panel layout
   ============================================================ */

/* === CSS Custom Properties === */
:root {
    /* Color Palette */
    --sea-salt:       #f0ece4;
    --shallow-tide:   #e8f4f0;
    --deep-harbour:   #1b3a4b;
    --cerulean:       #5b9db3;
    --tide-dark:      #2b3d3d;
    --verdigris:      #2d6a6a;
    --travertine:     #c8bfb0;
    --coral-wash:     #e07a5f;
    --driftwood:      #b8ccc8;
    --teal-mid:       #6b9e9e;

    /* Sidebar */
    --sidebar-width:  260px;
    --sidebar-bg:     var(--shallow-tide);

    /* Typography */
    --font-fraunces:  'Fraunces', serif;
    --font-instrument:'Instrument Sans', sans-serif;
    --font-dm:        'DM Sans', sans-serif;

    /* Spacing */
    --panel-padding:  96px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    display: flex;
    min-height: 100vh;
    background: var(--sea-salt);
    color: var(--tide-dark);
    font-family: var(--font-dm);
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* === Sidebar === */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 48px 28px 40px;
    z-index: 100;
    overflow: hidden;
}

#sidebar-rule {
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: var(--driftwood);
}

#sidebar-wordmark {
    font-family: var(--font-fraunces);
    font-size: 22px;
    font-weight: 700;
    font-variation-settings: 'wght' 700, 'opsz' 18;
    color: var(--tide-dark);
    letter-spacing: -0.02em;
    margin-bottom: 56px;
    line-height: 1;
}

/* === Sidebar Navigation === */
#sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    text-decoration: none;
    color: var(--tide-dark);
    font-family: var(--font-instrument);
    font-size: 13px;
    font-weight: 500;
    font-variation-settings: 'wght' 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 200ms ease, font-variation-settings 200ms ease;
    position: relative;
    border-left: 3px solid transparent;
    padding-left: 0;
    margin-left: -3px;
}

.nav-item .nav-icon {
    flex-shrink: 0;
    transition: transform 200ms ease;
}

.nav-item .nav-icon circle,
.nav-item .nav-icon rect,
.nav-item .nav-icon line,
.nav-item .nav-icon polygon {
    stroke: var(--verdigris);
    transition: stroke 200ms ease;
}

.nav-item:hover {
    color: var(--coral-wash);
    font-variation-settings: 'wght' 600;
}

.nav-item:hover .nav-icon circle,
.nav-item:hover .nav-icon rect,
.nav-item:hover .nav-icon line,
.nav-item:hover .nav-icon polygon {
    stroke: var(--coral-wash);
}

.nav-item.active {
    font-variation-settings: 'wght' 700;
    color: var(--verdigris);
    border-left: 3px solid var(--coral-wash);
    padding-left: 10px;
}

/* === Sidebar Log Line === */
#sidebar-log {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--driftwood);
}

#sidebar-log-label {
    display: block;
    font-family: var(--font-instrument);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal-mid);
    margin-bottom: 4px;
}

#sidebar-log-section {
    display: block;
    font-family: var(--font-fraunces);
    font-size: 13px;
    font-style: italic;
    font-variation-settings: 'wght' 300, 'opsz' 9;
    color: var(--teal-mid);
    transition: opacity 300ms ease;
}

/* === Main Canvas === */
#canvas {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

/* === Panels === */
.panel {
    width: 100%;
    min-height: 100vh;
    padding-block: var(--panel-padding);
    position: relative;
}

/* Panel color schemes */
.panel-seasalt {
    background: var(--sea-salt);
    color: var(--tide-dark);
}

.panel-tide {
    background: var(--shallow-tide);
    color: var(--tide-dark);
}

.panel-harbour {
    background: var(--deep-harbour);
    color: var(--sea-salt);
}

.panel-cerulean {
    background: var(--cerulean);
    color: var(--deep-harbour);
}

/* === Mode A — Wide Margin Layout === */
.panel-a .panel-content {
    display: grid;
    grid-template-columns: 55% 45%;
    min-height: calc(100vh - var(--panel-padding) * 2);
    padding: 0 64px;
    gap: 0;
    align-items: center;
}

.panel-text {
    padding-right: 48px;
    padding-block: 48px;
}

.panel-decor {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    padding: 24px;
    /* Bounce-enter initial state */
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 700ms ease, transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1.0);
    transition-delay: 300ms;
}

.panel-decor.animated {
    opacity: 1;
    transform: translateX(0);
}

/* === Mode B — Full Span Layout === */
.panel-b .panel-b-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - var(--panel-padding) * 2);
    padding: 0 64px;
}

.modeb-headline-wrap {
    width: 100%;
    overflow: hidden;
}

.modeb-headline {
    font-family: var(--font-fraunces);
    font-size: clamp(56px, 8vw, 112px);
    font-weight: 700;
    font-variation-settings: 'wght' 700, 'opsz' 72;
    color: var(--sea-salt);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.modeb-caption {
    font-family: var(--font-instrument);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--driftwood);
    margin-top: 16px;
}

/* === Typography === */
.panel-eyebrow {
    font-family: var(--font-instrument);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--verdigris);
    margin-bottom: 24px;
    display: block;
}

.panel-eyebrow-light {
    color: var(--deep-harbour);
    opacity: 0.75;
}

.display-headline {
    font-family: var(--font-fraunces);
    font-size: clamp(48px, 6vw, 96px);
    font-weight: 700;
    font-variation-settings: 'wght' 700, 'opsz' 72;
    color: var(--tide-dark);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
}

.headline-light {
    color: var(--deep-harbour);
}

/* Hero headline — animated weight */
.hero-animate {
    font-variation-settings: 'wght' 100, 'opsz' 72;
    animation: none; /* activated by JS after load */
}

.hero-animate.weight-animated {
    animation: hero-weight-bounce 1200ms cubic-bezier(0.34, 1.56, 0.64, 1.0) forwards;
}

@keyframes hero-weight-bounce {
    0%   { font-variation-settings: 'wght' 100, 'opsz' 72; }
    60%  { font-variation-settings: 'wght' 850, 'opsz' 72; }
    80%  { font-variation-settings: 'wght' 900, 'opsz' 72; }
    100% { font-variation-settings: 'wght' 750, 'opsz' 72; }
}

.section-headline {
    font-size: clamp(40px, 5vw, 72px);
}

.body-text {
    font-family: var(--font-dm);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--tide-dark);
    margin-bottom: 20px;
    max-width: 52ch;
}

.body-text-light {
    color: var(--deep-harbour);
}

.caption-text {
    font-family: var(--font-fraunces);
    font-size: 13px;
    font-style: italic;
    font-variation-settings: 'wght' 300, 'opsz' 9;
    color: var(--teal-mid);
    margin-top: 8px;
}

/* === Panel Entry Animations (bounce-enter) === */
.panel-text-content {
    opacity: 0;
    transform: translateY(30px);
}

.panel-text-content.animated {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 500ms ease 200ms, transform 500ms ease 200ms;
}

.panel-eyebrow,
.display-headline,
.section-headline,
.body-text,
.caption-text,
.panel-eyebrow-light {
    opacity: 0;
    transform: translateY(20px);
    transition: none;
}

.panel.in-view .panel-eyebrow {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 500ms ease, transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1.0);
    transition-delay: 0ms;
}

.panel.in-view .display-headline,
.panel.in-view .section-headline,
.panel.in-view .modeb-headline {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1.0);
    transition-delay: 80ms;
}

.panel.in-view .body-text {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 500ms ease, transform 500ms ease;
    transition-delay: 200ms;
}

.panel.in-view .caption-text {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 500ms ease, transform 500ms ease;
    transition-delay: 280ms;
}

.panel.in-view .modeb-caption {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 500ms ease, transform 500ms ease;
    transition-delay: 320ms;
}

.panel.in-view .panel-eyebrow-light {
    opacity: 0.75;
    transform: translateY(0);
    transition: opacity 500ms ease, transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1.0);
    transition-delay: 0ms;
}

.modeb-caption {
    opacity: 0;
    transform: translateY(16px);
    transition: none;
}

/* Panel background slide-in */
.panel {
    clip-path: inset(0);
    transition: none;
}

/* === Meander/Greek-key Rule === */
.meander-rule {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        var(--driftwood) 0px,
        var(--driftwood) 8px,
        transparent 8px,
        transparent 16px,
        var(--driftwood) 16px,
        var(--driftwood) 20px,
        transparent 20px,
        transparent 28px
    );
}

.meander-rule-light {
    background: repeating-linear-gradient(
        90deg,
        rgba(232, 244, 240, 0.4) 0px,
        rgba(232, 244, 240, 0.4) 8px,
        transparent 8px,
        transparent 16px,
        rgba(232, 244, 240, 0.4) 16px,
        rgba(232, 244, 240, 0.4) 20px,
        transparent 20px,
        transparent 28px
    );
}

/* === Marble SVG === */
.marble-svg {
    width: 100%;
    max-width: 380px;
    height: auto;
    display: block;
}

.marble-svg-light {
    opacity: 0.85;
}

/* === Fresco Tile === */
.fresco-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 380px;
}

.fresco-inner {
    width: 380px;
    max-width: 100%;
    overflow: hidden;
    line-height: 0;
}

.fresco-inner svg {
    display: block;
    width: 100%;
    height: auto;
}

.fresco-caption {
    font-family: var(--font-fraunces);
    font-size: 11px;
    font-style: italic;
    font-variation-settings: 'wght' 300, 'opsz' 9;
    color: var(--teal-mid);
    margin-top: 10px;
    letter-spacing: 0.01em;
}

/* === Column Drum (Classical Geometry) === */
.column-drum-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 280px;
    max-width: 100%;
}

.pediment {
    margin-bottom: 4px;
}

.drum-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.drum-ellipse {
    width: 120px;
    height: 22px;
    border: 1px solid var(--travertine);
    border-radius: 50%;
    background: transparent;
}

.drum-top {
    width: 140px;
    height: 24px;
}

.drum-mid {
    width: 110px;
    height: 20px;
}

.drum-base {
    width: 160px;
    height: 26px;
}

.drum-shaft {
    width: 100px;
    height: 80px;
    border-left: 1px solid var(--travertine);
    border-right: 1px solid var(--travertine);
    background: transparent;
    position: relative;
}

.drum-shaft::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 1px;
    background: var(--travertine);
    opacity: 0.4;
}

.drum-shaft-lower {
    height: 60px;
}

/* === Responsive — below 900px === */
@media (max-width: 899px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        align-items: center;
        padding: 0 24px;
        gap: 0;
        z-index: 200;
    }

    #sidebar-rule {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 1px;
    }

    #sidebar-wordmark {
        margin-bottom: 0;
        margin-right: 32px;
        font-size: 18px;
        white-space: nowrap;
    }

    #sidebar-nav {
        flex-direction: row;
        flex: 1;
        gap: 0;
        align-items: center;
        overflow-x: auto;
    }

    .nav-item {
        padding: 0 14px;
        white-space: nowrap;
        height: 60px;
        border-left: none;
        border-bottom: 3px solid transparent;
        margin-left: 0;
    }

    .nav-item .nav-icon {
        display: none;
    }

    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid var(--coral-wash);
        padding-left: 14px;
    }

    #sidebar-log {
        display: none;
    }

    #canvas {
        margin-left: 0;
        margin-top: 60px;
    }

    .panel-a .panel-content {
        grid-template-columns: 1fr;
        padding: 0 32px;
    }

    .panel-decor {
        opacity: 1 !important;
        transform: none !important;
    }

    .marble-svg {
        opacity: 0.5;
        max-width: 100%;
    }

    .panel-b .panel-b-content {
        padding: 0 32px;
    }

    .panel-text {
        padding-right: 0;
    }

    .display-headline {
        font-size: clamp(36px, 8vw, 64px);
    }

    .modeb-headline {
        font-size: clamp(42px, 10vw, 80px);
    }

    .fresco-inner {
        width: 100%;
    }

    .fresco-inner svg {
        max-width: 100%;
    }
}

/* === Utility: Initial opacity reset for non-panel.in-view === */
/* Handled via .in-view class toggled by IntersectionObserver in script.js */
