/* =========================================
   HEARIT — GLOBAL
========================================= */

:root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --surface-soft: #f0f0ed;

    --text: #111111;
    --text-soft: #686866;
    --text-faint: #9b9b96;

    --border: #deded9;
    --border-strong: #c9c9c2;

    --accent: #111111;
    --accent-soft: #e9e9e5;

    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 30px;

    --container: 1120px;

    --shadow: 0 12px 40px rgba(0, 0, 0, 0.06);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}


/* =========================================
   RESET
========================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
select,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: #111;
    color: #fff;
}


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

.app-shell {
    width: min(100% - 32px, var(--container));
    margin-inline: auto;
}


/* =========================================
   NAVBAR
========================================= */

.navbar {
    height: 80px;

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

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

.logo {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -1.4px;
}

.logo span,
.footer-brand span {
    color: #777;
}

.nav-links {
    display: none;
    gap: 32px;

    font-size: 14px;
    color: var(--text-soft);
}

.nav-links a {
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text);
}

.theme-button {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;

    color: var(--text);

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.theme-button:hover {
    background: var(--surface-soft);
    transform: rotate(20deg);
}


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

.hero {
    max-width: 760px;

    padding:
        clamp(80px, 13vw, 150px)
        0
        clamp(60px, 9vw, 100px);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    padding: 8px 12px;

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

    background: var(--surface);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.3px;
}

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

    border-radius: 50%;
    background: #111;
}

.hero h1 {
    margin-top: 24px;

    font-size: clamp(52px, 9vw, 104px);
    line-height: 0.92;

    letter-spacing: -6px;
    font-weight: 800;
}

.hero h1 span {
    color: #858580;
}

.hero-description {
    max-width: 520px;

    margin-top: 30px;

    font-size: clamp(17px, 2vw, 20px);
    line-height: 1.6;

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


/* =========================================
   TRANSCRIBER
========================================= */

.transcriber {
    width: 100%;
}


/* =========================================
   UPLOAD BOX
========================================= */

.upload-box {
    min-height: 360px;

    display: grid;
    place-items: center;

    padding: 40px;

    background: var(--surface);

    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-lg);

    text-align: center;

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

.upload-box:hover,
.upload-box.dragover {
    border-color: var(--text);
    background: #fbfbfa;
}

.upload-box:focus-visible {
    outline: 3px solid #bdbdb7;
    outline-offset: 4px;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-icon {
    width: 64px;
    height: 64px;

    display: grid;
    place-items: center;

    margin-bottom: 24px;

    border-radius: 18px;

    background: var(--surface-soft);
}

.upload-icon svg {
    width: 28px;
    height: 28px;
}

.upload-box h2 {
    font-size: clamp(22px, 4vw, 30px);
    letter-spacing: -1px;
}

.upload-box p {
    margin-top: 8px;
    color: var(--text-soft);
}

.browse-button {
    background: transparent;
    color: var(--text);
    font-weight: 700;

    text-decoration: underline;
    text-underline-offset: 3px;
}

.file-types {
    margin-top: 22px;

    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;

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


/* =========================================
   SELECTED FILE
========================================= */

.selected-file {
    margin-top: 16px;

    display: flex;
    align-items: center;
    gap: 14px;

    padding: 16px 18px;

    background: var(--surface);

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

.file-icon {
    width: 44px;
    height: 44px;

    flex-shrink: 0;

    display: grid;
    place-items: center;

    background: var(--surface-soft);
    border-radius: 12px;

    font-size: 20px;
}

.file-details {
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.file-details strong {
    max-width: 100%;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 14px;
}

.file-details span {
    margin-top: 2px;

    font-size: 12px;
    color: var(--text-faint);
}

.remove-file {
    margin-left: auto;

    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border-radius: 50%;

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

    font-size: 22px;
}

.remove-file:hover {
    background: var(--surface-soft);
    color: var(--text);
}


/* =========================================
   CONTROLS
========================================= */

.controls {
    display: grid;
    gap: 14px;

    margin-top: 16px;
}

.language-control {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.language-control label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;

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

.language-control select {
    width: 100%;
    height: 58px;

    padding: 0 18px;

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

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

    outline: none;

    cursor: pointer;
}

.language-control select:focus {
    border-color: var(--text);
}


/* =========================================
   TRANSCRIBE BUTTON
========================================= */

.transcribe-button {
    height: 58px;

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

    padding: 0 20px;

    border-radius: var(--radius-sm);

    background: var(--accent);
    color: #fff;

    font-weight: 700;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.transcribe-button span:last-child {
    font-size: 20px;
}

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

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

.transcribe-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}


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

.status {
    margin-top: 14px;

    font-size: 13px;
    color: var(--text-soft);

    text-align: center;
}


/* =========================================
   LOADING
========================================= */

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;

    margin-top: 24px;
    padding: 22px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

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

    border: 2px solid var(--border);
    border-top-color: var(--text);

    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}

.loading-state div:last-child {
    display: flex;
    flex-direction: column;
}

.loading-state strong {
    font-size: 14px;
}

.loading-state span {
    margin-top: 2px;

    font-size: 12px;
    color: var(--text-faint);
}

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


/* =========================================
   RESULT
========================================= */

.result {
    margin-top: 24px;

    background: var(--surface);

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

    overflow: hidden;

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

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    padding: 18px 20px;

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

.result-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.result-label,
.section-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
}

.detected-language {
    padding: 4px 8px;

    border-radius: 999px;

    background: var(--surface-soft);

    font-size: 10px;
    color: var(--text-soft);
}

.result-actions {
    display: flex;
    gap: 6px;
}

.result-actions button {
    padding: 8px 11px;

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

    background: var(--surface);

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

.result-actions button:hover {
    background: var(--surface-soft);
}

.transcript {
    min-height: 220px;

    padding: 24px;

    font-size: 16px;
    line-height: 1.8;

    white-space: pre-wrap;

    outline: none;
}

.transcript:focus {
    box-shadow: inset 0 0 0 2px var(--border-strong);
}


/* =========================================
   FEATURES
========================================= */

.features {
    padding: clamp(110px, 15vw, 180px) 0;
}

.section-heading {
    max-width: 620px;
}

.section-label {
    color: var(--text-faint);
}

.section-heading h2 {
    margin-top: 14px;

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

    letter-spacing: -3px;
}

.section-heading > p {
    margin-top: 18px;

    color: var(--text-soft);
    font-size: 17px;
}

.feature-grid {
    display: grid;
    gap: 14px;

    margin-top: 50px;
}

.feature-card {
    position: relative;

    min-height: 280px;

    padding: 28px;

    background: var(--surface);

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

    overflow: hidden;
}

.feature-number {
    position: absolute;
    top: 26px;
    right: 28px;

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

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

.feature-icon {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    margin-top: 38px;
    margin-bottom: 30px;

    background: var(--surface-soft);
    border-radius: 14px;

    font-size: 20px;
}

.feature-card h3 {
    font-size: 22px;
    letter-spacing: -0.7px;
}

.feature-card p {
    max-width: 300px;

    margin-top: 9px;

    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.65;
}


/* =========================================
   LANGUAGES
========================================= */

.languages-section {
    padding-bottom: clamp(110px, 15vw, 180px);
}

.language-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: 40px;
}

.language-list span {
    padding: 11px 15px;

    background: var(--surface);

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

    font-size: 13px;
}


/* =========================================
   FINAL CTA
========================================= */

.final-cta {
    padding:
        clamp(80px, 12vw, 130px)
        0;

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

.final-cta h2 {
    margin-top: 18px;

    font-size: clamp(42px, 8vw, 82px);
    line-height: 0.95;

    letter-spacing: -4px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 28px;

    margin-top: 38px;
    padding: 16px 20px;

    background: var(--accent);
    color: #fff;

    border-radius: 10px;

    font-weight: 700;

    transition: transform 0.2s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
}

.cta-button span {
    font-size: 20px;
}


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

.footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;

    padding: 45px 0 55px;
}

.footer-brand {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -1px;
}

.footer p {
    color: var(--text-soft);
    font-size: 13px;
}

.footer-credit {
    margin-top: 12px;

    font-size: 11px;
    color: var(--text-faint);
}


/* =========================================
   DARK MODE
========================================= */

body.dark {
    --bg: #11110f;
    --surface: #191917;
    --surface-soft: #232320;

    --text: #f4f4ef;
    --text-soft: #a6a69f;
    --text-faint: #70706b;

    --border: #30302c;
    --border-strong: #45453f;

    --accent: #f4f4ef;
    --accent-soft: #292925;

    --shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

body.dark .transcribe-button,
body.dark .cta-button {
    color: #111;
}

body.dark .badge-dot {
    background: #f4f4ef;
}

body.dark .upload-box:hover,
body.dark .upload-box.dragover {
    background: #1d1d1a;
}


/* =========================================
   TABLET
========================================= */

@media (min-width: 640px) {

    .app-shell {
        width: min(100% - 56px, var(--container));
    }

    .controls {
        grid-template-columns: 240px 1fr;
        align-items: end;
    }

    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer {
        flex-direction: row;
        align-items: center;
    }

    .footer p {
        margin-left: 20px;
    }

    .footer-credit {
        margin-left: auto;
        margin-top: 0;
    }
}


/* =========================================
   DESKTOP
========================================= */

@media (min-width: 900px) {

    .navbar {
        height: 88px;
    }

    .nav-links {
        display: flex;
    }

    .theme-button {
        margin-left: 20px;
    }

    .hero {
        padding-top: 150px;
    }

    .upload-box {
        min-height: 420px;
    }

    .feature-card {
        min-height: 330px;
        padding: 34px;
    }

    .feature-icon {
        margin-top: 45px;
        margin-bottom: 40px;
    }
}


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

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

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
