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

:root { color-scheme: dark; font-family: "DM Sans", sans-serif; background: #171819; color: #f9f3e7; --accent: #ffd08b; --muted: #c3b7a5; }
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at top left, #35291f, transparent 65%) no-repeat; }
main { max-width: 1050px; margin: auto; padding: clamp(24px, 7vw, 88px) clamp(16px, 5vw, 54px) 52px; }
.intro { border-bottom: 1px solid #625444; padding-bottom: 24px; margin-bottom: 30px; }
.eyebrow { color: var(--accent); text-transform: uppercase; font-size: .74rem; letter-spacing: .18em; font-weight: 700; margin: 0 0 12px; }
h1, .player h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; margin: 0; }
h1 { font-size: clamp(3.5rem, 9vw, 7rem); line-height: .94; letter-spacing: -.035em; }
h1 em { color: var(--accent); }
#book-length { color: var(--muted); margin-bottom: 0; }
.layout { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr); gap: clamp(24px, 5vw, 56px); align-items: start; }
.player { border: 1px solid #665340; background: #24211e; border-radius: 18px; padding: clamp(17px, 3vw, 30px); position: sticky; top: 20px; }
.player h2 { font-size: clamp(2.3rem, 5vw, 3.5rem); line-height: .98; min-height: 2em; }
#position { width: 100%; accent-color: var(--accent); margin: 20px 0 4px; cursor: pointer; }
.time, .options { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; }
.time, .chapter-time { font-variant-numeric: tabular-nums; }
.transport { display: flex; justify-content: center; gap: clamp(5px, 1.3vw, 12px); margin: 20px 0; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.transport button { min-width: 42px; min-height: 44px; border-radius: 50%; background: transparent; border: 1px solid #6d5b49; font-size: .9rem; }
.transport .play { background: var(--accent); color: #231b13; border: 0; width: 52px; height: 52px; align-self: center; font-size: 1.15rem; }
.transport button:not(.play) { align-self: center; }
.options { border-top: 1px solid #524538; padding-top: 12px; }
.options p { text-align: right; margin: 0; }
.options select { background: transparent; border: 0; padding: 5px 0; }
.chapters h2 { font-size: 1.1rem; margin: 1px 0 12px; }
ol { list-style: none; margin: 0; padding: 0; }
.chapters button { width: 100%; display: grid; grid-template-columns: 2ch 1fr auto; align-items: center; gap: 12px; padding: 11px; text-align: left; background: transparent; border: 0; border-bottom: 1px solid #3e3830; min-height: 48px; }
.chapters button:hover, .transport button:not(:disabled):not(.play):hover { background: #3b3228; }
.chapters [aria-current="true"] { border-radius: 8px; background: #3b3025; color: var(--accent); }
.track-number, .chapter-time, .chapter-section { color: var(--muted); font-size: .75rem; }
.chapter-section { display: block; margin-bottom: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 670px) { .layout { grid-template-columns: 1fr; } .player { position: static; } }

.login-screen { max-width: 650px; margin: 8vh auto 0; }
.login-screen h1 { font-size: clamp(3.5rem, 8vw, 6rem); }
#login-form { display: grid; gap: 10px; max-width: 360px; margin-top: 28px; }
#login-form label { color: var(--muted); font-weight: 600; }
#login-form input { background: #24211e; color: inherit; border: 1px solid #76614c; border-radius: 8px; padding: 12px 14px; font: inherit; }
#login-form button { background: var(--accent); color: #231b13; border: 0; border-radius: 8px; padding: 12px 14px; font-weight: 700; }
#login-status { margin: 0; min-height: 1.4em; color: #ffba9f; }
.library-link { color: var(--accent); display: inline-block; margin-bottom: 22px; }
.books { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0; }
.books a { display: grid; gap: 8px; align-content: start; max-width: 420px; padding: 22px; color: inherit; text-decoration: none; background: #24211e; border: 1px solid #665340; border-radius: 12px; }
.books a:hover { background: #3b3025; }
.books strong { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 2rem; }
.books span { color: var(--muted); font-size: .9rem; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
