/* Humble Stories: one night-on-the-lake world, single theme by choice.
   Layout: a narrow reading column, generous margins, a full-bleed hero on book pages. */
:root {
  --night: #0c1720;        /* the lake after dark */
  --night-2: #13222d;      /* raised surfaces */
  --frost: #e7ecea;        /* ice-white text */
  --mist: #9aaab2;         /* secondary text */
  --beam: #f1d38a;         /* the lamp: the one accent */
  --reef: #d06a5c;         /* used only where something is a warning */
  --rule: #24343f;
  --f-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --f-body: "Literata", "Iowan Old Style", Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--night);
  color: var(--frost);
  font: 18px/1.65 var(--f-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--beam); text-underline-offset: 3px; }
a:hover { color: var(--frost); }
:focus-visible { outline: 2px solid var(--beam); outline-offset: 3px; }
img { max-width: 100%; }

/* ---------- type scale ---------- */
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; line-height: 1.05; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(3rem, 9vw, 6.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 4.5vw, 2.9rem); margin-bottom: 18px; }
h3 { font-size: 1.6rem; margin-bottom: 6px; }
p { margin: 0 0 1em; max-width: 64ch; }
.label {
  font-family: var(--f-body); font-size: .72rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--mist);
  margin: 0 0 14px; display: block;
}
.italic { font-style: italic; }

/* ---------- frame ---------- */
.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }
.read { width: min(680px, 100% - 40px); margin-inline: auto; }

header.site {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: baseline; justify-content: space-between;
  padding: 22px 0;
}
.wordmark { display: inline-flex; align-items: center; text-decoration: none; }
.wordmark img { display: block; height: 30px; width: auto; }
.hero-mark { display: block; width: 96px; height: auto; margin: 0 0 28px -10px; }
.wordmark .flash { width: 7px; height: 7px; border-radius: 50%; background: var(--beam); box-shadow: 0 0 10px 2px var(--beam); animation: flash 10s infinite; }
nav.site { display: flex; gap: 22px; flex-wrap: wrap; }
nav.site a { color: var(--mist); text-decoration: none; font-size: .92rem; }
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--frost); }
nav.site a[aria-current="page"] { border-bottom: 1px solid var(--beam); }

/* one white flash every ten seconds */
@keyframes flash {
  0%, 88%, 100% { opacity: .25; transform: scale(.8); }
  92% { opacity: 1; transform: scale(1.25); }
}

section { padding: 72px 0; }
section + section { border-top: 1px solid var(--rule); }

/* ---------- home ---------- */
.home-hero { padding: 96px 0 80px; }
.home-hero h1 { max-width: 12ch; }
.home-hero .lede { font-size: 1.3rem; color: var(--mist); margin-top: 26px; max-width: 34ch; font-style: italic; }
.horizon { height: 1px; background: linear-gradient(90deg, transparent, var(--rule) 15%, var(--rule) 85%, transparent); margin-top: 64px; }

.shelf { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.entry {
  display: grid; gap: 10px; align-content: start;
  padding: 28px; background: var(--night-2); border: 1px solid var(--rule); border-radius: 4px;
  text-decoration: none; color: var(--frost);
  transition: border-color .3s;
}
a.entry:hover { border-color: var(--beam); color: var(--frost); }
.entry .meta { font-size: .85rem; color: var(--mist); }
.entry p { font-size: .98rem; margin: 0; }
.soon { display: inline-block; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--beam); border: 1px solid currentColor; padding: 3px 10px; border-radius: 2px; justify-self: start; }

/* ---------- book hero ---------- */
.book-hero { position: relative; min-height: 640px; display: grid; align-items: end; overflow: hidden; border-bottom: 1px solid var(--rule); }
.book-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.book-hero .over { position: relative; z-index: 1; padding: 0 0 64px; }
.book-hero .byline { font-family: var(--f-body); font-size: 1rem; letter-spacing: .2em; text-transform: uppercase; color: var(--mist); margin: 18px 0 0; }
.book-hero .tagline { font-family: var(--f-display); font-style: italic; font-size: clamp(1.3rem, 2.6vw, 1.75rem); max-width: 30ch; margin: 28px 0 0; color: var(--frost); }
.book-hero header.site { position: absolute; top: 0; left: 0; right: 0; width: min(1080px, 100% - 40px); margin-inline: auto; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 22px; margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--rule); }
.facts dt { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--mist); }
.facts dd { margin: 4px 0 0; font-size: .98rem; }

/* ---------- the letter ---------- */
.letter {
  background: var(--frost); color: #1c2a33;
  padding: clamp(28px, 5vw, 56px); border-radius: 2px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6);
  font-size: 1.04rem; line-height: 1.75;
  transform: rotate(-.6deg);
}
.letter p { max-width: none; }
.letter .first { font-family: var(--f-display); font-size: 1.7rem; line-height: 1.2; }
.letter .sig { font-family: var(--f-display); font-size: 1.6rem; font-style: italic; margin: 0; }
.letter-note { color: var(--mist); font-size: .9rem; margin-top: 22px; font-style: italic; }

/* ---------- buy ---------- */
.buy { margin: 30px 0 6px; }
.buy-row { display: flex; flex-wrap: wrap; gap: 12px; }
.buy-btn {
  display: inline-block; font-size: 1rem; padding: 13px 26px; border-radius: 2px;
  background: var(--beam); color: var(--night); text-decoration: none; font-weight: 600;
}
.buy-btn:hover { background: var(--frost); color: var(--night); }
.buy-btn.alt { background: transparent; color: var(--beam); border: 1px solid var(--beam); }
.buy-btn.alt:hover { background: var(--beam); color: var(--night); }
.buy-btn.waiting { background: transparent; color: var(--beam); border: 1px solid var(--beam); font-weight: 400; cursor: default; }
.buy-note { color: var(--mist); font-size: .92rem; margin-top: 12px; }

/* ---------- newsletter ---------- */
form.signup { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; max-width: 520px; }
form.signup label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
form.signup input {
  flex: 1 1 240px; font: inherit; font-size: 1rem; padding: 12px 14px;
  background: var(--night-2); color: var(--frost); border: 1px solid var(--rule); border-radius: 2px;
}
form.signup button {
  font: inherit; font-size: .95rem; padding: 12px 22px; cursor: pointer;
  background: var(--beam); color: var(--night); border: none; border-radius: 2px;
}
form.signup button:hover { background: var(--frost); }
.form-msg { font-size: .92rem; color: var(--mist); margin-top: 12px; min-height: 1.4em; }

/* ---------- author ---------- */
.author-hero { padding: 96px 0 64px; }
.author-hero h1 { font-size: clamp(3rem, 8vw, 5.6rem); }
.author-hero .lede { font-size: 1.25rem; color: var(--mist); margin-top: 22px; max-width: 40ch; font-style: italic; }

/* ---------- covers and images ---------- */
.split { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.split.narrow { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); align-items: center; }
.cover { display: block; width: 100%; height: auto; border-radius: 3px; box-shadow: 0 28px 50px -22px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.04); }
.split .sticky { position: sticky; top: 28px; }
.entry.with-cover { grid-template-columns: 96px 1fr; column-gap: 20px; align-items: start; }
.entry.with-cover .cover { grid-row: span 3; }
.photo { display: block; width: 100%; height: auto; border-radius: 3px; }
.photo-cap { color: var(--mist); font-size: .85rem; font-style: italic; margin-top: 10px; }
@media (max-width: 760px) {
  .split, .split.narrow { grid-template-columns: 1fr; }
  .split .sticky { position: static; max-width: 300px; }
  .split.narrow .cover { max-width: 220px; }
}

footer.site { padding: 48px 0 64px; border-top: 1px solid var(--rule); color: var(--mist); font-size: .85rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer.site a { color: var(--mist); }

@media (max-width: 600px) {
  body { font-size: 17px; }
  section { padding: 56px 0; }
  .book-hero { min-height: 560px; }
  .letter { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wordmark .flash { animation: none; opacity: 1; }
  .entry { transition: none; }
}
