/* =========================================================
   SPEECH TRACKER
   COMPLETE STYLE SHEET
   ========================================================= */


/* =========================================================
   THEME VARIABLES
========================================================= */

:root {
    --background: #ffffff;
    --surface: #f4f4f5;
    --surface-strong: #ffffff;
    --border: #e4e4e7;

    --text: #09090b;
    --text-secondary: #71717a;
    --text-muted: #a1a1aa;

    --primary: #18181b;
    --primary-text: #ffffff;

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --highlight: #f59e0b;

    --shadow:
        0 10px 30px rgba(0, 0, 0, 0.06);

    --shadow-small:
        0 4px 12px rgba(0, 0, 0, 0.05);

    --radius: 18px;
    --radius-small: 12px;

    color-scheme: light;
}


html[data-theme="dark"],
body.dark {
    --background: #09090b;
    --surface: #18181b;
    --surface-strong: #18181b;
    --border: #27272a;

    --text: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --primary: #fafafa;
    --primary-text: #09090b;

    --shadow:
        0 10px 30px rgba(0, 0, 0, 0.35);

    --shadow-small:
        0 4px 12px rgba(0, 0, 0, 0.25);

    color-scheme: dark;
}


/* =========================================================
   GLOBAL
========================================================= */

* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    margin: 0;

    min-height: 100vh;

    background: var(--background);
    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    line-height: 1.5;

    transition:
        background-color 0.25s ease,
        color 0.25s ease;
}


button,
input {
    font: inherit;
}


button {
    cursor: pointer;
}


button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}


img {
    max-width: 100%;
}


::selection {
    background: var(--text);
    color: var(--background);
}


/* =========================================================
   TOP BAR
========================================================= */

.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;

    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding:
        14px
        max(20px, calc((100vw - 920px) / 2));

    background:
        color-mix(
            in srgb,
            var(--background) 88%,
            transparent
        );

    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}


.brand-mini {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
}


.brand-mini img {
    width: 30px;
    height: 30px;

    border-radius: 8px;
}


.theme-toggle {
    min-width: 68px;

    padding: 8px 13px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface-strong);
    color: var(--text);

    font-size: 13px;
    font-weight: 600;

    transition:
        transform 0.15s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}


.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--text-muted);
}


.theme-toggle:active {
    transform: translateY(0);
}


/* =========================================================
   MAIN APP
========================================================= */

.app {
    width: min(920px, calc(100% - 32px));

    margin: 0 auto;

    padding:
        54px
        0
        80px;
}


/* =========================================================
   HERO
========================================================= */

.hero {
    display: flex;
    align-items: center;

    gap: 26px;

    margin-bottom: 36px;
}


.hero-icon {
    flex: 0 0 auto;

    width: 86px;
    height: 86px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 24px;

    background: var(--surface);

    box-shadow: var(--shadow-small);
}


.hero-icon img {
    width: 58px;
    height: 58px;

    border-radius: 16px;
}


.hero-copy {
    min-width: 0;
}


.eyebrow,
.section-kicker {
    color: var(--text-muted);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.12em;
}


.hero h1 {
    margin:
        5px
        0
        8px;

    font-size:
        clamp(34px, 6vw, 58px);

    line-height: 1.02;

    letter-spacing: -0.055em;
}


.hero p {
    max-width: 620px;

    margin: 0;

    color: var(--text-secondary);

    font-size: 16px;
}


/* =========================================================
   SCROLL INDICATOR
========================================================= */

.scroll-indicator {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    margin:
        0
        0
        28px;

    color: var(--text-muted);

    font-size: 12px;

    transition:
        opacity 0.25s ease;
}


.scroll-arrow {
    font-size: 18px;

    animation:
        scrollBounce 1.5s infinite;
}


@keyframes scrollBounce {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}


/* =========================================================
   CARDS
========================================================= */

.card {
    margin-bottom: 18px;

    padding: 26px;

    background: var(--surface-strong);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);

    transition:
        background-color 0.25s ease,
        border-color 0.25s ease;
}


/* =========================================================
   CARD HEADER
========================================================= */

.card-top,
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 18px;
}


.section-header {
    margin-bottom: 20px;
}


.section-header h2 {
    margin:
        4px
        0
        0;

    font-size: 22px;

    line-height: 1.15;

    letter-spacing: -0.035em;
}


.description {
    margin:
        0
        0
        18px;

    color: var(--text-secondary);

    font-size: 14px;
}


/* =========================================================
   RECORDING STATUS
========================================================= */

.status-pill {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    padding:
        7px
        11px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 999px;

    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 700;
}


.status-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--text-muted);
}


.status-dot.active,
.status-dot.recording {
    background: var(--success);

    box-shadow:
        0 0 0 4px
        color-mix(
            in srgb,
            var(--success) 15%,
            transparent
        );

    animation:
        statusPulse 1.4s infinite;
}


@keyframes statusPulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.45;
    }
}


.timer {
    color: var(--text-secondary);

    font-variant-numeric: tabular-nums;

    font-size: 14px;
    font-weight: 700;
}


/* =========================================================
   LIVE TRANSCRIPT
========================================================= */

.live-transcript {
    min-height: 150px;

    margin:
        22px
        0;

    padding: 22px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 14px;

    color: var(--text);

    font-size: 20px;
    line-height: 1.65;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}


.live-transcript .empty-state {
    color: var(--text-muted);

    font-size: 15px;
}


.live-transcript.filler-detected {
    animation:
        fillerFlash 0.45s ease;
}


@keyframes fillerFlash {
    0% {
        transform: scale(1);
    }

    35% {
        transform: scale(1.01);
    }

    100% {
        transform: scale(1);
    }
}


.filler-highlight {
    color: var(--error);

    font-weight: 800;

    text-decoration:
        underline;

    text-decoration-thickness: 2px;

    text-underline-offset: 3px;
}


/* =========================================================
   BUTTONS
========================================================= */

.button {
    min-height: 46px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding:
        11px
        18px;

    border-radius: 11px;

    font-size: 14px;
    font-weight: 750;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}


.button:hover:not(:disabled) {
    transform: translateY(-1px);
}


.button:active:not(:disabled) {
    transform: translateY(0);
}


.primary-button {
    border: 1px solid var(--primary);

    background: var(--primary);
    color: var(--primary-text);
}


.secondary-button {
    border: 1px solid var(--border);

    background: var(--surface);
    color: var(--text);
}


.secondary-button:hover:not(:disabled) {
    border-color: var(--text-muted);
}


.full-button {
    width: 100%;
}


/* =========================================================
   RECORD BUTTONS
========================================================= */

.record-buttons {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 12px;
}


.record-buttons .button {
    width: 100%;
}


/* =========================================================
   LIVE NOTE
========================================================= */

.live-note {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-top: 14px;

    color: var(--text-muted);

    font-size: 12px;
}


.live-dot {
    width: 7px;
    height: 7px;

    flex: 0 0 auto;

    border-radius: 50%;

    background: var(--success);
}


/* =========================================================
   SAVE PROMPT
========================================================= */

.save-prompt {
    margin-bottom: 18px;

    padding: 18px 20px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-small);
}


.save-prompt-content {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;
}


.save-title {
    font-size: 15px;
    font-weight: 800;
}


.save-subtitle {
    margin-top: 3px;

    color: var(--text-secondary);

    font-size: 13px;
}


.save-actions {
    display: flex;

    gap: 8px;
}


.icon-action {
    width: 40px;
    height: 40px;

    border-radius: 10px;

    border: 1px solid var(--border);

    background: var(--surface-strong);

    font-size: 20px;
    font-weight: 700;

    transition:
        transform 0.15s ease,
        border-color 0.2s ease;
}


.icon-action:hover {
    transform: translateY(-1px);
}


.icon-action.save {
    color: var(--success);
}


.icon-action.discard {
    color: var(--error);
}


/* =========================================================
   STATS
========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}


.stat-card {
    padding: 22px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 14px;
}


.stat-number {
    font-size: 38px;
    font-weight: 800;

    line-height: 1;

    letter-spacing: -0.04em;
}


.stat-label {
    margin-top: 8px;

    color: var(--text-secondary);

    font-size: 13px;
}


/* =========================================================
   INPUTS
========================================================= */

.input-row {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    gap: 10px;

    margin-bottom: 14px;
}


input {
    width: 100%;

    min-height: 46px;

    padding:
        10px
        13px;

    border: 1px solid var(--border);
    border-radius: 11px;

    outline: none;

    background: var(--surface);
    color: var(--text);

    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


input::placeholder {
    color: var(--text-muted);
}


input:focus {
    border-color: var(--text-secondary);

    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--text) 8%,
            transparent
        );
}


.add-button {
    min-width: 74px;
}


/* =========================================================
   WORD LIST
========================================================= */

.word-list {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-bottom: 16px;
}


.word-item {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    padding:
        7px
        10px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 999px;

    color: var(--text);

    font-size: 12px;
    font-weight: 650;
}


.remove-word {
    width: 19px;
    height: 19px;

    display: grid;
    place-items: center;

    padding: 0;

    border: 0;

    background: transparent;

    color: var(--text-muted);

    font-size: 16px;

    border-radius: 50%;
}


.remove-word:hover {
    color: var(--error);

    background:
        color-mix(
            in srgb,
            var(--error) 10%,
            transparent
        );
}


/* =========================================================
   DEFAULT WORDS
========================================================= */

.default-word-grid {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;
}


.default-word-grid span {
    padding:
        7px
        10px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 999px;

    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 650;
}


/* =========================================================
   NOTIFICATIONS
========================================================= */

.section-icon {
    font-size: 22px;
}


.notification-status {
    margin-top: 10px;

    color: var(--text-muted);

    font-size: 12px;
}


/* =========================================================
   AI
========================================================= */

.ai-card {
    position: relative;
}


.ai-badge {
    flex: 0 0 auto;

    padding:
        5px
        8px;

    border: 1px solid var(--border);
    border-radius: 7px;

    background: var(--surface);

    color: var(--text);

    font-size: 10px;
    font-weight: 900;

    letter-spacing: 0.08em;
}


.analysis-loading {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-top: 16px;

    color: var(--text-secondary);

    font-size: 13px;
}


.loading-spinner {
    width: 17px;
    height: 17px;

    border:
        2px solid var(--border);

    border-top-color:
        var(--text);

    border-radius: 50%;

    animation:
        spin 0.8s linear infinite;
}


@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


.analysis {
    margin-top: 18px;
}


.analysis-section {
    margin-top: 14px;

    padding: 18px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 13px;
}


.analysis-section:first-child {
    margin-top: 0;
}


.analysis-section h3 {
    margin:
        0
        0
        8px;

    font-size: 15px;

    letter-spacing: -0.015em;
}


.analysis-section p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 14px;

    line-height: 1.65;
}


.analysis-section ul {
    margin:
        8px
        0
        0;

    padding-left: 20px;

    color: var(--text-secondary);

    font-size: 14px;
}


.analysis-section li {
    margin-bottom: 6px;
}


.analysis-subsection {
    padding:
        10px
        0;

    border-bottom:
        1px solid var(--border);
}


.analysis-subsection:last-child {
    border-bottom: 0;
}


.analysis-subsection h4 {
    margin:
        0
        0
        4px;

    font-size: 13px;
}


.analysis-error {
    padding: 16px;

    background:
        color-mix(
            in srgb,
            var(--error) 8%,
            var(--surface)
        );

    border:
        1px solid
        color-mix(
            in srgb,
            var(--error) 25%,
            var(--border)
        );

    border-radius: 12px;

    color: var(--text);

    font-size: 13px;
}


.analysis-error p {
    margin:
        6px
        0
        0;

    color: var(--text-secondary);
}


/* =========================================================
   SAVED SPEECHES
========================================================= */

.history-count {
    min-width: 28px;
    height: 28px;

    display: grid;
    place-items: center;

    padding: 0 8px;

    border-radius: 999px;

    background: var(--surface);

    border: 1px solid var(--border);

    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 800;
}


.saved-speeches {
    display: flex;

    flex-direction: column;

    gap: 10px;
}


.empty-history {
    padding: 24px;

    text-align: center;

    color: var(--text-muted);

    font-size: 13px;

    border:
        1px dashed
        var(--border);

    border-radius: 13px;
}


.saved-speech {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    padding: 16px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 13px;
}


.saved-speech-content {
    min-width: 0;
}


.saved-speech-name {
    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-size: 14px;
    font-weight: 800;
}


.saved-speech-date {
    margin-top: 3px;

    color: var(--text-muted);

    font-size: 11px;
}


.saved-speech-stats {
    margin-top: 5px;

    color: var(--text-secondary);

    font-size: 11px;
}


.saved-speech-actions {
    display: flex;

    align-items: center;

    gap: 6px;
}


.saved-speech-open,
.saved-speech-delete {
    min-height: 34px;

    padding:
        6px
        10px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface-strong);
    color: var(--text);

    font-size: 12px;
    font-weight: 700;
}


.saved-speech-delete {
    width: 34px;

    padding: 0;

    color: var(--error);

    font-size: 18px;
}


.saved-speech-open:hover,
.saved-speech-delete:hover {
    border-color: var(--text-muted);
}


/* =========================================================
   FINAL TRANSCRIPT
========================================================= */

.final-transcript {
    min-height: 120px;

    padding: 20px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 13px;

    color: var(--text);

    font-size: 15px;

    line-height: 1.7;

    white-space: pre-wrap;
}


.transcript-card .filler-highlight {
    color: var(--error);
}


/* =========================================================
   HOW IT WORKS
========================================================= */

.steps {
    display: flex;

    flex-direction: column;

    gap: 18px;
}


.step {
    display: grid;

    grid-template-columns: 34px 1fr;

    gap: 13px;

    align-items: start;
}


.step > span {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);

    color: var(--text);

    font-size: 12px;
    font-weight: 800;
}


.step strong {
    display: block;

    margin-bottom: 2px;

    font-size: 14px;
}


.step p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 13px;
}


/* =========================================================
   FOOTER
========================================================= */

footer {
    padding:
        30px
        0
        10px;

    text-align: center;

    color: var(--text-muted);

    font-size: 12px;
}


footer span {
    padding:
        0
        5px;
}


/* =========================================================
   SAVE MODAL
========================================================= */

.modal-backdrop {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: grid;

    place-items: center;

    padding: 20px;

    background:
        rgba(0, 0, 0, 0.45);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}


.modal {
    width: min(
        440px,
        100%
    );

    padding: 25px;

    background: var(--surface-strong);

    border: 1px solid var(--border);
    border-radius: 18px;

    box-shadow:
        0 25px 80px
        rgba(0, 0, 0, 0.2);
}


.modal-title {
    font-size: 21px;
    font-weight: 800;

    letter-spacing: -0.03em;
}


.modal-description {
    margin:
        6px
        0
        18px;

    color: var(--text-secondary);

    font-size: 13px;
}


.modal-buttons {
    display: grid;

    grid-template-columns:
        1fr
        1fr;

    gap: 10px;

    margin-top: 14px;
}


/* =========================================================
   HIDDEN
========================================================= */

[hidden] {
    display: none !important;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    .top-bar {
        padding:
            12px
            16px;
    }


    .app {
        width: min(
            100% - 24px,
            920px
        );

        padding-top: 35px;
    }


    .hero {
        align-items: flex-start;

        gap: 16px;

        margin-bottom: 28px;
    }


    .hero-icon {
        width: 62px;
        height: 62px;

        border-radius: 17px;
    }


    .hero-icon img {
        width: 42px;
        height: 42px;

        border-radius: 11px;
    }


    .hero h1 {
        font-size: 35px;
    }


    .hero p {
        font-size: 14px;
    }


    .card {
        padding: 20px;

        border-radius: 16px;
    }


    .section-header h2 {
        font-size: 20px;
    }


    .live-transcript {
        min-height: 135px;

        padding: 17px;

        font-size: 17px;
    }


    .record-buttons {
        grid-template-columns: 1fr;
    }


    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }


    .stat-card {
        padding: 18px;
    }


    .stat-number {
        font-size: 32px;
    }


    .input-row {
        grid-template-columns: 1fr;
    }


    .add-button {
        width: 100%;
    }


    .save-prompt-content {
        align-items: flex-start;
    }


    .saved-speech {
        align-items: flex-start;

        flex-direction: column;
    }


    .saved-speech-actions {
        width: 100%;
    }


    .saved-speech-open {
        flex: 1;
    }


    .modal {
        padding: 21px;
    }
}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 420px) {

    .app {
        width: calc(100% - 18px);
    }


    .hero {
        flex-direction: column;
    }


    .hero h1 {
        font-size: 32px;
    }


    .card {
        padding: 17px;
    }


    .stats-grid {
        gap: 9px;
    }


    .stat-card {
        padding: 15px;
    }


    .stat-number {
        font-size: 28px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        animation-duration:
            0.001ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            0.001ms !important;
    }
}