:root {
  --ink: #201a17;
  --ink-soft: #64574e;
  --sea: #9b642f;
  --sea-dark: #6f421f;
  --aqua: #d9b879;
  --foam: #f6f0e7;
  --sand: #c9a56a;
  --sand-light: #eee2d0;
  --coral: #a56635;
  --white: #fffaf1;
  --line: rgba(81, 57, 39, 0.18);
  --shadow: 0 28px 80px rgba(31, 21, 15, 0.2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--foam);
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  top: -80px;
  left: 1rem;
  z-index: 100;
  padding: .7rem 1rem;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 0 clamp(1.25rem, 5vw, 5rem);
  background: rgba(22, 19, 18, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  width: fit-content;
  font-family: "Italiana", serif;
  font-size: 1.18rem;
  text-decoration: none;
  letter-spacing: .02em;
  color: #f6e7ca;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--white);
  background: linear-gradient(145deg, #b98244, #6d421f);
  border-radius: 50% 50% 50% 8%;
  font-family: "DM Sans", sans-serif;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
}
.nav { display: flex; gap: 2rem; }
.nav a {
  position: relative;
  font-size: .83rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-decoration: none;
  text-transform: uppercase;
  color: #f0dfc2;
}
.nav a::after {
  position: absolute;
  right: 0;
  bottom: -.35rem;
  left: 0;
  height: 1px;
  background: var(--coral);
  content: "";
  transform: scaleX(0);
  transition: transform .2s ease;
}
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  justify-self: end;
  padding: .38rem .7rem;
  color: #e8c88f;
  background: rgba(201, 165, 106, .1);
  border: 1px solid rgba(201, 165, 106, .3);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.privacy-badge svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: clamp(4rem, 8vw, 8rem) clamp(1.25rem, 8vw, 8rem);
  overflow: hidden;
  color: #f8ecd8;
  background:
    radial-gradient(circle at 18% 8%, rgba(171, 113, 54, .2), transparent 28rem),
    radial-gradient(circle at 82% 70%, rgba(205, 166, 102, .12), transparent 30rem),
    linear-gradient(135deg, #161413 0%, #24201d 56%, #0f1011 100%);
}
.sun {
  position: absolute;
  top: 13%;
  right: 9%;
  width: 15vw;
  min-width: 130px;
  aspect-ratio: 1;
  background: rgba(205, 166, 102, .06);
  border: 1px solid rgba(205, 166, 102, .25);
  border-radius: 50%;
}
.hero-copy { position: relative; z-index: 2; max-width: 760px; }
.eyebrow {
  margin: 0 0 1.2rem;
  color: var(--coral);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}
h1, h2, .book-title, .dialog-copy h2 {
  margin: 0;
  font-family: "Italiana", serif;
  font-weight: 400;
  line-height: 1.04;
}
h1 { max-width: 760px; font-size: clamp(3.45rem, 7.2vw, 7.4rem); letter-spacing: -.035em; }
.hero-intro { max-width: 620px; margin: 2rem 0 2.3rem; color: #d3c5b4; font-size: clamp(1.05rem, 1.6vw, 1.3rem); }
.primary-action {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  padding: .9rem 1.25rem;
  color: var(--white);
  color: #1c1714;
  background: linear-gradient(135deg, #e2bd7e, #b77a3d);
  border-radius: 4px;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 12px 28px rgba(31, 127, 141, .22);
  transition: transform .2s ease, background .2s ease;
}
.primary-action:hover { background: #f0d19a; transform: translateY(-2px); }
.primary-action svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.hero-art { position: relative; z-index: 1; justify-self: end; width: min(39vw, 540px); }
.hero-art img { display: block; width: 100%; height: auto; border: 1px solid rgba(222,181,111,.58); border-radius: 6px; box-shadow: 0 34px 90px rgba(0,0,0,.46); }
.arch {
  position: relative;
  aspect-ratio: .74;
  overflow: hidden;
  background:
    radial-gradient(circle at 34% 28%, rgba(225, 183, 113, .52), transparent 8%),
    radial-gradient(circle at 50% 46%, rgba(152, 93, 43, .24), transparent 40%),
    linear-gradient(145deg, #332921, #111214 72%);
  border: 8px solid rgba(214, 174, 108, .72);
  border-radius: 50% 50% 6px 6px;
  box-shadow: var(--shadow);
}
.arch::before {
  position: absolute;
  top: 17%;
  left: 14%;
  width: 27%;
  aspect-ratio: 1;
  background: #d9ad6e;
  border-radius: 50%;
  box-shadow: 0 0 75px rgba(217, 173, 110, .42);
  content: "";
}
.sea { position: absolute; right: -8%; left: -8%; border-radius: 50%; }
.sea-back { top: 55%; height: 18%; background: rgba(180, 122, 64, .38); transform: rotate(-3deg); }
.sea-front { top: 64%; height: 14%; background: rgba(229, 194, 137, .2); transform: rotate(2deg); }
.coast-line {
  position: absolute;
  right: -12%;
  bottom: 20%;
  left: -12%;
  height: 14%;
  background: rgba(246, 230, 202, .15);
  border-radius: 50%;
  transform: rotate(-5deg);
}
.hero-art p { margin: 1.2rem 0 0; color: #ead6b4; text-align: right; font-family: "Italiana", serif; font-size: 1.25rem; line-height: 1.25; }
.hero-art em { color: #bd8a50; font-family: "DM Sans", sans-serif; font-size: .72rem; font-style: normal; letter-spacing: .13em; text-transform: uppercase; }

.library-section { padding: clamp(5rem, 9vw, 9rem) clamp(1.25rem, 7vw, 7rem); background: linear-gradient(180deg, #fffaf1, #f3eadc); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 3rem; max-width: 1350px; margin: 0 auto 2.3rem; }
h2 { font-size: clamp(2.7rem, 5vw, 5rem); }
.section-note { max-width: 400px; margin: 0 0 .6rem; color: var(--ink-soft); }
.filters { display: flex; flex-wrap: wrap; gap: .55rem; max-width: 1350px; margin: 0 auto 2.7rem; }
.filter {
  padding: .62rem 1rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  transition: .2s ease;
}
.filter:hover, .filter:focus-visible { border-color: var(--sea); color: var(--sea); }
.filter.is-active { color: #fff4df; background: #2b231e; border-color: #2b231e; }
.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.2rem, 2.4vw, 2.4rem); max-width: 1350px; margin: 0 auto; }
.book-card { min-width: 0; animation: reveal .45s ease both; }
.book-card[hidden] { display: none; }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } }
.cover-button { display: block; width: 100%; padding: 0; background: none; border: 0; cursor: pointer; text-align: left; }
.book-cover {
  position: relative;
  display: flex;
  aspect-ratio: .68;
  flex-direction: column;
  justify-content: space-between;
  padding: 12% 10%;
  overflow: hidden;
  color: #fff;
  background: var(--sea);
  border-radius: 4px 14px 14px 4px;
  box-shadow: 0 16px 34px rgba(23, 60, 67, .17);
  isolation: isolate;
  transition: transform .25s ease, box-shadow .25s ease;
}
.cover-button:hover .book-cover, .cover-button:focus-visible .book-cover { transform: translateY(-8px) rotate(.3deg); box-shadow: 0 24px 45px rgba(23, 60, 67, .24); }
.book-cover::before { position: absolute; inset: 0 auto 0 0; width: 6%; background: rgba(0, 0, 0, .14); content: ""; z-index: -1; }
.book-cover::after { position: absolute; content: ""; z-index: -1; }
.book-cover.has-image { padding: 0; background: #102d32; }
.book-cover.has-image::before, .book-cover.has-image::after { display: none; }
.cover-art { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-waves { background: linear-gradient(160deg, #103e4a 0%, #1e7784 68%, #d8b47f 68%); }
.cover-waves::after { right: -20%; bottom: 13%; left: 4%; height: 24%; border: 2px solid rgba(255,255,255,.55); border-radius: 50%; transform: rotate(-8deg); box-shadow: 0 -13px 0 -11px rgba(255,255,255,.45), 0 -27px 0 -25px rgba(255,255,255,.35); }
.cover-ranch { background: linear-gradient(#efcf9f 0 55%, #9e573c 55%); }
.cover-ranch::after { right: 10%; bottom: 20%; left: 10%; height: 24%; border-top: 2px solid rgba(255,255,255,.72); border-bottom: 2px solid rgba(255,255,255,.72); transform: skewY(-6deg); }
.cover-salt { color: var(--ink); background: linear-gradient(145deg, #fffdf5 0 58%, #77b7c2 58%); }
.cover-salt::after { top: 15%; right: 14%; width: 39%; aspect-ratio: 1; border: 1px solid rgba(23,60,67,.4); border-radius: 50%; box-shadow: -36px 55px 0 -17px rgba(216,117,94,.8); }
.cover-duet { background: linear-gradient(90deg, #17191b 0 50%, #174b46 50%); }
.cover-duet::after { inset: 17% 17% 30%; border: 1px solid rgba(224,190,105,.75); border-radius: 50% 50% 42% 42%; }
.cover-spider { background: radial-gradient(circle at 50% 48%, #bd785c 0 4%, transparent 4%), repeating-radial-gradient(circle at 50% 48%, transparent 0 26px, rgba(255,255,255,.25) 27px 28px), #352e3c; }
.cover-spider::after { inset: 48% 8% auto; height: 1px; background: rgba(255,255,255,.5); transform: rotate(32deg); box-shadow: 0 0 0 0 rgba(255,255,255,.5), 0 -1px rgba(255,255,255,.5); }
.cover-eagle { background: linear-gradient(150deg, #a9d2d6 0 46%, #386470 46%); }
.cover-eagle::after { top: 24%; right: 22%; width: 44%; height: 16%; border-top: 3px solid rgba(255,255,255,.82); border-radius: 50%; transform: rotate(-12deg); box-shadow: 22px 8px 0 -4px transparent; }
.cover-sequel { background: linear-gradient(155deg, #173f48 0 58%, #ad6d5d 58%); }
.cover-sequel::after { right: 14%; bottom: 18%; width: 43%; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; box-shadow: -18px -18px 0 -17px #fff, 18px 18px 0 -17px #fff; }
.cover-label { font-size: .62rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .85; }
.book-cover h3 { margin: auto 0; font-family: "Italiana", serif; font-size: clamp(1.55rem, 2.3vw, 2.35rem); font-weight: 400; line-height: 1.05; text-wrap: balance; }
.cover-author { font-size: .65rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.book-meta { display: flex; align-items: start; justify-content: space-between; gap: .7rem; padding-top: 1rem; }
.book-meta h3 { margin: 0; font-family: "Italiana", serif; font-size: 1.18rem; font-weight: 400; line-height: 1.2; }
.book-meta span { flex: 0 0 auto; color: var(--sea); font-size: .65rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.library-footnote { max-width: 1350px; margin: 2.6rem auto 0; padding-top: 1.4rem; color: var(--ink-soft); border-top: 1px solid var(--line); font-size: .8rem; }

.author-section { display: block; padding: clamp(5rem, 10vw, 10rem) clamp(1.25rem, 10vw, 10rem); background: linear-gradient(135deg, #efe1cc, #f8f1e7 58%, #e4cfaf); }
.author-portrait { position: relative; width: min(100%, 500px); overflow: hidden; background: var(--ink); border: 1px solid rgba(105,70,38,.28); border-radius: 8px; box-shadow: var(--shadow); }
.author-portrait img { display: block; width: 100%; height: auto; }
.author-copy { max-width: 900px; margin: 0 auto; }
.author-copy h2 { margin-bottom: 1.6rem; }
.author-copy p { color: var(--ink-soft); }
.author-copy .author-lead { color: var(--ink); font-family: "Italiana", serif; font-size: clamp(1.45rem, 2.3vw, 2rem); line-height: 1.35; }
blockquote { margin: 2rem 0 0; padding-left: 1.2rem; color: var(--sea-dark); border-left: 2px solid var(--coral); font-family: "Italiana", serif; font-size: 1.4rem; }
.amazon-author-link { display: inline-flex; align-items: center; gap: .65rem; margin-top: 1.8rem; padding: .8rem 1rem; color: var(--white); background: var(--ink); border-radius: 4px; font-size: .78rem; font-weight: 600; letter-spacing: .07em; text-decoration: none; text-transform: uppercase; transition: transform .2s ease, background .2s ease; }
.amazon-author-link:hover { background: var(--sea-dark); transform: translateY(-2px); }
.amazon-author-link svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem clamp(1.25rem, 5vw, 5rem); color: rgba(246,231,202,.72); background: #171413; border-top: 1px solid rgba(201,165,106,.22); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }

.book-dialog { width: min(960px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 0; overflow: auto; color: var(--ink); background: var(--white); border: 0; border-radius: 14px; box-shadow: 0 30px 100px rgba(8, 34, 39, .4); }
.book-dialog::backdrop { background: rgba(10, 37, 42, .72); backdrop-filter: blur(8px); }
.dialog-close { position: sticky; top: 1rem; z-index: 5; float: right; display: grid; width: 42px; height: 42px; margin: 1rem 1rem -4rem 0; place-items: center; color: var(--ink); background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; backdrop-filter: blur(8px); }
.dialog-close svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.dialog-layout { display: grid; grid-template-columns: minmax(270px, .82fr) minmax(0, 1.18fr); min-height: 620px; }
.dialog-cover { min-height: 620px; background-color: #102d32; background-position: center; background-size: cover; }
.dialog-copy { padding: clamp(3rem, 7vw, 5rem); align-self: center; }
.dialog-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.status-pill { padding: .38rem .7rem; color: var(--sea-dark); background: rgba(142,203,208,.22); border-radius: 999px; font-size: .68rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.edition-toggle { display: flex; min-height: 34px; padding: 3px; background: var(--sand-light); border-radius: 999px; }
.edition-toggle:empty { display: none; }
.edition-button { min-width: 40px; padding: .28rem .62rem; color: var(--ink-soft); background: transparent; border: 0; border-radius: 999px; cursor: pointer; font-size: .68rem; font-weight: 600; }
.edition-button.is-active { color: var(--white); background: var(--sea); }
.dialog-kicker { margin: 0 0 .7rem; color: var(--coral); font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.dialog-copy h2 { font-size: clamp(2.5rem, 5vw, 4.6rem); }
.dialog-subtitle { margin: .8rem 0 0; color: var(--ink-soft); font-size: .92rem; }
.dialog-rule { width: 50px; height: 2px; margin: 2rem 0; background: var(--coral); }
.dialog-copy h3 { margin: 0 0 .55rem; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.dialog-synopsis { margin: 0; color: var(--ink-soft); }
.purchase-panel { display: flex; flex-direction: column; gap: .15rem; margin-top: 2rem; padding: 1rem 1.1rem; background: var(--sand-light); border-left: 3px solid var(--sand); border-radius: 2px; }
.purchase-panel span { font-size: .82rem; font-weight: 600; }
.purchase-panel small { color: var(--ink-soft); }
.purchase-panel a { width: fit-content; margin-top: .7rem; padding: .65rem .85rem; color: var(--white); background: var(--sea); border-radius: 4px; font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-decoration: none; text-transform: uppercase; }
.purchase-panel a:hover { background: var(--sea-dark); }
.purchase-panel a[hidden] { display: none; }

:focus-visible { outline: 3px solid rgba(216,117,94,.7); outline-offset: 4px; }
body.dialog-open { overflow: hidden; }

@media (max-width: 1050px) {
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1.15fr .85fr; }
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; min-height: 68px; }
  .nav { display: none; }
  .privacy-badge { font-size: 0; }
  .privacy-badge svg { width: 16px; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 5rem; }
  .hero-art { justify-self: center; width: min(92vw, 470px); margin-top: 3rem; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading { display: block; }
  .section-note { margin-top: 1rem; }
  .author-section { grid-template-columns: 1fr; }
  .author-portrait { width: min(82vw, 390px); }
  .dialog-layout { grid-template-columns: 1fr; }
  .dialog-cover { min-height: 0; aspect-ratio: 2 / 3; }
  footer { flex-direction: column; }
}
@media (max-width: 450px) {
  h1 { font-size: 3.2rem; }
  .book-grid { gap: 1.7rem .85rem; }
  .book-cover { border-radius: 3px 9px 9px 3px; }
  .book-cover h3 { font-size: 1.28rem; }
  .book-meta { display: block; }
  .book-meta span { display: block; margin-top: .3rem; }
  .dialog-copy { padding: 2rem 1.35rem 2.5rem; }
  .dialog-topline { align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
