/* ============================================================
   chika.webcam — Design System
   Palette: Triadic (Violet / Amber / Teal)
   Typography: Playfair Display + Lora (Serif Revival)
   Layout: Diagonal-Sections (6-degree shear)
   ============================================================ */

/* --- Custom Properties --- */
:root {
    /* Palette */
    --violet-dark: #1a0a2e;
    --violet-mid: #4b2d6e;
    --violet-bg: #2a1a3e;
    --amber-warm: #c97d1a;
    --amber-pale: #d4a56a;
    --amber-light: #f5c96a;
    --teal-deep: #0e6b6b;
    --teal-light: #7dd4d4;
    --neutral-warm: #f5f0e8;

    /* Blob border-radius states */
    --blob-state-a: 40% 60% 60% 40% / 40% 40% 60% 60%;
    --blob-state-b: 60% 40% 30% 70% / 60% 30% 70% 40%;

    /* Diagonal */
    --shear: 6vh;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--violet-dark);
    color: var(--neutral-warm);
    font-family: 'Lora', Georgia, serif;
    font-size: 16px;
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-feature-settings: "liga" 1, "kern" 1;
}

h3 {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
}

.section-label {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--teal-light);
    display: block;
    margin-bottom: 24px;
}

.section-label-light {
    color: var(--amber-light);
}

.body-text {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.75;
    color: var(--neutral-warm);
    margin-bottom: 20px;
}

/* --- Fixed Left Navigation Rail --- */
#nav-rail {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.nav-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--violet-mid);
    transform: translateX(-50%);
    z-index: 0;
}

.nav-labels {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    z-index: 1;
    height: 300px;
    justify-content: space-between;
}

.nav-labels li {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-label {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--violet-mid);
    text-decoration: none;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    transition: color 0.3s ease;
    padding: 6px 4px;
}

.nav-label:hover,
.nav-label.active {
    color: var(--amber-light);
}

.nav-progress {
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.nav-triangle {
    display: block;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

/* --- Panels (Diagonal Sections) --- */
.panel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* --- Bokeh Background --- */
.bokeh-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bokeh-circle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: radial-gradient(circle, var(--color) 0%, transparent 70%);
    opacity: var(--opacity);
    filter: blur(var(--blur));
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* --- Blob Forms --- */
.blob {
    position: absolute;
    border-radius: var(--blob-state-a);
    animation: blob-morph 12s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 1;
}

@keyframes blob-morph {
    0% { border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

.blob-opening {
    width: 420px;
    height: 420px;
    background: var(--violet-mid);
    opacity: 0.2;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
}

.blob-focus {
    width: 320px;
    height: 280px;
    background: var(--violet-mid);
    opacity: 0.15;
    left: -60px;
    bottom: 10%;
    animation-delay: -4s;
}

.blob-subject-1 {
    width: 380px;
    height: 350px;
    background: var(--teal-deep);
    opacity: 0.18;
    top: -80px;
    right: -80px;
    animation-delay: -2s;
}

.blob-subject-2 {
    width: 300px;
    height: 320px;
    background: var(--violet-mid);
    opacity: 0.15;
    bottom: -60px;
    left: 10%;
    animation-delay: -7s;
}

/* --- Diagonal Cut System --- */
.diagonal-cut {
    position: absolute;
    left: 0;
    right: 0;
    height: calc(var(--shear) * 2);
    z-index: 10;
    pointer-events: none;
}

.diagonal-cut-bottom {
    bottom: calc(var(--shear) * -1);
    clip-path: polygon(0 0, 100% var(--shear), 100% 100%, 0 100%);
}

.diagonal-cut-top {
    top: calc(var(--shear) * -1);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - var(--shear)));
}

.diagonal-cut-bottom {
    background: var(--amber-pale);
}

.diagonal-cut-bottom-teal {
    background: var(--teal-deep);
}

.diagonal-cut-bottom-dark {
    background: var(--violet-dark);
}

.diagonal-cut-bottom-close {
    background: var(--violet-dark);
}

.diagonal-cut-top {
    background: var(--amber-pale);
}

.diagonal-cut-top-teal {
    background: var(--teal-deep);
}

.diagonal-cut-top-dark {
    background: var(--violet-dark);
}

.diagonal-cut-top-closing {
    background: var(--violet-dark);
}

/* ============================================================
   Panel 1: Opening
   ============================================================ */
.panel-opening {
    height: 100vh;
    background: var(--violet-dark);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.opening-content {
    position: relative;
    z-index: 5;
    padding-top: 35vh;
    padding-left: 15%;
    max-width: 600px;
}

.opening-label {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--teal-light);
    margin-bottom: 16px;
    opacity: 0;
    animation: fade-up 0.6s ease forwards 0.3s;
}

.opening-wordmark {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(52px, 7vw, 96px);
    color: var(--neutral-warm);
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 24px;
    opacity: 0;
    animation: fade-up 0.6s ease forwards 0.5s;
}

.opening-subtitle {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    color: var(--amber-pale);
    opacity: 0;
    animation: fade-up 0.6s ease forwards 0.7s;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   Panel 2: Focus
   ============================================================ */
.panel-focus {
    min-height: 80vh;
    background: var(--amber-pale);
    padding-top: calc(var(--shear) + 40px);
    padding-bottom: calc(var(--shear) + 40px);
    position: relative;
}

.focus-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    padding: 60px 10% 60px 15%;
    position: relative;
    z-index: 5;
}

.focus-text-col {
    padding-top: 20px;
}

.focus-text-col .section-label {
    color: var(--violet-mid);
}

.focus-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(36px, 4vw, 60px);
    color: var(--violet-dark);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 32px;
}

.focus-text-col .body-text {
    color: var(--violet-dark);
    opacity: 0.85;
}

.focus-card-col {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-top: 20px;
}

.diamond-motif {
    position: absolute;
    top: -20px;
    right: -10px;
    z-index: 10;
    opacity: 0.9;
}

/* --- Skeleton Card --- */
.skeleton-card {
    width: 280px;
    height: 320px;
    border: 1px solid var(--violet-bg);
    border-radius: 16px;
    padding: 24px;
    background: var(--violet-dark);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 5;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--violet-bg) 0%, var(--violet-mid) 50%, var(--violet-bg) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

.skeleton-line-title { width: 70%; height: 18px; }
.skeleton-line-mid   { width: 90%; }
.skeleton-line-short { width: 55%; }
.skeleton-line-full  { width: 100%; }

.skeleton-image {
    flex: 1;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--violet-bg) 0%, var(--violet-mid) 50%, var(--violet-bg) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    margin: 8px 0;
}

@keyframes shimmer {
    to { background-position: -200% 0; }
}

/* --- Focus Card Content (revealed after skeleton) --- */
.focus-card-content {
    position: absolute;
    width: 280px;
    height: 320px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--violet-dark);
    border: 1px solid var(--violet-mid);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 6;
    top: 0;
    right: 0;
}

.focus-card-content.revealed {
    opacity: 1;
}

.focus-card-bokeh {
    position: absolute;
    inset: 0;
}

.focus-card-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(26,10,46,0.95) 0%, transparent 100%);
}

.focus-card-title {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--amber-light);
    margin-bottom: 6px;
}

.focus-card-body {
    font-family: 'Lora', Georgia, serif;
    font-size: 13px;
    color: var(--neutral-warm);
    opacity: 0.85;
    line-height: 1.6;
}

/* ============================================================
   Panel 3: Subject
   ============================================================ */
.panel-subject {
    min-height: 100vh;
    background: var(--teal-deep);
    padding-top: calc(var(--shear) + 60px);
    padding-bottom: calc(var(--shear) + 60px);
    position: relative;
}

.subject-content {
    position: relative;
    z-index: 5;
    padding: 60px 8%;
}

.subject-blobs-row {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-top: 40px;
    flex-wrap: wrap;
}

/* Individual blob containers */
.subject-blob-container {
    position: relative;
    width: 280px;
    height: 300px;
    background: rgba(26,10,46,0.7);
    border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-radius 0.6s ease;
}

.subject-blob-container:hover {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

.subject-blob-1 { margin-top: 0; }
.subject-blob-2 { margin-top: 40px; }
.subject-blob-3 { margin-top: 20px; }

.blob-inner-bokeh {
    position: absolute;
    inset: 0;
}

.blob-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(14,107,107,0.95) 0%, transparent 100%);
    z-index: 2;
}

.blob-title {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
    font-size: 22px;
    color: var(--amber-light);
    margin-bottom: 4px;
}

.blob-text {
    font-family: 'Lora', Georgia, serif;
    font-size: 13px;
    color: var(--neutral-warm);
    opacity: 0.8;
    letter-spacing: 0.05em;
}

/* Triangle motifs between blobs */
.triangle-motif {
    position: absolute;
    top: -30px;
    right: -20px;
    opacity: 0.8;
    z-index: 5;
    pointer-events: none;
}

.tri-2 { right: auto; left: -20px; top: auto; bottom: -20px; }
.tri-3 { top: -25px; right: -15px; }

/* ============================================================
   Panel 4: Authority
   ============================================================ */
.panel-authority {
    min-height: 70vh;
    background: var(--violet-dark);
    padding-top: calc(var(--shear) + 60px);
    padding-bottom: calc(var(--shear) + 60px);
    position: relative;
    display: flex;
    align-items: center;
}

.authority-content {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 40px 12%;
    width: 100%;
}

.diamond-frame {
    flex-shrink: 0;
    opacity: 0.85;
}

.pull-quote {
    max-width: 700px;
    text-align: center;
    flex: 1;
}

.pull-quote p {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(36px, 5vw, 72px);
    color: var(--amber-light);
    letter-spacing: -0.02em;
    line-height: 1.15;
    font-feature-settings: "liga" 1, "kern" 1;
    margin-bottom: 24px;
}

.quote-cite {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal-light);
    font-style: normal;
}

/* ============================================================
   Panel 5: Closing
   ============================================================ */
.panel-closing {
    min-height: 60vh;
    background: var(--violet-dark);
    padding-top: calc(var(--shear) + 60px);
    padding-bottom: 80px;
    position: relative;
    display: flex;
    align-items: center;
}

.closing-content {
    position: relative;
    z-index: 5;
    padding: 40px 15%;
    width: 100%;
    text-align: center;
}

.closing-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(32px, 4vw, 60px);
    color: var(--neutral-warm);
    letter-spacing: -0.02em;
    margin-bottom: 48px;
}

.closing-links {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

.closing-link {
    position: relative;
    text-decoration: none;
    padding: 20px 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.closing-link-text {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--neutral-warm);
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.closing-link:hover .closing-link-text {
    color: var(--amber-light);
}

.blob-hover-state {
    position: absolute;
    inset: 0;
    /* background: #4b2d6e 20% opacity blob hover state */
    background: rgba(75, 45, 110, 0.2);
    border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%;
    transform: scale(0);
    transition: transform 0.3s ease, border-radius 0.3s ease;
    z-index: 1;
}

.closing-link:hover .blob-hover-state {
    transform: scale(1);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

/* --- Panel Content Container --- */
.panel-content {
    position: relative;
}

/* ============================================================
   Section Entrance Animations
   ============================================================ */
.panel-section-enter {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.panel-section-enter.entered {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .focus-content {
        grid-template-columns: 1fr;
        padding: 60px 8%;
    }

    .focus-card-col {
        align-items: center;
    }

    .subject-blobs-row {
        justify-content: center;
    }

    .subject-blob-1,
    .subject-blob-2,
    .subject-blob-3 {
        margin-top: 0;
    }

    .authority-content {
        flex-direction: column;
        gap: 32px;
    }

    .diamond-frame {
        display: none;
    }

    .closing-links {
        gap: 32px;
    }

    #nav-rail {
        display: none;
    }

    .opening-content {
        padding-left: 8%;
    }
}

@media (max-width: 600px) {
    .focus-content {
        padding: 40px 6%;
    }

    .subject-content {
        padding: 40px 6%;
    }

    .subject-blob-container {
        width: 240px;
        height: 260px;
    }

    .authority-content {
        padding: 40px 6%;
    }

    .closing-content {
        padding: 40px 6%;
    }

    .opening-content {
        padding-left: 6%;
        padding-top: 30vh;
    }
}
