/* ==========================================================================
   theshore.ai — Into Alignment
   Night ocean / eclipse moon theme, from the novel's cover:
   midnight navy #0a1628 · blood moon #d4622e · cream #efe5d0
   ========================================================================== */

:root {
  --night-0: #060d1a;   /* deepest sky */
  --night-1: #0a1628;   /* page */
  --night-2: #101f36;   /* elevated */
  --night-3: #16273f;   /* raised edge */
  --ink: #efe5d0;       /* cream text */
  --ink-dim: #b6ab96;   /* muted cream */
  --ink-faint: #8a8172;
  --moon: #d4622e;      /* eclipse amber */
  --moon-bright: #e8946a;
  --ember: #c44536;
  --line: rgba(239, 229, 208, 0.14);
  --line-soft: rgba(239, 229, 208, 0.07);
  --moon-x: 50%;          /* default: centered (mobile / narrow) */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--night-1);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--moon-bright); text-decoration: none; }
a:hover { color: var(--moon); }

/* ---------- shared bits ---------- */

.kicker {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--moon-bright);
  margin-bottom: 1.75rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  padding: 0.8rem 1.6rem;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  min-height: 44px;
  line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--moon-bright) 0%, var(--moon) 55%, var(--ember) 100%);
  color: #1c0d05;
}
.btn-primary:hover { color: #1c0d05; filter: brightness(1.07); }

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: rgba(239,229,208,0.34); color: var(--ink); background: rgba(239,229,208,0.05); }

:focus-visible { outline: 2px solid var(--moon-bright); outline-offset: 3px; border-radius: 2px; }

/* ---------- nav ---------- */

.nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 4vw, 3rem);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
}
.wordmark:hover { color: var(--ink); opacity: 0.85; }

.nav-links { display: flex; align-items: center; gap: clamp(1.1rem, 2.5vw, 2.2rem); }
.nav-links a {
  font-family: var(--font-display);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}
.nav-links a:hover { color: var(--ink); }

.nav-buy {
  border: 1px solid rgba(212,98,46,0.55);
  color: var(--moon-bright) !important;
  padding: 0.5rem 1.05rem;
  border-radius: 2px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.nav-buy:hover { background: rgba(212,98,46,0.12); border-color: var(--moon); }

@media (max-width: 640px) {
  .nav-links a:not(.nav-buy) { display: none; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--night-0);
}

/* sky with a soft glow toward the moon (upper-center-right) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 62% 46% at var(--moon-x) 20%,
      rgba(212, 98, 46, 0.13) 0%,
      rgba(212, 98, 46, 0.05) 42%,
      transparent 72%),
    linear-gradient(180deg,
      #0b1830 0%,
      #081225 34%,
      var(--night-0) 78%);
  z-index: 0;
}

.sky {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.stars { position: absolute; inset: 0; }

.star {
  position: absolute;
  background: #f4ead8;
  border-radius: 50%;
}

@keyframes twinkle {
  0%, 100% { opacity: var(--o, 0.6); }
  50%      { opacity: calc(var(--o, 0.6) * 0.25); }
}

/* ---- Moon placement ----
   Wide (≥1160px): the moon hangs in the open sky between the title column
   and the book column — the ~200px gap that tracks the centered 1120px
   content box. Disc clears title, cover, and nav at every width.
   Mid (901–1159px): moon rides high and small, centered — measured clear.
   Mobile (≤900px): the moon and its reflection are hidden; the cover's own
   eclipse does the work, and stars + horizon-light keep the sky alive. */

.moon {
  position: absolute;
  top: clamp(4rem, 9vh, 6.5rem);
  left: var(--moon-x);
  translate: -50% 0;
  width: clamp(150px, 15vw, 165px);
  height: auto;
  filter: drop-shadow(0 0 42px rgba(212, 98, 46, 0.25));
}

@media (min-width: 1160px) {
  /* Gap between the title column and the book column tracks the centered
     content box; its center sits ~83px right of the viewport center. */
  :root { --moon-x: calc(50% + 83px); }
}

/* Mid viewports (two-column hero, cramped sky): moon rides high and smaller */
@media (max-width: 1159px) and (min-width: 901px) {
  .moon { width: clamp(120px, 13vw, 150px); top: 3.6rem; }
  .reflection { width: clamp(70px, 9vw, 100px); }
}

/* Mobile: no room for a moon in the cramped sky — the book cover's own
   eclipse carries the theme. Stars and horizon remain. */
@media (max-width: 900px) {
  .moon, .reflection { display: none; }
}

/* the sea */
.sea {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  z-index: 1;
  background:
    linear-gradient(180deg,
      rgba(16, 31, 54, 0.0) 0%,
      rgba(13, 24, 44, 0.85) 12%,
      #0a1424 55%,
      #081120 100%);
  border-top: 1px solid rgba(212, 98, 46, 0.18);
  pointer-events: none;
}

/* faint horizontal wave texture */
.sea::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(180deg,
      transparent 0px,
      transparent 9px,
      rgba(239, 229, 208, 0.022) 10px,
      transparent 11px,
      transparent 23px,
      rgba(239, 229, 208, 0.014) 24px,
      transparent 25px);
}

/* a tiny warm light on the horizon */
.horizon-light {
  position: absolute;
  top: -3px;
  left: 24%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffb26b;
  box-shadow: 0 0 10px 2px rgba(255, 178, 107, 0.5);
}

/* the moon's broken reflection down the water */
.reflection {
  position: absolute;
  top: 6%;
  left: var(--moon-x);
  translate: -50% 0;
  width: clamp(80px, 10vw, 130px);
  height: 88%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.reflection i {
  display: block;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(232, 148, 106, var(--a, 0.3)) 22%,
    rgba(212, 98, 46, var(--a, 0.3)) 50%,
    rgba(232, 148, 106, var(--a, 0.3)) 78%,
    transparent 100%);
  border-radius: 2px;
  margin-top: var(--gap, 9px);
  width: var(--w, 60%);
  height: var(--h, 3px);
  filter: blur(0.4px);
}

@keyframes shimmer {
  0%, 100% { opacity: 0.75; transform: translateX(0); }
  50%      { opacity: 1;    transform: translateX(var(--dx, 3px)); }
}

/* Mid viewports (two-column hero, cramped sky): moon rides high and smaller */
@media (max-width: 1159px) and (min-width: 901px) {
  .moon { width: clamp(120px, 13vw, 150px); top: 3.4rem; }
  .reflection { width: clamp(70px, 9vw, 100px); }
}

/* hero content */

.hero-inner {
  position: relative;
  z-index: 5;
  flex: 1;
  width: min(1120px, 100% - clamp(2.5rem, 8vw, 6rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: clamp(7rem, 14vh, 10rem) 0 clamp(4.5rem, 9vh, 6.5rem);
}

.hero-copy { max-width: 34rem; }

.title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.4rem, 9.5vw, 6.8rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: 1.1rem;
}

.subtitle {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--moon-bright);
  margin-bottom: 2.1rem;
}

.hook {
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  color: var(--ink-dim);
  max-width: 30rem;
  margin-bottom: 2.4rem;
  font-style: italic;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* the book itself */
.hero-book { justify-self: center; }

.hero-book img {
  width: clamp(220px, 24vw, 330px);
  border-radius: 3px;
  box-shadow:
    0 0 0 1px rgba(239, 229, 208, 0.08),
    0 30px 70px -18px rgba(0, 0, 0, 0.75),
    0 0 90px -10px rgba(212, 98, 46, 0.22);
}

/* scroll cue */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  translate: -50% 0;
  z-index: 6;
  width: 26px;
  height: 42px;
  border: 1.5px solid rgba(239, 229, 208, 0.35);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}
.scroll-cue span {
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: rgba(239, 229, 208, 0.55);
  animation: cue-drop 2.2s ease-in-out infinite;
}
@keyframes cue-drop {
  0%   { transform: translateY(0);    opacity: 0.9; }
  70%  { transform: translateY(12px); opacity: 0.15; }
  100% { transform: translateY(0);    opacity: 0.9; }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 2.8rem;
    padding-top: 8.5rem;
  }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .cta-row { justify-content: center; }
  .hero-book img { width: clamp(190px, 42vw, 240px); }
  .hook { margin-inline: auto; }
}

/* ---------- sections ---------- */

.section { position: relative; }

/* the premise */
.section-story {
  background:
    radial-gradient(ellipse 70% 40% at 50% -6%, rgba(16, 31, 54, 0.9), transparent 70%),
    var(--night-1);
  padding: clamp(5.5rem, 12vh, 9rem) 0;
}

.prose {
  width: min(42rem, 100% - clamp(2.5rem, 8vw, 6rem));
  margin: 0 auto;
}

.prose .kicker { text-align: center; }

.prose p {
  color: var(--ink-dim);
  margin-bottom: 1.6rem;
  font-size: 1.0938rem;
  text-wrap: pretty;
}

.prose p:first-of-type { color: var(--ink); }

.drop-cap::first-letter {
  font-family: var(--font-display);
  font-weight: 600;
  float: left;
  font-size: 4.4rem;
  line-height: 0.82;
  padding: 0.35rem 0.75rem 0 0;
  color: var(--moon);
}

.comp-line {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem !important;
  color: var(--ink) !important;
  text-align: center;
  margin-top: 2.6rem !important;
}

/* the books */
.section-books {
  border-top: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, var(--night-1) 0%, #0b1526 50%, var(--night-1) 100%);
  padding: clamp(5rem, 11vh, 8rem) 0;
}

.section-head { width: min(1120px, 100% - clamp(2.5rem, 8vw, 6rem)); margin: 0 auto 3.5rem; }

.books-grid {
  width: min(1120px, 100% - clamp(2.5rem, 8vw, 6rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: stretch;
}

.book-card {
  display: grid;
  grid-template-columns: minmax(150px, 230px) 1fr;
  gap: clamp(1.4rem, 3vw, 2.2rem);
  padding: clamp(1.6rem, 3vw, 2.4rem);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: linear-gradient(160deg, rgba(22, 39, 63, 0.35), rgba(10, 22, 40, 0.35));
}

.book-card-novel {
  border-color: rgba(212, 98, 46, 0.28);
  background:
    radial-gradient(ellipse 90% 70% at 18% 8%, rgba(212, 98, 46, 0.07), transparent 60%),
    linear-gradient(160deg, rgba(22, 39, 63, 0.5), rgba(10, 22, 40, 0.4));
}

.book-cover img {
  width: 100%;
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(239, 229, 208, 0.07),
    0 18px 44px -12px rgba(0, 0, 0, 0.65);
  transition: transform 0.25s ease;
}
.book-cover:hover img { transform: translateY(-4px); }

.book-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.book-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 0.3rem;
  text-wrap: balance;
}

.book-sub {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--moon-bright);
  margin-bottom: 1.1rem;
}

.book-desc {
  font-size: 0.98rem;
  color: var(--ink-dim);
  margin-bottom: 1.7rem;
  text-wrap: pretty;
}

.book-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: auto; padding-top: 0.5rem; }
.book-links .btn { padding: 0.62rem 1.25rem; font-size: 0.875rem; }

.series-line {
  width: min(1120px, 100% - clamp(2.5rem, 8vw, 6rem));
  margin: 2.4rem auto 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.95rem;
}
.series-line a { border-bottom: 1px solid rgba(212, 98, 46, 0.4); }

@media (max-width: 860px) {
  .books-grid { grid-template-columns: 1fr; }
  .book-card { grid-template-columns: minmax(120px, 170px) 1fr; }
}

@media (max-width: 480px) {
  .book-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .book-info { align-items: center; }
  .book-links { justify-content: center; }
  .book-cover img { max-width: 190px; }
}

/* the author */
.section-author {
  border-top: 1px solid var(--line-soft);
  padding: clamp(4.5rem, 10vh, 7rem) 0;
  background:
    radial-gradient(ellipse 46% 60% at 82% 110%, rgba(212, 98, 46, 0.06), transparent 70%),
    var(--night-1);
}

.author-inner {
  width: min(42rem, 100% - clamp(2.5rem, 8vw, 6rem));
  margin: 0 auto;
  text-align: center;
}

.author-bio {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: 1.6rem;
}

.author-more { font-size: 1rem; }
.author-more a { border-bottom: 1px solid rgba(212, 98, 46, 0.4); }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line-soft);
  padding: 3rem 0 3.5rem;
  background: var(--night-0);
}

.footer-inner {
  width: min(1120px, 100% - clamp(2.5rem, 8vw, 6rem));
  margin: 0 auto;
  text-align: center;
}

.footer-mark {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.8125rem;
  color: var(--ink-dim);
  margin-bottom: 0.9rem;
}

.footer-fine { font-size: 0.85rem; color: var(--ink-faint); }
.footer-fine a { color: var(--ink-faint); border-bottom: 1px solid var(--line-soft); }
.footer-fine a:hover { color: var(--ink-dim); }

/* ---------- 404 ---------- */

body.err {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 60% 40% at 50% 22%, rgba(212, 98, 46, 0.10), transparent 70%),
    var(--night-0);
}

.err-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.err-moon { width: clamp(90px, 14vw, 130px); margin-bottom: 1.8rem; }

.err-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 8vw, 4.5rem);
  color: var(--ink);
  line-height: 1;
  margin-bottom: 0.7rem;
}

.err-text {
  color: var(--ink-dim);
  font-style: italic;
  margin-bottom: 2.2rem;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .star, .reflection i, .scroll-cue span { animation: none !important; }
  .btn, .book-cover img { transition: none !important; }
}
