/* Variables & Theme — portfolio vibe (heyitsmejosh.com/tokens.css) */
@import url("https://heyitsmejosh.com/tokens.css");

:root {
    --font: var(--font-body, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif);
    /* ponytail: Voxprint's own blue instead of the portfolio yellow — the bright
       accent reads wrong here and fails contrast under white button text. */
    --primary: #2E6BE6;
    --primary-ink: #ffffff;
    --primary-light: var(--blue-light);
    --primary-dark: var(--navy);
    --text-primary: var(--text);
    --text-secondary: var(--text2);
    --bg-secondary: var(--bg2);
    --success: #10b981;
    --error: #ef4444;
    --radius: var(--radius-lg);
    --shadow: var(--shadow-sm);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111111;
        --bg2: #1a1a1a;
        --text: #e8e8f0;
        --text2: rgba(232,232,240,0.60);
        --border: rgba(232,232,240,0.10);
        --primary: #7FB0FF;
        --primary-ink: #111111;
        --primary-dark: var(--blue-light);
    }
}

html.dark-mode {
    --bg: #111111;
    --bg2: #1a1a1a;
    --text: #e8e8f0;
    --text2: rgba(232,232,240,0.60);
    --border: rgba(232,232,240,0.10);
    --primary: #7FB0FF;
    --primary-ink: #111111;
    --primary-dark: var(--blue-light);
}

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

body {
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg);
    transition: background 0.3s, color 0.3s;
    line-height: 1.6;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.navbar-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-icon {
    width: 32px;
    height: 32px;
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-right {
    display: flex;
    gap: 0.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Record Section */
.record-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.waveform-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    min-height: 250px;
    position: relative;
}

#waveformCanvas {
    width: 100%;
    max-width: 400px;
    height: 150px;
}

.waveform-bars {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 100px;
    justify-content: center;
}

.bar {
    width: 6px;
    height: 20px;
    background: var(--primary);
    border-radius: 3px;
    transition: height 0.1s ease-out;
    opacity: 0.7;
}

.bar:nth-child(2) { transition-delay: 0.02s; }
.bar:nth-child(3) { transition-delay: 0.04s; }
.bar:nth-child(4) { transition-delay: 0.02s; }
.bar:nth-child(5) { transition-delay: 0.04s; }

/* Record Controls */
.record-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.btn-record {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.btn-record:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.btn-record.recording {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.record-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
}

.btn-record.recording .record-icon {
    width: 10px;
    height: 10px;
}

.record-status {
    text-align: center;
}

.record-status p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
}

.record-time {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

/* Settings Row */
.settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group label {
    font-weight: 500;
    color: var(--text-primary);
}

.select-control {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.select-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.15);
}

/* Upload Section */
.upload-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-secondary);
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(91, 155, 213, 0.08);
}

.upload-area svg {
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-area h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.upload-area p {
    color: var(--text-secondary);
}

/* Transcription Area */
.transcription-area {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.transcription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.transcription-header h2 {
    margin: 0;
}

.transcription-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-action:hover {
    background: var(--primary-dark);
}

.btn-action.btn-close {
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.transcription-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text-primary);
    word-break: break-word;
}

.transcription-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* History Panel */
.history-panel {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.history-header h2 {
    margin: 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid var(--primary);
}

.history-item:hover {
    background: var(--border);
}

.history-item-text {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-item-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-icon-small {
    padding: 0.25rem 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.btn-icon-small:hover {
    background: var(--primary-dark);
}

.history-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Buttons */
.btn-icon {
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-secondary:hover {
    background: var(--primary-dark);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
}

.modal-content {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.setting-item {
    margin-bottom: 1.5rem;
}

.setting-item label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.setting-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-left {
        gap: 0.5rem;
    }

    .navbar-title {
        font-size: 1.25rem;
    }

    .main-content {
        padding: 1rem 0.75rem;
    }

    .tabs {
        margin-bottom: 1.5rem;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .btn-record {
        width: 80px;
        height: 80px;
    }

    .waveform-container {
        min-height: 200px;
    }

    .transcription-area {
        padding: 1.5rem;
    }

    .transcription-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .transcription-actions {
        width: 100%;
        gap: 0.5rem;
    }

    .btn-action {
        flex: 1;
        justify-content: center;
    }

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

@media (max-width: 480px) {
    .navbar-content {
        padding: 0 0.5rem;
    }

    .navbar-title {
        font-size: 1rem;
    }

    .main-content {
        padding: 1rem 0.5rem;
    }

    .modal {
        width: 95%;
    }

    .history-item {
        padding: 0.75rem;
    }

    .btn-record {
        width: 70px;
        height: 70px;
        font-size: 0.9rem;
    }

    .record-time {
        font-size: 1.2rem;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .transcription-text {
        font-size: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-item {
    animation: fadeIn 0.3s ease-out;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Landing page */
.site-bar {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-bar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.site-bar-brand img { border-radius: 7px; display: block; }

/* Official Apple badge, same asset the other project sites use. */
.btn-appstore { display: inline-flex; align-items: center; }
.btn-appstore img { display: block; height: 40px; width: auto; }

.landing-hero {
    position: relative;
    /* full-bleed band: the wall spans the viewport, the copy stays narrow */
    padding: 72px 24px 56px;
    text-align: center;
    z-index: 1;
    overflow: hidden;
}

/* Animated hero wall — the same drifting card wall the other project landing
   pages use (see wordroot/landing/index.html). No canvas; CSS transforms only,
   and it stops dead under prefers-reduced-motion. */
.hero-wall {
    position: absolute; inset: -8%; z-index: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px;
    opacity: 0.55;
    pointer-events: none; user-select: none;
}
.wall-col { display: flex; min-width: 0; flex-direction: column; gap: 10px; }
.wall-col.up   { animation: wall-up   var(--dur) linear infinite; }
.wall-col.down { animation: wall-down var(--dur) linear infinite; }
@keyframes wall-up   { from { transform: translateY(0); }    to { transform: translateY(-50%); } }
@keyframes wall-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }

.wall-card {
    aspect-ratio: 5/3; border-radius: 6px; display: flex;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 0.2rem; padding: 0.45rem; text-align: center; overflow: hidden;
    background: var(--bg2); border: 1px solid var(--border);
}
.wall-card b { font-size: 0.78rem; font-weight: 600; color: var(--text); line-height: 1.15; }
.wall-card span { font-size: 0.62rem; color: var(--text2); line-height: 1.1; }

/* keeps the headline readable over the wall, in either theme */
.hero-scrim {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(46% 60% at 50% 45%,
        var(--bg) 0%,
        color-mix(in srgb, var(--bg) 78%, transparent) 55%,
        transparent 100%);
}

.hero-copy { position: relative; z-index: 2; max-width: 640px; margin: 0 auto; }

@media (prefers-reduced-motion: reduce) {
    .wall-col { animation: none; }
}

.landing-hero img {
    border-radius: 22px;
    margin-bottom: 24px;
}

.landing-hero h1 {
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 14px;
}

.landing-hero p {
    color: var(--text-secondary);
    font-size: 1.08rem;
    max-width: 30em;
    margin: 0 auto 28px;
}

.landing-ctas {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary,
.btn-outline {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
}

.btn-primary,
.btn-outline,
.btn-appstore,
.site-bar-brand {
    transition: background 0.15s, border-color 0.15s, transform 0.15s, opacity 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-ink);
}

.btn-primary:hover { background: color-mix(in srgb, var(--primary) 86%, black); }
.btn-primary:active { transform: translateY(1px); }

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-appstore:hover { opacity: 0.82; }
.site-bar-brand:hover { opacity: 0.7; }

/* visible keyboard focus — the default outline is lost against the wall */
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

.landing-features {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 8px 24px 64px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.landing-features .feature {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--bg2);
    border: 1px solid var(--border);
}

.landing-features h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.landing-features p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.landing-footer {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.landing-footer a {
    color: inherit;
}

.landing-footer a:hover { color: var(--primary); }

@media (max-width: 640px) {
    /* ponytail: keep the wall on phones, just quieter behind the copy */
    .hero-wall { opacity: 0.35; gap: 8px; }
    .landing-hero { padding-top: 48px; }
    .site-bar { padding: 12px 16px; }
}
