/**
 * style.css — Ruby Prism marketing site
 * Crystal cave theme: deep crimson, gold, midnight navy
 */

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

:root {
    --black:       #1a0a0d;
    --crimson:     #c8405a;
    --crimson-bright: #e04a66;
    --gold:        #d4a017;
    --gold-bright: #f0c040;
    --navy:        #0a1a35;
    --navy-light:  #142850;
    --prism-blue:  #85B7EB;
    --cream:       #E8D5B0;
    --cream-dim:   #b0a088;
    --white:       #f0e8dc;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--black);
    color: var(--cream);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', Georgia, serif;
    color: var(--white);
    line-height: 1.2;
}

a {
    color: var(--prism-blue);
    text-decoration: none;
}

a:hover {
    color: var(--gold);
}

img, svg {
    display: block;
    max-width: 100%;
}

/* ── Scroll Animations ────────────────────────────────────────────────────── */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }

/* ── Navigation ───────────────────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
    background: rgba(26, 10, 13, 0.92);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--crimson);
    text-decoration: none;
}

.nav-logo svg {
    width: 32px;
    height: 32px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--cream);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--gold);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--crimson);
    color: var(--white) !important;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s, transform 0.15s;
}

.nav-cta:hover {
    background: var(--crimson-bright);
    color: var(--white) !important;
    transform: translateY(-1px);
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--cream);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Hero Section ─────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 60px;
    overflow: hidden;
}

/* Crystal cave background — CSS/SVG art */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 80%, rgba(200, 64, 90, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 30%, rgba(133, 183, 235, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 40% 40% at 50% 10%, rgba(212, 160, 23, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 100% 80% at 50% 100%, rgba(10, 26, 53, 0.9) 0%, transparent 70%),
        linear-gradient(180deg, #0d0510 0%, #0a1a35 40%, #1a0a0d 100%);
    z-index: 0;
}

/* Floating gem facets */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle 3px at 15% 20%, rgba(200, 64, 90, 0.3) 0%, transparent 100%),
        radial-gradient(circle 2px at 75% 15%, rgba(212, 160, 23, 0.4) 0%, transparent 100%),
        radial-gradient(circle 4px at 35% 60%, rgba(133, 183, 235, 0.25) 0%, transparent 100%),
        radial-gradient(circle 2px at 85% 55%, rgba(200, 64, 90, 0.35) 0%, transparent 100%),
        radial-gradient(circle 3px at 50% 40%, rgba(212, 160, 23, 0.2) 0%, transparent 100%),
        radial-gradient(circle 2px at 25% 85%, rgba(133, 183, 235, 0.3) 0%, transparent 100%),
        radial-gradient(circle 3px at 65% 75%, rgba(200, 64, 90, 0.2) 0%, transparent 100%),
        radial-gradient(circle 2px at 90% 90%, rgba(212, 160, 23, 0.25) 0%, transparent 100%),
        radial-gradient(circle 3px at 10% 50%, rgba(133, 183, 235, 0.2) 0%, transparent 100%),
        radial-gradient(circle 2px at 45% 10%, rgba(200, 64, 90, 0.3) 0%, transparent 100%);
    animation: floatParticles 20s ease-in-out infinite;
    z-index: 0;
}

@keyframes floatParticles {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.8; }
    25% { transform: translateY(-10px) scale(1.02); opacity: 1; }
    50% { transform: translateY(5px) scale(0.98); opacity: 0.9; }
    75% { transform: translateY(-5px) scale(1.01); opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 700px;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--crimson-bright), var(--gold-bright), var(--crimson));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--cream-dim);
    margin-bottom: 36px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--crimson), var(--crimson-bright));
    color: var(--white);
    box-shadow: 0 4px 20px rgba(200, 64, 90, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 30px rgba(200, 64, 90, 0.45);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--cream);
    border: 1px solid rgba(200, 64, 90, 0.4);
}

.btn-ghost:hover {
    border-color: var(--crimson);
    background: rgba(200, 64, 90, 0.1);
    color: var(--cream);
}

/* ── Demo Game Canvas ─────────────────────────────────────────────────────── */
.demo-container {
    position: relative;
    z-index: 1;
    margin-top: 20px;
}

.demo-label {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.demo-canvas-wrap {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 26, 53, 0.4);
    border: 1px solid rgba(200, 64, 90, 0.2);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(200, 64, 90, 0.05);
}

#demo-board {
    border: 2px solid rgba(133, 183, 235, 0.3);
    border-radius: 8px;
    cursor: pointer;
}

/* ── Section Shared ───────────────────────────────────────────────────────── */
.section {
    padding: 100px 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.section-label {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin-bottom: 16px;
}

.section-desc {
    color: var(--cream-dim);
    font-size: 1.05rem;
    max-width: 560px;
    margin-bottom: 48px;
}

/* ── How It Works ─────────────────────────────────────────────────────────── */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.step {
    text-align: center;
    padding: 32px 24px;
    border-radius: 12px;
    background: rgba(10, 26, 53, 0.3);
    border: 1px solid rgba(212, 160, 23, 0.1);
    transition: border-color 0.3s, transform 0.3s;
}

.step:hover {
    border-color: rgba(212, 160, 23, 0.3);
    transform: translateY(-4px);
}

.step-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.step h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--gold);
}

.step p {
    color: var(--cream-dim);
    font-size: 0.95rem;
}

/* ── Features ─────────────────────────────────────────────────────────────── */
.features-section {
    background: linear-gradient(180deg, var(--black) 0%, var(--navy) 50%, var(--black) 100%);
}

.features-section .section {
    padding-top: 80px;
    padding-bottom: 80px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 32px;
    border-radius: 12px;
    background: rgba(26, 10, 13, 0.6);
    border: 1px solid rgba(200, 64, 90, 0.12);
    transition: border-color 0.3s, transform 0.3s;
}

.feature-card:hover {
    border-color: rgba(200, 64, 90, 0.3);
    transform: translateY(-3px);
}

.feature-gems {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.feature-gems svg {
    width: 36px;
    height: 36px;
}

.feature-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: var(--crimson-bright);
}

.feature-card p {
    color: var(--cream-dim);
    font-size: 0.95rem;
}

/* ── Leaderboard Teaser ───────────────────────────────────────────────────── */
.lb-teaser {
    text-align: center;
}

.lb-table {
    max-width: 600px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(212, 160, 23, 0.15);
}

.lb-table-header {
    display: grid;
    grid-template-columns: 60px 1fr 120px;
    padding: 12px 20px;
    background: rgba(212, 160, 23, 0.08);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cream-dim);
}

.lb-row {
    display: grid;
    grid-template-columns: 60px 1fr 120px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
}

.lb-row:hover {
    background: rgba(200, 64, 90, 0.06);
}

.lb-rank {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
}

.lb-rank.gold   { color: var(--gold-bright); }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }

.lb-name-cell {
    text-align: left;
    font-weight: 500;
}

.lb-score-cell {
    text-align: right;
    font-weight: 600;
    color: var(--prism-blue);
}

.lb-rank-badge {
    font-size: 0.7rem;
    color: var(--cream-dim);
    display: block;
}

.lb-cta {
    margin-top: 32px;
}

/* ── Fortune Quotes ───────────────────────────────────────────────────────── */
.quotes-section {
    padding: 60px 24px;
    text-align: center;
    background: linear-gradient(90deg, var(--navy), var(--black), var(--navy));
    border-top: 1px solid rgba(200, 64, 90, 0.08);
    border-bottom: 1px solid rgba(200, 64, 90, 0.08);
}

.quotes-carousel {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quote {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--cream);
    font-style: italic;
    transition: opacity 0.5s ease;
    max-width: 600px;
    line-height: 1.5;
}

.quote.fade-out {
    opacity: 0;
}

.quote.fade-in-quote {
    opacity: 1;
}

/* ── About / Story ────────────────────────────────────────────────────────── */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.about-text h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin-bottom: 20px;
}

.about-text p {
    color: var(--cream-dim);
    font-size: 1rem;
    margin-bottom: 16px;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-illustration svg {
    width: 100%;
    max-width: 320px;
    height: auto;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
    background: linear-gradient(180deg, var(--black), #0d0510);
    padding: 60px 24px 0;
    border-top: 1px solid rgba(200, 64, 90, 0.08);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-brand p {
    color: var(--cream-dim);
    font-size: 0.9rem;
    margin-top: 12px;
    max-width: 280px;
}

.footer-col h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    color: var(--cream-dim);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--cream);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 20px 24px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--cream-dim);
    max-width: 1100px;
    margin: 0 auto;
}

.footer-bottom a {
    color: var(--cream-dim);
    margin: 0 8px;
}

/* ── Legal Pages ──────────────────────────────────────────────────────────── */
.legal-page {
    padding: 120px 24px 80px;
    max-width: 720px;
    margin: 0 auto;
}

.legal-page h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    margin-bottom: 8px;
    color: var(--crimson-bright);
}

.legal-page .legal-date {
    font-size: 0.85rem;
    color: var(--cream-dim);
    margin-bottom: 40px;
}

.legal-page h2 {
    font-size: 1.3rem;
    margin-top: 40px;
    margin-bottom: 12px;
    color: var(--gold);
}

.legal-page p {
    color: var(--cream-dim);
    font-size: 0.95rem;
    margin-bottom: 12px;
    line-height: 1.7;
}

/* ── Contact Page ─────────────────────────────────────────────────────────── */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 48px;
    align-items: start;
    padding: 120px 24px 80px;
    max-width: 900px;
    margin: 0 auto;
}

.contact-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 120px;
}

.contact-illustration svg {
    width: 100%;
    max-width: 280px;
}

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

.contact-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cream);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(10, 26, 53, 0.4);
    border: 1px solid rgba(200, 64, 90, 0.2);
    border-radius: 8px;
    color: var(--cream);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--crimson);
    box-shadow: 0 0 12px rgba(200, 64, 90, 0.15);
}

.contact-form textarea {
    min-height: 140px;
    resize: vertical;
}

.contact-note {
    font-size: 0.9rem;
    color: var(--cream-dim);
    font-style: italic;
    margin-top: 8px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100vh;
        background: rgba(10, 26, 53, 0.97);
        flex-direction: column;
        padding: 80px 32px 32px;
        gap: 24px;
        transition: right 0.3s ease;
    }

    .nav-links.open {
        right: 0;
    }

    .nav-hamburger {
        display: flex;
        z-index: 1001;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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

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

    .about-illustration {
        order: -1;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

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

    .contact-illustration {
        position: static;
        margin-bottom: 32px;
    }

    .lb-table-header,
    .lb-row {
        grid-template-columns: 40px 1fr 80px;
        padding: 10px 14px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero-ctas {
        flex-direction: column;
        align-items: stretch;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }

    .btn {
        justify-content: center;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }
}
