/* =====================================================================
   THE GHOSTS OF PORT ST. JOE — Alex Giles Author Site
   Southern Gothic design system, complementary to the real book cover.
   Palette: deep forest-green/near-black, aged brass-gold, parchment.
   ===================================================================== */

:root {
  /* Core palette (tuned to the cover artwork) */
  --ink-void: #0c110d;        /* near-black forest */
  --ink-deep: #11180f;        /* deep moss black */
  --forest: #14201a;          /* dark forest green */
  --forest-soft: #1c2b22;     /* raised surface */
  --bark: #2a3a2f;            /* border / divider */
  --gold: #c5a059;            /* aged brass-gold accent */
  --gold-soft: #d9be86;       /* lighter gold for hover */
  --parchment: #ece3cf;       /* primary text on dark */
  --parchment-dim: #b7ae9a;   /* muted text */
  --rust: #8b5a36;            /* earthy secondary accent */
  --ghost: #7e9488;           /* spectral teal-gray */

  --maxw: 1180px;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --serif-display: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --serif-body: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --type-writer: "Courier Prime", "Courier New", monospace;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--serif-body);
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--parchment);
  background: var(--ink-void);
  /* Layered atmosphere: subtle radial vignette + drifting mist */
  background-image:
    radial-gradient(120% 90% at 50% -10%, rgba(42,58,47,0.55) 0%, rgba(12,17,13,0) 55%),
    radial-gradient(140% 120% at 50% 120%, rgba(28,43,34,0.5) 0%, rgba(12,17,13,0) 60%);
  background-attachment: fixed;
  overflow-x: hidden;
  text-wrap: pretty;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; transition: color 0.25s var(--ease); }
a:hover { color: var(--gold-soft); }

/* Paper-grain texture overlay (subtle, no glassmorphism) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Site-wide drifting fog — real looping video behind all content */
.fog-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
  opacity: 0.32;
  filter: brightness(0.72) saturate(0.9);
}
/* Static fallback (poster) for no-JS / reduced-motion */
.fog-fallback {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("assets/atmos/fog.jpg");
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  filter: brightness(0.85) saturate(0.95);
}

/* ---- Layout helpers ---- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; position: relative; z-index: 1; }
section { position: relative; z-index: 1; padding: clamp(3.5rem, 8vw, 7rem) 0; }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--serif-display);
  font-weight: 700;
  line-height: 1.12;
  color: var(--parchment);
  margin: 0 0 0.6em;
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
p { margin: 0 0 1.1rem; color: var(--parchment); }
.lede { font-size: clamp(1.2rem, 2vw, 1.45rem); color: var(--parchment-dim); }
.eyebrow {
  font-family: var(--type-writer);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.78rem;
  color: var(--gold);
  margin: 0 0 1rem;
  display: inline-block;
}
.gold { color: var(--gold); }
.dim { color: var(--parchment-dim); }
.script { font-family: "Cormorant Garamond", serif; font-style: italic; }

/* ---- Under-development notice (forms not yet live) ---- */
.under-dev {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--type-writer);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-void);
  background: var(--gold);
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.dev-banner {
  font-family: var(--type-writer);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  line-height: 1.55;
  color: var(--parchment-dim);
  border: 1px dashed var(--bark);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
  background: rgba(12,17,13,0.45);
}
.dev-banner b { color: var(--gold); font-weight: 400; }
input:disabled, textarea:disabled, button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--serif-display);
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  padding: 0.85rem 1.8rem;
  border: 1px solid var(--gold);
  color: var(--gold);
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  min-height: 44px;
}
.btn:hover { background: var(--gold); color: var(--ink-void); transform: translateY(-2px); }
.btn-solid { background: var(--gold); color: var(--ink-void); }
.btn-solid:hover { background: var(--gold-soft); border-color: var(--gold-soft); }
.btn-ghost { border-color: var(--bark); color: var(--parchment-dim); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: transparent; }

/* ---- Equal-weight retailer quick-pick row (Books page, under H1) ---- */
.retailer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.6rem auto 0;
}
.retailer-row .eyebrow {
  flex-basis: 100%;
  text-align: center;
  margin: 0 0 0.2rem;
}
.retailer-pill {
  flex: 1 1 0;
  min-width: 0;
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--serif-display);
  font-size: 1rem;
  letter-spacing: 0.03em;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--gold);
  color: var(--gold);
  background: transparent;
  border-radius: var(--radius);
  text-decoration: none;
  text-align: center;
  transition: all 0.3s var(--ease);
  min-height: 44px;
}
.retailer-pill:hover { background: var(--gold); color: var(--ink-void); transform: translateY(-2px); }

/* ---- Header / Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12,17,13,0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(197,160,89,0.18);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  font-family: var(--serif-display);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--parchment);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.brand .mark { color: var(--gold); font-style: italic; }
.nav-links { display: flex; gap: 1.8rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav-links a {
  font-family: var(--serif-display);
  font-size: 1.02rem;
  color: var(--parchment-dim);
  letter-spacing: 0.03em;
  padding: 0.4rem 0;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1px; background: var(--gold);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--gold); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { width: 100%; }
.nav-toggle { display: none; background: none; border: 0; color: var(--gold); cursor: pointer; padding: 0.5rem; }

/* ---- Hero (Home) ---- */
.hero { padding-top: clamp(3rem, 7vw, 6rem); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero h1 .line2 { display: block; color: var(--gold); font-style: italic; font-weight: 400; }
.hero-cover {
  position: relative;
  filter: drop-shadow(0 24px 50px rgba(0,0,0,0.6));
  transition: transform 0.6s var(--ease);
}
.hero-cover img { border-radius: 2px; }
.hero-cover::after {
  content: "";
  position: absolute; inset: -6% -6% -10% -6%;
  background: radial-gradient(60% 50% at 50% 40%, rgba(197,160,89,0.12), transparent 70%);
  z-index: -1;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.6rem; }
.meta-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 2rem; font-family: var(--type-writer); font-size: 0.82rem; color: var(--parchment-dim); letter-spacing: 0.05em; }
.meta-row span { display: flex; flex-direction: column; }
.meta-row span b { color: var(--gold); font-weight: 400; font-size: 1.05rem; font-family: var(--serif-display); letter-spacing: 0; }

/* ---- Book card / gallery ---- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.8rem);
}
.book-card {
  background: linear-gradient(180deg, var(--forest) 0%, var(--ink-deep) 100%);
  border: 1px solid var(--bark);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.book-card:hover { transform: translateY(-6px); border-color: rgba(197,160,89,0.55); box-shadow: 0 18px 40px rgba(0,0,0,0.5); }
.book-cover-wrap { padding: 1.6rem 1.6rem 0; aspect-ratio: 1/1; display: flex; justify-content: center; }
.book-cover-wrap img { height: 100%; width: auto; object-fit: contain; border-radius: 2px; box-shadow: 0 10px 26px rgba(0,0,0,0.55); }
.book-body { padding: 1.4rem 1.6rem 1.8rem; display: flex; flex-direction: column; flex: 1; }
.book-body h3 { margin-bottom: 0.3rem; }
.book-tag { font-family: var(--type-writer); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.7rem; }
.book-body p { font-size: 1rem; color: var(--parchment-dim); flex: 1; }
.book-links { display: flex; gap: 1rem; margin-top: 1.1rem; font-family: var(--serif-display); font-size: 0.98rem; }

/* ---- Generic content blocks ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.rule { height: 1px; background: linear-gradient(90deg, transparent, rgba(197,160,89,0.4), transparent); border: 0; margin: 0; }
.quote {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1.4;
  color: var(--parchment);
  border-left: 2px solid var(--gold);
  padding-left: 1.4rem;
  margin: 2rem 0;
}
.quote cite { display: block; font-style: normal; font-family: var(--type-writer); font-size: 0.8rem; letter-spacing: 0.15em; color: var(--gold); margin-top: 0.8rem; text-transform: uppercase; }

.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.2rem; }
.feature-list li { display: flex; gap: 1rem; align-items: flex-start; }
.feature-list .num { font-family: var(--type-writer); color: var(--gold); font-size: 0.9rem; padding-top: 0.35rem; min-width: 2rem; }

/* ---- Forms ---- */
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.2rem; }
.field label { font-family: var(--type-writer); font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold); }
.field input, .field textarea {
  font-family: var(--serif-body);
  font-size: 1.05rem;
  background: var(--forest);
  border: 1px solid var(--bark);
  color: var(--parchment);
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  transition: border-color 0.25s var(--ease);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.note { font-size: 0.92rem; color: var(--parchment-dim); font-style: italic; }
.form-status { font-family: var(--type-writer); font-size: 0.85rem; min-height: 1.2rem; margin-top: 0.6rem; color: var(--gold); }

/* ---- Footer ---- */
.site-footer {
  background: var(--ink-deep);
  border-top: 1px solid rgba(197,160,89,0.18);
  padding: 3rem 0 2rem;
  position: relative;
  z-index: 1;
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; }
.footer-brand { font-family: var(--serif-display); font-size: 1.4rem; color: var(--parchment); }
.footer-brand .mark { color: var(--gold); font-style: italic; }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.footer-links a { font-family: var(--serif-display); color: var(--parchment-dim); }
.footer-meta { width: 100%; border-top: 1px solid var(--bark); margin-top: 2rem; padding-top: 1.4rem; font-family: var(--type-writer); font-size: 0.78rem; color: var(--parchment-dim); letter-spacing: 0.05em; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; }

/* ---- Atmospheric corner accents (Spanish moss + rustic cottage) ---- */
/* Decorative only: pointer-events none, masked fade so they never fight text. */
.atmos {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  background-size: cover;
  background-repeat: no-repeat;
}
/* Spanish moss drapes — clearly visible, only the corners/edges intrude */
.atmos-moss {
  top: 0; left: 0;
  width: min(620px, 60vw);
  height: min(620px, 60vw);
  background-image: url("assets/atmos/moss.jpg");
  background-position: top left;
  opacity: 0.95;
  filter: saturate(0.9) brightness(0.9);
  -webkit-mask-image: linear-gradient(135deg, #000 0%, rgba(0,0,0,0.85) 32%, transparent 68%);
          mask-image: linear-gradient(135deg, #000 0%, rgba(0,0,0,0.85) 32%, transparent 68%);
}
/* Second moss drape, top-right — "moss in places" */
.atmos-moss-2 {
  top: 0; right: 0;
  width: min(460px, 46vw);
  height: min(420px, 42vw);
  background-image: url("assets/atmos/moss.jpg");
  background-position: top right;
  opacity: 0.85;
  filter: saturate(0.85) brightness(0.82);
  transform: scaleX(-1);
  -webkit-mask-image: linear-gradient(225deg, #000 0%, rgba(0,0,0,0.8) 30%, transparent 66%);
          mask-image: linear-gradient(225deg, #000 0%, rgba(0,0,0,0.8) 30%, transparent 66%);
}
/* Rustic cottage in fog, bottom-right */
.atmos-cottage {
  bottom: 0; right: 0;
  width: min(620px, 60vw);
  height: min(460px, 46vw);
  background-image: url("assets/atmos/cottage.jpg");
  background-position: bottom right;
  opacity: 0.92;
  filter: saturate(0.9) brightness(0.88);
  -webkit-mask-image: radial-gradient(65% 65% at 100% 100%, #000 0%, transparent 72%);
          mask-image: radial-gradient(65% 65% at 100% 100%, #000 0%, transparent 72%);
}

/* ---- Author portrait: oval antique gothic frame ---- */
.author-portrait {
  position: relative;
  width: min(320px, 72vw);
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 12px;
  /* antique double-ring frame */
  background:
    radial-gradient(circle at 50% 42%, #caa15e 0%, #8a6a2f 60%, #5c451c 100%) padding-box,
    linear-gradient(145deg, #e7c98a, #9c7833) border-box;
  border: 7px solid transparent;
  box-shadow:
    0 14px 38px rgba(0,0,0,0.55),
    inset 0 0 0 2px rgba(255,240,205,0.25),
    inset 0 2px 10px rgba(0,0,0,0.45);
}
.author-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  /* sepia-tinted gothic wash + vignette so the photo reads antique */
  filter: sepia(0.22) contrast(1.02) brightness(0.97) saturate(0.92);
  box-shadow: inset 0 0 22px rgba(0,0,0,0.6), inset 0 0 4px rgba(0,0,0,0.5);
}
.author-portrait::after {
  /* soft inner vignette over the oval */
  content: "";
  position: absolute; inset: 12px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 0 26px rgba(0,0,0,0.45);
}
@media (prefers-reduced-motion: reduce) {
  .author-portrait, .author-portrait img { filter: none; }
}

/* ---- Reveal animation ---- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---- Buy / format emphasis (Amazon promo, 2026-08-13) ---- */
.buy-block { margin: 2rem 0 1rem; }
.buy-primary {
  text-align: center;
  padding: 1.8rem 1.2rem;
  border: 1px solid rgba(197,160,89,0.5);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(197,160,89,0.07), rgba(12,17,13,0));
}
.print-flag {
  display: inline-block;
  font-family: var(--type-writer);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-void);
  background: var(--gold);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.buy-primary .btn-lg { font-size: 1.2rem; padding: 1rem 2.2rem; }
.price-line {
  font-family: var(--serif-display);
  color: var(--parchment);
  margin: 1rem 0 0;
  font-size: 1.05rem;
}
.price-line b { color: var(--gold); }
.buy-secondary { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-top: 1.2rem; }
.buy-secondary .btn { font-size: 0.98rem; }
.retailer-note {
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1.4rem auto 0;
  max-width: 620px;
}

/* ---- Reader reviews ---- */
.reviews { margin-top: clamp(3rem, 7vw, 5rem); }
.reviews h3 { text-align: center; color: var(--parchment); }
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.review-card {
  margin: 0;
  background: linear-gradient(180deg, var(--forest) 0%, var(--ink-deep) 100%);
  border: 1px solid var(--bark);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.review-card .stars { color: var(--gold); font-size: 1.1rem; letter-spacing: 0.15em; }
.review-card blockquote { margin: 0; font-family: var(--serif-body); font-style: italic; color: var(--parchment); line-height: 1.6; }
.review-card figcaption { font-family: var(--type-writer); font-size: 0.78rem; color: var(--parchment-dim); letter-spacing: 0.04em; margin-top: auto; }
.reviews > .btn { display: block; width: fit-content; margin: 0 auto; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .nav-links {
    position: fixed; inset: 72px 0 auto 0;
    flex-direction: column; gap: 0;
    background: rgba(12,17,13,0.97);
    border-bottom: 1px solid rgba(197,160,89,0.2);
    padding: 1rem 1.5rem 1.6rem;
    transform: translateY(-130%);
    transition: transform 0.4s var(--ease);
    align-items: stretch;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links li { padding: 0.6rem 0; border-bottom: 1px solid var(--bark); }
  .nav-toggle { display: block; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-cover { max-width: 320px; margin: 0 auto; order: -1; }
  .split { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-cover { transition: none; }
  body::after, .atmos { background-attachment: scroll; animation: none; }
  /* Reduced motion: pause the fog video and lean on the static fallback */
  .fog-video { display: none; }
}
