/* Theme and variables */
:root {
    --bg-900: #071126;
    --bg-800: #081426;
    --blue-600: #06b6d4;
    --blue-500: #0ea5c9;
    --accent: #60a5fa;
    --glass: rgba(255, 255, 255, 0.06);
    --card: rgba(255, 255, 255, 0.03);
    --text: #e6f0f8;
    --muted: #a0b6c8;
}

* {
    box-sizing: border-box;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

html,
body {
    height: 100%;
    /* scroll-behavior: smooth; DOESNT WORK WITH LENIS */
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    color: var(--text);
    background: radial-gradient(1200px 600px at 10% 10%, rgba(6, 182, 212, 0.06), transparent),
        linear-gradient(180deg, var(--bg-900), var(--bg-800));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Snap container for nice full-screen sections */
main.snap-container {
    scroll-snap-type: y proximity;
}

section.section {
    min-height: 70dvh;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 28px;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    overflow: visible
}

/* Sticky navbar with blur */
#topbar.sticky {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 22px;
    background: linear-gradient(180deg, rgba(7, 10, 16, 0.6), rgba(7, 10, 16, 0.35));
    backdrop-filter: blur(10px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.logo {
    height: 34px;
    width: auto;
    display: block
}

.brand-title {
    font-weight: 700;
    color: var(--blue-600);
    letter-spacing: 0.6px
}

.alpha-badge code {
    background: rgba(255, 255, 255, 0.02);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--muted)
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.02)
}

.btn {
    background: linear-gradient(90deg, var(--blue-500), var(--blue-600));
    color: #041024;
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 8px 30px rgba(6, 182, 212, 0.08);
    transition: transform .18s ease, box-shadow .18s ease
}

.btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(6, 182, 212, 0.12)
}

/* Sections themed backgrounds */
section[data-theme="blue"] {
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.06), rgba(6, 20, 36, 0.02));
}

section[data-theme="midblue"] {
    background: linear-gradient(180deg, rgba(6, 146, 201, 0.04), rgba(5, 12, 22, 0.03));
}

section[data-theme="soft"] {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), transparent);
}

section[data-theme="dark"] {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.1));
}

/* Decorative animated gradient overlay */
.section::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(600px 300px at var(--bg-pos, 50%) 20%, rgba(6, 182, 212, 0.07), transparent 30%);
    mix-blend-mode: overlay;
    opacity: 0.9;
    transition: opacity 300ms ease
}

/* Parallax helper */
.parallax {
    will-change: transform
}

/* Typing area & demo styles (kept polished) */
#canvasContainer {
    position: relative;
    width: 100%;
    max-width: 980px;
    height: calc(46px * 3 + 56px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
    border-radius: 14px;
    padding: 28px;
    margin: 24px 0;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(3, 6, 12, 0.6)
}

#typingContent {
    white-space: pre-wrap;
    word-break: break-word;
    padding-right: 20px;
    line-height: 46px;
    font-size: 22px;
    transition: transform 0.08s ease-out;
    will-change: transform
}

#container,
#typing-text,
.word,
.char {
    font-family: "Courier New", Courier, monospace
}

.word {
    display: inline-block
}

.char {
    display: inline-block;
    transition: background-color .1s ease;
    user-select: none
}

.char.correct {
    color: #4CAF50
}

.char.incorrect {
    color: #f44336;
    background-color: rgba(244, 67, 54, 0.08);
    border-bottom: 1px solid rgba(244, 67, 54, 0.12)
}

#caret {
    position: absolute;
    background: var(--blue-600);
    width: 2px;
    transition: left .18s cubic-bezier(.2, .8, .25, 1), top .06s cubic-bezier(.2, .8, .25, 1), height .12s ease;
    will-change: left, top, height;
    pointer-events: none;
    border-radius: 1px
}

@keyframes caretPulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0
    }
}

#caret.idle {
    animation: caretPulse 1.2s ease-in-out infinite
}

#caret.typing {
    animation: none !important;
    opacity: 1 !important
}

.initial-highlight {
    display: inline-block;
    transform-origin: left center;
    transform: scale(1.06);
    color: #fff;
    font-weight: 700
}

.hero-inner {
    display: flex;
    gap: 28px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%
}

.hero-left {
    flex: 1;
    padding-right: 10px
}

.hero-right {
    width: 420px;
    display: flex;
    justify-content: center
}

.svg-wrap {
    position: relative;
    width: 320px;
    height: 220px
}

.blob {
    width: 140px;
    height: 140px;
    position: absolute;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.45))
}

.blob.b1 {
    left: 10px;
    top: 20px;
    animation: bob 4s ease-in-out infinite
}

.blob.b2 {
    right: 10px;
    bottom: 10px;
    width: 90px;
    height: 90px;
    animation: bob 3.2s ease-in-out infinite reverse
}

@keyframes bob {
    0% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-10px)
    }

    100% {
        transform: translateY(0)
    }
}

.countdown {
    margin-top: 12px;
    color: var(--muted);
    font-weight: 700
}

.lead {
    font-size: 1.05rem;
    color: rgba(230, 245, 255, 0.9);
    margin-top: 6px
}

.features {
    margin-top: 12px;
    list-style: disc;
    margin-left: 18px;
    color: var(--muted)
}

.hero-title {
    font-size: 3.4rem;
    margin-bottom: 8px
}

/* make body/generic text slightly bigger on large screens */
@media (min-width:1200px) {
    body {
        font-size: 19px
    }

    .hero-title {
        font-size: 4.2rem
    }
}

.demo-inner {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%
}

.demo-info {
    flex: 1
}

.test-panel {
    flex: 0 0 460px;
    background: var(--card);
    padding: 20px;
    border-radius: 14px
}

/* demo-full: make the test panel wider and more prominent */
.demo-full{
    max-width:1200px;
    margin:18px auto 0;
    width:100%;
    padding:12px;
}
.demo-full .test-panel{flex:1;width:100%;padding:28px;font-size:1.05rem;border-radius:16px}

/* result panel */
.result-panel{position:relative;margin-top:18px;background:linear-gradient(180deg, rgba(6,182,212,0.03), rgba(255,255,255,0.02));padding:18px;border-radius:12px;box-shadow:0 12px 30px rgba(3,6,12,0.45)}
.result-panel[hidden]{display:none}
.results-inner{display:flex;flex-direction:column;gap:12px;align-items:center}
.results-stats{display:flex;flex-direction:column;align-items:center}
.big-wpm{font-size:2.6rem;font-weight:900;color:var(--blue-600)}
.small-meta{color:var(--muted);margin-top:6px}
.results-roast{margin-top:6px;padding:10px 14px;border-radius:10px;background:rgba(255,255,255,0.02);font-weight:700;color:var(--text);text-align:center}
.results-actions{display:flex;gap:10px;margin-top:8px}

/* Footer */
.footer {
    padding: 18px 20px;
    text-align: center;
    color: var(--muted)
}

/* spark canvas sits behind content */
#sparkCanvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.45
}

/* Creators / team cards */
.container.creators {
    max-width: 1200px;
    padding: 6px 12px
}

.creators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    width: 100%
}

.creator-card {
    display: flex;
    gap: 14px;
    align-items: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(3, 6, 12, 0.6);
    backdrop-filter: blur(6px);
    z-index: 5
}

.creator-img {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.04)
}

.creator-meta {
    flex: 1
}

.creator-name {
    display: block;
    color: var(--text);
    font-weight: 800
}

.creator-role {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px
}

.creator-bio {
    margin-top: 8px;
    color: rgba(230, 240, 250, 0.85);
    font-size: 13px
}

/* testers subsection */
.testers-section .container {
    max-width: 980px;
    padding: 6px 18px
}

.muted {
    color: var(--muted);
    margin-top: 6px
}

.testers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px
}

.tester-card {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 12px;
    border-radius: 10px;
    text-align: center;
    color: var(--text);
    font-weight: 700;
    font-size: 14px
}

.tester-card img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.04);
    margin-right: 8px
}

/* reduce default section padding to pack content (handled above) */

/* ensure content sits above spark canvas */
.section>.container,
.hero-inner,
.demo-inner {
    position: relative;
    z-index: 6
}

/* Scroll reveal and in-view */
.section {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 640ms cubic-bezier(.2, .9, .2, 1), transform 640ms cubic-bezier(.2, .9, .2, 1)
}

.section.in-view {
    opacity: 1;
    transform: none
}

/* Layout responsiveness */
@media (max-width:900px) {
    .hero-inner {
        flex-direction: column-reverse;
        align-items: center
    }

    .hero-right {
        width: 100%
    }

    .svg-wrap {
        width: 220px;
        height: 160px
    }

    #canvasContainer {
        height: auto;
        padding: 20px
    }
}

@media (max-width:480px) {
    #topbar.sticky {
        padding: 10px
    }

    .brand-title {
        display: none
    }

    .logo {
        height: 28px
    }

    .btn {
        padding: 8px 12px
    }

    .hero-left {
        padding: 8px
    }
}

a {
    color: var(--accent);
    text-decoration: none;
    transition-duration: 0.4s;
}

a:hover {
    /* text-decoration: underline; */
    color: var(--muted);
}