/* ========================================
   archetypos.dev - Frost Corporate Tutorial
   ======================================== */

/* Frost Palette Reference:
   #1a2332 - Deep Frost Navy
   #2d3e50 - Slate Frost
   #3a5a72 - Mid Frost
   #4a7c9b - Steel Frost
   #5d8aa8 - Links/Operators
   #6a9bb5 - Ice Frost
   #7babc4 - Pale accent
   #88b2ca - Blob accent
   #8fb5c9 - Vine borders
   #94b8cc - Comments
   #a8c8da - Transition blob
   #b8d4e3 - Glass Frost
   #c8dde9 - Light accent
   #d0e4f0 - Breath Frost
   #e8f0f6 - Vapor Frost
   #f4f8fb - White Ice
*/

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: #f4f8fb;
    color: #2d3e50;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Progress Indicator
   ======================================== */
.progress-indicator {
    position: fixed;
    right: 16px;
    top: 10vh;
    width: 2px;
    height: 0;
    background: rgba(74, 124, 155, 0.6);
    z-index: 100;
    border-radius: 1px;
    transition: height 0.1s linear;
}

/* ========================================
   Blobs Layer
   ======================================== */
.blobs-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.blob-wrapper {
    position: absolute;
}

/* Drift Blob Positions */
.blob-drift-1 {
    top: 5%;
    left: -5%;
}

.blob-drift-2 {
    top: 25%;
    right: -8%;
}

.blob-drift-3 {
    top: 50%;
    left: 15%;
}

/* Transition Blob Positions */
.blob-transition-1 {
    top: 85vh;
    left: 30%;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.blob-transition-1.revealed {
    opacity: 1;
}

.blob-transition-2 {
    top: 195vh;
    left: 15%;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.blob-transition-2.revealed {
    opacity: 1;
}

.blob-transition-3 {
    top: 190vh;
    left: 45%;
    opacity: 0;
    transition: opacity 1.2s ease-out 0.2s;
}

.blob-transition-3.revealed {
    opacity: 1;
}

.blob-transition-4 {
    top: 200vh;
    left: 65%;
    opacity: 0;
    transition: opacity 1.2s ease-out 0.4s;
}

.blob-transition-4.revealed {
    opacity: 1;
}

/* Accent Blob Positions */
.blob-accent-1 {
    top: 140vh;
    right: 8%;
}

.blob-accent-2 {
    top: 260vh;
    left: 5%;
}

.blob-accent-3 {
    top: 65vh;
    right: 20%;
}

/* Blob Animations */
.blob-rotate {
    animation: blobRotate 80s linear infinite;
}

.blob-scale {
    animation: blobScale 10s ease-in-out infinite;
}

.blob-translate {
    animation: blobDrift 25s ease-in-out infinite;
}

@keyframes blobRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes blobScale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes blobDrift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(40px); }
}

/* ========================================
   Z-Module Layout
   ======================================== */
.z-module {
    position: relative;
    min-height: 100vh;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px;
}

.z-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 64px;
    max-width: 1200px;
    width: 100%;
    min-height: 70vh;
}

.z-cell {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.z-top-left {
    grid-column: 1;
    grid-row: 1;
}

.z-top-right {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
}

.z-bottom-left {
    grid-column: 1;
    grid-row: 2;
    align-items: flex-end;
}

.z-bottom-right {
    grid-column: 2;
    grid-row: 2;
    align-items: flex-end;
    justify-content: flex-end;
}

/* ========================================
   Frost Panels
   ======================================== */
.frost-panel {
    background: rgba(220, 232, 245, 0.35);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(26, 35, 50, 0.06);
    max-width: 560px;
    width: 100%;
    transition: background 300ms ease, border-color 300ms ease;
    position: relative;
    overflow: hidden;
}

.frost-panel:hover {
    background: rgba(220, 232, 245, 0.45);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ========================================
   Leaf Watermarks
   ======================================== */
.leaf-watermark {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.frost-panel > *:not(.leaf-watermark) {
    position: relative;
    z-index: 1;
}

#domainPanel .leaf-watermark {
    right: 16px;
    bottom: 12px;
}

.leaf-watermark-sm {
    right: 20px;
    bottom: 16px;
}

.leaf-watermark-md {
    right: 12px;
    top: 20px;
}

/* ========================================
   Typography
   ======================================== */
.domain-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 72px;
    letter-spacing: 0.12em;
    line-height: 1.1;
    color: #1a2332;
}

.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: #1a2332;
    margin-bottom: 20px;
}

.body-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: #2d3e50;
    margin-bottom: 16px;
}

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

.body-text code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    color: #3a5a72;
    background: rgba(26, 35, 50, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

.closing-line {
    font-style: italic;
    color: #4a7c9b;
}

/* ========================================
   Module 1: Opening
   ======================================== */

/* Subtitle / Typewriter */
.subtitle-area {
    padding-top: 24px;
    display: flex;
    align-items: center;
}

.typewriter-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 24px;
    color: #4a7c9b;
    letter-spacing: 0.02em;
}

.cursor {
    display: inline-block;
    width: 1px;
    height: 1.1em;
    background: #4a7c9b;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 1.06s step-end infinite;
}

.cursor.fade-out {
    animation: cursorFadeOut 0.5s 2s forwards;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes cursorFadeOut {
    to { opacity: 0; }
}

/* Manifesto */
.manifesto-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.7;
    color: #2d3e50;
}

/* Chevron */
.chevron-container {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    height: 100%;
    padding-bottom: 16px;
}

.breathing-chevron {
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Panel entrance animation */
.panel-animate {
    opacity: 0;
    transform: translateY(12px);
}

.panel-animate.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 800ms cubic-bezier(0.4, 0, 0.2, 1), transform 800ms cubic-bezier(0.4, 0, 0.2, 1);
}

#manifestoPanel {
    transition-delay: 0ms;
}

#chevronContainer {
    opacity: 0;
}

#chevronContainer.visible {
    opacity: 1;
    transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Module 2: Tutorial
   ======================================== */

/* Code Panels */
.code-panel {
    background: rgba(26, 35, 50, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.code-title-bar {
    display: flex;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(143, 181, 201, 0.2);
    margin-bottom: 16px;
    align-items: center;
}

.code-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(232, 240, 246, 0.4);
}

.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #94b8cc;
    margin-left: 8px;
}

.code-block {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    line-height: 1.6;
    color: #3a5a72;
    overflow-x: auto;
    white-space: pre;
}

.code-ln {
    color: #94b8cc;
    opacity: 0.5;
    user-select: none;
}

.code-kw {
    color: #4a7c9b;
}

.code-str {
    color: #7babc4;
}

.code-cm {
    color: #94b8cc;
    font-style: italic;
}

.code-op {
    color: #5d8aa8;
}

.code-num {
    color: #6a9bb5;
}

/* Vine Card */
.vine-card {
    position: relative;
    overflow: visible;
}

.vine-border {
    position: absolute;
    left: 0;
    width: 100%;
    height: 20px;
}

.vine-top {
    top: -10px;
}

.vine-bottom {
    bottom: -10px;
}

.vine-path {
    stroke: #8fb5c9;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2.5s ease-in-out;
}

.vine-card.revealed .vine-path {
    stroke-dashoffset: 0;
}

.annotation-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #1a2332;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
    margin-top: 12px;
}

/* ========================================
   Module 3: Synthesis
   ======================================== */

/* Diagram */
.archetype-diagram {
    width: 100%;
    max-width: 440px;
    height: auto;
}

/* Terminal Panel */
.terminal-panel {
    font-family: 'JetBrains Mono', monospace;
}

.terminal-content {
    font-size: 14px;
    line-height: 1.8;
}

.terminal-line {
    margin-bottom: 4px;
    color: #3a5a72;
}

.terminal-prompt {
    color: #4a7c9b;
    margin-right: 8px;
}

.terminal-cmd {
    color: #5d8aa8;
}

.terminal-output {
    color: #7babc4;
    opacity: 0;
    transition: opacity 600ms ease;
}

.terminal-output.visible {
    opacity: 1;
}

.terminal-blink {
    animation: blink 1.06s step-end infinite;
}

/* ========================================
   Scroll Reveal
   ======================================== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms cubic-bezier(0.4, 0, 0.2, 1), transform 800ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ========================================
   Responsive (< 768px)
   ======================================== */
@media (max-width: 768px) {
    .z-module {
        padding: 32px 20px;
    }

    .z-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 32px;
        min-height: auto;
    }

    .z-top-left,
    .z-top-right,
    .z-bottom-left,
    .z-bottom-right {
        grid-column: 1;
        justify-content: flex-start;
        align-items: flex-start;
    }

    .z-top-left { grid-row: 1; }
    .z-top-right { grid-row: 2; }
    .z-bottom-left { grid-row: 3; }
    .z-bottom-right { grid-row: 4; }

    .frost-panel {
        padding: 20px;
        max-width: 100%;
    }

    .domain-title {
        font-size: 40px;
    }

    .section-heading {
        font-size: 22px;
    }

    .body-text,
    .manifesto-text {
        font-size: 16px;
    }

    .typewriter-text {
        font-size: 18px;
    }

    .blob-drift-1 svg,
    .blob-drift-2 svg,
    .blob-drift-3 svg {
        transform: scale(0.6);
        opacity: 0.7;
    }

    .blob-transition-1 svg,
    .blob-transition-2 svg,
    .blob-transition-3 svg,
    .blob-transition-4 svg {
        transform: scale(0.6);
        opacity: 0.7;
    }
}
