* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f8fc;
    color: #171923;
    transition: 0.3s;
}

body.dark {
    background: #0d1117;
    color: #f5f5f5;
}


/* ================= HEADER ================= */

header {
    width: 100%;
    height: 75px;
    padding: 0 7%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.95);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #eee;
}

.dark header {
    background: #11161e;
    border-color: #222;
}

.logo {
    font-size: 22px;
    font-weight: bold;
}

.logo span {
    color: #6c4df6;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: inherit;
    font-size: 14px;
    font-weight: 600;
}

nav a:hover {
    color: #6c4df6;
}

#themeBtn {
    border: none;
    background: #eee;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
}

.dark #themeBtn {
    background: #222;
}


/* ================= HERO ================= */

.hero {
    min-height: 650px;
    padding: 80px 8%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    background: linear-gradient(135deg, #f8f7ff, #eef1ff);
}

.dark .hero {
    background: linear-gradient(135deg, #0d1117, #171b29);
}

.hero-content {
    max-width: 650px;
}

.small-title {
    color: #6c4df6;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: clamp(45px, 7vw, 80px);
    line-height: 1;
    margin-bottom: 25px;
}

.hero h1 span {
    color: #6c4df6;
}

.hero p {
    font-size: 18px;
    line-height: 1.7;
    color: #666;
    margin-bottom: 35px;
}

.dark .hero p {
    color: #aaa;
}

.main-btn {
    display: inline-block;
    padding: 16px 28px;
    background: #6c4df6;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: bold;
    transition: 0.3s;
}

.main-btn:hover {
    transform: translateY(-3px);
}


/* VOICE CIRCLE */

.voice-circle {
    width: 330px;
    height: 330px;
    border-radius: 50%;
    background: #6c4df6;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 30px 70px rgba(108,77,246,0.35);
}

.mic {
    font-size: 100px;
    z-index: 2;
}

.wave {
    position: absolute;
    width: 240px;
    height: 240px;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}


/* ================= SECTIONS ================= */

.section {
    padding: 100px 8%;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title p {
    color: #6c4df6;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.section-title h2 {
    font-size: 40px;
    margin-bottom: 12px;
}

.section-title span {
    color: #777;
}

.dark .section-title span {
    color: #aaa;
}


/* ================= RECORD ================= */

.record-card {
    max-width: 650px;
    margin: auto;
    padding: 50px;
    background: white;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0,0,0,0.07);
}

.dark .record-card {
    background: #161b22;
}

#recordStatus {
    color: #777;
    margin-bottom: 20px;
}

#timer {
    font-size: 60px;
    font-weight: bold;
    margin-bottom: 30px;
}

.record-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.record-buttons button {
    border: none;
    padding: 14px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

.record-btn {
    background: #6c4df6;
    color: white;
}

.stop-btn {
    background: #eee;
}

.stop-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#audioPlayer {
    width: 100%;
    margin-top: 30px;
    display: none;
}

.record-note {
    margin-top: 20px;
    color: #888;
    font-size: 13px;
}


/* ================= ANALYSIS ================= */

.overall-score {
    max-width: 850px;
    margin: auto;
    padding: 35px;
    display: flex;
    align-items: center;
    gap: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
}

.dark .overall-score {
    background: #161b22;
}

.score-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: #6c4df6;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.score-circle strong {
    font-size: 40px;
}

.score-circle span {
    font-size: 13px;
}

.overall-score h3 {
    font-size: 25px;
    margin-bottom: 8px;
}

.overall-score p {
    color: #777;
}


/* ANALYSIS CARDS */

.analysis-grid {
    max-width: 1000px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 20px;
}

.analysis-card {
    padding: 30px;
    background: white;
    border-radius: 16px;
}

.dark .analysis-card {
    background: #161b22;
}

.analysis-card .icon {
    font-size: 30px;
    margin-bottom: 15px;
}

.analysis-card h3 {
    margin-bottom: 10px;
}

.analysis-card strong {
    color: #6c4df6;
    font-size: 25px;
}

.progress {
    height: 8px;
    background: #eee;
    margin-top: 15px;
    border-radius: 20px;
    overflow: hidden;
}

.progress div {
    width: 0%;
    height: 100%;
    background: #6c4df6;
    transition: width 1s;
}


/* RANGE */

.range-card {
    max-width: 1000px;
    margin: auto;
    padding: 30px;
    background: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dark .range-card {
    background: #161b22;
}

.range-card p {
    color: #777;
    font-size: 12px;
}

.range-card h2 {
    margin-top: 8px;
}

.range-line {
    display: flex;
    align-items: center;
    gap: 15px;
}

.range-line > div {
    width: 250px;
    height: 8px;
    background: #ddd;
    border-radius: 20px;
}

.range-line > div span {
    display: block;
    width: 65%;
    height: 100%;
    background: #6c4df6;
    border-radius: 20px;
}


/* ================= PROGRESS ================= */

.stats-grid {
    max-width: 1000px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
}

.dark .stat-card {
    background: #161b22;
}

.stat-card span {
    font-size: 30px;
}

.stat-card h3 {
    font-size: 30px;
    margin: 10px 0;
}

.stat-card p {
    color: #777;
}

.history-card {
    max-width: 1000px;
    margin: 40px auto;
    background: white;
    padding: 30px;
    border-radius: 16px;
}

.dark .history-card {
    background: #161b22;
}

.history-card h3 {
    margin-bottom: 20px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 18px 0;
    border-bottom: 1px solid #eee;
}

.dark .history-item {
    border-color: #333;
}

.empty {
    color: #888;
}


/* ================= TRAINING ================= */

.training-section {
    background: #f0efff;
}

.dark .training-section {
    background: #10141c;
}

.training-grid {
    max-width: 1100px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 20px;
}

.training-card {
    background: white;
    padding: 30px;
    border-radius: 18px;
}

.dark .training-card {
    background: #161b22;
}

.training-card > span {
    color: #6c4df6;
    font-size: 12px;
    font-weight: bold;
}

.training-card h3 {
    margin: 15px 0;
}

.training-card p {
    color: #777;
    line-height: 1.6;
    margin-bottom: 20px;
}

.training-card strong {
    color: #6c4df6;
}


/* ================= FOOTER ================= */

footer {
    padding: 60px 8%;
    text-align: center;
    background: #111;
    color: white;
}

footer p {
    margin-top: 10px;
    color: #aaa;
}

.copyright {
    font-size: 12px;
}


/* ================= MOBILE ================= */

@media(max-width: 850px) {

    nav {
        display: none;
    }

    .hero {
        flex-direction: column;
        text-align: center;
    }

    .voice-circle {
        width: 250px;
        height: 250px;
    }

    .mic {
        font-size: 70px;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2,1fr);
    }

    .training-grid {
        grid-template-columns: 1fr;
    }

    .range-card {
        flex-direction: column;
        gap: 25px;
    }
}


@media(max-width: 500px) {

    .section {
        padding: 70px 5%;
    }

    .hero {
        padding: 60px 5%;
    }

    .hero h1 {
        font-size: 45px;
    }

    .record-card {
        padding: 30px 20px;
    }

    .overall-score {
        flex-direction: column;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .range-line > div {
        width: 150px;
    }
}