:root {
    --ink: #2f201a;
    --muted: #6f5b4c;
    --paper: #fff8e6;
    --paper-deep: #ead8af;
    --line: #8d5a34;
    --line-soft: #c49a70;
    --accent: #9f3e35;
    --accent-dark: #753026;
    --shadow: 0 20px 42px rgba(92, 58, 32, 0.2);
    --serif-display: Georgia, "Times New Roman", serif;
    --serif-body: Garamond, "Times New Roman", serif;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: var(--serif-body);
    background:
        radial-gradient(circle at 70% 12%, rgba(255, 247, 218, 0.95), transparent 29rem),
        radial-gradient(circle at 15% 85%, rgba(190, 126, 62, 0.18), transparent 23rem),
        linear-gradient(90deg, #f2e3c1, #fbf2d8 45%, #e5c998 100%);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    opacity: 0.16;
    background-image: linear-gradient(45deg, rgba(70, 40, 20, 0.08) 25%, transparent 25%), linear-gradient(-45deg, rgba(70, 40, 20, 0.08) 25%, transparent 25%);
    background-size: 8px 8px;
}

.page-shell {
    width: min(1040px, calc(100% - 56px));
    margin: 0 auto;
    padding: clamp(24px, 3.6vw, 46px) 0;
}

.top-grid {
    display: block;
}

.panel {
    border: 2px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 250, 232, 0.82);
    box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.portrait-frame {
    position: relative;
    overflow: hidden;
    align-self: start;
    width: 100%;
    max-width: 260px;
    border: 3px solid var(--line);
    background: linear-gradient(135deg, #f6ecd1, #d9bd88);
    box-shadow: 7px 8px 0 rgba(113, 79, 43, 0.13);
}

.portrait-frame::after {
    position: absolute;
    inset: 10px;
    content: "";
    pointer-events: none;
    border: 1px solid rgba(255, 248, 226, 0.75);
    box-shadow: inset 0 0 0 1px rgba(66, 38, 20, 0.18);
}

.portrait-frame img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
}

.facts-card {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: clamp(26px, 3.2vw, 38px);
    align-items: start;
    padding: clamp(28px, 3.1vw, 40px);
}

.author-side {
    display: grid;
    gap: 18px;
    align-content: start;
}

.author-side .portrait-frame {
    max-width: none;
}

.author-info {
    min-width: 0;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-family: var(--serif-display);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    font-family: var(--serif-display);
    line-height: 1.05;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2.25rem, 4.3vw, 3.65rem);
    letter-spacing: 0.055em;
}

h2 {
    font-size: clamp(1.25rem, 1.8vw, 1.55rem);
    letter-spacing: 0.03em;
}

.subtitle {
    margin: 12px 0 18px;
    color: var(--muted);
    font-size: clamp(1.08rem, 1.6vw, 1.3rem);
    font-style: italic;
}

.author-info h2 {
    margin-top: 2px;
}

.ornament {
    display: block;
    width: 100%;
    height: 14px;
    margin: 0 0 22px;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='12' viewBox='0 0 80 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 6c5 0 5-4 10-4s5 4 10 4 5-4 10-4 5 4 10 4 5-4 10-4 5 4 10 4 5-4 10-4 5 4 10 4' fill='none' stroke='%23a87956' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 80px 12px;
}

.ornament.long {
    margin: 22px 0;
}

.bio-text,
.work-card p {
    color: #513c31;
    font-size: clamp(1.08rem, 1.38vw, 1.22rem);
    line-height: 1.52;
}

.bio-text {
    margin: 14px 0 0;
}

.bio-text + .bio-text {
    margin-top: 16px;
}

dl {
    margin: 0;
    padding: 4px 18px;
    border: 1px solid rgba(141, 90, 52, 0.35);
    background: rgba(234, 216, 175, 0.28);
}

dl div {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px dashed var(--line-soft);
}

dl div:last-child {
    border-bottom: 0;
}

dt {
    align-self: center;
    font-family: var(--serif-display);
    font-size: 0.88rem;
    font-variant: small-caps;
    font-weight: 700;
    letter-spacing: 0.02em;
}

dd {
    margin: 0;
    color: #4d382d;
    font-size: 0.96rem;
    line-height: 1.3;
    text-align: right;
}

dd em {
    color: var(--muted);
    font-size: 1rem;
}

.work-card {
    margin-top: clamp(22px, 3vw, 34px);
    padding: clamp(26px, 3.2vw, 38px);
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.year-stamp {
    display: grid;
    place-items: center;
    min-width: 78px;
    padding: 10px 14px 8px;
    border: 2px solid var(--line-soft);
    background: var(--paper-deep);
    font-family: var(--serif-display);
    line-height: 1;
    box-shadow: 4px 4px 0 rgba(113, 79, 43, 0.14);
}

.year-stamp strong {
    display: block;
    font-size: 1.08rem;
}

blockquote {
    margin: 20px 0 0;
    padding: 15px 20px;
    border-left: 5px solid var(--accent);
    color: var(--muted);
    background: rgba(234, 216, 175, 0.45);
    font-size: clamp(1.08rem, 1.55vw, 1.28rem);
    font-style: italic;
    line-height: 1.35;
}

.audio-player {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 30px;
    gap: 16px;
    align-items: center;
    margin-top: 24px;
    padding: 15px 18px;
    border: 2px solid var(--line-soft);
    outline: 1px dashed var(--line-soft);
    outline-offset: -7px;
    background: #ead9b3;
}

button {
    font: inherit;
}

.play-button {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 0;
    color: #fff8e8;
    background: var(--accent);
    box-shadow: 4px 4px 0 rgba(55, 35, 25, 0.35);
    cursor: pointer;
}

.play-icon {
    display: block;
    width: 0;
    height: 0;
    margin-left: 5px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 16px solid currentColor;
}

.audio-player.is-playing .play-icon {
    width: 18px;
    height: 22px;
    margin-left: 0;
    border: 0;
    background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65% 100%);
}

.audio-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 11px;
    font-family: var(--serif-display);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.time-readout {
    white-space: nowrap;
}

.progress-track {
    height: 12px;
    border: 2px solid var(--line);
    background: rgba(255, 248, 226, 0.7);
    cursor: pointer;
}

.progress-fill {
    display: block;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #bc7d4a);
}

.volume-button {
    border: 0;
    color: var(--ink);
    background: transparent;
    font-size: 1.35rem;
    cursor: pointer;
}

.transcript {
    margin-top: 24px;
    padding: 20px 22px;
    border: 1px solid rgba(141, 90, 52, 0.38);
    background: rgba(255, 248, 226, 0.52);
}

.transcript-title {
    margin: 0 0 10px;
    color: var(--accent-dark);
    font-family: var(--serif-display);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.transcript-text {
    margin: 0;
    color: #513c31;
    font-size: clamp(1.08rem, 1.35vw, 1.22rem);
    line-height: 1.65;
}

.transcript-word {
    border-radius: 4px;
    padding: 1px 2px;
    transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.transcript-word.is-read {
    color: var(--accent-dark);
    background: rgba(196, 154, 112, 0.22);
}

.transcript-word.is-current {
    color: #fff8e8;
    background: var(--accent);
    box-shadow: 0 2px 0 rgba(91, 52, 31, 0.24);
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    animation: reveal 700ms ease forwards;
}

.reveal:nth-child(2) {
    animation-delay: 120ms;
}

.work-card.reveal {
    animation-delay: 240ms;
}

@keyframes reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 1180px) {
    .page-shell {
        width: 980px;
    }

    .facts-card {
        grid-template-columns: 330px minmax(0, 1fr);
    }
}

@media (max-width: 860px) {
    .page-shell {
        width: min(100% - 24px, 680px);
        padding: 18px 0 34px;
    }

    .facts-card {
        grid-template-columns: 1fr;
    }

    .portrait-frame {
        max-width: 380px;
        width: 100%;
        margin: 0 auto;
    }

    .section-head {
        display: block;
    }

    .year-stamp {
        width: 74px;
        margin-top: 18px;
    }
}

@media (max-width: 620px) {
    .panel {
        border-width: 2px;
        border-radius: 10px;
    }

    .facts-card,
    .work-card {
        padding: 22px 18px;
    }

    h1 {
        font-size: clamp(2rem, 12vw, 3.2rem);
    }

    dl div {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    dl {
        padding: 2px 14px;
    }

    dd {
        text-align: left;
    }

    .audio-player {
        grid-template-columns: 54px 1fr;
        gap: 14px;
    }

    .play-button {
        width: 54px;
        height: 54px;
    }

    .volume-button {
        grid-column: 1 / -1;
        justify-self: end;
    }

    .audio-row {
        display: grid;
        font-size: 0.82rem;
    }

    .transcript {
        padding: 18px 16px;
    }
}

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