/* kimwildwood.com */
:root {
  --ink: #0d0a0f;
  --velvet: #16121a;
  --bone: #e8e2e6;
  --dusk: #a89aa3;
  --wine: #7a1f3d;
  --rose: #c25a78;
  --line: #2a2230;
  --display: 'Cormorant Garamond', Georgia, serif;
  --body: 'EB Garamond', Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--ink); color: var(--bone);
  font-family: var(--body); font-size: 19px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--rose); }
a:hover { color: var(--bone); }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; }
em, i { font-style: italic; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 680px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; gap: .5rem 2rem;
  justify-content: space-between; align-items: baseline; padding-top: 1.3rem; padding-bottom: 1.1rem;
}
.wordmark {
  font-family: var(--display); font-weight: 600; font-size: 1.55rem;
  letter-spacing: .12em; color: var(--bone); text-decoration: none;
}
.site-nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.site-nav a { color: var(--dusk); text-decoration: none; font-size: 1rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--bone); }
.site-nav a[aria-current="page"] { border-bottom: 1px solid var(--wine); }

/* Hero */
.hero { padding: 4.5rem 0 4rem; }
.hero .wrap {
  display: grid; grid-template-columns: minmax(200px, 300px) 1fr;
  gap: 3.5rem; align-items: center;
}
.hero-cover { width: 100%; box-shadow: 0 30px 60px -20px #000, 0 0 0 1px var(--line); }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 500; max-width: 22ch; margin-bottom: 1.4rem; }
.hero .lede { color: var(--dusk); font-size: 1.15rem; max-width: 46ch; }
.hero .lede strong { color: var(--bone); font-weight: 400; }
.age { color: var(--dusk); font-size: .9rem; margin-top: 1.6rem; }

.btn {
  display: inline-block; background: var(--wine); color: #fff; text-decoration: none;
  font-family: var(--body); font-size: 1.02rem; padding: .8rem 1.7rem; border: 0; border-radius: 2px;
  cursor: pointer; transition: background .15s;
}
.btn:hover { background: var(--rose); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: center; margin-top: 2rem; }
.ku { color: var(--dusk); font-size: .95rem; font-style: italic; }

/* Sections */
.section { padding: 4.5rem 0; }
.section.alt { background: var(--velvet); }
.section h2 { font-size: clamp(1.8rem, 3vw, 2.3rem); margin-bottom: .8rem; }
.section-intro { color: var(--dusk); max-width: 60ch; margin-bottom: 2.8rem; }

/* Series shelf */
.shelf {
  list-style: none; display: grid; gap: 2.2rem 1.4rem;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.book-btn {
  all: unset; display: block; cursor: pointer; width: 100%;
}
.book-btn:focus-visible { outline: 2px solid var(--rose); outline-offset: 4px; }
.cover-frame {
  display: block; aspect-ratio: 5 / 8; width: 100%; overflow: hidden; background: var(--ink);
  box-shadow: 0 14px 28px -14px #000, 0 0 0 1px var(--line);
  transition: transform .2s ease, box-shadow .2s ease;
}
.cover-frame img { width: 100%; height: 100%; object-fit: cover; }
.book-btn:hover .cover-frame { transform: translateY(-4px); box-shadow: 0 22px 36px -16px #000, 0 0 0 1px var(--wine); }
@media (prefers-reduced-motion: reduce) { .cover-frame { transition: none; } .book-btn:hover .cover-frame { transform: none; } }
.book-num { display: block; margin-top: .85rem; color: var(--dusk); font-size: .85rem; }
.book-title { display: block; font-family: var(--display); font-size: 1.18rem; font-weight: 600; line-height: 1.2; color: var(--bone); }
.book-status { display: block; font-size: .88rem; color: var(--dusk); margin-top: .15rem; }
.book-status.live { color: var(--rose); }

/* Fallback when a cover image is missing */
.cover-fallback {
  width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12%; background: radial-gradient(120% 80% at 50% 0%, #3a1424 0%, var(--ink) 70%);
}
.cover-fallback span { font-family: var(--display); color: var(--bone); font-size: clamp(1rem, 1.6vw, 1.3rem); line-height: 1.15; }
.cover-fallback small { color: var(--dusk); font-size: .75rem; margin-top: .5rem; }

.reading-order { margin-top: 3rem; color: var(--dusk); max-width: 62ch; }
.reading-order p + p { margin-top: .6rem; }

/* Newsletter */
.signup { display: grid; gap: 1rem; max-width: 520px; margin-top: 1.8rem; }
.signup-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.signup input[type="email"] {
  flex: 1 1 240px; min-width: 0; font: inherit; font-size: 1rem; color: var(--bone);
  background: var(--ink); border: 1px solid var(--line); border-radius: 2px; padding: .75rem .9rem;
}
.signup input[type="email"]::placeholder { color: #6f6470; }
.signup input[type="email"]:focus { border-color: var(--rose); outline: none; }
.check { display: flex; gap: .6rem; align-items: flex-start; color: var(--dusk); font-size: .98rem; cursor: pointer; }
.check input { margin-top: .35rem; accent-color: var(--wine); width: 1rem; height: 1rem; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.signup-msg { min-height: 1.6em; font-size: 1rem; }
.signup-msg.ok { color: var(--bone); }
.signup-msg.err { color: #e48aa2; }
.fine { color: var(--dusk); font-size: .9rem; }

/* About */
.about p + p { margin-top: 1.1rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2.4rem 0; color: var(--dusk); font-size: .95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem; }
.site-footer a { color: var(--dusk); }
.site-footer a:hover { color: var(--bone); }

/* Book dialog */
dialog.book-dialog {
  border: 1px solid var(--line); background: var(--velvet); color: var(--bone);
  width: min(980px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem);
  margin: auto; padding: 0; overflow: hidden;
}
dialog.book-dialog::backdrop { background: rgba(5, 3, 6, .86); }
.dlg-inner { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); max-height: calc(100dvh - 2rem); }
.dlg-inner { grid-template-rows: minmax(0, 1fr); }
.dlg-inner > * { min-height: 0; }
.dlg-cover { background: var(--ink); display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.dlg-cover .cover-frame { width: min(100%, calc((100dvh - 5rem) * 5 / 8)); }
.dlg-cover .cover-frame img { cursor: zoom-in; }
.dlg-cover.zoomed { position: fixed; inset: 0; z-index: 2; padding: 1rem; background: rgba(5,3,6,.97); }
.dlg-cover.zoomed img { cursor: zoom-out; }
.dlg-cover.zoomed .cover-frame { width: min(calc(100vw - 2rem), calc((100dvh - 2rem) * 5 / 8)); }
.dlg-text { padding: 2.4rem 2.4rem 2rem; overflow-y: auto; }
.dlg-num { color: var(--dusk); font-size: .95rem; }
.dlg-text h2 { font-size: 2.2rem; margin: .1rem 0 .3rem; }
.dlg-series { color: var(--dusk); font-style: italic; margin-bottom: 1.2rem; }
.dlg-blurb p { margin-bottom: 1rem; max-width: 60ch; }
.dlg-status { color: var(--dusk); }
.dlg-status.live { color: var(--rose); }
.dlg-text .btn-row { margin-top: 1.2rem; }
.dlg-text { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
details.content-note { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
details.content-note summary { cursor: pointer; color: var(--dusk); }
details.content-note summary:hover { color: var(--bone); }
details.content-note h3 { font-family: var(--body); font-weight: 500; font-size: 1rem; margin: 1rem 0 .3rem; color: var(--bone); }
details.content-note ul { padding-left: 1.2rem; color: var(--dusk); font-size: .97rem; }
details.content-note p { color: var(--dusk); font-size: .97rem; margin-top: .9rem; }

.dlg-close, .dlg-nav {
  position: absolute; z-index: 3; background: rgba(13,10,15,.8); color: var(--bone);
  border: 1px solid var(--line); border-radius: 50%; width: 2.6rem; height: 2.6rem;
  font-size: 1.3rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.dlg-close:hover, .dlg-nav:hover { border-color: var(--rose); color: #fff; }
.dlg-close { top: .8rem; right: .8rem; }
.dlg-nav.prev { left: .8rem; top: 50%; transform: translateY(-50%); }
.dlg-nav.next { right: .8rem; top: 50%; transform: translateY(-50%); }
.dlg-nav[hidden] { display: none; }

/* Characters page */
.char-controls { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin-bottom: 2.6rem; color: var(--dusk); }
.char-controls select {
  font: inherit; font-size: 1rem; color: var(--bone); background: var(--ink);
  border: 1px solid var(--line); border-radius: 2px; padding: .45rem .7rem;
}
.read-panel {
  display: grid; grid-template-columns: 110px 1fr; gap: 1.4rem; align-items: start;
  margin: -1.2rem 0 2.6rem; padding: 1.2rem 1.4rem;
  background: var(--velvet); box-shadow: 0 0 0 1px var(--line);
}
.read-panel[hidden] { display: none; }
.read-cover { width: 110px; }
.read-text h2 { font-size: 1.25rem; margin-bottom: .55rem; }
.read-blurb { font-size: .98rem; }
.read-blurb p + p { margin-top: .7rem; }
.cast { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2.6rem 2.4rem; }
.person { display: grid; grid-template-columns: 96px 1fr; gap: 1.2rem; align-items: start; }
.portrait {
  width: 96px; aspect-ratio: 4 / 5; overflow: hidden; background: var(--velvet);
  box-shadow: 0 0 0 1px var(--line); border: 0; padding: 0;
}
button.portrait { cursor: zoom-in; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.monogram {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-family: var(--display); font-size: 2.4rem; color: var(--dusk);
  background: radial-gradient(100% 80% at 50% 10%, #2b1420 0%, var(--velvet) 75%);
}
.person h3 { font-size: 1.45rem; }
.person .role { color: var(--dusk); font-style: italic; font-size: .98rem; margin-bottom: .5rem; }
.person .bio { font-size: 1rem; }
.person .intro { color: var(--dusk); font-size: .88rem; margin-top: .55rem; }
.cast-more { margin-top: 3rem; color: var(--dusk); font-style: italic; }
dialog.portrait-dialog { border: 0; background: transparent; margin: auto; max-width: calc(100vw - 2rem); max-height: calc(100dvh - 2rem); }
dialog.portrait-dialog::backdrop { background: rgba(5,3,6,.92); }
dialog.portrait-dialog img { max-height: calc(100dvh - 3rem); width: auto; cursor: zoom-out; }

/* Responsive */
@media (max-width: 1000px) { .shelf { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  body { font-size: 18px; }
  .hero { padding: 2.6rem 0 3rem; }
  .hero .wrap { grid-template-columns: 1fr; gap: 2rem; }
  .hero-cover { max-width: 220px; }
  .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.8rem 1rem; }
  .dlg-inner { grid-template-columns: 1fr; overflow-y: auto; }
  .dlg-inner { grid-template-rows: none; }
  .dlg-inner > * { min-height: auto; }
  .dlg-cover { padding: 3.6rem 1rem 1rem; }
  .dlg-cover .cover-frame { width: min(60vw, 260px); }
  .dlg-text { padding: 1.4rem 1.3rem 1.6rem; overflow: visible; }
  .dlg-nav.prev, .dlg-nav.next { top: 1.9rem; }
  .dlg-nav.next { right: 4rem; }
  .dlg-nav.prev { left: .8rem; }
}
@media (max-width: 460px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .person { grid-template-columns: 76px 1fr; }
  .portrait { width: 76px; }
  .read-panel { grid-template-columns: 76px 1fr; gap: 1rem; padding: 1rem; }
  .read-cover { width: 76px; }
}
