/* Lina Davenant — author site
   Palette: lime-whitewash walls, stove soot, and the three hand-colours of a lubok print. */

@font-face { font-family: "Old Standard"; src: url("fonts/OldStandard-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Old Standard"; src: url("fonts/OldStandard-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Old Standard"; src: url("fonts/OldStandard-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --wash: #edece6;      /* whitewashed stove */
  --wash-2: #e2e0d6;    /* whitewash in shadow */
  --soot: #2a221d;      /* ink and soot */
  --soot-2: #5a4e45;
  --madder: #9b2a22;    /* lubok red */
  --madder-dk: #7d1f19;
  --ochre: #c9962e;     /* lubok yellow, lamp light */
  --verdigris: #3a6b5c; /* lubok green */
  --night: #1e2740;     /* a January night at the window */
  --night-2: #2a3554;
  --frost: #c9d3e6;

  --serif: "Old Standard", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --measure: 34em;
  --gap: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--wash);
  color: var(--soot);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
cite { font-style: italic; }
a { color: var(--madder); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--madder-dk); }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }

h1, h2, h3 { font-weight: 400; line-height: 1.15; margin: 0 0 0.6em; }
h2 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.75rem); font-style: italic; }
h3 { font-size: 1.35rem; font-style: italic; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ochre); color: var(--soot); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

.night { background: var(--night); color: var(--wash); }
.night a { color: var(--frost); }
.night a:hover { color: #fff; }
.wash { background: var(--wash); }
.narrow { max-width: var(--measure); margin-inline: auto; }

section { padding: clamp(3.5rem, 8vw, 6.5rem) var(--gap); }

/* ---------- header ---------- */
.top {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 2rem;
  padding: 1.1rem var(--gap);
  border-bottom: 1px solid rgba(201, 211, 230, .14);
}
.wordmark { font-style: italic; font-size: 1.5rem; color: var(--wash) !important; text-decoration: none; letter-spacing: .01em; }
.top nav { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.top nav a { text-decoration: none; color: var(--frost); }
.top nav a:hover { color: #fff; text-decoration: underline; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
  padding-inline: max(var(--gap), calc((100% - 70rem) / 2));
}
.hero-line {
  font-size: clamp(2.6rem, 1.6rem + 4.6vw, 5.4rem);
  font-style: italic; line-height: 1.02; letter-spacing: -0.01em;
  margin: 0 0 .45em; color: var(--wash);
  text-wrap: balance;
}
.hero-sub { max-width: 30em; color: var(--frost); font-size: 1.125em; }
.hero-sub cite { color: var(--wash); }

/* buttons */
.buy { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 1.75rem; }
.btn {
  display: inline-block; font: inherit; font-size: 1rem; line-height: 1.2;
  padding: .85em 1.35em; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; border-radius: 2px;
}
.btn-main { background: var(--madder); color: var(--wash) !important; border-color: var(--madder); }
.btn-main:hover { background: var(--madder-dk); border-color: var(--madder-dk); }
.btn-quiet { color: var(--wash) !important; border-color: rgba(237, 236, 230, .45); }
.btn-quiet:hover { border-color: var(--wash); }
.btn-ink { color: var(--soot) !important; border-color: var(--soot); background: transparent; }
.btn-ink:hover { background: var(--soot); color: var(--wash) !important; }

.store { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--frost); flex-basis: 100%; }
.store select {
  font: inherit; color: var(--wash); background: var(--night-2);
  border: 1px solid rgba(201, 211, 230, .3); border-radius: 2px; padding: .3em .5em;
}

/* the carved window */
.window { position: relative; margin: 0 auto; width: min(100%, 26rem); aspect-ratio: 400 / 650; }
.nalichnik { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.nalichnik .carve { fill: var(--wash); }
.nalichnik .cut { fill: var(--night); }
.nalichnik .frame { fill: none; stroke: var(--wash); stroke-width: 6; }
.nalichnik .sun { fill: var(--ochre); }
.nalichnik .madder { fill: var(--madder); }

.pane {
  position: absolute;
  left: 17%; top: 20.3%; width: 66%; height: 62.1%;
  background: #f1e7cf; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 0 70px 18px rgba(201, 150, 46, .28);
  animation: lamp 2.4s ease-out .3s both;
}
.pane img { width: 100%; height: 100%; object-fit: cover; }
@keyframes lamp {
  from { box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 0 0 0 rgba(201, 150, 46, 0); filter: brightness(.55); }
  to   { box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 0 70px 18px rgba(201, 150, 46, .28); filter: brightness(1); }
}
@media (prefers-reduced-motion: reduce) { .pane { animation: none; } }

/* type-only cover, shown until the cover image is uploaded */
.cover-fallback { display: none; }
.no-cover img { display: none; }
.no-cover .cover-fallback {
  display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center;
  height: 100%; padding: 12% 8%; color: var(--soot);
  background:
    radial-gradient(circle at 50% 46%, rgba(155,42,34,.12) 0 28%, transparent 29%),
    #f1e7cf;
}
.cf-series { font-size: .72rem; letter-spacing: .04em; }
.cf-title { font-size: clamp(1.4rem, 1rem + 1.5vw, 2rem); font-style: italic; line-height: 1.05; color: var(--madder); }
.cf-sub { font-size: .85rem; margin-top: -1.5rem; }
.cf-author { font-size: 1rem; }

/* ---------- book ---------- */
.book-grid {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem); max-width: 70rem; margin-inline: auto; align-items: start;
}
.book-copy { max-width: var(--measure); }
.kicker { color: var(--soot-2); font-style: italic; margin-top: -.3em; margin-bottom: 2em; }
.lead { font-size: 1.15em; }
.promise {
  margin-top: 1.75em; padding-left: 1rem; border-left: 3px solid var(--verdigris);
  font-style: italic; color: var(--verdigris);
}

.book-facts {
  background: var(--wash-2); padding: 1.75rem 1.75rem 2rem;
  border-top: 4px solid var(--madder);
  position: sticky; top: 1.5rem;
}
.book-facts dl { margin: 0 0 1.25rem; }
.book-facts dl > div { padding: .6rem 0; border-bottom: 1px solid rgba(42, 34, 29, .14); }
.book-facts dt { font-style: italic; color: var(--soot-2); font-size: .9rem; }
.book-facts dd { margin: 0; }
.buy-stack { flex-direction: column; align-items: stretch; margin-top: 0; }
.buy-stack .btn { text-align: center; }

/* ---------- opening excerpt ---------- */
.opening { background: var(--wash-2); }
.page {
  max-width: 43rem; margin-inline: auto;
  background: #f6f1e4; color: var(--soot);
  padding: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 6vw, 4.25rem);
  box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 18px 40px -24px rgba(42,34,29,.45);
  line-height: 1.68;
}
.page h2 { font-size: 1rem; font-style: normal; color: var(--madder); margin-bottom: 2.25rem; text-align: center; }
.page-head { text-align: center; font-style: italic; font-size: 1.3rem; margin-bottom: 2rem; }
.page p { text-indent: 1.4em; margin: 0; hyphens: auto; }
.page p.initial, .page p.page-head, .page p.sep, .page p.page-end { text-indent: 0; }
.initial::first-letter {
  float: left; font-size: 3.6em; line-height: .82; padding: .06em .1em 0 0;
  color: var(--madder); font-style: italic;
}
.sep { text-align: center; color: var(--ochre); margin: 1.6rem 0 1.2rem !important; font-size: 1.2rem; }
.page-end { font-style: italic; color: var(--soot-2); text-align: center; }
.buy-center { justify-content: center; }

/* ---------- series shelf ---------- */
.series .narrow > p { margin-bottom: 2.5rem; }
.shelf {
  list-style: none; margin: 0 auto; padding: 0 0 0;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px; max-width: 70rem; align-items: end;
  border-bottom: 10px solid var(--soot);
}
.spine {
  position: relative; display: flex; flex-direction: column; align-items: center;
  height: 21rem; padding: .9rem .25rem .8rem;
  background: var(--wash-2); color: var(--soot-2);
  border: 1px solid rgba(42,34,29,.18); border-bottom: 0;
}
.spine:nth-child(3n+2) { height: 19.5rem; }
.spine:nth-child(4n+3) { height: 20.25rem; }
.spine .no { font-size: .9rem; }
.spine .lbl {
  writing-mode: vertical-rl; transform: rotate(180deg);
  margin: auto 0; max-height: 15rem; display: flex; flex-direction: column; align-items: center; gap: .3rem;
}
.spine .t { font-style: italic; font-size: 1.02rem; line-height: 1.1; }
.spine .w { font-size: .78rem; line-height: 1.1; opacity: .8; }
.spine .st { font-size: .72rem; text-align: center; line-height: 1.15; }
.spine.is-out { background: var(--madder); color: var(--wash); border-color: var(--madder); height: 22rem; }
.spine.is-out::before, .spine.is-out::after {
  content: ""; position: absolute; left: 18%; right: 18%; height: 3px; background: var(--ochre);
}
.spine.is-out::before { top: 2.6rem; }
.spine.is-out::after { bottom: 2.6rem; }
.spine.is-next { background: var(--verdigris); color: var(--wash); border-color: var(--verdigris); }
.shelf-note { text-align: center; font-size: .9rem; font-style: italic; color: var(--soot-2); margin-top: .9rem; }
.next { margin-top: 3.5rem; }

/* ---------- also by ---------- */
.also { background: var(--wash); border-top: 1px solid rgba(42,34,29,.12); }
.duet { color: var(--madder); font-size: 1.6rem; }
.duet-books { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: .4rem 2rem; font-size: 1.2rem; }
.duet-books li::before { content: "❧ "; color: var(--ochre); font-style: normal; }
.soon { color: var(--soot-2); font-style: italic; }

/* ---------- about ---------- */
.about { background: var(--wash-2); }
.about-grid { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 2rem; max-width: 44rem; align-items: start; }
.about-mark { width: 7rem; height: 7rem; }
.about-mark .sun { fill: var(--ochre); }
.about-mark .madder { fill: var(--madder); }
.about-mark text { fill: var(--wash); font-family: var(--serif); font-style: italic; font-size: 38px; }

/* ---------- newsletter ---------- */
.letters h2 { color: var(--wash); }
.letters p { color: var(--frost); }
.letters-form { margin-top: 2rem; }
.letters-form label { display: block; margin-bottom: .5rem; }
.field { display: flex; flex-wrap: wrap; gap: .6rem; }
.field input {
  flex: 1 1 15rem; font: inherit; padding: .8em 1em; border-radius: 2px;
  border: 1.5px solid rgba(201, 211, 230, .35); background: var(--night-2); color: var(--wash);
}
.field input::placeholder { color: rgba(201, 211, 230, .55); }
.field input:focus { border-color: var(--ochre); outline: none; }
.form-msg { min-height: 1.5em; margin: .75rem 0 0; color: var(--ochre) !important; }
.fine { font-size: .9rem; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2.5rem; max-width: 52rem; }
.mail { font-size: 1.2rem; }
.h-small { font-size: 1.35rem; }
.elsewhere { list-style: none; margin: 0; padding: 0; }
.elsewhere li { padding: .35rem 0; border-bottom: 1px solid rgba(42,34,29,.12); }

/* ---------- footer ---------- */
.foot { padding: 2.5rem var(--gap) 3rem; font-size: .9rem; color: var(--frost); text-align: center; }
.foot p { margin: .3rem 0; }
.credit { opacity: .8; }

/* ---------- simple pages (privacy, 404) ---------- */
.simple { max-width: var(--measure); margin-inline: auto; padding: clamp(3rem, 8vw, 5rem) var(--gap); }
.simple h1 { font-size: clamp(2.2rem, 1.6rem + 2.5vw, 3.2rem); font-style: italic; }
.simple h2 { font-size: 1.4rem; margin-top: 2rem; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .window { order: -1; width: min(78%, 20rem); }
  .book-grid, .contact-grid { grid-template-columns: 1fr; }
  .book-facts { position: static; }
  .shelf { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 0; border-bottom: 0; }
  .shelf .spine { height: 15rem !important; border-bottom: 8px solid var(--soot); }
  .spine .lbl { max-height: 11rem; }
  .spine .t { font-size: .9rem; }
  .spine .w { font-size: .7rem; }
  .spine.is-out::before, .spine.is-out::after { display: none; }
}
@media (max-width: 520px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-mark { width: 5rem; height: 5rem; }
  .top { justify-content: center; text-align: center; }
  .top nav { justify-content: center; }
}
