:root {
    --cyan: #00F2FF; --pink: #FF00FF; --yellow: #FFFB00;
    --green: #00FF6A; --orange: #FF6A00; --purple: #7D00FF;
    --red: #FF003C; --grey: #555555;
    --border-color: rgba(255, 255, 255, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: #000; color: #fff; font-family: 'Montserrat', sans-serif; transition: background 1.5s ease; overflow-x: hidden; }


.trail-particle {
    position: fixed; pointer-events: none; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 80%);
    z-index: 9998; animation: fade-trail 1s forwards;
}
@keyframes fade-trail { to { opacity: 0; transform: scale(3.5); } }

.progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--pink); z-index: 1001; width: 0%; }


.hero { height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; border-bottom: 1px solid var(--border-color); text-align: center; }
.interactive-title { font-family: 'Playfair Display', serif; font-size: clamp(3rem, 15vw, 8.5rem); font-weight: 900; color: #fff; }
.interactive-title span { display: inline-block; transition: 0.4s; cursor: crosshair; }


.interactive-title span:hover { transform: scale(1.3) translateY(-20px); }
.interactive-title .l-1:hover { color: var(--cyan); text-shadow: 0 0 30px var(--cyan); }
.interactive-title .l-2:hover { color: var(--pink); text-shadow: 0 0 30px var(--pink); }
.interactive-title .l-3:hover { color: var(--yellow); text-shadow: 0 0 30px var(--yellow); }
.interactive-title .l-4:hover { color: var(--green); text-shadow: 0 0 30px var(--green); }
.interactive-title .l-5:hover { color: var(--orange); text-shadow: 0 0 30px var(--orange); }
.interactive-title .l-6:hover { color: var(--purple); text-shadow: 0 0 30px var(--purple); }

.hero-line { margin-top: 25px; letter-spacing: 5px; font-size: 0.8rem; opacity: 0.5; max-width: 600px; font-style: italic; }


.container { max-width: 1200px; margin: 0 auto; padding: 0 5vw; display: flex; flex-direction: column; align-items: center; }
.section-split { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; width: 100%; }
.section-margin { margin-bottom: 250px; width: 100%; }
.centered-text { text-align: center; max-width: 850px; }


.photo-box { width: 100%; max-width: 400px; margin: 0 auto; }
.frame-border { border: 1px solid var(--border-color); padding: 10px; border-radius: 20px; background: #000; }
.photo-box img { width: 100%; border-radius: 12px; filter: saturate(1.2); }


.types-modern-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; width: 100%; }
.type-card { padding: 40px; background: rgba(255,255,255,0.02); border: 1px solid var(--border-color); border-radius: 20px; position: relative; }
.type-card h3 { font-family: 'Playfair Display'; font-size: 1.6rem; margin-bottom: 15px; color: var(--cyan); }


.mixer-section { display: flex; flex-direction: column; align-items: center; }
.emotion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 50px; width: 100%; max-width: 900px; }
.emotion { padding: 40px 10px; background: rgba(15,15,15,0.6); border: 1px solid var(--border-color); border-radius: 20px; cursor: pointer; transition: 0.3s; text-align: center; }
.emotion:hover { transform: translateY(-5px); border-color: var(--pink); }

.shape { width: 50px; height: 50px; margin: 20px auto; }
.bg-cyan { background: var(--cyan); border-radius: 50%; box-shadow: 0 0 20px var(--cyan); }
.bg-yellow { background: var(--yellow); border-radius: 8px; }
.bg-red { background: var(--red); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.bg-grey { background: var(--grey); border-radius: 4px; }
.bg-pink { background: var(--pink); border-radius: 50%; }
.bg-orange { background: var(--orange); clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }


.drift { animation: drift 4s infinite; }
.pulse { animation: pulse 1s infinite; }
.jitter { animation: jitter 0.1s infinite; }
.fall { animation: fall 3s infinite; }
.shake { animation: shake 0.3s infinite; }
.glow { animation: glow 2s infinite alternate; }
@keyframes drift { 50% { transform: translateY(-10px); } }
@keyframes pulse { 50% { transform: scale(1.15); } }
@keyframes jitter { 50% { transform: translate(1px, 1px); } }
@keyframes fall { 100% { transform: translateY(30px); opacity: 0; } }
@keyframes shake { 50% { transform: translateX(5px); } }
@keyframes glow { to { box-shadow: 0 0 30px var(--pink); } }


.lab-title {
    font-size: clamp(2.5rem, 5vw, 4rem) !important;
    text-align: center;
    width: 100%;
    margin-bottom: 15px;
}


.lab-description {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 30px auto;
    font-style: italic;
    opacity: 0.8;
    line-height: 1.6;
}


.lab-outer-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.lab-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
#graphemeInput {
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    padding: 10px;
    color: #fff;
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    text-align: center;
    width: 100%;
    max-width: 600px;
    outline: none;
    margin: 30px 0;
}

.grapheme-display {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 700;
    min-height: 100px;
    text-align: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    display: block;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}
.quiz-box { width: 100%; max-width: 850px; margin: 0 auto; padding: 50px; border: 1px solid var(--border-color); border-radius: 20px; background: #050505; }
.quiz-options-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-top: 30px; }
.quiz-btn { padding: 20px; border: 1px solid #222; background: #0c0c0c; color: #fff; border-radius: 10px; cursor: pointer; transition: 0.3s; }
.quiz-btn:hover { background: #fff; color: #000; font-weight: 700; }

.restart-btn { padding: 15px 40px; background: var(--pink); color: #000; border: none; border-radius: 50px; font-weight: 700; cursor: pointer; text-transform: uppercase; margin-top: 30px; }


.centered-footer { padding: 80px 0; border-top: 1px solid var(--border-color); text-align: center; }
.footer-custom { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 900; font-size: 1.2rem; color: #fff; }


.neon-pink { color: var(--pink); text-shadow: 0 0 10px var(--pink); }
.neon-purple { color: var(--purple); text-shadow: 0 0 10px var(--purple); }
.neon-cyan { color: var(--cyan); text-shadow: 0 0 10px var(--cyan); }
.neon-yellow { color: var(--yellow); text-shadow: 0 0 10px var(--yellow); }

.reveal { opacity: 0; transform: translateY(40px); transition: 1s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }


body.state-calm { background: #002d3d; }
body.state-joy { background: #333300; }
body.state-anxiety { background: #3d0000; }
body.state-melancholy { background: #111111; }
body.state-love { background: #3d001e; }
body.state-anger { background: #3d1500; }

@media (max-width: 900px) { .section-split, .types-modern-grid, .quiz-options-grid, .emotion-grid { grid-template-columns: 1fr; } }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}