/* ========================================
   SIGIL FORGE — Design System & Styles
   ======================================== */

:root {
    --bg-primary: #060610;
    --bg-secondary: #0c0c1a;
    --bg-card: rgba(12, 12, 26, 0.7);

    --gold: #d4af37;
    --gold-light: #f4c542;
    --gold-dim: rgba(212, 175, 55, 0.3);

    --purple: #8b5cf6;
    --purple-glow: #a855f7;
    --purple-dim: rgba(139, 92, 246, 0.3);

    --cyan: #06b6d4;
    --cyan-glow: #22d3ee;

    --text-primary: #eee5d3;
    --text-heading: #ffffff;
    --text-muted: rgba(232, 220, 200, 0.5);

    --font-heading: 'Cinzel Decorative', serif;
    --font-body: 'Raleway', sans-serif;

    --transition-fast: 0.3s ease;
    --transition-medium: 0.6s ease;
    --transition-slow: 1s ease-in-out;
}

/* ========================================
   Reset & Base
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 300;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========================================
   Particle Background
   ======================================== */

#particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* ========================================
   Layout
   ======================================== */

.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

section.hidden {
    display: none;
    opacity: 0;
    transform: translateY(30px);
}

section.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Typography
   ======================================== */

h1, h2 {
    font-family: var(--font-heading);
    color: var(--text-heading);
    letter-spacing: 6px;
    margin-bottom: 1rem;
}

.logo-mark {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px var(--gold), 0 0 40px var(--purple);
    animation: pulse-glow-symbol 3s ease-in-out infinite alternate;
}

.glow-title {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--gold-light), var(--purple-glow), var(--gold));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 6s ease infinite, text-glow 4s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.4));
}

.glow-title-small {
    font-size: 1.8rem;
    color: var(--gold-light);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    margin-bottom: 2rem;
    letter-spacing: 8px;
    text-transform: uppercase;
}

.subtitle {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 3rem;
    max-width: 550px;
    color: rgba(232, 220, 200, 0.7);
    font-weight: 300;
}

.hint-text {
    margin-top: 2rem;
    opacity: 0.4;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* ========================================
   Input Area
   ======================================== */

.input-group {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin-bottom: 2.5rem;
}

textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--gold-dim);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 300;
    padding: 1.5rem;
    resize: none;
    border-radius: 8px;
    outline: none;
    transition: all var(--transition-fast);
    text-align: center;
    backdrop-filter: blur(10px);
    letter-spacing: 1px;
}

textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

textarea:focus {
    border-color: var(--gold);
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.25),
        0 0 60px rgba(139, 92, 246, 0.1),
        inset 0 0 15px rgba(212, 175, 55, 0.05);
}

/* ========================================
   Buttons
   ======================================== */

.mystic-btn {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: 4px;
    padding: 1rem 2.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    border-radius: 4px;
}

.mystic-btn .btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212,175,55,0.15) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.mystic-btn:hover {
    color: var(--text-heading);
    border-color: var(--gold-light);
    box-shadow:
        0 0 25px rgba(212, 175, 55, 0.4),
        inset 0 0 20px rgba(212, 175, 55, 0.1);
    transform: translateY(-2px);
}

.mystic-btn:hover .btn-glow {
    transform: translate(-50%, -50%) scale(1);
}

.mystic-btn:active {
    transform: translateY(0);
}

.mystic-btn.accent {
    border-color: var(--purple);
    color: var(--purple-glow);
}

.mystic-btn.accent .btn-glow {
    background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, transparent 60%);
}

.mystic-btn.accent:hover {
    color: var(--text-heading);
    border-color: var(--purple-glow);
    box-shadow:
        0 0 25px rgba(139, 92, 246, 0.4),
        inset 0 0 20px rgba(139, 92, 246, 0.1);
}

/* ========================================
   Step Indicator
   ======================================== */

.step-indicator {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-fast);
}

.step-dot.active {
    background: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold);
}

.step-dot.complete {
    background: var(--purple);
    border-color: var(--purple);
    box-shadow: 0 0 8px var(--purple);
}

/* ========================================
   Crafting Visualization
   ======================================== */

.visualization-area {
    min-height: 200px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
    font-size: 1.8rem;
    font-family: var(--font-heading);
    position: relative;
    transition: opacity var(--transition-medium);
    padding: 1rem;
}

.word-span {
    display: inline-block;
    margin: 0.2rem 0.5rem;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.word-span.stop-word {
    color: rgba(232, 220, 200, 0.5);
}

.char-span {
    display: inline-block;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.fade-out-dissolve {
    opacity: 0;
    transform: scale(0.3) translateY(-30px);
    filter: blur(8px);
    color: var(--purple-glow);
    text-shadow: 0 0 30px var(--purple-glow);
}

.glow-vowel {
    color: var(--gold-light) !important;
    text-shadow: 0 0 20px var(--gold), 0 0 40px var(--gold);
    transform: scale(1.3);
}

.fade-vowel {
    opacity: 0;
    transform: scale(0.2) translateY(-40px);
    filter: blur(10px);
    text-shadow: 0 0 40px var(--gold-light);
}

.merge-target {
    color: var(--cyan-glow) !important;
    text-shadow: 0 0 20px var(--cyan);
    transform: scale(1.2);
}

.duplicate-merge {
    opacity: 0;
    transform: scale(0.3);
    filter: blur(6px);
    text-shadow: 0 0 30px var(--cyan);
}

.forge-canvas {
    margin-top: 1rem;
    border-radius: 50%;
    transition: opacity var(--transition-slow);
}

.forge-canvas.hidden {
    display: none;
    opacity: 0;
}

.forge-canvas.visible {
    display: block;
    opacity: 1;
}

/* ========================================
   Sigil Result
   ======================================== */

.result-heading {
    margin-bottom: 1rem;
}

.sigil-container {
    position: relative;
    width: 420px;
    height: 420px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sigil-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid var(--gold-dim);
    animation: ring-pulse 4s ease-in-out infinite alternate;
    pointer-events: none;
}

.sigil-ring::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.15);
    animation: ring-rotate 40s linear infinite;
}

#sigil-canvas {
    border-radius: 50%;
    box-shadow:
        0 0 60px rgba(139, 92, 246, 0.08),
        0 0 120px rgba(212, 175, 55, 0.05);
}

.intention-display {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: rgba(232, 220, 200, 0.6);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    font-style: italic;
}

.essence-display {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--cyan);
    opacity: 0.6;
    letter-spacing: 6px;
    margin-bottom: 2.5rem;
    text-transform: uppercase;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.button-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ========================================
   Toggle Switch
   ======================================== */

.toggle-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: rgba(232, 220, 200, 0.6);
    letter-spacing: 1px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.08);
    transition: 0.4s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--gold);
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

input:checked + .slider {
    background-color: rgba(139, 92, 246, 0.25);
    border-color: var(--purple);
}

input:checked + .slider::before {
    transform: translateX(24px);
    background-color: var(--cyan);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}

/* ========================================
   Keyframe Animations
   ======================================== */

@keyframes pulse-glow-symbol {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes text-glow {
    0% { filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.3)); }
    100% { filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.7)) drop-shadow(0 0 30px rgba(139, 92, 246, 0.4)); }
}

@keyframes ring-pulse {
    0% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.05); }
    100% { box-shadow: 0 0 40px rgba(212, 175, 55, 0.15), 0 0 80px rgba(139, 92, 246, 0.1); }
}

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

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

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 600px) {
    .glow-title {
        font-size: 2.2rem;
        letter-spacing: 3px;
    }

    .glow-title-small {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .visualization-area {
        font-size: 1.4rem;
    }

    .sigil-container {
        width: 300px;
        height: 300px;
    }

    #sigil-canvas {
        width: 300px;
        height: 300px;
    }

    .button-group {
        flex-direction: column;
    }

    .mystic-btn {
        font-size: 0.85rem;
        padding: 0.8rem 1.8rem;
        letter-spacing: 3px;
    }

    .container {
        padding: 1rem;
    }
}

@media (max-width: 400px) {
    .glow-title {
        font-size: 1.8rem;
    }

    .sigil-container {
        width: 260px;
        height: 260px;
    }

    #sigil-canvas {
        width: 260px;
        height: 260px;
    }
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 1rem;
    z-index: 1;
    font-family: var(--font-body);
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: rgba(232, 220, 200, 0.3);
    background: linear-gradient(to top, rgba(6, 6, 16, 0.8), transparent);
    pointer-events: none;
}

