:root {
    color-scheme: dark;
    --bg: #090909;
    --surface: rgba(20, 20, 20, 0.84);
    --surface-strong: rgba(10, 10, 10, 0.94);
    --surface-soft: rgba(255, 255, 255, 0.04);
    --line: rgba(255, 255, 255, 0.1);
    --text: #f3ede5;
    --muted: #b7afa4;
    --accent: #d3a676;
    --accent-deep: #8d6642;
    --success: #8abf9f;
    --danger: #d27f74;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --headline-font: "Syne", sans-serif;
    --body-font: "Instrument Sans", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(211, 166, 118, 0.12), transparent 34%),
        radial-gradient(circle at bottom right, rgba(87, 70, 53, 0.28), transparent 28%),
        linear-gradient(135deg, #050505 0%, #0b0b0b 55%, #101010 100%);
    color: var(--text);
    font-family: var(--body-font);
}

img {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
}

.page-shell {
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 28px;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: 28px;
    align-items: stretch;
    min-height: calc(100vh - 96px);
}

.hero-visual,
.voice-card {
    position: relative;
    overflow: hidden;
}

.hero-visual {
    min-height: 720px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: #111;
    box-shadow: var(--shadow);
}

.hero-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.18) 32%, rgba(0, 0, 0, 0.68) 100%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0) 48%, rgba(0, 0, 0, 0.46) 100%);
}

.hero-image-frame,
.hero-image {
    height: 100%;
}

.hero-image {
    width: 100%;
    object-fit: cover;
    object-position: center 18%;
    filter: saturate(0.95) contrast(1.05);
}

.hero-visual-copy {
    position: absolute;
    inset: auto 28px 28px 28px;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

.visual-caption {
    margin: 0;
    color: rgba(243, 237, 229, 0.92);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.76rem;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 26px;
    padding: 22px 0;
}

.copy-block {
    padding-right: 8px;
}

.eyebrow,
.card-kicker {
    margin: 0 0 12px;
    color: var(--accent);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.76rem;
}

h1,
h2 {
    margin: 0;
    font-family: var(--headline-font);
    font-weight: 700;
    line-height: 0.94;
    letter-spacing: -0.04em;
}

h1 {
    max-width: 12ch;
    font-size: clamp(3.4rem, 7vw, 6.7rem);
}

h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.subtitle,
.helper-text,
.site-footer p,
.detail-label,
#transcriptHint,
.empty-transcript {
    color: var(--muted);
}

.subtitle {
    max-width: 34rem;
    margin: 18px 0 0;
    font-size: 1.02rem;
    line-height: 1.7;
}

.voice-card {
    padding: 28px;
    border-radius: 30px;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
        var(--surface);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.voice-card::before {
    content: "";
    position: absolute;
    inset: -10% auto auto 52%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(211, 166, 118, 0.2), transparent 72%);
    pointer-events: none;
}

.voice-card-top,
.controls,
.details-grid,
.transcript-head,
.site-footer {
    display: flex;
    align-items: center;
}

.voice-card-top,
.transcript-head,
.site-footer {
    justify-content: space-between;
}

.helper-text {
    margin: 14px 0 0;
    max-width: 48ch;
    line-height: 1.6;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.24);
}

.status-pill[data-state="connecting"] .status-dot,
.status-pill[data-state="listening"] .status-dot,
.status-pill[data-state="speaking"] .status-dot {
    animation: pulse 1.8s infinite;
}

.status-pill[data-state="connecting"] .status-dot {
    background: var(--accent);
}

.status-pill[data-state="listening"] .status-dot {
    background: var(--success);
}

.status-pill[data-state="speaking"] .status-dot {
    background: #efe0c1;
}

.status-pill[data-state="error"] .status-dot {
    background: var(--danger);
}

.controls {
    gap: 14px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.button {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 54px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition:
        transform 180ms ease,
        opacity 180ms ease,
        background 180ms ease,
        color 180ms ease,
        box-shadow 180ms ease;
}

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

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

.button-primary {
    color: #090909;
    background: linear-gradient(135deg, #f1d1ac 0%, #d4a16d 52%, #b07a44 100%);
    box-shadow:
        0 14px 32px rgba(179, 126, 73, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.button-primary::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: inherit;
    border: 1px solid rgba(211, 166, 118, 0.26);
    opacity: 0;
    transition: opacity 180ms ease;
}

.button-primary:hover:not(:disabled)::after {
    opacity: 1;
}

.button-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
}

.signal-panel {
    position: relative;
    width: 154px;
    height: 154px;
    margin: 32px auto 26px;
    display: grid;
    place-items: center;
}

.signal-ring,
.signal-core {
    border-radius: 50%;
}

.signal-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(211, 166, 118, 0.18);
    background:
        radial-gradient(circle at center, rgba(211, 166, 118, 0.14), transparent 60%),
        rgba(255, 255, 255, 0.02);
    transform: scale(0.9);
    opacity: 0.55;
}

.signal-core {
    width: 64px;
    height: 64px;
    background: radial-gradient(circle at 30% 30%, #ffe6cb, #b37d49 66%, #4b3421 100%);
    box-shadow:
        0 0 34px rgba(211, 166, 118, 0.36),
        inset 0 0 16px rgba(255, 255, 255, 0.18);
}

.signal-panel[data-state="connecting"] .signal-ring,
.signal-panel[data-state="listening"] .signal-ring,
.signal-panel[data-state="speaking"] .signal-ring {
    animation: breathe 2.1s ease-in-out infinite;
}

.signal-panel[data-state="listening"] .signal-core {
    box-shadow:
        0 0 48px rgba(138, 191, 159, 0.34),
        inset 0 0 16px rgba(255, 255, 255, 0.18);
}

.signal-panel[data-state="speaking"] .signal-core {
    box-shadow:
        0 0 54px rgba(241, 209, 172, 0.44),
        inset 0 0 18px rgba(255, 255, 255, 0.2);
}

.signal-panel[data-state="error"] .signal-core {
    background: radial-gradient(circle at 30% 30%, #efb3ab, #c46a5f 66%, #522925 100%);
}

.details-grid {
    gap: 14px;
    align-items: stretch;
    margin-top: 4px;
}

.detail-box,
.transcript-panel {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.detail-box {
    flex: 1 1 0;
    padding: 16px 18px;
    border-radius: 18px;
}

.detail-label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.detail-box strong {
    font-size: 1.02rem;
    font-weight: 600;
}

.transcript-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    margin-top: 18px;
    padding: 18px;
    border-radius: 22px;
    height: clamp(240px, 28vh, 320px);
}

.transcript-head {
    gap: 18px;
}

.transcript-head p,
#transcriptHint {
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.transcript-list {
    display: grid;
    align-content: start;
    gap: 12px;
    margin-top: 16px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
}

.transcript-entry {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
}

.transcript-entry strong {
    display: block;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.transcript-entry p,
.empty-transcript {
    margin: 0;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.transcript-list::-webkit-scrollbar {
    width: 8px;
}

.transcript-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.transcript-list::-webkit-scrollbar-track {
    background: transparent;
}

.site-footer {
    padding: 16px 8px 0;
    gap: 18px;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-footer p {
    margin: 0;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(211, 166, 118, 0.28);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(211, 166, 118, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(211, 166, 118, 0);
    }
}

@keyframes breathe {
    0%,
    100% {
        transform: scale(0.9);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.04);
        opacity: 0.88;
    }
}

@media (max-width: 1080px) {
    .page-shell {
        width: min(100% - 24px, 1240px);
        padding-top: 12px;
    }

    .hero-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-visual {
        min-height: 72vh;
    }

    .hero-copy {
        padding: 0;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 18px, 100%);
    }

    .hero-visual,
    .voice-card {
        border-radius: 24px;
    }

    .hero-visual {
        min-height: 62vh;
    }

    .hero-visual-copy {
        inset: auto 18px 18px 18px;
        flex-direction: column;
        align-items: flex-start;
    }

    .voice-card {
        padding: 22px 18px;
    }

    .voice-card-top,
    .details-grid,
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .details-grid {
        width: 100%;
    }

    .detail-box {
        width: 100%;
    }

    .controls {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

    .signal-panel {
        width: 132px;
        height: 132px;
        margin-top: 26px;
    }

    .transcript-panel {
        height: 220px;
    }
}
