/* Ezz's Wattpad - calm, gentle reading library. Mobile-first, no JS. */
:root {
  --paper: #fff8f4;
  --blush: #fde4ea;
  --coral: #e8806a;
  --coral-deep: #b4492f;
  --ink: #4a3a40;
  --ink-soft: #6e5a62;
  --lavender: #e6dcf5;
  --mint: #d8efe3;
  --butter: #fbefc9;
  --sky: #d9e9f7;
  --line: #f0d6d0;
  --radius: 1.25rem;
  --space: clamp(1rem, 4vw, 2rem);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}
img, picture, video, canvas, svg { max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol { margin: 0; }
a { color: var(--coral-deep); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--coral-deep); outline-offset: 3px; border-radius: 0.5rem; }

.skip-link {
  position: absolute; left: 0.75rem; top: -4rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 0.75rem 1rem; border-radius: 0.75rem;
  font-family: var(--sans);
}
.skip-link:focus { top: 0.75rem; }

.wrap { width: 100%; max-width: 68rem; margin-inline: auto; padding-inline: var(--space); }

/* header */
.site-header { background: var(--blush); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; padding-block: 1rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; text-decoration: none; color: var(--ink); }
.brand img { width: 3rem; height: 3rem; flex: none; }
.brand span { font-size: 1.375rem; font-weight: 700; line-height: 1.2; }
.nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; font-family: var(--sans); }
.nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.25rem 1rem;
  border-radius: 999px; background: var(--paper); color: var(--ink); text-decoration: none; font-size: 0.9375rem;
  border: 1px solid var(--line); transition: background-color 200ms ease-out;
}
.nav a:hover { background: var(--butter); }

/* hero */
.hero { padding-block: clamp(2rem, 8vw, 4.5rem); }
.hero h1 { font-size: clamp(1.875rem, 6vw, 3rem); line-height: 1.2; margin-bottom: 1rem; max-width: 22ch; }
.hero p { max-width: 62ch; color: var(--ink-soft); font-size: 1.125rem; }

/* shelves */
.shelf { padding-block: clamp(1.75rem, 6vw, 3.5rem); border-top: 1px solid var(--line); }
.shelf h2 { font-size: clamp(1.5rem, 4.5vw, 2rem); line-height: 1.25; margin-bottom: 0.5rem; }
.shelf .sub { color: var(--ink-soft); margin-bottom: clamp(1.25rem, 4vw, 2rem); max-width: 60ch; }
.books {
  display: grid; gap: clamp(1rem, 3vw, 1.75rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  margin: 0; padding: 0; list-style: none;
}
.book { min-width: 0; }

/* card */
.card {
  height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.cover { position: relative; min-height: 7.5rem; padding: 1.25rem; display: flex; align-items: flex-end; background: var(--lavender); }
.cover.mint { background: var(--mint); }
.cover.butter { background: var(--butter); }
.cover.sky { background: var(--sky); }
.cover::before {
  content: ""; position: absolute; top: 0; right: 1.5rem; width: 1.5rem; height: 2.5rem;
  background: var(--coral); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
}
.tag {
  font-family: var(--sans); font-size: 0.8125rem; letter-spacing: 0.02em; color: var(--ink);
  background: rgba(255, 255, 255, 0.75); padding: 0.125rem 0.75rem; border-radius: 999px;
}
.card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; min-width: 0; }
.card h3 { font-size: 1.3125rem; line-height: 1.3; }
.meta { font-family: var(--sans); font-size: 0.9375rem; color: var(--ink-soft); }
.optional { font-size: 0.9375rem; color: var(--ink-soft); font-style: italic; }

/* chapters */
details { margin-top: auto; border-top: 1px solid var(--line); padding-top: 0.5rem; }
summary {
  display: flex; align-items: center; min-height: 2.75rem; cursor: pointer; font-family: var(--sans);
  font-size: 0.9375rem; color: var(--coral-deep); font-weight: 600; list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; display: inline-block; width: 1.25rem; font-weight: 700; }
details[open] summary::before { content: "\2212"; }
.chapters { margin: 0.25rem 0 0.5rem; padding: 0; list-style: none; font-family: var(--sans); font-size: 0.9375rem; }
.chapters li { padding: 0.5rem 0.75rem; border-radius: 0.75rem; }
.chapters li:nth-child(odd) { background: var(--paper); }

/* notes */
.note { background: var(--blush); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2rem); }
.note h2 { font-size: 1.375rem; margin-bottom: 0.5rem; }
.note ul { padding-left: 1.25rem; margin-top: 0.75rem; }
.note li { margin-block: 0.25rem; }
.about { padding-block: clamp(1.75rem, 6vw, 3.5rem); }

footer { border-top: 1px solid var(--line); padding-block: 1.5rem 2.5rem; color: var(--ink-soft); font-family: var(--sans); font-size: 0.9375rem; }

@media (min-width: 48em) {
  .site-header .wrap { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
