/* ==========================================================================
   LOOM Desk — 3D UI Perspective Scrollytelling & Metrics Strip
   Hardware-accelerated CSS 3D Depth + Scroll Scrubbing (Linear/Stripe Style)
   ========================================================================== */

html,
body {
    overflow-x: clip !important;
}

html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

/* Clean Full-Viewport Editorial Hero */
.loom-hero-clean {
    position: relative;
    width: 100%;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6.5rem 0 3.5rem;
    overflow: hidden;
}

@media (min-width: 768px) {
    .loom-hero-clean {
        padding: 7.5rem 0 4rem;
    }
}

.loom-hero-h1 {
    font-family: 'Fraunces', 'Space Grotesk', serif;
    font-size: clamp(2.1rem, 4.4vw, 3.45rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.loom-hero-lead {
    margin: 1.25rem auto 0;
    max-width: 40rem;
    font-size: clamp(0.95rem, 1.25vw, 1.1rem);
    line-height: 1.65;
    color: #475569;
}

.loom-hero-actions {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
}

.loom-hero-metrics {
    margin: 2.5rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    max-width: 40rem;
}

@media (min-width: 1024px) and (max-width: 1200px) {
    #main-header nav {
        gap: 1rem !important;
    }
    #main-header .nav-clean-link {
        font-size: 0.8125rem !important;
        white-space: nowrap;
    }
}

.loom-story-wrap {
    position: relative;
    background: #141619;
    color: #ffffff;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.loom-story-track {
    position: relative;
    height: 360vh;
}

@media (max-width: 767px) {
    .loom-story-track {
        height: 280vh;
    }
}

.loom-story-stage {
    position: sticky;
    top: 0;
    height: 100svh;
    min-height: 600px;
    width: 100%;
    overflow: hidden;
    background: #141619;
    --p: 0;
}

.loom-story-stage::before {
    display: none;
}

.loom-cinema-poster,
.loom-seq-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.loom-cinema-poster {
    z-index: 1;
}

.loom-seq-canvas {
    z-index: 2;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: contents;
}

/* Wayabi-style dual editorial scrims for crisp legibility */
.loom-cinema-scrim-v {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(to top, rgba(15, 18, 22, 0.88) 0%, rgba(15, 18, 22, 0.36) 44%, rgba(15, 18, 22, 0.32) 100%);
    pointer-events: none;
}

.loom-cinema-scrim-h {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(to right, rgba(15, 18, 22, 0.62) 0%, rgba(15, 18, 22, 0.12) 55%, rgba(15, 18, 22, 0.38) 100%);
    pointer-events: none;
}

/* Minimalist 12x12 corner framing ticks */
.loom-cinema-frame {
    position: absolute;
    inset: 5.5rem 2rem 2.25rem;
    z-index: 4;
    pointer-events: none;
}

.loom-tick {
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: rgba(255, 255, 255, 0.28);
    border-style: solid;
    border-width: 0;
}
.loom-tick-tl { top: 0; left: 0; border-top-width: 1.5px; border-left-width: 1.5px; }
.loom-tick-tr { top: 0; right: 0; border-top-width: 1.5px; border-right-width: 1.5px; }
.loom-tick-bl { bottom: 0; left: 0; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.loom-tick-br { bottom: 0; right: 0; border-bottom-width: 1.5px; border-right-width: 1.5px; }

/* Bottom-left Chapter Copy Block (Wayabi border-l-2 style) */
.loom-cinema-chapters {
    position: absolute;
    left: 2.25rem;
    right: 2.25rem;
    bottom: 4.5rem;
    z-index: 5;
    max-width: 34rem;
    pointer-events: none;
}

@media (min-width: 1024px) {
    .loom-cinema-chapters {
        left: 3.5rem;
        bottom: 5.25rem;
    }
}

.loom-story-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding-left: 1.15rem;
    border-left: 2px solid #e11d48;
    opacity: 0;
    transform: translate3d(0, var(--shift, 14px), 0);
    pointer-events: none;
    will-change: transform, opacity;
}

.loom-story-panel.is-active {
    pointer-events: auto;
}

.loom-story-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 0.65rem;
}

.loom-story-kicker::before {
    display: none;
}

.loom-kicker-sep {
    display: inline-block;
    width: 16px;
    height: 1px;
    background: rgba(255, 255, 255, 0.35);
}

.loom-kicker-tag {
    color: #fda4af;
}

.loom-story-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(1.55rem, 2.8vw, 2.35rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: #ffffff;
    margin-bottom: 0.65rem;
}

.loom-char-word {
    display: inline-block;
    white-space: nowrap;
}

.loom-char {
    display: inline-block;
    will-change: opacity;
}

.loom-story-desc {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(0.86rem, 1vw, 0.96rem);
    line-height: 1.6;
    color: rgba(241, 245, 249, 0.88);
    max-width: 46ch;
}

/* Compact Live Operational Telemetry Pill (Top-Left below header) */
.loom-cinema-telemetry {
    position: absolute;
    top: 6.5rem;
    left: 2.25rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.48rem 0.85rem;
    border-radius: 9999px;
    background: rgba(15, 18, 22, 0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: 0.04em;
}

@media (min-width: 1024px) {
    .loom-cinema-telemetry {
        left: 3.5rem;
    }
}

.loom-telemetry-dot {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* Right-Center Chapter Rail (Wayabi Style) */
.loom-story-nav {
    position: absolute;
    right: 2.25rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    display: none;
    flex-direction: column;
    gap: 0.85rem;
}

@media (min-width: 1024px) {
    .loom-story-nav {
        display: flex;
    }
}

.loom-story-nav-btn {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    background: transparent;
    border: 0;
    padding: 0.2rem 0;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.45);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: color 0.2s ease;
}

.loom-story-nav-btn:hover {
    color: rgba(255, 255, 255, 0.85);
}

.loom-story-nav-btn.is-active {
    color: #ffffff;
    font-weight: 700;
}

.loom-story-nav-bar {
    width: 14px;
    height: 2px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease;
}

.loom-story-nav-btn:hover .loom-story-nav-bar {
    width: 22px;
    background: rgba(255, 255, 255, 0.65);
}

.loom-story-nav-btn.is-active .loom-story-nav-bar {
    width: 30px;
    background: #e11d48;
}

.loom-story-hud {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    padding: 0 5.5rem 1.25rem 2.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

@media (min-width: 1024px) {
    .loom-story-hud {
        padding: 0 5.5rem 1.4rem 3.5rem;
    }
}

.loom-story-scroll-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.58);
    letter-spacing: 0.04em;
}

.loom-story-skip {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #f8fafc;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.loom-story-skip:hover {
    background: rgba(225, 29, 72, 0.85);
    border-color: #e11d48;
    color: #ffffff;
}

.loom-story-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.14);
    z-index: 7;
}

.loom-story-progress > span {
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    transform: scaleX(var(--p, 0));
    background: #e11d48;
    will-change: transform;
}

/* Metrics Strip Below 3D Stage */
.loom-metrics-strip {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 2.5rem 1.5rem;
}

.loom-metrics-grid {
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.5rem;
}

@media (min-width: 768px) {
    .loom-metrics-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.loom-metric-item {
    border-left: 2px solid rgba(225, 29, 72, 0.35);
    padding-left: 1rem;
}

.loom-metric-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.loom-metric-accent {
    color: #e11d48;
}

.loom-metric-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    color: #475569;
    margin-top: 0.35rem;
    line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
    .loom-story-track { height: auto; }
    .loom-story-stage { position: relative; top: 0; height: auto; padding: 3rem 0; }
    .loom-story-panels { display: grid; gap: 1.5rem; min-height: auto; }
    .loom-story-panel { position: relative; opacity: 1 !important; transform: none !important; }
    .loom-3d-rig { transform: none !important; }
    .loom-story-nav, .loom-story-progress, .loom-story-scroll-hint { display: none; }
}

/* ==========================================================================
   Airy Lyrics Section (#cerita) & Real Problem -> Solved Section (#masalah)
   Explicit CSS spacing independent of pre-compiled Tailwind utilities
   ========================================================================== */

#cerita.loom-lyrics-airy {
    padding: 6.5rem 1.5rem;
}

@media (min-width: 768px) {
    #cerita.loom-lyrics-airy {
        padding: 8.5rem 2rem;
    }
}

.loom-lyrics-stack {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    max-width: 48rem;
    margin: 3.5rem auto 0;
}

@media (min-width: 768px) {
    .loom-lyrics-stack {
        gap: 5.5rem;
        margin-top: 4.5rem;
    }
}

/* Problem -> Solved Editorial Rows */
.loom-solved-section {
    padding: 6rem 1.5rem;
    background: #fffdf7;
}

@media (min-width: 768px) {
    .loom-solved-section {
        padding: 7.5rem 2rem;
    }
}

.loom-solved-container {
    max-width: 68rem;
    margin: 0 auto;
}

.loom-solved-head {
    max-width: 38rem;
    margin-bottom: 3.5rem;
}

.loom-solved-kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e11d48;
    margin-bottom: 0.75rem;
}

.loom-solved-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(1.85rem, 3.2vw, 2.75rem);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.loom-solved-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #e2e8f0;
}

.loom-solved-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 2rem 0;
    border-bottom: 1px solid #e2e8f0;
    align-items: start;
}

@media (min-width: 768px) {
    .loom-solved-row {
        grid-template-columns: 180px 1fr 1fr;
        gap: 2.25rem;
        padding: 2.5rem 0;
    }
}

.loom-solved-cat {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.loom-solved-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
}

.loom-solved-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.loom-solved-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #64748b;
}

.loom-solved-col-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
}

.loom-solved-col-label.is-problem {
    color: #94a3b8;
}

.loom-solved-col-label.is-solution {
    color: #059669;
}

.loom-solved-problem-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #64748b;
}

.loom-solved-solution-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #0f172a;
    font-weight: 600;
}

.loom-solved-cta-bar {
    margin-top: 3rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    border-radius: 1rem;
    background: #0f172a;
    color: #f8fafc;
}

.loom-solved-cta-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

.loom-solved-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.35rem;
    border-radius: 0.75rem;
    background: #e11d48;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.loom-solved-cta-btn:hover {
    background: #be123c;
    transform: translateY(-1px);
}
