@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;600;700&family=Fira+Code:wght@400;500&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --navy: #0F2E3D;
    --navy-hover: #1a4a5e;
    --gold: #CA981A;
    --white: #FFFFFF;
    --light-gray: #f1f3f5;
    --text-primary: rgba(0, 0, 0, 1.0);
    --text-secondary: rgba(0, 0, 0, 0.8);
    --text-muted: rgba(0, 0, 0, 0.6);
    --text-light: rgba(255, 255, 255, 0.8);
    --border-radius: 4px;
    --transition: 0.2s ease;
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--white);
    color: var(--text-secondary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 1.06rem;
    line-height: 1.6;
}

/* Header */
header {
    background: var(--navy);
    padding: 14px 20px;
}

header .header-content {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.back-link {
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--white);
}

.header-title {
    text-align: center;
    flex: 1;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
    margin: 0;
}

.header-title .subtitle {
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--text-light);
    margin-top: 2px;
}

.header-controls {
    min-width: 100px;
}

main {
    flex: 1;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
}

.input-section {
    margin-bottom: 32px;
}

.input-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.input-section input {
    width: 100%;
    max-width: 200px;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: 'Fira Code', monospace;
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    background: var(--white);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.input-section input:focus {
    border-color: var(--gold);
}

.record-btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Lato', sans-serif;
    border: none;
    border-radius: 4px;
    background: var(--navy);
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 32px;
}

.record-btn:hover {
    background: #1a4a5e;
}

.record-btn.recording {
    background: var(--gold);
    color: var(--navy);
    animation: pulse 1.5s infinite;
}

.record-btn.recording:hover {
    background: #b8891a;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(202, 152, 26, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(202, 152, 26, 0);
    }
}

.visualization-section {
    margin-bottom: 32px;
    background: var(--light-gray);
    border-radius: 4px;
    padding: 16px;
}

#fft-canvas {
    width: 100%;
    height: 200px;
    display: block;
    background: var(--white);
    border-radius: 2px;
}

.results-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--light-gray);
    border-radius: 4px;
    border-left: 4px solid transparent;
}

.result-item.summary {
    border-left-color: var(--gold);
    background: rgba(202, 152, 26, 0.08);
}

.result-label {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.95rem;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
    font-family: 'Fira Code', monospace;
}

.result-item.summary .result-value {
    color: var(--gold);
}

footer {
    background: var(--navy);
    padding: 20px;
    text-align: center;
    margin-top: 30px;
}

footer p {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 300;
}

footer a {
    color: var(--gold);
    text-decoration: none;
}

footer a:hover {
    color: var(--white);
}

@media (max-width: 768px) {
    header {
        padding: 12px 16px;
    }

    header .header-content {
        flex-direction: column;
        text-align: center;
    }

    .back-link {
        order: -1;
    }

    .header-title h1 {
        font-size: 1.25rem;
    }

    .header-controls {
        display: none;
    }

    main {
        padding: 24px 16px;
    }

    .result-value {
        font-size: 1.1rem;
    }
}
