/* ============================================================
   SplashEdit Website — Styles
   ============================================================ */

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

:root {
    --purple: #7c3aed;
    --purple-light: #a78bfa;
    --purple-dark: #5b21b6;
    --purple-glow: rgba(124, 58, 237, 0.35);
    --amber: #f59e0b;
    --amber-light: #fbbf24;
    --amber-dark: #d97706;
    --amber-glow: rgba(245, 158, 11, 0.25);
    --bg: #0a0a0f;
    --bg-card: #111118;
    --bg-card-hover: #16161f;
    --border: #1e1e2a;
    --border-light: #2a2a3a;
    --text: #e4e4ef;
    --text-dim: #9191a8;
    --text-muted: #6b6b80;
    --white: #ffffff;
    --success: #34d399;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-sm: 8px;
    --nav-height: 72px;
    --container: 1200px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
code { font-family: 'JetBrains Mono', monospace; font-size: 0.9em; }
img { max-width: 100%; display: block; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.95rem;
    transition: all 0.25s ease;
    cursor: pointer; border: none;
    white-space: nowrap;
}
.btn--primary {
    background: var(--purple);
    color: var(--white);
    box-shadow: 0 0 24px var(--purple-glow);
}
.btn--primary:hover {
    background: var(--purple-light);
    box-shadow: 0 0 40px var(--purple-glow);
    transform: translateY(-2px);
}
.btn--outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-light);
}
.btn--outline:hover {
    border-color: var(--purple-light);
    color: var(--purple-light);
    transform: translateY(-2px);
}

/* ---------- Section Header ---------- */
.section-header { text-align: center; margin-bottom: 64px; }
.section-header__label {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.12);
    color: var(--purple-light);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}
.section-header__title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}
.section-header__desc { color: var(--text-dim); max-width: 600px; margin: 0 auto; font-size: 1.1rem; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background 0.3s;
}
.nav__inner {
    max-width: var(--container);
    margin: 0 auto; padding: 0 24px;
    height: 100%;
    display: flex; align-items: center; justify-content: space-between;
}
.nav__logo {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.25rem; color: var(--white);
}
.nav__logo-img { width: 28px; height: 28px; object-fit: contain; }
.nav__logo-icon { color: var(--purple-light); font-size: 0.9em; }
.nav__links {
    display: flex; align-items: center; gap: 32px;
    font-size: 0.9rem; color: var(--text-dim);
}
.nav__links a { transition: color 0.2s; }
.nav__links a:hover { color: var(--white); }
.nav__cta {
    padding: 8px 20px !important;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--purple-light) !important;
    font-weight: 500;
}
.nav__cta:hover { border-color: var(--purple-light); background: rgba(124, 58, 237, 0.08); }
.nav__toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.nav__toggle span { display: block; width: 24px; height: 2px; background: var(--text); transition: all 0.3s; }

@media (max-width: 900px) {
    .nav__links {
        position: fixed; top: var(--nav-height); left: 0; right: 0;
        flex-direction: column; gap: 0;
        background: rgba(10, 10, 15, 0.97);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border);
        padding: 8px 0;
        transform: translateY(-120%);
        transition: transform 0.35s ease;
    }
    .nav__links.active { transform: translateY(0); }
    .nav__links a { padding: 14px 24px; width: 100%; text-align: center; }
    .nav__cta { margin: 8px 24px; width: calc(100% - 48px); text-align: center; justify-content: center; }
    .nav__toggle { display: flex; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    padding: calc(var(--nav-height) + 80px) 24px 80px;
    overflow: hidden;
}
.hero__bg {
    position: absolute; inset: 0; z-index: 0;
    pointer-events: none;
}
.hero__grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}
.hero__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
}
.hero__glow--purple {
    width: 600px; height: 600px;
    background: var(--purple);
    top: -10%; left: 20%;
    opacity: 0.15;
    animation: float 8s ease-in-out infinite;
}
.hero__glow--amber {
    width: 400px; height: 400px;
    background: var(--amber);
    bottom: 5%; right: 15%;
    opacity: 0.08;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -20px); }
}

.hero__inner {
    position: relative; z-index: 1;
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero__content {
    text-align: center; max-width: 720px;
}
.hero__badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: var(--purple-light);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease both;
}
.hero__title {
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease 0.1s both;
}
.hero__accent {
    background: linear-gradient(135deg, var(--purple-light), var(--amber-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero__subtitle {
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: var(--text-dim);
    max-width: 540px;
    margin: 0 auto 40px;
    animation: fadeInUp 0.6s ease 0.2s both;
}
.hero__actions {
    display: flex; gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 48px;
    animation: fadeInUp 0.6s ease 0.3s both;
}
.hero__stats {
    display: flex; align-items: center; gap: 32px;
    justify-content: center;
    animation: fadeInUp 0.6s ease 0.4s both;
}
.hero__stat { text-align: center; }
.hero__stat-value { display: block; font-size: 1.2rem; font-weight: 700; color: var(--white); }
.hero__stat-label { font-size: 0.8rem; color: var(--text-muted); }
.hero__stat-divider { width: 1px; height: 36px; background: var(--border-light); }

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

/* Hero Compare Slider */
.hero__compare {
    width: 100%;
    max-width: 900px;
    margin-top: 56px;
    animation: fadeInUp 0.8s ease 0.5s both;
}

@media (max-width: 900px) {
    .hero__content { max-width: 100%; }
    .hero__compare { margin-top: 40px; }
}

/* ---------- Terminal ---------- */
.terminal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.terminal__bar {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
}
.terminal__dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal__dot--red { background: #ff5f57; }
.terminal__dot--yellow { background: #febc2e; }
.terminal__dot--green { background: #28c840; }
.terminal__title { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.terminal__body { padding: 20px; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; }
.terminal__line { display: flex; align-items: center; gap: 10px; padding: 4px 0; opacity: 0; animation: termLine 0.4s ease forwards; }
.terminal__line[data-delay="0"]   { animation-delay: 0.8s; }
.terminal__line[data-delay="400"] { animation-delay: 1.2s; }
.terminal__line[data-delay="800"] { animation-delay: 1.6s; }
.terminal__line[data-delay="1200"]{ animation-delay: 2.0s; }
.terminal__line[data-delay="1800"]{ animation-delay: 2.6s; }
.terminal__prompt { color: var(--purple-light); }
.terminal__arrow { color: var(--text-muted); }
.terminal__check { color: var(--success); }
.terminal__text { color: var(--text); }
.terminal__text--dim { color: var(--text-dim); }
.terminal__text--accent { color: var(--amber-light); }
.terminal__text--success { color: var(--success); }

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

/* Code terminal */
.terminal--code .terminal__body,
.terminal__body--code { padding: 20px 24px; }
.terminal--code pre,
.terminal__body--code pre { margin: 0; white-space: pre; overflow-x: auto; }
.terminal--code code,
.terminal__body--code code { font-size: 0.85rem; line-height: 1.8; color: var(--text); }
.code-kw { color: var(--purple-light); }
.code-fn { color: var(--amber-light); }
.code-str { color: var(--success); }
.code-num { color: #f472b6; }
.code-bool { color: #f472b6; }
.code-comment { color: var(--text-muted); font-style: italic; }

/* ============================================================
   COMPARISON SLIDER
   ============================================================ */
.compare { padding: 80px 0 120px; }
.compare__wrapper { max-width: 900px; margin: 0 auto; }
.compare__slider {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 16px 60px rgba(0,0,0,0.4);
    background: var(--bg-card);
}
.compare__side { position: absolute; inset: 0; }
.compare__side img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.compare__side--before { z-index: 2; clip-path: inset(0 50% 0 0); }
.compare__side--after { z-index: 1; }
.compare__label {
    position: absolute;
    top: 16px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 5;
    pointer-events: none;
}
.compare__label--before {
    left: 16px;
    background: rgba(124, 58, 237, 0.8);
    color: var(--white);
    backdrop-filter: blur(8px);
}
.compare__label--after {
    right: 16px;
    background: rgba(245, 158, 11, 0.8);
    color: var(--white);
    backdrop-filter: blur(8px);
}
.compare__handle {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    width: 4px;
}
.compare__handle-line {
    flex: 1;
    width: 2px;
    background: var(--white);
    opacity: 0.8;
    box-shadow: 0 0 8px rgba(0,0,0,0.5);
}
.compare__handle-grip {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--white);
    display: flex; align-items: center; justify-content: center;
    gap: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    flex-shrink: 0;
    pointer-events: auto;
    color: var(--bg);
}
.compare__handle-grip svg { margin: -3px; }
.compare__hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 16px;
}

/* Placeholder state before images are added */
.compare__side--before::after,
.compare__side--after::after {
    content: '';
    position: absolute; inset: 0;
    z-index: -1;
}

/* ============================================================
   ARCHITECTURE
   ============================================================ */
.arch { padding: 120px 0; }
.arch__cards {
    display: flex; align-items: center; gap: 24px;
    justify-content: center;
}
.arch__card {
    flex: 1; max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.arch__card:hover {
    border-color: var(--border-light);
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.arch__card h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 12px; color: var(--white); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.arch__card p { color: var(--text-dim); margin-bottom: 20px; }
.arch__card-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}
.arch__card-icon--purple { background: rgba(124, 58, 237, 0.12); color: var(--purple-light); }
.arch__card-icon--amber { background: rgba(245, 158, 11, 0.12); color: var(--amber-light); }
.arch__card-tag {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--text-dim);
    font-weight: 500;
}
.arch__list {
    list-style: none; margin-bottom: 24px;
}
.arch__list li {
    padding: 6px 0 6px 20px;
    position: relative;
    color: var(--text-dim);
    font-size: 0.9rem;
}
.arch__list li::before {
    content: '→';
    position: absolute; left: 0;
    color: var(--purple-light);
}
.arch__link {
    color: var(--purple-light);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.arch__link:hover { color: var(--white); }
.arch__arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .arch__cards { flex-direction: column; }
    .arch__arrow { transform: rotate(90deg); }
}

/* ============================================================
   FEATURES
   ============================================================ */
.features {
    padding: 120px 0;
    background: linear-gradient(180deg, transparent 0%, rgba(124, 58, 237, 0.03) 50%, transparent 100%);
}
.features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: all 0.3s ease;
}
.feature-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.feature-card__icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(124, 58, 237, 0.08);
    display: flex; align-items: center; justify-content: center;
    color: var(--purple-light);
    margin-bottom: 20px;
    transition: background 0.3s;
}
.feature-card:hover .feature-card__icon { background: rgba(124, 58, 237, 0.15); }
.feature-card h3 {
    font-size: 1.1rem; font-weight: 700;
    margin-bottom: 8px; color: var(--white);
}
.feature-card p { font-size: 0.9rem; color: var(--text-dim); line-height: 1.6; }

/* ============================================================
   LUA SHOWCASE
   ============================================================ */
.lua { padding: 120px 0; }
.lua__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}
.lua__info { text-align: left; }
.lua__info .section-header__label { display: inline-block; }
.lua__info .section-header__title { text-align: left; }
.lua__info p { color: var(--text-dim); margin-bottom: 24px; font-size: 1.05rem; }
.lua__apis { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.lua__api-tag {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.15);
    color: var(--purple-light);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}
.lua__code { position: relative; }

@media (max-width: 900px) {
    .lua__layout { grid-template-columns: 1fr; gap: 40px; }
    .lua__info .section-header__title { text-align: left; }
}

/* ============================================================
   GET STARTED
   ============================================================ */
.start {
    padding: 120px 0;
    background: linear-gradient(180deg, transparent 0%, rgba(245, 158, 11, 0.03) 50%, transparent 100%);
}
.start__steps {
    max-width: 700px;
    margin: 0 auto 48px;
}
.start__step {
    display: flex; gap: 24px; align-items: flex-start;
    padding: 24px 0;
    position: relative;
}
.start__step::after {
    content: '';
    position: absolute;
    left: 23px; top: 72px; bottom: -24px;
    width: 2px;
    background: var(--border);
}
.start__step:last-child::after { display: none; }
.start__step-num {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: var(--purple-light);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.start__step-content h3 {
    font-size: 1.1rem; font-weight: 700;
    color: var(--white); margin-bottom: 6px;
}
.start__step-content p { color: var(--text-dim); font-size: 0.95rem; }
.start__step-content code {
    background: rgba(124,58,237,0.1);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--purple-light);
    font-size: 0.85rem;
}
.start__cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   PLATFORMS
   ============================================================ */
.platforms { padding: 80px 0; }
.platforms__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.platform-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
    transition: all 0.3s;
}
.platform-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
}
.platform-card__icon {
    color: var(--amber-light);
    margin-bottom: 20px;
    display: flex; justify-content: center;
}
.platform-card h3 { font-size: 1.2rem; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.platform-card p { color: var(--text-dim); font-size: 0.9rem; }
.platform-card code {
    background: rgba(245,158,11,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--amber-light);
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .platforms__grid { grid-template-columns: 1fr; }
}

/* ============================================================
   COMMUNITY
   ============================================================ */
.community {
    padding: 120px 0;
    background: linear-gradient(180deg, transparent, rgba(124,58,237,0.04) 50%, transparent);
}
.community__content { text-align: center; }
.community__content .section-header__desc { margin-bottom: 48px; }
.community__links {
    display: flex; gap: 20px;
    justify-content: center; flex-wrap: wrap;
    max-width: 900px; margin: 0 auto;
}
.community__link {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 32px;
    min-width: 240px;
    text-align: left;
    transition: all 0.3s;
}
.community__link:hover {
    border-color: var(--purple-light);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.community__link svg { flex-shrink: 0; color: var(--purple-light); }
.community__link strong { display: block; color: var(--white); font-size: 1rem; }
.community__link span { color: var(--text-dim); font-size: 0.85rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}
.footer__inner {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
}
.footer__brand { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; color: var(--white); }
.footer__copy { color: var(--text-muted); font-size: 0.85rem; }
.footer__links { display: flex; gap: 24px; }
.footer__links a { color: var(--text-dim); font-size: 0.85rem; transition: color 0.2s; }
.footer__links a:hover { color: var(--white); }

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   RESPONSIVE POLISH
   ============================================================ */
@media (max-width: 600px) {
    .hero__stats { flex-direction: column; gap: 16px; }
    .hero__stat-divider { width: 40px; height: 1px; }
    .hero__terminal { margin-top: 40px; }
    .features__grid { grid-template-columns: 1fr; }
}
