/* ==========================================================
   CHEMISTRY & MATH SOLVER PAGE — Premium Dark-Science CSS
   ========================================================== */

/* ── SCROLL REVEAL ── */
.chem-reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.chem-reveal.visible { opacity: 1; transform: translateY(0); }

/* ── HERO ── */
.chem-hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #020f0a 0%, #051a10 55%, #020f0a 100%);
    position: relative;
    overflow: hidden;
}

#molecule-canvas {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

.chem-hero-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
    pointer-events: none;
}
.chem-hero-watermark span {
    font-size: clamp(160px, 28vw, 340px);
    font-weight: 900;
    color: rgba(0, 230, 120, 0.04);
    line-height: 1;
    user-select: none;
    font-family: 'Nunito', sans-serif;
}

.chem-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
    padding: 80px 24px;
}

/* Badge */
.chem-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    background: rgba(0, 230, 140, 0.1);
    border: 1px solid rgba(0, 230, 140, 0.3);
    border-radius: 999px;
    color: #00e68c;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.4rem;
    animation: fadeUp 0.8s ease both;
}
.chem-badge-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #00e68c;
    animation: dotBlink 1.4s ease-in-out infinite;
}
@keyframes dotBlink { 0%,100%{opacity:1;} 50%{opacity:0.2;} }

.chem-hero-content h1 {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    color: #ffffff;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 0.6rem;
    animation: fadeUp 0.8s ease 0.15s both;
}
.chem-hero-content h2 {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.75);
    font-weight: 600;
    margin-bottom: 1.2rem;
    animation: fadeUp 0.8s ease 0.28s both;
}
.chem-hero-desc {
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.8;
    margin-bottom: 1.4rem;
    animation: fadeUp 0.8s ease 0.42s both;
}

.chem-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.8rem;
    animation: fadeUp 0.8s ease 0.55s both;
}
.chem-pill {
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    background: rgba(0,230,140,0.08);
    border: 1px solid rgba(0,230,140,0.2);
    color: #00e68c;
    font-size: 0.8rem;
    font-weight: 700;
}

.chem-hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    animation: fadeUp 0.8s ease 0.68s both;
}

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

/* ── SOLVER CARD ── */
.solver-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(0,230,140,0.2);
    border-radius: 20px;
    padding: 1.8rem;
    backdrop-filter: blur(16px);
    box-shadow:
        0 24px 64px rgba(0,0,0,0.5),
        0 0 40px rgba(0,230,140,0.08);
    animation: floatCard 6s ease-in-out infinite;
}
@keyframes floatCard {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

.solver-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.solver-dots {
    display: flex;
    gap: 5px;
}
.solver-dots span {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
}
.solver-dots span:nth-child(1) { background: #ff5f57; }
.solver-dots span:nth-child(2) { background: #ffbd2e; }
.solver-dots span:nth-child(3) { background: #28ca41; }
.solver-card-title {
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-left: auto;
    margin-right: auto;
}

.solver-input-box {
    background: rgba(0,230,140,0.06);
    border: 1px solid rgba(0,230,140,0.18);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
}
.solver-input-label {
    font-size: 0.7rem;
    color: #00e68c;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 0.4rem;
}
.solver-formula {
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    color: #ffffff;
    min-height: 1.6rem;
    border-right: 2px solid #00e68c;
    animation: blink-cursor 0.8s steps(1) infinite;
}
@keyframes blink-cursor { 50% { border-color: transparent; } }

.solver-steps {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}
.solver-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: rgba(255,255,255,0.04);
    border-radius: 9px;
    border-left: 2px solid rgba(0,230,140,0.35);
}
.solver-step-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(0,230,140,0.15);
    color: #00e68c;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.solver-step-text {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
    font-family: 'Courier New', monospace;
}

.solver-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    background: linear-gradient(135deg, rgba(0,230,140,0.15), rgba(80,220,120,0.1));
    border: 1px solid rgba(0,230,140,0.3);
    border-radius: 12px;
}
.solver-result-label {
    font-size: 0.75rem;
    color: #00e68c;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.solver-result-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    font-family: 'Courier New', monospace;
}

@media (max-width: 900px) {
    .chem-hero-grid { grid-template-columns: 1fr; gap: 40px; padding: 90px 24px 60px; }
}

/* ── SUBJECTS ── */
.chem-subjects { background: #0a1a0e; padding: 4rem 0 3rem; }
.chem-subjects .section-title { color: #ffffff; }

.subject-tabs {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}
.subject-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    border: 1px solid rgba(0,230,140,0.2);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Nunito', sans-serif;
}
.subject-tab:hover {
    background: rgba(0,230,140,0.1);
    border-color: rgba(0,230,140,0.4);
    color: #00e68c;
}
.subject-tab.active {
    background: linear-gradient(135deg, #00b86b, #00e68c);
    border-color: transparent;
    color: #020f0a;
    box-shadow: 0 4px 16px rgba(0,230,140,0.35);
}
.subject-tab-icon { font-size: 1.1rem; }

.subject-panel { display: none; }
.subject-panel.active { display: block; }

.subject-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(0,230,140,0.12);
    border-radius: 22px;
    padding: 2.5rem;
}

.subject-examples h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.6rem;
}
.subject-examples p {
    color: rgba(255,255,255,0.55);
    font-size: 0.93rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
}

.subject-example-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.subject-example-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1rem;
    background: rgba(0,230,140,0.06);
    border-radius: 10px;
    border-left: 3px solid rgba(0,230,140,0.4);
}
.ex-formula {
    font-family: 'Courier New', monospace;
    color: #00e68c;
    font-weight: 700;
    font-size: 1rem;
    min-width: 110px;
}
.ex-label {
    font-size: 0.83rem;
    color: rgba(255,255,255,0.55);
}

.subject-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.subject-feat-card {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.2rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    transition: background 0.25s ease, border-color 0.25s ease;
}
.subject-feat-card:hover {
    background: rgba(0,230,140,0.07);
    border-color: rgba(0,230,140,0.25);
}
.subject-feat-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.subject-feat-card strong {
    display: block;
    color: #ffffff;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}
.subject-feat-card p {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 860px) {
    .subject-panel-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── HOW IT WORKS ── */
.chem-how {
    background: linear-gradient(180deg, #061510 0%, #030e08 100%);
    padding: 4rem 0 3rem;
}
.chem-how .section-title { color: #ffffff; }
.chem-how-sub {
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 1.02rem;
    margin-top: -1.5rem;
    margin-bottom: 3rem;
}

.chem-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.chem-step-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(0,230,140,0.14);
    border-radius: 18px;
    padding: 1.8rem 1.4rem;
    max-width: 200px;
    text-align: center;
    flex: 0 0 auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.chem-step-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,230,140,0.12);
    border-color: rgba(0,230,140,0.4);
}
.chem-step-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}
.chem-step-num {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b86b, #00e68c);
    color: #020f0a;
    font-size: 1rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chem-step-icon { font-size: 1.4rem; }
.chem-step-card h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.4rem;
}
.chem-step-card p {
    font-size: 0.83rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
    margin: 0;
}

.chem-step-arrow {
    font-size: 1.6rem;
    color: #00e68c;
    opacity: 0.4;
    align-self: center;
    margin-top: -20px;
    animation: nudge 2s ease-in-out infinite;
}
@keyframes nudge { 0%,100%{transform:translateX(0)} 50%{transform:translateX(5px)} }

/* ── CAPABILITIES ── */
.chem-capabilities {
    background: #0a1a0e;
    padding: 4rem 0 3rem;
}
.chem-capabilities .section-title { color: #ffffff; }

.chem-cap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.chem-cap-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(0,230,140,0.12);
    border-radius: 18px;
    padding: 1.8rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}
.chem-cap-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00b86b, #00e68c);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.chem-cap-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 20px 48px rgba(0,230,140,0.12);
    border-color: rgba(0,230,140,0.3);
}
.chem-cap-card:hover::before { transform: scaleX(1); }

.chem-cap-icon {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    display: block;
}
.chem-cap-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.6rem;
}
.chem-cap-card > p {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.6;
    margin-bottom: 0.9rem;
}
.chem-cap-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.chem-cap-list li {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    padding-left: 1.2rem;
    position: relative;
}
.chem-cap-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #00e68c;
    font-weight: 800;
}

/* ── FORMULA SHOWCASE ── */
.chem-formula-showcase {
    background: linear-gradient(135deg, #020f0a, #061510);
    padding: 3rem 0;
    overflow: hidden;
}
.chem-formula-showcase .section-title { color: #ffffff; }

.formula-ticker-wrap {
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}
.formula-ticker {
    display: flex;
    gap: 1rem;
    animation: tickerScroll 30s linear infinite;
    width: max-content;
}
@keyframes tickerScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.formula-ticker-wrap:hover .formula-ticker { animation-play-state: paused; }

.formula-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1.4rem;
    background: rgba(0,230,140,0.07);
    border: 1px solid rgba(0,230,140,0.2);
    border-radius: 12px;
    white-space: nowrap;
    min-width: 160px;
    transition: background 0.2s ease;
}
.formula-chip:hover {
    background: rgba(0,230,140,0.15);
}
.formula-chip-cat {
    font-size: 0.65rem;
    color: #00e68c;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.3rem;
}
.formula-chip-expr {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: #ffffff;
    font-weight: 700;
}

/* ── TRUST ── */
.chem-trust {
    background: #0a1a0e;
    padding: 4rem 0 3rem;
}
.chem-trust .section-title { color: #ffffff; }

.chem-trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.chem-trust-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(0,230,140,0.1);
    border-radius: 16px;
    padding: 1.6rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.chem-trust-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 36px rgba(0,230,140,0.1);
}
.chem-trust-icon { font-size: 1.9rem; display: block; margin-bottom: 0.75rem; }
.chem-trust-item strong {
    display: block;
    color: #ffffff;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}
.chem-trust-item p {
    font-size: 0.83rem;
    color: rgba(255,255,255,0.5);
    margin: 0;
    line-height: 1.5;
}

/* ── CTA ── */
.chem-cta {
    background: linear-gradient(135deg, #00b86b 0%, #00e68c 50%, #00c77a 100%);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}
.chem-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}
.chem-cta-card {
    text-align: center;
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}
.chem-cta-card h2 {
    font-size: 2.2rem;
    color: #020f0a;
    font-weight: 900;
    margin-bottom: 0.75rem;
}
.chem-cta-card p {
    color: rgba(2,15,10,0.7);
    font-size: 1rem;
    margin-bottom: 2rem;
}
.chem-cta-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── BUTTONS OVERRIDE FOR DARK PAGES ── */
.chem-hero .btn-primary,
.chem-cta .btn-primary {
    background: linear-gradient(135deg, #00b86b, #00e68c);
    color: #020f0a;
    border: none;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(0,230,140,0.35);
}
.chem-hero .btn-secondary {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(0,230,140,0.3);
    color: #00e68c;
}
.chem-hero .btn-secondary:hover {
    background: rgba(0,230,140,0.1);
    border-color: #00e68c;
    color: #ffffff;
}
.chem-cta .btn-secondary {
    background: rgba(2,15,10,0.12);
    border: 1px solid rgba(2,15,10,0.4);
    color: #020f0a;
}
.chem-cta .btn-secondary:hover {
    background: rgba(2,15,10,0.25);
}
