/* ============================================================
   hero.css — TypeMaster Pro Hero Banner
   All rules are scoped under .hero so nothing leaks into
   the rest of the site.  Drop alongside style.css.
   ============================================================ */

/* ── CSS custom properties — scoped to .hero ─────────────── */
.hero {
    --hb-bg: #f4f3f0;
    --hb-accent: #4a6cf7;
    --hb-accent-dim: #e8eeff;
    --hb-text-pri: #1a1917;
    --hb-text-sec: #6b6862;
    --hb-text-ter: #9e9a95;
    --hb-key-bg: #ffffff;
    --hb-key-border: rgba(0, 0, 0, 0.09);
    --hb-key-shadow: 0 2px 0 rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    --hb-key-hover-shadow: 0 1px 0 rgba(0, 0, 0, 0.10),
        0 0 0 1px rgba(74, 108, 247, 0.22),
        0 0 14px rgba(74, 108, 247, 0.14);
    --hb-kbd-bg: #eceae6;
    --hb-radius-key: 7px;
}

/* ── Layout ──────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    position: relative;
    background: var(--hb-bg);
    font-family: 'DM Sans', sans-serif;
}

/* noise-texture overlay */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    background-size: 180px;
    pointer-events: none;
    z-index: 0;
}

/* ── LEFT panel ──────────────────────────────────────────── */
.hero .hb-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 64px 80px 72px;
    position: relative;
    z-index: 1;
}

/* badge */
.hero .hb-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--hb-accent-dim);
    color: var(--hb-accent);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 12px 5px 8px;
    border-radius: 100px;
    width: fit-content;
    margin-bottom: 28px;
}

.hero .hb-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--hb-accent);
    border-radius: 50%;
    animation: hbPulse 2s ease-in-out infinite;
}

@keyframes hbPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* heading */
.hero .hb-heading {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(36px, 3.6vw, 54px);
    line-height: 1.12;
    color: var(--hb-text-pri);
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    max-width: 440px;
}

.hero .hb-heading em {
    font-style: italic;
    color: var(--hb-accent);
}

/* subtext */
.hero .hb-subtext {
    font-size: 16px;
    line-height: 1.65;
    color: var(--hb-text-sec);
    font-weight: 400;
    max-width: 380px;
    margin-bottom: 24px;
}

/* ── Typing preview ──────────────────────────────────────── */
.hero .hb-type-preview-wrap {
    margin-bottom: 40px;
    min-height: 52px;
}

.hero .hb-type-label {
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hb-text-ter);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero .hb-type-label-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--hb-accent);
    opacity: 0.5;
    animation: hbLiveDot 1.8s ease-in-out infinite;
}

@keyframes hbLiveDot {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

.hero .hb-type-preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    color: var(--hb-text-sec);
    font-weight: 400;
    letter-spacing: 0.01em;
    min-height: 24px;
    line-height: 1.6;
}

.hero .hb-type-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(4px);
    animation: hbCharIn 0.18s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes hbCharIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero .hb-cursor {
    display: inline-block;
    width: 2px;
    height: 17px;
    background: var(--hb-accent);
    border-radius: 1px;
    animation: hbBlink 1s step-end infinite;
    flex-shrink: 0;
    margin-left: 1px;
    vertical-align: middle;
}

@keyframes hbBlink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0
    }
}

/* ── Buttons ─────────────────────────────────────────────── */
.hero .hb-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero .hb-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--hb-accent);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 14.5px;
    font-weight: 500;
    padding: 13px 26px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px 2px rgba(74, 108, 247, 0.25), 0 4px 12px rgba(74, 108, 247, 0.20);
}

.hero .hb-btn-primary:hover {
    background: #3a5ce0;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(74, 108, 247, 0.30), 0 8px 20px rgba(74, 108, 247, 0.22);
}

.hero .hb-btn-primary:active {
    transform: translateY(0);
}

.hero .hb-btn-primary svg {
    transition: transform 0.18s;
}

.hero .hb-btn-primary:hover svg {
    transform: translateX(3px);
}

.hero .hb-btn-secondary {
    font-family: 'DM Sans', sans-serif;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--hb-text-sec);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.18s;
    letter-spacing: 0.005em;
}

.hero .hb-btn-secondary:hover {
    color: var(--hb-text-pri);
}

.hero .hb-btn-secondary::after {
    content: '→';
    transition: transform 0.18s;
    display: inline-block;
}

.hero .hb-btn-secondary:hover::after {
    transform: translateX(3px);
}

/* ── Stats ───────────────────────────────────────────────── */
.hero .hb-stats {
    display: flex;
    gap: 32px;
    margin-top: 52px;
    padding-top: 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.hero .hb-stat-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hero .hb-stat-val {
    font-family: 'DM Serif Display', serif;
    font-size: 22px;
    color: var(--hb-text-pri);
    letter-spacing: -0.01em;
}

.hero .hb-stat-val small {
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0;
}

.hero .hb-stat-label {
    font-size: 12px;
    color: var(--hb-text-ter);
    font-weight: 400;
}

/* ── RIGHT panel ─────────────────────────────────────────── */
.hero .hb-right {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 40px;
    overflow: hidden;
}

/* orb 1 */
.hero .hb-right::before {
    content: '';
    position: absolute;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(150, 170, 255, 0.18) 0%, transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: hbOrbBreath 9s ease-in-out infinite alternate;
}

/* orb 2 */
.hero .hb-right::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(180, 155, 255, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    top: 30%;
    left: 60%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: hbOrbBreath 13s 2s ease-in-out infinite alternate-reverse;
}

@keyframes hbOrbBreath {
    from {
        transform: translate(-50%, -50%) scale(1);
    }

    to {
        transform: translate(-50%, -50%) scale(1.14) translateY(-16px);
    }
}

/* ── Ambient div-key layer ───────────────────────────────── */
.hero .hb-ambient-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero .hb-amb-key {
    position: absolute;
    border: 1.5px solid rgba(74, 108, 247, 0.11);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 9px;
    font-weight: 500;
    color: rgba(74, 108, 247, 0.40);
    letter-spacing: 0.02em;
    opacity: 0;
    will-change: transform, opacity;
}

/* ── SVG ambient layer ───────────────────────────────────── */
.hero .hb-svg-ambient-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.hero .hb-svg-el {
    position: absolute;
    pointer-events: none;
    line-height: 0;
    transition: color 1.2s ease;
    will-change: transform, opacity;
}

.hero .hb-right.hb-svg-hovered .hb-svg-el {
    color: rgba(74, 108, 247, 0.55) !important;
    transition: color 0.6s ease;
}

/* ── Keyboard scene ──────────────────────────────────────── */
.hero .hb-keyboard-scene {
    perspective: 1000px;
    position: relative;
    z-index: 2;
}

.hero .hb-keyboard-wrap {
    transform: rotateX(14deg) rotateY(-4deg) rotateZ(1.5deg);
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero .hb-keyboard {
    background: var(--hb-kbd-bg);
    border-radius: 16px;
    padding: 14px 14px 18px;
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.9) inset,
        0 40px 80px rgba(0, 0, 0, 0.16),
        0 8px 20px rgba(0, 0, 0, 0.10),
        0 0 0 1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
    user-select: none;
    position: relative;
    overflow: hidden;
}

/* ── Light sweep ─────────────────────────────────────────── */
.hero .hb-light-sweep {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    z-index: 10;
    background: linear-gradient(108deg,
            transparent 25%,
            rgba(255, 255, 255, 0.09) 48%,
            rgba(255, 255, 255, 0.04) 52%,
            transparent 72%);
    background-size: 220% 100%;
    animation: hbSweep 7s ease-in-out infinite;
    pointer-events: none;
}

@keyframes hbSweep {
    0% {
        background-position: 160% 0;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    50% {
        background-position: -60% 0;
        opacity: 1;
    }

    90% {
        opacity: 0;
    }

    100% {
        background-position: 160% 0;
        opacity: 0;
    }
}

/* ── Key rows ────────────────────────────────────────────── */
.hero .hb-key-row {
    display: flex;
    gap: 5px;
    justify-content: center;
}

/* ── Individual key ──────────────────────────────────────── */
.hero .hb-key {
    background: var(--hb-key-bg);
    border-radius: var(--hb-radius-key);
    box-shadow: var(--hb-key-shadow);
    border: 1px solid var(--hb-key-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #3a3835;
    cursor: default;
    transition:
        transform 160ms cubic-bezier(0.34, 1.3, 0.64, 1),
        box-shadow 160ms ease,
        background 160ms ease,
        color 160ms ease;
    position: relative;
    height: 38px;
    min-width: 34px;
    padding: 0 8px;
    letter-spacing: 0.01em;
    will-change: transform;
}

.hero .hb-key::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.75) 0%, transparent 55%);
    pointer-events: none;
}

.hero .hb-key:hover {
    transform: scale(0.95) translateY(1px);
    box-shadow: var(--hb-key-hover-shadow);
    background: #fafbff;
    color: var(--hb-accent);
}

.hero .hb-key.hb-auto-press {
    transform: scale(0.93) translateY(2px) !important;
    box-shadow: 0 0 0 1px rgba(74, 108, 247, 0.22), 0 0 16px rgba(74, 108, 247, 0.14) !important;
    background: #eef1ff !important;
    color: var(--hb-accent) !important;
    transition: transform 70ms ease, box-shadow 70ms ease, background 70ms ease !important;
}

.hero .hb-key.hb-active {
    transform: scale(0.92) translateY(2px);
    box-shadow: 0 0 0 1px rgba(74, 108, 247, 0.30), 0 0 14px rgba(74, 108, 247, 0.18);
    background: #eef0ff;
    color: var(--hb-accent);
    transition-duration: 80ms;
}

/* ── Wide key overrides ──────────────────────────────────── */
.hero .hb-key-tab {
    min-width: 56px;
}

.hero .hb-key-caps {
    min-width: 64px;
}

.hero .hb-key-shift-l {
    min-width: 78px;
}

.hero .hb-key-shift-r {
    min-width: 78px;
}

.hero .hb-key-backsp {
    min-width: 56px;
}

.hero .hb-key-enter {
    min-width: 66px;
    font-size: 14px;
}

.hero .hb-key-space {
    min-width: 200px;
}

.hero .hb-key-fn {
    min-width: 48px;
    font-size: 10px;
    color: var(--hb-text-ter);
}

.hero .hb-key-meta {
    min-width: 48px;
    font-size: 10px;
}

.hero .hb-key-alt {
    min-width: 42px;
    font-size: 10px;
}

.hero .hb-key-ctrl {
    min-width: 42px;
    font-size: 10px;
}

/* ── Entrance animations ─────────────────────────────────── */
@keyframes hbFadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero .hb-left>* {
    animation: hbFadeSlideUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero .hb-badge {
    animation-delay: 0.05s;
}

.hero .hb-heading {
    animation-delay: 0.13s;
}

.hero .hb-subtext {
    animation-delay: 0.20s;
}

.hero .hb-type-preview-wrap {
    animation-delay: 0.26s;
}

.hero .hb-actions {
    animation-delay: 0.32s;
}

.hero .hb-stats {
    animation-delay: 0.40s;
}

/* keyboard float */
@keyframes hbKbFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-7px);
    }
}

.hero .hb-keyboard-scene {
    animation:
        hbFadeSlideUp 0.9s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both,
        hbKbFloat 7s 1.2s ease-in-out infinite;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero .hb-left {
        padding: 60px 40px 40px;
        align-items: center;
        text-align: center;
    }

    .hero .hb-heading,
    .hero .hb-subtext {
        max-width: 100%;
    }

    .hero .hb-type-preview {
        justify-content: center;
    }

    .hero .hb-stats {
        justify-content: center;
    }

    .hero .hb-right {
        padding: 20px 20px 60px;
    }

    .hero .hb-keyboard-wrap {
        transform: rotateX(10deg) rotateY(0) rotateZ(0);
    }
}

@media (max-width: 560px) {
    .hero .hb-key {
        height: 32px;
        min-width: 27px;
        font-size: 10px;
    }

    .hero .hb-key-space {
        min-width: 150px;
    }
}