/* ============================================
   JJUGGL.com - Styles
   Terminal Alchemist's Workshop
   ============================================ */

/* --- Custom Properties (Palette) --- */
:root {
    --void-black: #0a0e1a;
    --deep-terminal-blue: #111b2e;
    --phosphor-blue: #c8dff5;
    --electric-cyan: #5eaed5;
    --candle-amber: #d4a03c;
    --wax-cream: #e8dcc8;
    --ember-red: #c4463a;
    --smoke-gray: #3a4560;

    --font-heading: 'Roboto Slab', serif;
    --font-body: 'IBM Plex Mono', monospace;
    --font-accent: 'Bitter', serif;

    --morph-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--phosphor-blue);
    background-color: var(--void-black);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* --- Scanline Overlay --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 2px,
        rgba(10, 14, 26, 0.03) 2px,
        rgba(10, 14, 26, 0.03) 4px
    );
}

/* --- Navigation --- */
.terminal-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 8vw;
    display: flex;
    align-items: center;
    gap: 24px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--phosphor-blue);
    background: linear-gradient(to bottom, rgba(10, 14, 26, 0.95) 0%, rgba(10, 14, 26, 0) 100%);
}

.nav-prompt {
    color: var(--electric-cyan);
    font-weight: 600;
    white-space: nowrap;
}

.nav-tilde {
    color: var(--candle-amber);
}

.nav-mobile-toggle {
    display: none;
    background: none;
    border: 1px solid var(--smoke-gray);
    color: var(--phosphor-blue);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 6px 14px;
    cursor: pointer;
    transition: border-color 0.3s var(--morph-ease);
}

.nav-mobile-toggle:hover {
    border-color: var(--electric-cyan);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-cmd {
    color: var(--phosphor-blue);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 14px;
    padding: 4px 2px;
    transition: color 0.4s ease, text-shadow 0.4s ease, letter-spacing 0.4s var(--morph-ease);
    display: inline-block;
}

.nav-cmd:hover {
    color: var(--candle-amber);
    text-shadow: 0 0 8px var(--electric-cyan);
    letter-spacing: 2px;
}

/* --- Terminal Hero --- */
.terminal-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px 8vw;
    overflow: hidden;
}

.hero-ambient-glow {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 80vw;
    height: 80vh;
    background: radial-gradient(ellipse at center, rgba(212, 160, 60, 0.06), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-terminal-window {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 760px;
    background: var(--deep-terminal-blue);
    border: 1px solid var(--smoke-gray);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(94, 174, 213, 0.08), 0 0 120px rgba(10, 14, 26, 0.5);
    transition: all 1s var(--morph-ease);
}

.terminal-hero.boot-complete .hero-terminal-window {
    max-width: 100%;
}

.terminal-title-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(10, 14, 26, 0.6);
    border-bottom: 1px solid var(--smoke-gray);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: var(--ember-red); }
.terminal-dot.yellow { background: var(--candle-amber); }
.terminal-dot.green { background: #4a9; }

.terminal-title-text {
    font-size: 12px;
    color: var(--smoke-gray);
    margin-left: 8px;
}

.terminal-body {
    padding: 24px;
    min-height: 280px;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.8;
    color: var(--phosphor-blue);
}

#boot-text .boot-line {
    display: block;
    margin-bottom: 4px;
    opacity: 0;
    animation: fadeInLine 0.3s forwards;
}

#boot-text .boot-line.system-msg {
    color: var(--electric-cyan);
}

#boot-text .boot-line.ok-msg {
    color: #4a9;
}

#boot-text .boot-line.ready-msg {
    color: var(--candle-amber);
    font-weight: 600;
}

@keyframes fadeInLine {
    to { opacity: 1; }
}

/* Cursor blink */
.cursor-blink {
    color: var(--electric-cyan);
    animation: blink 1s step-end infinite;
    font-size: 15px;
}

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

/* --- Section Blocks --- */
.section-block {
    padding: 0 8vw;
}

.section-content {
    padding: 60px 0 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 32px;
    color: var(--phosphor-blue);
    margin-bottom: 40px;
    letter-spacing: 1px;
}

/* --- Reveal animation (blur-to-focus) --- */
.reveal-section {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(20px);
    transition: opacity 0.6s var(--morph-ease), filter 0.6s var(--morph-ease), transform 0.6s var(--morph-ease);
}

.reveal-section.revealed {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* --- Candle Dividers --- */
.candle-divider {
    padding: 60px 0;
    text-align: center;
    position: relative;
}

.candle-divider::before,
.candle-divider::after {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--smoke-gray), transparent);
    margin: 0 auto;
    max-width: 600px;
}

.candle-divider::before {
    margin-bottom: 30px;
}

.candle-divider::after {
    margin-top: 30px;
}

.flame-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
}

.candle-flame {
    animation: flameFlicker 1.2s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 6px rgba(212, 160, 60, 0.4));
}

.candle-flame.flame-1 { animation-delay: 0s; }
.candle-flame.flame-2 { animation-delay: 0.2s; }
.candle-flame.flame-3 { animation-delay: 0.4s; }
.candle-flame.flame-4 { animation-delay: 0.1s; }
.candle-flame.flame-5 { animation-delay: 0.35s; }

@keyframes flameFlicker {
    0% { transform: scaleY(0.95) scaleX(1); }
    25% { transform: scaleY(1.03) scaleX(0.97); }
    50% { transform: scaleY(0.98) scaleX(1.02); }
    75% { transform: scaleY(1.05) scaleX(0.98); }
    100% { transform: scaleY(0.96) scaleX(1.01); }
}

.divider-quote {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 400;
    font-size: 16px;
    color: var(--candle-amber);
    opacity: 0.85;
    max-width: 500px;
    margin: 0 auto;
}

/* --- About Section --- */
.about-terminal {
    max-width: 720px;
}

.terminal-text {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.8;
    color: var(--wax-cream);
    margin-bottom: 20px;
}

.text-accent {
    color: var(--electric-cyan);
    font-weight: 600;
}

.text-green {
    color: #4a9;
}

/* --- Portfolio Grid --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* Leather texture on terminal panes */
.terminal-pane {
    background-color: var(--deep-terminal-blue);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(94, 174, 213, 0.03) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 160, 60, 0.02) 0%, transparent 60%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(200, 223, 245, 0.008) 2px,
            rgba(200, 223, 245, 0.008) 4px
        );
    border: 1px solid var(--smoke-gray);
    border-radius: 0px;
    overflow: hidden;
    transition: border-radius 0.4s var(--morph-ease), box-shadow 0.4s var(--morph-ease), background-color 0.4s var(--morph-ease), border-color 0.4s var(--morph-ease);
    position: relative;
}

.terminal-pane::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

.terminal-pane:hover {
    border-radius: 6px;
    background-color: rgba(10, 14, 26, 0.8);
    box-shadow: 0 0 30px rgba(94, 174, 213, 0.1);
    border-color: var(--electric-cyan);
}

/* Wax drip border */
.wax-drip-border {
    border-top: none;
    position: relative;
}

.wax-drip-border::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 12px;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 12' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L400,0 L400,2 C380,2 375,8 360,8 C345,8 340,2 320,2 C300,2 295,10 280,10 C265,10 260,2 240,2 C220,2 215,6 200,6 C185,6 180,2 160,2 C140,2 135,12 120,12 C105,12 100,2 80,2 C60,2 55,7 40,7 C25,7 20,2 0,2 Z' fill='%23d4a03c' fill-opacity='0.6'/%3E%3C/svg%3E") repeat-x;
    background-size: 400px 12px;
}

.pane-title-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(10, 14, 26, 0.5);
    border-bottom: 1px solid rgba(58, 69, 96, 0.5);
}

.pane-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red { background: var(--ember-red); }
.dot.yellow { background: var(--candle-amber); }
.dot.green { background: #4a9; }

.pane-path {
    font-size: 11px;
    color: var(--smoke-gray);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pane-content {
    padding: 20px;
}

.pane-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    color: var(--phosphor-blue);
    margin-bottom: 12px;
}

.pane-text {
    font-size: 13px;
    line-height: 1.7;
    color: var(--wax-cream);
    margin-bottom: 16px;
}

.pane-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--electric-cyan);
    border: 1px solid var(--smoke-gray);
    padding: 3px 10px;
    margin-right: 6px;
    margin-bottom: 6px;
    border-radius: 2px;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.terminal-pane:hover .pane-tag {
    border-color: var(--electric-cyan);
    color: var(--candle-amber);
}

/* --- Contact Section --- */
.contact-terminal {
    max-width: 640px;
}

.contact-prompt-line {
    margin-bottom: 24px;
}

.prompt-symbol {
    color: var(--electric-cyan);
    font-size: 14px;
    font-weight: 600;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.field-prompt {
    color: var(--candle-amber);
    font-size: 14px;
    font-family: var(--font-body);
    white-space: nowrap;
    padding-top: 10px;
    min-width: 160px;
}

.terminal-input {
    flex: 1;
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid var(--smoke-gray);
    color: var(--phosphor-blue);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.terminal-input:focus {
    border-color: var(--electric-cyan);
    box-shadow: 0 0 12px rgba(94, 174, 213, 0.15);
}

.terminal-input::placeholder {
    color: var(--smoke-gray);
}

.terminal-textarea {
    resize: vertical;
    min-height: 100px;
}

.input-cursor {
    display: none;
}

.terminal-submit {
    background: none;
    border: 1px solid var(--electric-cyan);
    color: var(--electric-cyan);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 12px 28px;
    cursor: pointer;
    transition: background 0.4s var(--morph-ease), color 0.4s var(--morph-ease), border-color 0.4s var(--morph-ease);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.terminal-submit:hover {
    background: var(--candle-amber);
    border-color: var(--candle-amber);
    color: var(--void-black);
}

.terminal-submit .cursor-blink {
    font-size: 12px;
}

.form-response {
    font-size: 14px;
    padding: 8px 0;
    min-height: 24px;
}

.form-response.success {
    color: #4a9;
}

.form-response.error {
    color: var(--ember-red);
}

/* --- Footer --- */
.terminal-footer {
    padding: 40px 8vw 30px;
    border-top: 1px solid var(--smoke-gray);
    margin-top: 40px;
}

.footer-log {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 40px;
    margin-bottom: 20px;
}

.footer-line {
    font-size: 12px;
    color: var(--smoke-gray);
}

.footer-line span {
    color: var(--wax-cream);
}

.footer-line .text-green {
    color: #4a9;
}

.footer-bottom {
    padding-top: 16px;
    border-top: 1px solid rgba(58, 69, 96, 0.3);
}

.footer-prompt {
    font-size: 12px;
    color: var(--smoke-gray);
}

/* --- Mobile Menu Animation --- */
.nav-links.mobile-expanded {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(10, 14, 26, 0.97);
    padding: 16px 8vw;
    border-bottom: 1px solid var(--smoke-gray);
    gap: 12px;
}

.nav-links.mobile-expanded .nav-cmd {
    opacity: 0;
    animation: typeReveal 0.3s forwards;
}

.nav-links.mobile-expanded li:nth-child(1) .nav-cmd { animation-delay: 0.1s; }
.nav-links.mobile-expanded li:nth-child(2) .nav-cmd { animation-delay: 0.2s; }
.nav-links.mobile-expanded li:nth-child(3) .nav-cmd { animation-delay: 0.3s; }

@keyframes typeReveal {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .terminal-nav {
        padding: 16px 5vw;
    }

    .nav-links {
        display: none;
    }

    .nav-mobile-toggle {
        display: inline-block;
    }

    .nav-links.mobile-expanded {
        display: flex;
    }

    .section-block {
        padding: 0 5vw;
    }

    .terminal-hero {
        padding: 40px 5vw;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

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

    .field-prompt {
        min-width: auto;
        font-size: 12px;
    }

    .form-field {
        flex-direction: column;
        gap: 6px;
    }

    .footer-log {
        flex-direction: column;
        gap: 8px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Hidden utility --- */
.hidden {
    display: none;
}

/* --- Boot sequence hero states --- */
.terminal-hero.boot-running {
    position: relative;
}

.terminal-hero.boot-complete {
    min-height: auto;
    padding: 80px 8vw 0;
}

/* --- Main content hidden during boot --- */
.main-content-hidden .section-block,
.main-content-hidden .terminal-footer {
    opacity: 0;
    pointer-events: none;
}

.main-content-visible .section-block,
.main-content-visible .terminal-footer {
    opacity: 1;
    transition: opacity 0.8s var(--morph-ease);
    pointer-events: auto;
}
