/* A Key of Salt and Glass — Aurelia Ashcombe
   The page is a dive: lit gold water at the top, deep teal at the bottom. */

:root {
  --gold: #ECC478;
  --gold-soft: #c9a35c;
  --cream: #F4E8CE;
  --cream-dim: #d6ccb6;
  --shallows: #1d6460;
  --teal: #0d3a3c;
  --deep: #072426;
  --abyss: #03100f;
  --amber: #8a5a2b;

  --display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --body: "Lora", "Palatino Linotype", "Book Antiqua", Georgia, serif;

  --measure: 34rem;
  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }

html { scroll-behavior: smooth; background: var(--abyss); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  line-height: 1.7;
  color: var(--cream);
  /* The descent: one gradient over the whole page height */
  background:
    linear-gradient(180deg,
      var(--shallows) 0%,
      var(--teal) 16%,
      #0a3032 34%,
      var(--deep) 58%,
      #051a1b 80%,
      var(--abyss) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); text-underline-offset: 0.2em; }
a:hover { color: var(--cream); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--gold); color: var(--abyss); padding: 0.5rem 1rem;
}
.skip:focus { top: 1rem; }

h1, h2 {
  font-family: var(--display);
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
  margin: 0 0 1.25rem;
  text-shadow: 0 0 24px rgba(236, 196, 120, 0.35);
}
h1 { font-size: clamp(2.6rem, 1.6rem + 4.2vw, 4.75rem); letter-spacing: 0.01em; }
h2 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.75rem); }

p { margin: 0 0 1.1em; }

/* ---------- Layout ---------- */

.col {
  width: min(100% - 3rem, 40rem);
  margin-inline: auto;
}


main > section {
  padding-block: clamp(4.5rem, 3rem + 7vw, 8.5rem);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--gold);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-gold { background: var(--gold); color: #1a1408; }
.btn-gold:hover { background: var(--cream); border-color: var(--cream); color: #1a1408; box-shadow: 0 0 28px rgba(236, 196, 120, 0.45); }
.btn-line { background: transparent; color: var(--gold); }
.btn-line:hover { background: rgba(236, 196, 120, 0.12); color: var(--cream); }

/* ---------- Hero: the surface, lit from above ---------- */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: clamp(3rem, 2rem + 4vw, 6rem) 0 clamp(4rem, 3rem + 4vw, 7rem);
}
.sun {
  position: absolute;
  left: 50%; top: -38vmax;
  width: 90vmax; height: 90vmax;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 226, 160, 0.75) 0%,
    rgba(245, 180, 80, 0.42) 16%,
    rgba(214, 150, 60, 0.14) 38%,
    rgba(214, 150, 60, 0) 62%);
  pointer-events: none;
  animation: kindle 2.4s ease-out both;
}
/* Light shafts through the water */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(100deg,
      rgba(236, 196, 120, 0) 0 7%,
      rgba(236, 196, 120, 0.05) 8% 10%,
      rgba(236, 196, 120, 0) 11% 19%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  width: min(100% - 3rem, 68rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  align-items: center;
}
.hero-cover { margin: 0; animation: rise 1.6s 0.3s cubic-bezier(.2,.7,.2,1) both; }
.hero-cover img {
  width: 100%;
  max-width: 26rem;
  margin-inline: auto;
  border-radius: 3px;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.06) inset,
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 0 80px -10px rgba(236, 196, 120, 0.35);
}

.hero-text { animation: rise 1.6s 0.6s cubic-bezier(.2,.7,.2,1) both; }
.series-line {
  font-family: var(--body);
  font-style: italic;
  color: var(--cream-dim);
  margin-bottom: 0.75rem;
}
.author-line {
  font-family: var(--display);
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
  color: var(--cream);
  letter-spacing: 0.06em;
  margin-bottom: 1.75rem;
}
.tagline {
  font-style: italic;
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  line-height: 1.45;
  color: var(--cream);
  margin-bottom: 2rem;
}
.buy { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.9rem; }
.ku { font-size: 0.95rem; color: var(--cream-dim); margin-bottom: 2.25rem; }
.dive {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--cream-dim);
}
.dive::after {
  content: "";
  width: 1px; height: 2.2rem;
  background: linear-gradient(var(--gold), transparent);
}

@keyframes kindle { from { opacity: 0; transform: translateX(-50%) scale(0.85); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(2.5rem); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .sun, .hero-cover, .hero-text { animation: none; }
}

/* ---------- The story ---------- */

.lede {
  font-size: 1.3em;
  line-height: 1.5;
  color: var(--cream);
}
.until {
  font-family: var(--display);
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
  color: var(--gold);
  margin-block: 1.5rem;
}
.closer {
  font-style: italic;
  color: var(--gold);
  font-size: 1.12em;
  margin-top: 1.75rem;
}

/* ---------- Excerpt ---------- */

.excerpt {
  position: relative;
  padding: clamp(1.75rem, 1rem + 3vw, 3rem);
  border-left: 1px solid rgba(236, 196, 120, 0.4);
  background: linear-gradient(90deg, rgba(236, 196, 120, 0.06), rgba(236, 196, 120, 0) 70%);
}
.chapter {
  font-family: var(--display);
  color: var(--gold);
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
}
.chapter span {
  display: block;
  font-family: var(--body);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--cream-dim);
}
.excerpt p { text-wrap: pretty; }
.excerpt-end { font-style: italic; color: var(--gold); margin-top: 1.75rem; }
.read-more { margin-top: 0.75rem; }

/* ---------- Tropes and heat ---------- */

.trope-list {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.trope-list li {
  padding: 0.5rem 1.05rem;
  border: 1px solid rgba(236, 196, 120, 0.5);
  border-radius: 999px;
  font-style: italic;
  color: var(--cream);
  background: rgba(7, 36, 38, 0.5);
}

.heat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
}
.heat p { margin: 0; max-width: 28rem; }
.heat strong { color: var(--gold); font-weight: 500; }
.flames { display: flex; gap: 0.35rem; }
.flame { width: 1.35rem; height: 2rem; fill: none; stroke: rgba(236, 196, 120, 0.45); stroke-width: 1.2; }
.flame.on { fill: var(--gold); stroke: var(--gold); filter: drop-shadow(0 0 6px rgba(236, 196, 120, 0.6)); }

.notes {
  border-top: 1px solid rgba(236, 196, 120, 0.25);
  padding-top: 1rem;
  max-width: var(--measure);
}
.notes summary {
  cursor: pointer;
  color: var(--gold);
  font-family: var(--display);
  font-size: 1rem;
  list-style-position: inside;
}
.notes p { margin-top: 0.9rem; color: var(--cream-dim); font-size: 0.97rem; }

/* ---------- Series shelf: ten suns, one lit ---------- */

.shelf {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 2rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.75rem 0.75rem;
}
.shelf li { text-align: center; }
.orb {
  display: block;
  width: 3.25rem; height: 3.25rem;
  margin: 0 auto 0.7rem;
  border-radius: 50%;
  border: 1px solid rgba(236, 196, 120, 0.35);
  background: radial-gradient(circle at 35% 30%, rgba(244, 232, 206, 0.12), rgba(13, 58, 60, 0.4) 70%);
}
.shelf .lit .orb {
  border-color: var(--gold);
  background: radial-gradient(circle at 40% 35%, #fff4d8 0%, var(--gold) 35%, #a77b33 75%, #5b3d14 100%);
  box-shadow: 0 0 30px rgba(236, 196, 120, 0.6);
}
.shelf-label { font-size: 0.85rem; line-height: 1.35; color: var(--cream-dim); display: block; }
.shelf .lit .shelf-label { color: var(--cream); }
.small { font-size: 0.95rem; color: var(--cream-dim); }

/* ---------- Comps ---------- */

.comps { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.comps li { padding-block: 0.9rem; border-bottom: 1px solid rgba(236, 196, 120, 0.15); color: var(--cream-dim); }
.comps li:last-child { border-bottom: 0; }
.comps cite { font-style: italic; color: var(--cream); }

/* ---------- Author ---------- */

.author-grid {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: clamp(1.75rem, 1rem + 3vw, 3.5rem);
  align-items: start;
}
.author-photo {
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(236, 196, 120, 0.45), 0 0 50px -8px rgba(236, 196, 120, 0.35);
}

/* ---------- Newsletter ---------- */

.letters { text-align: left; }
.signup label { display: block; font-size: 0.95rem; color: var(--cream-dim); margin-bottom: 0.5rem; }
.signup-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.signup input {
  flex: 1 1 14rem;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(236, 196, 120, 0.5);
  background: rgba(3, 16, 15, 0.6);
  color: var(--cream);
}
.signup input::placeholder { color: rgba(214, 204, 182, 0.55); }
.signup input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.form-msg { min-height: 1.5em; margin-top: 0.8rem; font-size: 0.95rem; color: var(--gold); }

/* ---------- Footer ---------- */

.foot {
  padding: 3rem 1.5rem 4rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(214, 204, 182, 0.6);
}
.foot p { margin: 0.3rem 0; }

/* ---------- Depth gauge (wide screens) ---------- */

.gauge {
  position: fixed;
  left: clamp(1rem, 2vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: none;
}
.gauge ol { list-style: none; margin: 0; padding: 0; position: relative; }
.gauge ol::before {
  content: "";
  position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(var(--gold), rgba(236, 196, 120, 0.15));
}
.gauge a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.42rem 0;
  text-decoration: none;
  color: var(--cream-dim);
  font-size: 0.8rem;
}
.tick {
  width: 11px; height: 11px; flex: none;
  border-radius: 50%;
  border: 1px solid rgba(236, 196, 120, 0.6);
  background: var(--abyss);
  position: relative;
  transition: background-color 0.3s, box-shadow 0.3s;
}
.gauge-label { opacity: 0; transform: translateX(-4px); transition: opacity 0.2s, transform 0.2s; }
.gauge:hover .gauge-label,
.gauge a:focus-visible .gauge-label,
.gauge a.current .gauge-label { opacity: 1; transform: none; }
.gauge a.current .tick { background: var(--gold); box-shadow: 0 0 12px rgba(236, 196, 120, 0.8); }
.gauge a.current { color: var(--cream); }
.gauge-reading {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin: 0 0 0.75rem;
  white-space: nowrap;
}

@media (min-width: 1180px) {
  .gauge { display: block; }
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .hero { min-height: auto; padding-top: 2.5rem; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-cover img { max-width: 15rem; }
  .buy { justify-content: center; }
  .dive { justify-content: center; }
  .author-grid { grid-template-columns: 1fr; }
  .author-photo { max-width: 11rem; }
  .heat { grid-template-columns: 1fr; gap: 0.9rem; }
  .shelf { grid-template-columns: repeat(5, 1fr); gap: 1.25rem 0.4rem; }
  .orb { width: 2.4rem; height: 2.4rem; }
  .shelf-label { font-size: 0.72rem; }
  .shelf .lit .shelf-label em { display: none; }
}

/* Sign-up: honeypot and consent note */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-note { font-size: 0.85rem; opacity: 0.75; margin-top: 0.75rem; }
