:root {
--ink: #171717;
--muted: #666;
--line: rgba(0,0,0,.12);
--book-theme: #eeeeee;
--serif: "Bodoni Moda", Didot, "Bodoni 72", Georgia, serif;
--sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  }

html {
scroll-behavior: smooth;
}

body {
margin: 0;
color: var(--ink);
background: #faf9f7;
font-family: var(--sans);
}

a {
color: inherit;
text-decoration: none;
}

/* =========================================
HOMEPAGE
========================================= */

.home-shell {
width: min(1180px, calc(100% - 40px));
margin: 0 auto;
padding: 72px 0 36px;
}

.site-header {
text-align: center;
max-width: 680px;
margin: 0 auto 56px;
}

.eyebrow {
margin: 0 0 12px;
font-size: .72rem;
letter-spacing: .22em;
text-transform: uppercase;
color: var(--muted);
}

h1,
h2 {
font-family: var(--serif);
font-weight: 400;
}

.site-header h1 {
margin: 0;
font-size: clamp(3rem, 7vw, 5.5rem);
line-height: .95;
}

.intro {
margin: 24px auto 0;
color: var(--muted);
line-height: 1.7;
}

/* HOMEPAGE BOOK GRID */

#books {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 20px;
align-items: start;
max-width: 1100px;
margin: 40px auto 0;
}

.book-card {
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
overflow: hidden;
background: white;
box-shadow: 0 18px 45px rgba(0,0,0,.08);
transition: transform .3s ease, box-shadow .3s ease;
text-align: center;
}

.book-card:hover {
transform: translateY(-8px);
box-shadow: 0 25px 55px rgba(0,0,0,.13);
}

.book-card img {
display: block;
width: 100%;
height: auto;
transition: transform .25s ease;
}

/* BOOK TITLES UNDER COVERS */

.book-title {
display: block;
width: 100%;
padding: 0 10px 16px;
font-family: var(--serif);
font-size: 1.2rem;
line-height: 1.35;
font-weight: 400;
text-align: center;
}

.site-footer {
margin-top: 72px;
text-align: center;
color: #888;
font-size: .8rem;
}

/* =========================================
BOOK SUBPAGE
========================================= */

.book-page {
min-height: 100vh;
background: var(--book-theme);
transition: background .3s;
}

.book-shell {
width: min(1050px, calc(100% - 40px));
margin: 0 auto;
padding: 30px 0 60px;
}

.back-link,
.reading-nav a {
font-size: .85rem;
opacity: .72;
}

.back-link:hover,
.reading-nav a:hover {
opacity: 1;
}

/* BOOK LAYOUT */

.book-layout {
min-height: calc(100vh - 100px);
display: grid;
grid-template-columns: 380px minmax(300px, 460px);
justify-content: center;
gap: 80px;
align-items: center;
padding: 35px 0;
}

/* COVER */

.cover-wrap {
display: flex;
justify-content: center;
align-items: center;
}

.detail-cover {
width: 280px;
max-width: 100%;
height: auto;
box-shadow: 0 20px 45px rgba(0,0,0,.18);
}

/* BOOK INFORMATION */

.book-options {
width: 100%;
}

.book-options h1 {
margin: 0 0 10px;
font-size: clamp(2.5rem, 5vw, 4rem);
line-height: 1;
}

.book-options .eyebrow {
margin-bottom: 12px;
}

.book-description {
margin: 18px 0;
color: rgba(0,0,0,.72);
font-size: 0.92rem;
line-height: 1.7;
}

/* READING OPTIONS */

.reading-options {
display: grid;
gap: 10px;
margin-top: 30px;
margin-bottom: 18px;
}

.reading-options h2 {
margin: 0 0 8px;
}

.option {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 20px;
border: 1px solid rgba(0,0,0,.17);
background: rgba(255,255,255,.38);
transition: background .2s, transform .2s;
}

.option:hover {
background: rgba(255,255,255,.78);
transform: translateX(4px);
}

.option span:first-child {
font-family: var(--serif);
font-size: 1.25rem;
}

/* AMAZON */

.amazon-button {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 25px;
padding: 17px 20px;
background: var(--ink);
color: white;
font-weight: 600;
transition: opacity .2s, transform .2s;
}

.amazon-button:hover {
opacity: .86;
transform: translateY(-2px);
}

.book-meta {
margin-top: 22px;
color: rgba(0,0,0,.62);
font-size: .8rem;
}

/* =========================================
READING PAGE
========================================= */

.reading-body {
background: white;
}

.reading-page {
min-height: 100vh;
background: white;
}

.reading-shell {
width: min(820px, calc(100% - 42px));
margin: 0 auto;
padding: 28px 0 90px;
}

.reading-header {
padding: 80px 0 50px;
text-align: center;
border-bottom: 1px solid var(--line);
}

.reading-header h1 {
margin: 0;
font-size: clamp(2.7rem, 6vw, 4.8rem);
}

.reading-content {
padding: 55px 0;
font-family: var(--serif);
font-size: 1.2rem;
line-height: 1.95;
color: #222;
white-space: normal;
}

/* =========================================
NOT FOUND
========================================= */

.not-found {
min-height: 100vh;
display: grid;
place-content: center;
text-align: center;
}

.not-found a {
text-decoration: underline;
}

/* =========================================
TABLET
========================================= */

@media (max-width: 800px) {
.home-shell {
width: min(calc(100% - 28px), 600px);
padding-top: 48px;
}

#books {
grid-template-columns: 1fr;
gap: 28px;
}

.book-card {
gap: 10px;
}

.book-title {
font-size: 1.25rem;
padding-bottom: 14px;
}

.book-layout {
grid-template-columns: 1fr;
gap: 35px;
padding-top: 42px;
text-align: center;
}

.detail-cover {
width: 230px;
}

.book-options {
padding: 0 4px;
}

.reading-options {
text-align: left;
}

.amazon-button {
text-align: left;
}
}

/* =========================================
PHONE
========================================= */

@media (max-width: 480px) {
.home-shell {
width: calc(100% - 24px);
}

.site-header {
margin-bottom: 36px;
}

#books {
gap: 28px;
}

.book-shell {
width: calc(100% - 28px);
}

.book-layout {
gap: 30px;
}

.detail-cover {
width: 210px;
}

.book-options h1 {
font-size: 2.5rem;
}

.reading-shell {
width: calc(100% - 30px);
}

.reading-content {
font-size: 1.08rem;
line-height: 1.85;
}
}
