/* ==========================================================================
   Back to the Beyond — site styles
   Palette carried over from the original site:
     primary blue  #1f65d6   secondary green  #26cb7c
     body text     #4e4e4e   headings         #111111
   plus the night-sky navy from the hero image and book cover.
   ========================================================================== */

:root {
  --blue: #1f65d6;
  --blue-dark: #174fa9;
  --blue-soft: #e8f0fc;
  --green: #26cb7c;
  --green-dark: #1a9d5e;
  --text: #4e4e4e;
  --heading: #111111;
  --night: #0b1033;
  --night-2: #18205a;
  --paper: #f7f6f2;
  --white: #ffffff;
  --line: #e4e2dc;

  --font-head: "Quicksand", system-ui, sans-serif;
  --font-body: "PT Sans", system-ui, sans-serif;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 16, 51, 0.12);
  --wrap: 1120px;
  --gutter: 20px;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--paper) url("../images/pattern.png");
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--heading);
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.1em; }

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.narrow { max-width: 760px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--white);
  padding: 10px 16px;
  z-index: 200;
  border-radius: 8px;
}
.skip-link:focus { left: 8px; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 0.8em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 52px;
  padding: 0.75em 1.6em;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); color: var(--white); }
.btn-green { background: var(--green); color: var(--night); }
.btn-green:hover { background: var(--green-dark); color: var(--white); }
.btn-ghost { border-color: currentColor; color: var(--white); background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: var(--white); }
.btn-outline { border-color: var(--blue); color: var(--blue); background: transparent; }
.btn-outline:hover { background: var(--blue); color: var(--white); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 16, 51, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
  min-width: 0;
}
.brand img { width: 42px; height: 42px; border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-title { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }
.brand-tag {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand:hover { color: var(--white); }

.nav-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 24px;
  height: 2px;
  margin: 0 auto;
  background: currentColor;
  border-radius: 2px;
  position: relative;
  transition: transform 0.25s, background-color 0.25s;
}
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-7px) rotate(-45deg); }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 10px 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--white); background: rgba(255, 255, 255, 0.1); }
.site-nav .nav-cta a { background: var(--green); color: var(--night); margin-left: 6px; }
.site-nav .nav-cta a:hover { background: var(--white); color: var(--night); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--night);
    padding: 16px var(--gutter) 40px;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .nav-open .site-nav { visibility: visible; opacity: 1; transform: none; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
  .site-nav a {
    padding: 16px 18px;
    font-size: 1.15rem;
    border-radius: 12px;
  }
  .site-nav .nav-cta a { margin: 12px 0 0; text-align: center; }
  .nav-open { overflow: hidden; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(11, 16, 51, 0.35), rgba(11, 16, 51, 0.85)),
    url("../images/hero-banner.jpeg") center / cover no-repeat,
    var(--night);
  padding: 56px 0 72px;
  overflow: hidden;
}
.hero::after {
  /* soft light at the end of the tunnel, echoing the book cover */
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -120px;
  top: 40px;
  background: radial-gradient(circle, rgba(120, 160, 255, 0.35), transparent 65%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 40px;
  align-items: center;
}
.hero h1 { color: var(--white); margin-bottom: 0.25em; }
.hero .subtitle {
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: #b9c8ff;
  margin-bottom: 1.4em;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(38, 203, 124, 0.16);
  color: #8ff0c0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
  text-decoration: none;
}
a.badge:hover { background: rgba(38, 203, 124, 0.28); color: #b5f5d5; }
.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.hero blockquote {
  margin: 0 0 28px;
  padding-left: 18px;
  border-left: 3px solid var(--green);
  color: rgba(255, 255, 255, 0.88);
  font-style: italic;
}
.hero blockquote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
}
.hero-cover { display: flex; justify-content: center; }
.hero-cover img {
  width: min(300px, 72vw);
  border-radius: 6px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 0 80px rgba(100, 140, 255, 0.25);
  transform: rotate(-2deg);
}

@media (min-width: 860px) {
  .hero { padding: 88px 0 104px; }
  .hero-grid { grid-template-columns: 1.3fr 1fr; gap: 64px; }
  .hero-cover img { width: 340px; }
}

/* Page heroes for inner pages */
.page-hero {
  background:
    linear-gradient(180deg, rgba(11, 16, 51, 0.55), rgba(11, 16, 51, 0.9)),
    url("../images/hero-banner.jpeg") center / cover no-repeat,
    var(--night);
  color: var(--white);
  padding: 56px 0 48px;
  text-align: center;
}
.page-hero h1 { color: var(--white); margin-bottom: 0.3em; }
.page-hero p { color: rgba(255, 255, 255, 0.8); max-width: 640px; margin: 0 auto; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-white { background: var(--white); }
.section-night { background: var(--night); color: rgba(255, 255, 255, 0.85); }
.section-night h2, .section-night h3 { color: var(--white); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
@media (min-width: 860px) { .section { padding: 88px 0; } }

/* About the book */
.book-grid { display: grid; gap: 40px; }
.book-grid .lede {
  font-family: var(--font-head);
  font-size: 1.35rem;
  color: var(--heading);
  font-weight: 600;
}
.who-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 12px;
}
.who-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--blue-soft);
  padding: 14px 16px;
  border-radius: 12px;
  color: var(--heading);
}
.who-list li::before {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 0.55em;
  border-radius: 50%;
  background: var(--blue);
}
@media (min-width: 860px) { .book-grid { grid-template-columns: 1.4fr 1fr; gap: 64px; } }

/* Quote cards */
.quote-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 26px 26px;
  box-shadow: var(--shadow);
  margin: 0;
}
.quote-card::before {
  content: "\201C";
  position: absolute;
  top: -6px;
  left: 18px;
  font-family: Georgia, serif;
  font-size: 4.5rem;
  line-height: 1;
  color: var(--green);
}
.quote-card p { margin-bottom: 1em; }
.quote-card footer { font-weight: 700; color: var(--heading); font-size: 0.95rem; }
.quote-card footer span { display: block; font-weight: 400; color: var(--text); font-size: 0.85rem; }
.section-night .quote-card { background: var(--night-2); color: rgba(255, 255, 255, 0.85); box-shadow: none; }
.section-night .quote-card footer { color: var(--white); }
.section-night .quote-card footer span { color: rgba(255, 255, 255, 0.6); }

.quote-grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .quote-grid { grid-template-columns: repeat(2, 1fr); } }

.feature-quote {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.feature-quote p {
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 3.4vw, 1.6rem);
  line-height: 1.5;
  color: var(--white);
}
.feature-quote cite { font-style: normal; color: #8ff0c0; font-weight: 700; }
.feature-quote cite span { display: block; font-weight: 400; color: rgba(255, 255, 255, 0.6); font-size: 0.9rem; }

/* Author */
.author-grid { display: grid; gap: 36px; align-items: center; }
.author-photo {
  width: min(320px, 80vw);
  aspect-ratio: 1;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
  margin: 0 auto;
  border: 6px solid var(--white);
  box-shadow: var(--shadow);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.tags li {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.9rem;
  color: var(--heading);
}
@media (min-width: 860px) { .author-grid { grid-template-columns: 1fr 1.6fr; gap: 64px; } }

/* Buy band */
.buy-band { text-align: center; }
.buy-options {
  display: grid;
  gap: 16px;
  max-width: 640px;
  margin: 32px auto 0;
}
.buy-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.buy-option:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.buy-option strong { font-family: var(--font-head); font-size: 1.2rem; color: var(--heading); }
.buy-option .go { margin-top: 8px; color: var(--blue); font-weight: 700; font-family: var(--font-head); }
.buy-option.is-featured { border-color: var(--green); }
@media (min-width: 640px) { .buy-options { grid-template-columns: repeat(2, 1fr); } }

/* Community */
.community {
  display: grid;
  gap: 28px;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.community img { border-radius: 10px; }
@media (min-width: 860px) { .community { grid-template-columns: 1.2fr 1fr; padding: 40px; } }

/* ---------- Forms ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
}
@media (min-width: 640px) { .card { padding: 40px; } }

.form-grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--heading);
  font-size: 0.95rem;
}
.field .req { color: var(--blue); }
.field .hint { font-size: 0.85rem; color: #6d6d6d; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  color: var(--heading);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.2s, background-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 150px; resize: vertical; }
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  background-color: var(--white);
}
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: #c63d3d; }
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.95rem;
}
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--blue); flex-shrink: 0; }
.hidden-field { position: absolute; left: -9999px; }
.form-note { font-size: 0.85rem; color: #6d6d6d; margin: 0; }
.form-status {
  display: none;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 700;
}
.form-status.is-error { display: block; background: #fdecec; color: #9b2c2c; }
.form-status.is-success { display: block; background: #e3f8ee; color: #136c42; }

/* Contact layout */
.contact-grid { display: grid; gap: 28px; }
.contact-aside h3 { margin-top: 0; }
.contact-aside ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.contact-aside li { padding: 16px; background: var(--white); border-radius: 12px; border: 1px solid var(--line); }
.contact-aside li strong { display: block; color: var(--heading); font-family: var(--font-head); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1.6fr 1fr; gap: 40px; } }

/* Prose pages */
.prose h2 { font-size: 1.5rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--night);
  color: rgba(255, 255, 255, 0.7);
  padding: 56px 0 calc(28px + env(safe-area-inset-bottom));
  font-size: 0.95rem;
}
.footer-grid { display: grid; gap: 32px; }
.site-footer h3 { color: var(--white); font-size: 1.05rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.site-footer a { color: rgba(255, 255, 255, 0.85); text-decoration: none; display: inline-block; padding: 6px 0; }
.site-footer a:hover { color: var(--green); }
.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  font-size: 0.85rem;
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; } }

/* Sticky mobile buy bar */
.mobile-buy {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(11, 16, 51, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(110%);
  transition: transform 0.25s;
}
.mobile-buy.is-visible { transform: none; }
.mobile-buy .btn { flex: 1; min-height: 48px; padding: 0.5em 1em; font-size: 0.95rem; }
@media (min-width: 900px) { .mobile-buy { display: none; } }
body.has-mobile-buy .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body.has-mobile-buy .site-footer { padding-bottom: 28px; } }

/* Reveal-on-scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s, transform 0.6s; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
