/* =========================================================
   TYPING FOR BEGINNERS
   PROFESSIONAL CSS
========================================================= */

:root {

    --primary: #2563eb;
    --primary-dark: #1d4ed8;

    --secondary: #6366f1;

    --success: #16a34a;

    --danger: #dc2626;

    --dark: #172033;
    --text: #334155;

    --muted: #64748b;
    --light: #94a3b8;

    --background: #f5f7fb;
    --white: #ffffff;

    --border: #e2e8f0;

    --blue-light: #eff6ff;
    --green-light: #f0fdf4;
    --red-light: #fef2f2;

    --shadow:
        0 10px 30px rgba(15, 23, 42, 0.07);

    --radius: 12px;
    --radius-large: 18px;

}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html {
    scroll-behavior: smooth;
}


body {

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: var(--background);

    color: var(--text);

    line-height: 1.6;

}


button,
textarea {
    font-family: inherit;
}


button {
    cursor: pointer;
}


button:focus-visible,
textarea:focus-visible {

    outline:
        3px solid
        rgba(37, 99, 235, .2);

    outline-offset: 2px;

}


/* =========================================================
   HEADER
========================================================= */

.header {

    background: var(--white);

    border-bottom:
        1px solid var(--border);

}


.header-inner {

    width:
        min(1150px, calc(100% - 30px));

    min-height: 72px;

    margin: auto;

    display: flex;

    align-items: center;

    justify-content: space-between;

}


.brand {

    display: flex;

    align-items: center;

    gap: 11px;

}


.brand-icon {

    width: 44px;
    height: 44px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: white;

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );

    font-size: 22px;

}


.brand h1 {

    color: var(--dark);

    font-size: 19px;

    line-height: 1.1;

}


.brand p {

    margin-top: 2px;

    color: var(--light);

    font-size: 9px;

    text-transform: uppercase;

    letter-spacing: .6px;

}


.beginner-label {

    padding:
        6px 12px;

    border-radius: 30px;

    color: var(--primary);

    background: var(--blue-light);

    border:
        1px solid #dbeafe;

    font-size: 9px;

    font-weight: 800;

}


/* =========================================================
   CONTAINER
========================================================= */

.container {

    width:
        min(1100px, calc(100% - 30px));

    margin: auto;

}


/* =========================================================
   INTRO
========================================================= */

.intro {

    padding:
        55px 10px 35px;

    text-align: center;

}


.intro-label,
.section-label {

    color: var(--primary);

    font-size: 8px;

    font-weight: 800;

    letter-spacing: 1px;

}


.intro h2 {

    margin-top: 8px;

    color: var(--dark);

    font-size:
        clamp(34px, 5vw, 50px);

    line-height: 1.1;

    letter-spacing: -1px;

}


.intro p {

    max-width: 680px;

    margin:
        13px auto 0;

    color: var(--muted);

    font-size: 13px;

}


/* =========================================================
   LESSON NAVIGATION
========================================================= */

.lesson-navigation {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 9px;

    margin-bottom: 20px;

}


.lesson-btn {

    min-height: 68px;

    padding: 10px;

    display: flex;

    align-items: center;

    gap: 10px;

    text-align: left;

    color: var(--dark);

    background: var(--white);

    border:
        1px solid var(--border);

    border-radius: 11px;

    transition: .2s ease;

}


.lesson-btn:hover {

    border-color: #bfdbfe;

    transform: translateY(-1px);

}


.lesson-btn.active {

    color: white;

    background: var(--primary);

    border-color: var(--primary);

}


.lesson-number {

    width: 34px;
    height: 34px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    color: var(--primary);

    background: var(--blue-light);

    border-radius: 8px;

    font-size: 10px;

    font-weight: 800;

}


.lesson-btn.active
.lesson-number {

    color: white;

    background:
        rgba(255,255,255,.18);

}


.lesson-btn strong {

    display: block;

    font-size: 11px;

}


.lesson-btn small {

    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 8px;

}


.lesson-btn.active small {

    color: #dbeafe;

}


/* =========================================================
   LESSON CARD
========================================================= */

.lesson-card {

    display: grid;

    grid-template-columns:
        1.2fr 1fr;

    gap: 20px;

    padding: 27px;

    background: var(--white);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

    box-shadow: var(--shadow);

}


.lesson-label {

    color: var(--primary);

    font-size: 8px;

    font-weight: 800;

    letter-spacing: 1px;

}


.lesson-content h2 {

    margin-top: 5px;

    color: var(--dark);

    font-size: 27px;

}


.lesson-description {

    margin-top: 10px;

    color: var(--muted);

    font-size: 13px;

}


.lesson-tip {

    margin-top: 17px;

    padding: 13px;

    background: var(--blue-light);

    border:
        1px solid #dbeafe;

    border-radius: 9px;

}


.lesson-tip strong {

    color: var(--primary);

    font-size: 10px;

}


.lesson-tip p {

    margin-top: 3px;

    color: var(--muted);

    font-size: 10px;

}


.lesson-keys {

    display: flex;

    flex-wrap: wrap;

    gap: 6px;

    margin-top: 17px;

}


.lesson-keys span {

    min-width: 38px;

    padding:
        7px 10px;

    text-align: center;

    color: var(--dark);

    background: #f1f5f9;

    border:
        1px solid var(--border);

    border-radius: 7px;

    font-family: monospace;

    font-weight: 800;

}


/* =========================================================
   HAND CARD
========================================================= */

.hand-card {

    padding: 18px;

    background: #f8fafc;

    border:
        1px solid var(--border);

    border-radius: 12px;

}


.hand-card-title {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

}


.hand-card-title h3 {

    font-size: 15px;

}


.hand-card-title p {

    color: var(--muted);

    font-size: 9px;

}


.hand-card-title span {

    padding:
        5px 8px;

    color: var(--primary);

    background: var(--blue-light);

    border-radius: 6px;

    font-size: 7px;

    font-weight: 800;

}


.hands {

    display: flex;

    flex-direction: column;

    gap: 9px;

    margin-top: 14px;

}


.hand {

    padding: 10px;

    background: white;

    border:
        1px solid var(--border);

    border-radius: 8px;

}


.hand > strong {

    color: var(--muted);

    font-size: 8px;

    letter-spacing: .7px;

}


.finger-row {

    display: flex;

    gap: 5px;

    margin-top: 7px;

}


.finger {

    flex: 1;

    padding: 7px 2px;

    text-align: center;

    background: var(--blue-light);

    border-radius: 6px;

    transition: .15s ease;

}


.finger b {

    display: block;

    color: var(--primary);

    font-family: monospace;

    font-size: 8px;

}


.finger small {

    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 7px;

}


.finger.active {

    color: white;

    background: var(--primary);

    transform: translateY(-2px);

    box-shadow:
        0 5px 15px
        rgba(37,99,235,.2);

}


.finger.active b,
.finger.active small {

    color: white;

}


.thumb-guide {

    display: flex;

    align-items: center;

    gap: 8px;

    margin-top: 10px;

    padding: 9px;

    background: white;

    border:
        1px solid var(--border);

    border-radius: 8px;

}


.thumb-guide > span {

    width: 30px;
    height: 30px;

    display: flex;

    align-items: center;
    justify-content: center;

    background: var(--green-light);

    border-radius: 7px;

}


.thumb-guide strong {

    display: block;

    font-size: 9px;

}


.thumb-guide p {

    color: var(--muted);

    font-size: 8px;

}


/* =========================================================
   KEY INFORMATION
========================================================= */

.key-information {

    margin-top: 25px;

    padding: 20px 25px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    background: white;

    border:
        1px solid var(--border);

    border-radius: var(--radius-large);

}


.key-information h2 {

    margin-top: 3px;

    color: var(--dark);

    font-size: 19px;

}


.key-information p {

    color: var(--muted);

    font-size: 10px;

}


.selected-key {

    min-width: 190px;

    padding: 13px;

    text-align: center;

    background: var(--blue-light);

    border:
        1px solid #dbeafe;

    border-radius: 10px;

}


.selected-key span {

    display: block;

    color: var(--muted);

    font-size: 7px;

    font-weight: 800;

}


.selected-key strong {

    display: block;

    margin: 2px 0;

    color: var(--primary);

    font-size: 27px;

}


.selected-key small {

    color: var(--muted);

    font-size: 8px;

}


/* =========================================================
   KEYBOARD
========================================================= */

.keyboard-section {

    margin-top: 20px;

    padding: 25px;

    background: white;

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

}


.keyboard-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

}


.keyboard-header h2 {

    margin-top: 3px;

    color: var(--dark);

    font-size: 20px;

}


.keyboard-header p {

    color: var(--muted);

    font-size: 10px;

}


.keyboard-mode {

    padding:
        7px 10px;

    color: var(--primary);

    background: var(--blue-light);

    border-radius: 6px;

    font-size: 8px;

    font-weight: 800;

}


.keyboard-container {

    margin-top: 19px;

    padding: 15px;

    overflow-x: auto;

    background: #dbe2ea;

    border-radius: 12px;

}


.keyboard {

    min-width: 650px;

}


.keyboard-row {

    display: flex;

    justify-content: center;

    gap: 5px;

    margin-bottom: 5px;

}


.key {

    width: 49px;
    height: 45px;

    flex: 0 0 49px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: var(--dark);

    background: white;

    border:
        1px solid #cbd5e1;

    border-radius: 6px;

    box-shadow:
        0 3px 0 #cbd5e1;

    font-size: 11px;

    font-weight: 800;

    transition:
        transform .12s ease,
        background .12s ease,
        box-shadow .12s ease;

}


.key:hover {

    background: #f8fafc;

}


/* Current lesson keys */

.key.lesson-key {

    color: var(--primary);

    background: #dbeafe;

    border-color: #93c5fd;

}


/* Currently selected key */

.key.selected {

    color: white;

    background: var(--primary);

    border-color: var(--primary);

    box-shadow:
        0 4px 10px
        rgba(37,99,235,.25);

}


/* Press animation */

.key.pressed {

    transform:
        translateY(4px)
        scale(.97);

    box-shadow:
        0 0 0 #cbd5e1;

    background: #dbeafe;

}


.key.wrong-press {

    background: #fee2e2;

    border-color: var(--danger);

}


.number {

    color: #64748b;

}


.home-row {

    margin-left: 17px;
    margin-right: 17px;

}


.bottom-row {

    margin-left: 27px;
    margin-right: 27px;

}


.special-row {

    margin-top: 7px;

}


.special-key {

    min-width: 100px;
    height: 39px;

    padding:
        0 16px;

    color: var(--dark);

    background: white;

    border:
        1px solid #cbd5e1;

    border-radius: 6px;

    box-shadow:
        0 3px 0 #cbd5e1;

    font-size: 9px;

    font-weight: 800;

    transition: .12s ease;

}


.special-key:hover {

    background: #f8fafc;

}


.special-key.pressed {

    transform:
        translateY(4px);

    box-shadow:
        0 0 0 #cbd5e1;

    background: #dbeafe;

}


/* =========================================================
   KEYBOARD LEGEND
========================================================= */

.keyboard-legend {

    display: flex;

    flex-wrap: wrap;

    gap: 15px;

    margin-top: 12px;

    color: var(--muted);

    font-size: 8px;

}


.keyboard-legend span {

    display: flex;

    align-items: center;

    gap: 5px;

}


.keyboard-legend i {

    width: 10px;
    height: 10px;

    display: inline-block;

    border-radius: 3px;

}


.legend-active {

    background: #dbeafe;

    border:
        1px solid #93c5fd;

}


.legend-pressed {

    background: var(--primary);

}


.legend-finger {

    background: #f0fdf4;

    border:
        1px solid #bbf7d0;

}


/* =========================================================
   LIVE TYPING
========================================================= */

.typing-practice {

    margin-top: 25px;

    padding: 25px;

    background: white;

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

    box-shadow: var(--shadow);

}


.practice-heading {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 15px;

}


.practice-heading h2 {

    margin-top: 3px;

    color: var(--dark);

    font-size: 21px;

}


.practice-heading p {

    color: var(--muted);

    font-size: 10px;

}


.clear-button {

    padding:
        9px 14px;

    color: var(--dark);

    background: white;

    border:
        1px solid var(--border);

    border-radius: 7px;

    font-size: 9px;

    font-weight: 800;

}


.clear-button:hover {

    color: var(--danger);

    border-color: #fecaca;

}


/* =========================================================
   TYPING BOX
========================================================= */

.typing-box-wrapper {

    margin-top: 18px;

    overflow: hidden;

    border:
        1px solid var(--border);

    border-radius: 10px;

}


.typing-box-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding:
        10px 13px;

    background: #f8fafc;

    border-bottom:
        1px solid var(--border);

}


.typing-box-header strong {

    font-size: 10px;

}


.typing-box-header span {

    color: var(--muted);

    font-size: 8px;

}


#liveTyping {

    width: 100%;

    min-height: 180px;

    padding: 17px;

    resize: vertical;

    border: none;

    outline: none;

    color: var(--dark);

    background: white;

    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 15px;

    line-height: 1.8;

}


.typing-box-footer {

    display: flex;

    flex-wrap: wrap;

    gap: 15px;

    padding:
        8px 13px;

    color: var(--muted);

    background: #f8fafc;

    border-top:
        1px solid var(--border);

    font-size: 8px;

}


/* =========================================================
   CURRENT KEY GUIDE
========================================================= */

.current-key-guide {

    display: flex;

    align-items: center;

    gap: 10px;

    margin-top: 12px;

    padding: 11px;

    background: var(--blue-light);

    border:
        1px solid #dbeafe;

    border-radius: 8px;

}


.current-key-icon {

    width: 35px;
    height: 35px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: white;

    background: var(--primary);

    border-radius: 8px;

}


.current-key-guide strong {

    display: block;

    color: var(--dark);

    font-size: 10px;

}


.current-key-guide p {

    color: var(--muted);

    font-size: 8px;

}


/* =========================================================
   SIMPLE PRACTICE
========================================================= */

.simple-practice {

    margin-top: 25px;

    padding: 25px;

    background: white;

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

}


.exercise-grid {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;

    margin-top: 18px;

}


.exercise {

    padding: 15px;

    text-align: left;

    background: #f8fafc;

    border:
        1px solid var(--border);

    border-radius: 9px;

    transition: .2s ease;

}


.exercise:hover {

    border-color: #93c5fd;

    background: var(--blue-light);

    transform: translateY(-2px);

}


.exercise span {

    display: block;

    color: var(--primary);

    font-size: 8px;

    font-weight: 800;

}


.exercise strong {

    display: block;

    margin-top: 6px;

    color: var(--dark);

    font-family: monospace;

    font-size: 13px;

}


.exercise small {

    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 8px;

}


/* =========================================================
   TIPS
========================================================= */

.tips {

    padding:
        55px 0;

}


.section-center {

    text-align: center;

}


.section-center h2 {

    margin-top: 4px;

    color: var(--dark);

    font-size: 23px;

}


.tips-grid {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 10px;

    margin-top: 20px;

}


.tips-grid article {

    padding: 18px;

    background: white;

    border:
        1px solid var(--border);

    border-radius: 10px;

}


.tips-grid article > span {

    color: var(--primary);

    font-size: 8px;

    font-weight: 800;

}


.tips-grid h3 {

    margin-top: 6px;

    color: var(--dark);

    font-size: 13px;

}


.tips-grid p {

    margin-top: 5px;

    color: var(--muted);

    font-size: 9px;

    line-height: 1.7;

}


/* =========================================================
   FOOTER
========================================================= */

.footer {

    padding: 22px;

    text-align: center;

    background: white;

    border-top:
        1px solid var(--border);

}


.footer p {

    color: var(--muted);

    font-size: 9px;

}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .lesson-card {

        grid-template-columns: 1fr;

    }


    .tips-grid {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .exercise-grid {

        grid-template-columns:
            repeat(2, 1fr);

    }

}


@media (max-width: 700px) {

    .container {

        width:
            calc(100% - 20px);

    }


    .header-inner {

        width:
            calc(100% - 20px);

    }


    .beginner-label {

        display: none;

    }


    .lesson-navigation {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .lesson-card,
    .keyboard-section,
    .typing-practice,
    .simple-practice {

        padding: 18px;

    }


    .key-information {

        align-items: stretch;

        flex-direction: column;

    }


    .selected-key {

        width: 100%;

    }


    .keyboard-header {

        flex-direction: column;

        align-items: flex-start;

    }

}


@media (max-width: 500px) {

    .intro {

        padding:
            40px 5px 28px;

    }


    .intro h2 {

        font-size: 34px;

    }


    .lesson-navigation {

        grid-template-columns: 1fr;

    }


    .practice-heading {

        flex-direction: column;

    }


    .clear-button {

        width: 100%;

    }


    .exercise-grid {

        grid-template-columns: 1fr;

    }


    .tips-grid {

        grid-template-columns: 1fr;

    }


    .finger-row {

        overflow-x: auto;

    }


    .finger {

        min-width: 70px;

    }

}