/* ============================================
   storiographer.com -- Terminal Aurora Chronicle
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0A0508;
    color: #40C060;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    font-weight: 400;
    overflow-x: hidden;
}

/* --- Aurora Background --- */
.aurora-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #C8508A, #50C8C0, #C8508A, #50C8C0);
    background-size: 300% 300%;
    animation: auroraShift 12s ease infinite;
    opacity: 0.15;
    z-index: 0;
}

.aurora-bg-full {
    opacity: 0.3;
}

@keyframes auroraShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* --- Aurora Bleed --- */
.aurora-bleed {
    position: absolute;
    top: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(135deg, #C8508A, #50C8C0, #C8508A);
    background-size: 300% 300%;
    animation: auroraShift 10s ease infinite;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
}

.aurora-bleed-left {
    left: 0;
    mask-image: linear-gradient(to right, rgba(0,0,0,0.6), transparent);
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0.6), transparent);
}

.aurora-bleed-right {
    right: 0;
    mask-image: linear-gradient(to left, rgba(0,0,0,0.6), transparent);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.6), transparent);
}

/* --- Blinking Cursor --- */
.cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: #40C060;
    font-family: 'Victor Mono', monospace;
    font-weight: 700;
}

.cursor-inline {
    animation: blink 1s step-end infinite;
    color: #40C060;
}

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

/* --- Terminal Title Bar --- */
.terminal-titlebar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #5A0A1A;
    border-bottom: 1px solid #C8707A;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background: #C8508A; }
.dot-yellow { background: #C8707A; }
.dot-green { background: #40C060; }

.terminal-titlebar-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: #C8707A;
    margin-left: 10px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.section-hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0A0508;
}

.terminal-overlay {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 800px;
    background: rgba(10, 5, 8, 0.85);
    border: 1px solid #C8707A;
}

.terminal-body {
    padding: 40px 30px;
}

.hero-prompt {
    font-family: 'Victor Mono', monospace;
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 700;
    color: #40C060;
    line-height: 1.2;
    margin-bottom: 20px;
    white-space: nowrap;
    overflow: hidden;
}

.prompt-symbol {
    color: #C8707A;
}

.typed-text {
    color: #40C060;
}

.hero-subtitle {
    margin-top: 20px;
    opacity: 0;
    transition: opacity 1.5s ease 3.5s;
}

.hero-subtitle.visible {
    opacity: 1;
}

.prompt-muted {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    color: #C8707A;
}

/* Diagonal Cut */
.diagonal-cut-bottom {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 80px;
    background: #0A0508;
    clip-path: polygon(0 100%, 100% 0%, 100% 100%);
    z-index: 5;
}

.diagonal-cut-reverse {
    clip-path: polygon(0 0%, 0 100%, 100% 100%);
}

/* ============================================
   DIAGONAL SECTIONS (2 & 3)
   ============================================ */
.section-diagonal {
    position: relative;
    padding: 120px 5% 120px;
    background: #0A0508;
    overflow: hidden;
}

.section-quill {
    clip-path: polygon(0 6%, 100% 0, 100% 94%, 0 100%);
    background: #0A0508;
    padding-top: 160px;
    padding-bottom: 160px;
}

.section-scroll {
    clip-path: polygon(0 0, 100% 6%, 100% 100%, 0 94%);
    background: #0A0508;
    margin-top: -60px;
    padding-top: 160px;
    padding-bottom: 160px;
}

/* --- Terminal Window --- */
.terminal-window {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
    background: rgba(10, 5, 8, 0.9);
    border: 2px dashed #C8707A;
}

.terminal-content {
    padding: 24px 20px;
}

/* Marching Ants Border */
.marching-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.marching-border rect {
    fill: none;
    stroke: #C8707A;
    stroke-width: 1.5;
    stroke-dasharray: 8 4;
    animation: marchingAnts 1.5s linear infinite;
    vector-effect: non-scaling-stroke;
}

@keyframes marchingAnts {
    to {
        stroke-dashoffset: -24;
    }
}

/* --- Terminal Lines --- */
.terminal-line {
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #40C060;
    margin-bottom: 2px;
}

.terminal-output {
    color: #C8707A;
    padding-left: 1rem;
}

.prompt-green {
    color: #40C060;
    font-weight: 500;
}

.timestamp {
    color: #50C8C0;
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 10px;
}

/* ============================================
   MARGINALIA (Hand-drawn SVGs)
   ============================================ */
.marginalia {
    position: absolute;
    z-index: 1;
    opacity: 0.6;
}

.marginalia-quill {
    top: 20%;
    right: 8%;
}

.marginalia-scroll {
    top: 15%;
    left: 6%;
}

.hand-drawn-quill {
    width: 80px;
    height: auto;
}

.hand-drawn-scroll {
    width: 100px;
    height: auto;
}

/* Path Drawing Animation */
.draw-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawIn 3s ease forwards;
}

.section-quill .draw-path {
    animation-delay: 0.5s;
}

.section-scroll .draw-path {
    animation-delay: 0.3s;
}

@keyframes drawIn {
    to {
        stroke-dashoffset: 0;
    }
}

/* ============================================
   EXIT SECTION
   ============================================ */
.section-exit {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0A0508;
    overflow: hidden;
    padding: 60px 5%;
}

.terminal-overlay-exit {
    max-width: 600px;
    width: 90%;
}

.terminal-body-exit {
    padding: 30px 24px;
}

.exit-domain {
    font-family: 'Victor Mono', monospace;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    font-weight: 700;
    color: #40C060;
    margin-top: 16px;
    text-align: center;
}

.exit-tagline {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: #50C8C0;
    text-align: center;
    opacity: 0.8;
    margin-top: 4px;
}

/* --- Compass Rose --- */
.compass-rose-container {
    position: relative;
    z-index: 2;
    margin-top: 50px;
    opacity: 0.5;
}

.hand-drawn-compass {
    width: 140px;
    height: 140px;
}

.compass-rose-container .draw-path {
    animation-delay: 0.5s;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .terminal-body {
        padding: 24px 16px;
    }

    .terminal-content {
        padding: 16px 12px;
    }

    .marginalia {
        display: none;
    }

    .section-quill {
        clip-path: polygon(0 3%, 100% 0, 100% 97%, 0 100%);
        padding-top: 100px;
        padding-bottom: 100px;
    }

    .section-scroll {
        clip-path: polygon(0 0, 100% 3%, 100% 100%, 0 97%);
        padding-top: 100px;
        padding-bottom: 100px;
    }

    .diagonal-cut-bottom {
        height: 40px;
    }

    .hero-prompt {
        white-space: normal;
    }

    .hand-drawn-compass {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .terminal-titlebar {
        padding: 8px 10px;
        gap: 4px;
    }

    .terminal-dot {
        width: 7px;
        height: 7px;
    }

    .terminal-titlebar-text {
        font-size: 0.65rem;
    }

    .terminal-line {
        font-size: 0.8rem;
    }

    .section-diagonal {
        padding: 80px 3% 80px;
    }
}
