@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg: #0b1020;
    --bg-alt: #0f172a;
    --surface: rgba(17, 25, 44, 0.78);
    --surface-strong: rgba(15, 23, 42, 0.92);
    --stroke: rgba(148, 163, 184, 0.22);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #5ef0e8;
    --accent-2: #7aa2ff;
    --accent-3: #ff7db8;
    --shadow: 0 24px 60px rgba(4, 8, 20, 0.55);
    --radius: 20px;
    --radius-lg: 28px;
    --page-width: 1200px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(94, 240, 232, 0.2), transparent 60%),
        radial-gradient(900px 600px at 90% 0%, rgba(122, 162, 255, 0.25), transparent 55%),
        radial-gradient(900px 800px at 50% 120%, rgba(255, 125, 184, 0.12), transparent 60%),
        var(--bg);
    line-height: 1.6;
}

.page {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 32px 24px 80px;
    position: relative;
}

.page::before,
.page::after {
    content: '';
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    filter: blur(0px);
    z-index: -1;
    opacity: 0.35;
}

.page::before {
    top: -80px;
    left: -60px;
    background: radial-gradient(circle, rgba(94, 240, 232, 0.45) 0%, transparent 70%);
}

.page::after {
    bottom: 120px;
    right: -80px;
    background: radial-gradient(circle, rgba(122, 162, 255, 0.45) 0%, transparent 70%);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    background: var(--surface-strong);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand img {
    height: 38px;
    width: auto;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 600;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(94, 240, 232, 0.12);
    color: var(--accent);
    border: 1px solid rgba(94, 240, 232, 0.28);
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(94, 240, 232, 0.8);
    animation: pulse 2.2s ease-in-out infinite;
}

.hero {
    margin-top: 36px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    align-items: center;
}

.hero-content h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.15;
    margin: 0 0 16px;
}

.hero-content p {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 16px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 26px;
}

.record-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
}

.record-toggle .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.record-toggle svg {
    width: 100%;
    height: 100%;
}

.record-toggle .icon.mic {
    color: #0b1020;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 10px;
    width: 28px;
    height: 28px;
    padding: 4px;
}

.record-toggle .icon.action {
    color: #0b1020;
}

.record-toggle .icon-stop {
    display: none;
}

.record-toggle[data-state="recording"] .icon-record {
    display: none;
}

.record-toggle[data-state="recording"] .icon-stop {
    display: inline-flex;
}

.record-toggle .btn-label {
    white-space: nowrap;
}

.record-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid var(--stroke);
    background: rgba(15, 23, 42, 0.55);
    max-width: 460px;
}

.waveform-shell {
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(10, 15, 30, 0.6);
    max-width: 560px;
}

.waveform {
    width: 100%;
    height: 72px;
    display: block;
}

.record-status.active {
    border-color: rgba(94, 240, 232, 0.45);
    box-shadow: 0 16px 40px rgba(94, 240, 232, 0.15);
}

.record-status.processing {
    border-color: rgba(122, 162, 255, 0.45);
    box-shadow: 0 16px 40px rgba(122, 162, 255, 0.12);
}

.voice-orb {
    position: relative;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
}

.orb-core {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(94, 240, 232, 0.95), rgba(122, 162, 255, 0.9));
    box-shadow: 0 0 20px rgba(94, 240, 232, 0.8);
    z-index: 2;
}

.orb-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(94, 240, 232, 0.5);
    box-shadow: 0 0 24px rgba(122, 162, 255, 0.25);
    opacity: 0.4;
    transform: scale(0.85);
}

.orb-ring.delayed {
    opacity: 0.25;
    transform: scale(0.7);
}

.record-status.active .orb-ring,
.record-status.processing .orb-ring {
    animation: orbPulse 1.8s ease-in-out infinite;
}

.record-status.active .orb-ring.delayed,
.record-status.processing .orb-ring.delayed {
    animation-delay: 0.6s;
}

.record-status.speaking .orb-core {
    animation: orbSpeak 0.8s ease-in-out infinite;
}

.timer {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.recording-state {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.mic-activity {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    align-items: end;
    height: 28px;
    width: 120px;
}

.mic-activity span {
    display: block;
    height: 18px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(94, 240, 232, 0.9), rgba(122, 162, 255, 0.9));
    transform: scaleY(0.3);
    transform-origin: bottom;
    transition: transform 0.15s ease;
    opacity: 0.65;
}

.mic-activity.active span {
    opacity: 1;
}

.btn {
    border: none;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 22px;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn.primary {
    background: linear-gradient(135deg, rgba(94, 240, 232, 0.95), rgba(122, 162, 255, 0.95));
    color: #0b1020;
    box-shadow: 0 12px 30px rgba(94, 240, 232, 0.25);
}

.btn.secondary {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.btn.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--stroke);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
}

.btn:active {
    transform: translateY(0);
}

.insight-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.insight-card {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--stroke);
}

.insight-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.insight-value {
    font-size: 18px;
    font-weight: 600;
}

.hero-visual {
    position: relative;
    min-height: 360px;
    display: grid;
    align-items: center;
    justify-items: center;
}

.glass-card {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 240px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(94, 240, 232, 0.25);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    animation: float 6s ease-in-out infinite;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 16px;
}

.chip {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(94, 240, 232, 0.18);
    color: var(--accent);
    font-weight: 600;
}

.card-metric {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.metric-title {
    font-size: 12px;
    color: var(--muted);
}

.metric-value {
    font-size: 24px;
    font-weight: 600;
}

.wave {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 16px;
}

.wave span {
    display: block;
    height: 28px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(94, 240, 232, 0.8), rgba(122, 162, 255, 0.8));
    animation: wave 1.6s ease-in-out infinite;
}

.wave span:nth-child(2) { animation-delay: 0.2s; }
.wave span:nth-child(3) { animation-delay: 0.4s; }
.wave span:nth-child(4) { animation-delay: 0.6s; }
.wave span:nth-child(5) { animation-delay: 0.8s; }

.medical-illustration {
    width: min(100%, 420px);
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(3, 7, 18, 0.55));
}

.workspace,
.documents {
    margin-top: 48px;
}

.section-header h2,
.docs-header h2 {
    margin: 0 0 6px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
}

.section-header p,
.docs-header p {
    margin: 0;
    color: var(--muted);
}

.workspace-shell {
    margin-top: 26px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr);
    gap: 28px;
    align-items: start;
    padding: 24px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.output-column {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.output-divider {
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(94, 240, 232, 0.4), transparent);
    height: 100%;
}

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

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.output-header h3 {
    margin: 0;
    font-size: 16px;
    font-family: 'Space Grotesk', sans-serif;
}

.output-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(122, 162, 255, 0.12);
    color: var(--accent-2);
}

.output-body {
    position: relative;
    margin: 0;
    padding: 4px 0 4px 20px;
    color: #d1d5db;
    display: flex;
    flex-direction: column;
    gap: 12px;
    word-break: break-word;
    font-family: 'DM Sans', sans-serif;
    min-height: 120px;
}

.output-body::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, rgba(94, 240, 232, 0.6), rgba(122, 162, 255, 0.2));
    border-radius: 2px;
}

.output-body h4 {
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.output-body p {
    margin: 0;
    color: #e2e8f0;
}

.output-body ul {
    margin: 0;
    padding-left: 18px;
    color: #e2e8f0;
}

.output-body li {
    margin-bottom: 6px;
}

.output-body .data-row {
    display: grid;
    grid-template-columns: minmax(100px, 140px) minmax(0, 1fr);
    gap: 8px;
    font-size: 14px;
    color: #e2e8f0;
}

.output-body .data-row span {
    color: var(--muted);
}

.output-body .turn-card {
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.output-body .turn-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.output-body .empty-state {
    color: var(--muted);
    font-style: italic;
}

.output-body .structured-section {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.documents {
    padding: 22px;
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow);
}

.docs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

#docs > * {
    background: rgba(9, 14, 26, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    padding: 14px;
    color: var(--text);
    transition: transform 0.2s ease, border 0.2s ease;
}

#docs .doc-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    margin: 0 0 6px;
}

#docs .doc-subtitle {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 12px;
}

#docs .doc-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

#docs .doc-section h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#docs p {
    margin: 0 0 6px;
    color: #e2e8f0;
}

#docs ul {
    margin: 0;
    padding-left: 18px;
    color: #e2e8f0;
}

#docs .turn-card {
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.16);
    margin-bottom: 8px;
}

#docs .turn-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

#docs .data-row {
    display: grid;
    grid-template-columns: minmax(100px, 140px) minmax(0, 1fr);
    gap: 8px;
    font-size: 14px;
    color: #e2e8f0;
}

#docs .data-row span {
    color: var(--muted);
}

#docs .empty-state {
    color: var(--muted);
    font-style: italic;
}

#docs .structured-section {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.12);
    margin-bottom: 10px;
}

#docs > *:hover {
    transform: translateY(-3px);
    border-color: rgba(122, 162, 255, 0.4);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes wave {
    0%, 100% { transform: scaleY(0.6); opacity: 0.6; }
    50% { transform: scaleY(1); opacity: 1; }
}

@keyframes orbPulse {
    0% { transform: scale(0.8); opacity: 0.35; }
    50% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(0.8); opacity: 0.35; }
}

@keyframes orbSpeak {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}

@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        order: -1;
        min-height: 320px;
    }

    .glass-card {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 12px;
    }

    .insight-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .workspace-shell {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .output-divider {
        display: none;
    }

    .docs-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .hero-visual {
        min-height: 260px;
    }

    .record-status {
        width: 100%;
        justify-content: space-between;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
