/* ============================================
   AudioToTextAI Design System
   Grayscale palette with coral-red accent
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Grayscale */
    --gray-950: #0a0a0a;
    --gray-900: #111111;
    --gray-850: #1a1a1a;
    --gray-800: #222222;
    --gray-700: #333333;
    --gray-600: #555555;
    --gray-500: #777777;
    --gray-400: #999999;
    --gray-300: #cccccc;
    --gray-200: #e5e5e5;
    --gray-100: #f2f2f2;
    --gray-50:  #fafafa;
    --white:    #ffffff;

    /* Accent */
    --accent:       #e5574f;
    --accent-hover:  #d44840;
    --accent-soft:   rgba(229, 87, 79, 0.1);
    --accent-muted:  rgba(229, 87, 79, 0.6);

    /* Semantic */
    --success:     #22c55e;
    --success-soft: rgba(34, 197, 94, 0.1);
    --warning:     #eab308;
    --warning-soft: rgba(234, 179, 8, 0.1);
    --error:       #ef4444;
    --error-soft:  rgba(239, 68, 68, 0.1);
    --info:        #3b82f6;
    --info-soft:   rgba(59, 130, 246, 0.1);

    /* Surfaces (light mode defaults) */
    --bg-page:      var(--gray-100);
    --bg-card:      var(--white);
    --bg-elevated:  var(--gray-50);
    --bg-inset:     var(--gray-100);
    --bg-nav:       var(--gray-900);
    --bg-footer:    var(--gray-900);

    /* Text */
    --text-primary:   var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted:     var(--gray-500);
    --text-placeholder: var(--gray-400);
    --text-inverse:   var(--white);

    /* Borders */
    --border-default: var(--gray-200);
    --border-subtle:  var(--gray-100);
    --border-strong:  var(--gray-300);

    /* Shadows */
    --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.06);

    /* Typography scale (1.25 major third) */
    --text-xs:   0.75rem;    /* 12px */
    --text-sm:   0.875rem;   /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg:   1.125rem;   /* 18px */
    --text-xl:   1.25rem;    /* 20px */
    --text-2xl:  1.563rem;   /* 25px */
    --text-3xl:  1.953rem;   /* 31px */
    --text-4xl:  2.441rem;   /* 39px */
    --text-5xl:  3.052rem;   /* 49px */

    /* Spacing */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Radii */
    --radius-sm:   0.375rem;
    --radius-md:   0.5rem;
    --radius-lg:   0.75rem;
    --radius-xl:   1rem;
    --radius-2xl:  1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base:   200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:   300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index scale */
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-fixed:    300;
    --z-modal-bg: 400;
    --z-modal:    500;
    --z-toast:    600;
}

/* ---------- Dark Mode ---------- */
[data-theme="dark"] {
    --bg-page:      var(--gray-950);
    --bg-card:      var(--gray-850);
    --bg-elevated:  var(--gray-800);
    --bg-inset:     var(--gray-900);
    --bg-nav:       var(--gray-900);
    --bg-footer:    var(--gray-950);

    --text-primary:   var(--gray-100);
    --text-secondary: var(--gray-400);
    --text-muted:     var(--gray-500);
    --text-placeholder: var(--gray-600);

    --border-default: var(--gray-700);
    --border-subtle:  var(--gray-800);
    --border-strong:  var(--gray-600);

    --shadow-sm:  0 1px 2px rgba(0,0,0,0.2);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.35), 0 4px 6px -4px rgba(0,0,0,0.2);
    --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.4), 0 8px 10px -6px rgba(0,0,0,0.3);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-page);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); font-weight: 500; }

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--accent-hover);
}

strong { font-weight: 600; }

small { font-size: var(--text-sm); }

code, kbd, pre {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
}

code {
    background: var(--bg-inset);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--accent);
}

pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    line-height: 1.5;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

hr {
    border: none;
    border-top: 1px solid var(--border-default);
    margin: var(--space-8) 0;
}

/* ---------- Selection ---------- */
::selection {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-inset);
}
::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ---------- Utility Classes ---------- */
.text-accent  { color: var(--accent) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-error   { color: var(--error) !important; }
.text-inverse { color: var(--text-inverse) !important; }

.bg-page      { background-color: var(--bg-page) !important; }
.bg-card      { background-color: var(--bg-card) !important; }
.bg-elevated  { background-color: var(--bg-elevated) !important; }
.bg-inset     { background-color: var(--bg-inset) !important; }
.bg-dark-section { background-color: var(--gray-900) !important; }
.bg-accent    { background-color: var(--accent) !important; }
.bg-accent-soft { background-color: var(--accent-soft) !important; }

.font-mono { font-family: 'JetBrains Mono', monospace !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }

.hidden { display: none !important; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-padding {
    padding: var(--space-20) 0;
}

.section-padding-lg {
    padding: var(--space-24) 0;
}

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Waveform animation for hero */
@keyframes waveform {
    0%, 100% { height: 20%; }
    50% { height: 80%; }
}

.waveform-bar {
    display: inline-block;
    width: 4px;
    background: var(--accent);
    border-radius: 2px;
    margin: 0 2px;
    animation: waveform 1.2s ease-in-out infinite;
}

.waveform-bar:nth-child(2) { animation-delay: 0.1s; }
.waveform-bar:nth-child(3) { animation-delay: 0.2s; }
.waveform-bar:nth-child(4) { animation-delay: 0.3s; }
.waveform-bar:nth-child(5) { animation-delay: 0.4s; }
.waveform-bar:nth-child(6) { animation-delay: 0.5s; }
.waveform-bar:nth-child(7) { animation-delay: 0.6s; }
.waveform-bar:nth-child(8) { animation-delay: 0.7s; }
.waveform-bar:nth-child(9) { animation-delay: 0.8s; }
.waveform-bar:nth-child(10) { animation-delay: 0.9s; }
.waveform-bar:nth-child(11) { animation-delay: 1.0s; }
.waveform-bar:nth-child(12) { animation-delay: 0.15s; }
.waveform-bar:nth-child(13) { animation-delay: 0.35s; }
.waveform-bar:nth-child(14) { animation-delay: 0.55s; }
.waveform-bar:nth-child(15) { animation-delay: 0.75s; }
.waveform-bar:nth-child(16) { animation-delay: 0.95s; }

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }
    .section-padding { padding: var(--space-12) 0; }
    .section-padding-lg { padding: var(--space-16) 0; }
}
