/* The Silent Cradle — site styles.
   Palette from the book's imagery: rust-and-gray world, bruised purple sky,
   the sensor dome's blue-to-violet cycling, bioluminescence, Melorin's debris arc. */

:root {
  --bg: #131417;
  --bg-raised: #1b1d23;
  --line: #2a2d35;
  --text: #d9d6d1;
  --muted: #979490;
  --rust: #c26a45;
  --rust-deep: #8a4630;
  --purple: #6b5a8c;
  --dome-blue: #5b82d8;
  --dome-violet: #8f68e8;
  --bio: #5fd3c0;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  background: var(--dome-blue);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem clamp(1rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}
.wordmark {
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.site-header nav a:hover,
.site-header nav a:focus,
.site-header nav a[aria-current="page"] { color: var(--text); }
.site-header nav a[aria-current="page"] {
  border-bottom: 2px solid var(--rust);
  padding-bottom: 2px;
}

main { min-height: 60vh; }

/* Hero */
.hero {
  padding: clamp(3.5rem, 12vh, 7rem) clamp(1rem, 6vw, 4rem);
  max-width: 62rem;
  margin: 0 auto;
  position: relative;
}
.hero .kicker {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rust);
  margin: 0 0 1rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.1;
  margin: 0 0 1.25rem;
  font-weight: 600;
}
.hero .dome-line {
  display: block;
  width: 7rem;
  height: 3px;
  border-radius: 2px;
  margin: 1.75rem 0;
  background: linear-gradient(90deg, var(--dome-blue), var(--dome-violet), var(--dome-blue));
  background-size: 200% 100%;
  animation: dome-cycle 9s ease-in-out infinite;
}
@keyframes dome-cycle {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .dome-line { animation: none; }
  html { scroll-behavior: auto; }
}
.hero .lede {
  font-size: 1.25rem;
  color: var(--muted);
  max-width: 38rem;
}
.hero .lede strong { color: var(--text); font-weight: 600; }

/* Buttons & links */
.button,
.signup-form button {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(100deg, var(--dome-blue), var(--dome-violet));
  border: none;
  border-radius: 4px;
  padding: 0.7rem 1.4rem;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, .button:focus,
.signup-form button:hover, .signup-form button:focus { filter: brightness(1.12); }
.button.secondary {
  background: none;
  border: 1px solid var(--rust);
  color: var(--rust);
}
.button.secondary:hover, .button.secondary:focus {
  color: var(--text);
  border-color: var(--text);
  filter: none;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

a { color: var(--dome-blue); }
a:hover, a:focus { color: var(--dome-violet); }

/* Sections */
.section {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 6vw, 3rem);
}
.section h2 {
  font-size: 1.6rem;
  margin-top: 0;
}
.section.wide { max-width: 62rem; }
.muted { color: var(--muted); }

/* Book panel on home */
.book-panel {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
}
.book-panel .inner {
  max-width: 62rem;
  margin: 0 auto;
  padding: 3rem clamp(1rem, 6vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 2.5rem;
  align-items: center;
}
@media (max-width: 44rem) {
  .book-panel .inner { grid-template-columns: 1fr; }
}
.cover-placeholder {
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    radial-gradient(120% 80% at 70% 10%, rgba(107, 90, 140, 0.55), transparent 60%),
    radial-gradient(100% 60% at 20% 95%, rgba(138, 70, 48, 0.5), transparent 55%),
    linear-gradient(180deg, #1c1a24 0%, #241a18 100%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Signup */
.signup {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-raised);
  padding: 2rem;
  margin: 3rem auto;
  max-width: 40rem;
}
.signup h2 { margin-top: 0; font-size: 1.35rem; }
.signup p { color: var(--muted); }
.signup-form { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.signup-form input[type="email"] {
  flex: 1 1 14rem;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
.signup-form input[type="email"]:focus {
  outline: 2px solid var(--dome-blue);
  outline-offset: 1px;
}

/* Excerpt / prose pages */
.prose { max-width: 38rem; margin: 0 auto; padding: 3rem clamp(1rem, 6vw, 3rem); }
.prose h1 { font-size: 1.9rem; line-height: 1.2; }
.prose p { margin: 0 0 1.1em; }
.prose .chapter-heading {
  font-family: var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--rust);
}
.excerpt-end {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding-top: 2rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--muted);
}

/* Forms (contact) */
.contact-form { display: grid; gap: 1rem; max-width: 34rem; }
.contact-form label { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); }
.contact-form input, .contact-form textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--text);
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: 2px solid var(--dome-blue);
  outline-offset: 1px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem clamp(1rem, 5vw, 3rem);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover, .site-footer a:focus { color: var(--text); }
