/* Nora Kemble / The Last Good Spring. Plain CSS, no framework, no third-party requests. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url(fonts/cormorant-garamond.woff2) format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url(fonts/jost.woff2) format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f7f5f2;
  --bg-2: #edf0f5;
  --ink: #102040;
  --ink-soft: #34435f;
  --accent: #6f4b0c;          /* deep gold: 7:1 on --bg */
  --gold: #e8be6e;
  --rule: rgba(16, 32, 64, 0.16);
  --sky-top: #d3dfec;
  --sky-mid: #f6e4cc;
  --btn-bg: #102040;
  --btn-ink: #f7efe2;
  --focus: #102040;
  --shadow: 0 34px 60px -26px rgba(16, 32, 64, 0.55), 0 12px 24px -12px rgba(16, 32, 64, 0.35);
  --sky-filter: none;
  --grain: 0.07;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Jost", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1828;
    --bg-2: #15223a;
    --ink: #f4e8d6;
    --ink-soft: #c3c9d6;
    --accent: #e8be6e;
    --rule: rgba(244, 232, 214, 0.2);
    --sky-top: #0e1828;
    --sky-mid: #26324d;
    --btn-bg: #e8be6e;
    --btn-ink: #102040;
    --focus: #f4e8d6;
    --shadow: 0 34px 60px -24px rgba(0, 0, 0, 0.85), 0 12px 24px -12px rgba(0, 0, 0, 0.6);
    --sky-filter: brightness(0.55) saturate(0.85);
    --grain: 0.1;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* subtle paper grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: var(--grain);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .1  0 0 0 0 .13  0 0 0 0 .22  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@media (prefers-color-scheme: dark) { body::after { mix-blend-mode: screen; } }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--btn-bg); color: var(--btn-ink); padding: 0.6rem 1rem; border-radius: 999px; z-index: 100; }
.skip:focus { top: 1rem; }

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.serif { font-family: var(--serif); }

/* ---------- nav ---------- */
.nav { position: relative; z-index: 5; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.25rem; padding-bottom: 0.5rem; }
.mark { font-weight: 500; letter-spacing: 0.3em; font-size: 0.8125rem; text-transform: uppercase; text-decoration: none; padding: 0.6rem 0; }
.nav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; font-size: 0.9375rem; }
.nav ul a { text-decoration: none; display: inline-block; padding: 0.6rem 0; }
.nav ul a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 100%);
  padding-bottom: clamp(9rem, 24vw, 19rem);
}
.hero .sky {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: clamp(10rem, 30vw, 24rem);
  z-index: 0;
  -webkit-mask-image: linear-gradient(to top, #000 55%, transparent 100%);
          mask-image: linear-gradient(to top, #000 55%, transparent 100%);
}
.hero .sky img { width: 100%; height: 100%; object-fit: cover; object-position: 78% bottom; filter: var(--sky-filter); }
.hero::after { /* melt the band into the page */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5rem; z-index: 1;
  background: linear-gradient(to top, var(--bg), transparent);
}
.hero .wrap { position: relative; z-index: 2; }

.book-hero { display: grid; gap: 2rem; justify-items: center; text-align: center; padding-top: 1.5rem; }
.cover { width: min(72vw, 19rem); }
.cover img { width: 100%; border-radius: 3px; box-shadow: var(--shadow); aspect-ratio: 5 / 8; background: var(--sky-mid); }
.hero-text { max-width: 33rem; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.7rem, 9vw, 4.75rem); line-height: 1; }
h2 { font-size: clamp(1.9rem, 5vw, 2.75rem); line-height: 1.1; }
h3 { font-size: 1.5rem; line-height: 1.2; }
.subtitle { font-family: var(--serif); font-weight: 500; font-size: clamp(1.3rem, 3.4vw, 1.65rem); line-height: 1.25; margin: 0.9rem 0 0; color: var(--ink-soft); }
.tagline { font-family: var(--serif); font-weight: 600; font-size: clamp(1.4rem, 3.6vw, 1.75rem); line-height: 1.3; margin: 1.5rem 0 0; }
.soon { display: inline-flex; align-items: center; gap: 0.6rem; margin: 1.5rem 0 0; font-weight: 500; font-size: 0.9375rem; letter-spacing: 0.04em; padding: 0.4rem 1rem; border: 1px solid var(--rule); border-radius: 999px; background: color-mix(in srgb, var(--bg) 55%, transparent); }
.soon::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; justify-content: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.6rem; border-radius: 999px; background: var(--btn-bg); color: var(--btn-ink); font-weight: 500; letter-spacing: 0.02em; text-decoration: none; border: 1px solid transparent; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgba(16, 32, 64, 0.6); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn:focus-visible { outline-offset: 4px; }

/* entrance: one soft moment on load */
@media (prefers-reduced-motion: no-preference) {
  .cover, .hero-text, .author-hero > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-text { animation-delay: 0.12s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }

/* ---------- sections ---------- */
section { padding: clamp(3.5rem, 9vw, 6.5rem) 0; }
.narrow { max-width: 36rem; margin: 0 auto; }
.prose p { font-family: var(--serif); font-weight: 500; font-size: clamp(1.25rem, 3.2vw, 1.4rem); line-height: 1.55; margin: 1.1rem 0 0; }
.prose h2 { margin-bottom: 1.4rem; }
.alt { background: var(--bg-2); }

.finds { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 0; }
.finds li { padding: 1.25rem 0; border-top: 1px solid var(--rule); font-size: 1.0625rem; color: var(--ink-soft); }
.finds li:last-child { border-bottom: 1px solid var(--rule); }
.finds b { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.45rem; line-height: 1.2; color: var(--ink); margin-bottom: 0.2rem; }
.note { font-size: 0.9375rem; color: var(--ink-soft); margin-top: 1.5rem; }

.author-card { display: grid; gap: 1.25rem; justify-items: center; text-align: center; max-width: 40rem; margin: 0 auto; }
.avatar { width: 6rem; height: 6rem; border-radius: 50%; box-shadow: 0 10px 24px -10px rgba(16, 32, 64, 0.5); }
.author-card p { margin: 0; color: var(--ink-soft); }
.author-card .lead { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; line-height: 1.5; color: var(--ink); }

.contact { text-align: center; }
.contact .email { display: inline-block; font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 6.4vw, 2.4rem); margin-top: 1rem; word-break: break-word; }
.contact .actions { justify-content: center; }
.contact p { margin: 0.8rem auto 0; max-width: 30rem; color: var(--ink-soft); }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.75rem; list-style: none; padding: 0; margin: 1.75rem 0 0; }
.links a { display: inline-block; padding: 0.55rem 0; }

footer { border-top: 1px solid var(--rule); padding: 2.25rem 0 3rem; font-size: 0.875rem; color: var(--ink-soft); text-align: center; }
footer p { margin: 0.35rem 0; }

/* ---------- author home ---------- */
.author-hero { display: grid; gap: 1.25rem; text-align: center; justify-items: center; padding-top: clamp(2.5rem, 8vw, 5.5rem); }
.author-hero h1 { font-size: clamp(3.4rem, 15vw, 7.5rem); letter-spacing: -0.015em; }
.author-hero .identity { font-family: var(--serif); font-weight: 500; font-size: clamp(1.35rem, 4.4vw, 2rem); line-height: 1.3; margin: 0; color: var(--ink-soft); max-width: 24rem; }

.book-card { display: grid; gap: 1.75rem; justify-items: center; text-align: center; max-width: 52rem; margin: 0 auto; }
.book-card .cover { width: min(56vw, 13rem); }
.book-card .actions { justify-content: center; }
.book-card p { margin: 0.8rem 0 0; color: var(--ink-soft); }
.book-card h2 { font-size: clamp(2rem, 6vw, 2.75rem); }

@media (min-width: 52rem) {
  .wrap { padding: 0 2rem; }
  .book-hero { grid-template-columns: auto minmax(0, 33rem); gap: clamp(3rem, 7vw, 6rem); justify-content: center; align-items: center; text-align: left; padding-top: 2.5rem; }
  .cover { width: clamp(17rem, 28vw, 23rem); }
  .book-hero .actions, .book-card .actions { justify-content: flex-start; }
  .finds { grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .finds li:nth-last-child(2) { border-bottom: 1px solid var(--rule); }
  .author-card { grid-template-columns: auto 1fr; text-align: left; justify-items: start; align-items: center; gap: 2.25rem; max-width: 46rem; }
  .avatar { width: 7.5rem; height: 7.5rem; }
  .book-card { grid-template-columns: auto minmax(0, 28rem); text-align: left; justify-items: start; align-items: center; gap: 3.5rem; }
  .book-card .cover { width: 15rem; }
}
@media print { body::after, .hero .sky { display: none; } }

h1, h2, h3, .subtitle, .tagline, .identity { text-wrap: balance; }
.prose p, .author-card .lead { text-wrap: pretty; }
