/* A Song of the Past — promotional site
   Palette: a New Haven night in late October — ink-black sky, sodium-amber
   streetlight, brick, granite, and old paper for the excerpt pages. */

:root {
  --ink: #0e1116;
  --night: #151a22;
  --slate: #1e2530;
  --granite: #8b93a1;
  --mist: #c9ced6;
  --paper: #f3ece0;
  --paper-ink: #2a2622;
  --amber: #e0a54a;
  --amber-dim: #a8772f;
  --brick: #8e3b2e;
  --rule: rgba(224, 165, 74, 0.35);

  --display: "Cormorant Garamond", "Times New Roman", serif;
  --body: "EB Garamond", Georgia, serif;
  --caps: "Cormorant SC", "Cormorant Garamond", serif;

  --measure: 38rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--mist);
  font-family: var(--body);
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); text-underline-offset: 0.2em; }
a:hover { color: #f2c27a; }

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

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: var(--measure); margin-left: auto; margin-right: auto; }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14, 17, 22, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.site-nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 3.5rem;
}
.site-nav .brand {
  font-family: var(--caps); font-size: 1.15rem; letter-spacing: 0.08em;
  color: var(--paper); text-decoration: none; white-space: nowrap;
}
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: clamp(0.75rem, 2vw, 1.75rem);
  overflow-x: auto; scrollbar-width: none;
}
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav a.navlink {
  font-family: var(--caps); letter-spacing: 0.06em; font-size: 1.15rem; font-weight: 500;
  color: var(--mist); text-decoration: none; white-space: nowrap;
}
.site-nav a.navlink:hover { color: var(--amber); }
@media (max-width: 720px) {
  .site-nav .brand { display: none; }
  .site-nav .wrap { justify-content: center; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(92vh, 56rem);
  display: grid; align-items: center;
  padding: clamp(3rem, 8vw, 6rem) 0;
  background:
    radial-gradient(ellipse 60% 50% at 78% 18%, rgba(224, 165, 74, 0.20), transparent 70%),
    radial-gradient(ellipse 40% 35% at 10% 90%, rgba(142, 59, 46, 0.25), transparent 70%),
    linear-gradient(180deg, #0b0e13 0%, var(--night) 100%);
}
/* faint chessboard laid over the night sky */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: conic-gradient(rgba(255,255,255,0.025) 25%, transparent 0 50%,
                                   rgba(255,255,255,0.025) 0 75%, transparent 0);
  background-size: 7rem 7rem;
  mask-image: linear-gradient(180deg, transparent 0%, black 40%, black 70%, transparent 100%);
}
.hero .wrap {
  position: relative;
  display: grid; gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
}
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .cover { order: -1; max-width: 18rem; margin: 0 auto; }
}

.kicker {
  font-family: var(--caps); letter-spacing: 0.22em; text-transform: lowercase;
  color: var(--amber); font-size: 1rem; margin: 0 0 1rem;
}
.hero h1 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(3rem, 2rem + 6vw, 6.5rem);
  line-height: 0.95; letter-spacing: -0.01em;
  color: var(--paper); margin: 0;
}
.hero h1 em { font-style: italic; color: var(--amber); font-weight: 400; }
.hero .byline {
  font-family: var(--caps); letter-spacing: 0.18em; font-size: 1.15rem;
  color: var(--granite); margin: 1.25rem 0 2rem;
}
.hero .tagline {
  font-family: var(--display); font-style: italic;
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); line-height: 1.35;
  color: var(--mist); max-width: 30rem; margin: 0 0 2.25rem;
  border-left: 2px solid var(--amber); padding-left: 1.1rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.btn {
  display: inline-block; padding: 0.8rem 1.5rem;
  font-family: var(--caps); letter-spacing: 0.1em; font-size: 1.05rem;
  text-decoration: none; border: 1px solid var(--amber); border-radius: 2px;
  transition: background 0.2s, color 0.2s;
}
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { background: #f2c27a; color: var(--ink); }
.btn-ghost { color: var(--amber); }
.btn-ghost:hover { background: rgba(224, 165, 74, 0.12); }

/* Typographic stand-in for the cover until real art exists */
.cover {
  aspect-ratio: 2 / 3; width: 100%; max-width: 22rem; justify-self: center;
  position: relative; display: flex; flex-direction: column;
  justify-content: space-between; padding: 2rem 1.6rem;
  background:
    radial-gradient(circle at 70% 22%, rgba(224,165,74,0.55) 0 0.45rem, rgba(224,165,74,0.18) 0.5rem 4.5rem, transparent 9rem),
    linear-gradient(180deg, #1b2230 0%, #10141b 62%, #2a1714 100%);
  box-shadow: 0 2rem 4rem rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06);
  color: var(--paper); text-align: center;
  transform: rotate(-1.5deg);
}
.cover::after { /* chain-link fence along the bottom */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background:
    repeating-linear-gradient(45deg, rgba(201,206,214,0.18) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, rgba(201,206,214,0.18) 0 1px, transparent 1px 14px);
  mask-image: linear-gradient(180deg, transparent, black 45%);
}
.cover .c-title {
  font-family: var(--display); font-size: clamp(2rem, 1.4rem + 2vw, 2.7rem);
  line-height: 1; font-weight: 500; margin-top: 18%;
}
.cover .c-title em { display: block; font-style: italic; color: var(--amber); font-size: 0.7em; margin: 0.2em 0; }
.cover .c-author {
  position: relative; z-index: 1;
  font-family: var(--caps); letter-spacing: 0.25em; font-size: 0.95rem; color: var(--mist);
}
.cover .c-piece { font-size: 2.2rem; color: var(--amber); line-height: 1; opacity: 0.9; }

/* ---------- Sections ---------- */
section { padding: clamp(4rem, 9vw, 7rem) 0; }
section + section { border-top: 1px solid rgba(255,255,255,0.05); }

.section-head { text-align: center; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head .eyebrow {
  font-family: var(--caps); letter-spacing: 0.25em; color: var(--amber);
  font-size: 0.95rem; text-transform: lowercase; margin: 0 0 0.4rem;
}
.section-head h2 {
  font-family: var(--display); font-weight: 500; color: var(--paper);
  font-size: clamp(2.2rem, 1.6rem + 2.5vw, 3.4rem); line-height: 1.05; margin: 0;
}
.ornament {
  display: block; text-align: center; color: var(--amber-dim);
  letter-spacing: 0.6em; margin: 1rem 0 0; font-size: 0.9rem;
}

.prose p { margin: 0 0 1.2em; }
.prose p.lede::first-letter {
  font-family: var(--display); float: left; font-size: 4.2em; line-height: 0.82;
  padding: 0.06em 0.12em 0 0; color: var(--amber);
}

/* ---------- The board: eight parts ---------- */
.board {
  display: grid; gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: rgba(224,165,74,0.15);
  border: 1px solid rgba(224,165,74,0.15);
}
@media (max-width: 900px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .board { grid-template-columns: 1fr; } }
.square {
  padding: 1.6rem 1.4rem 1.8rem; min-height: 13rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
/* checkerboard colouring that survives the column count changing */
.board .square:nth-child(odd)  { background: var(--slate); }
.board .square:nth-child(even) { background: var(--night); }
@media (min-width: 901px) {
  .board .square:nth-child(n+5):nth-child(odd)  { background: var(--night); }
  .board .square:nth-child(n+5):nth-child(even) { background: var(--slate); }
}
.square .num { font-family: var(--display); font-size: 2.4rem; color: var(--amber); line-height: 1; }
.square h3 { font-family: var(--caps); letter-spacing: 0.06em; color: var(--paper); font-weight: 500; font-size: 1.3rem; margin: 0; }
.square p { margin: 0; font-size: 0.98rem; color: var(--granite); line-height: 1.5; }
.square blockquote { margin: auto 0 0; font-style: italic; font-size: 0.92rem; color: var(--mist); line-height: 1.45; }
.square blockquote cite { display: block; font-style: normal; font-family: var(--caps); letter-spacing: 0.05em; color: var(--amber-dim); margin-top: 0.3rem; font-size: 0.85rem; }

/* ---------- Characters ---------- */
.cast { display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.person { border-top: 1px solid var(--rule); padding-top: 1rem; }
.person h3 { font-family: var(--display); font-size: 1.6rem; font-weight: 500; color: var(--paper); margin: 0; line-height: 1.15; }
.person .role { font-family: var(--caps); letter-spacing: 0.08em; color: var(--amber); font-size: 0.95rem; margin: 0.15rem 0 0.5rem; }
.person p { margin: 0; color: var(--mist); }

/* ---------- Excerpt (paper) ---------- */
.excerpt { background: var(--paper); color: var(--paper-ink); }
.excerpt .section-head h2 { color: var(--paper-ink); }
.excerpt .section-head .eyebrow { color: var(--brick); }
.excerpt .ornament { color: var(--brick); }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 0 0 2.5rem; }
.tabs button {
  font: inherit; font-family: var(--caps); letter-spacing: 0.08em; font-size: 1rem;
  background: transparent; color: var(--paper-ink); cursor: pointer;
  border: 1px solid rgba(42,38,34,0.35); border-radius: 2px; padding: 0.5rem 1rem;
}
.tabs button[aria-selected="true"] { background: var(--paper-ink); color: var(--paper); border-color: var(--paper-ink); }
.chapter-head { text-align: center; margin-bottom: 2rem; }
.chapter-head .part { font-family: var(--caps); letter-spacing: 0.2em; color: var(--brick); margin: 0; }
.chapter-head .when { font-style: italic; margin: 0.3rem 0 0; color: #6d645a; }
.excerpt .prose { font-size: 1.12em; }
.excerpt .prose p { text-indent: 1.5em; margin: 0 0 0.35em; }
.excerpt .prose p.lede, .excerpt .prose p.noindent { text-indent: 0; }
.excerpt .prose p.lede::first-letter { color: var(--brick); }
.fade-note { text-align: center; font-style: italic; color: #6d645a; margin-top: 2rem; }
[hidden] { display: none !important; }

/* ---------- New Haven ---------- */
.places { display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); background: rgba(255,255,255,0.06); }
.place { background: var(--ink); padding: 1.5rem 1.4rem; }
.place h3 { font-family: var(--display); font-weight: 500; font-size: 1.45rem; color: var(--paper); margin: 0 0 0.35rem; }
.place p { margin: 0; color: var(--granite); font-size: 0.98rem; line-height: 1.55; }
.intro { text-align: center; color: var(--mist); margin: -1rem auto 2.5rem; }

/* ---------- Pull quote band ---------- */
.band {
  background: linear-gradient(90deg, #1a1210, #0e1116 50%, #121820);
  text-align: center; padding: clamp(3.5rem, 8vw, 6rem) 0;
}
.band blockquote {
  font-family: var(--display); font-style: italic; color: var(--paper);
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.4rem); line-height: 1.3;
  max-width: 46rem; margin: 0 auto;
}
.band cite { display: block; margin-top: 1.2rem; font-family: var(--caps); font-style: normal; letter-spacing: 0.18em; color: var(--amber); font-size: 1rem; }

/* ---------- Author / buy / signup ---------- */
.two-col { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
.panel { background: var(--night); border: 1px solid rgba(255,255,255,0.06); padding: clamp(1.5rem, 4vw, 2.5rem); }
.panel h3 { font-family: var(--display); font-weight: 500; color: var(--paper); font-size: 1.8rem; margin: 0 0 0.75rem; }
.retailers { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 0.6rem; }
.retailers a { display: flex; justify-content: space-between; padding: 0.75rem 1rem; border: 1px solid var(--rule); text-decoration: none; font-family: var(--caps); letter-spacing: 0.06em; }
.retailers a:hover { background: rgba(224,165,74,0.08); }
.signup { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }
.signup input {
  flex: 1 1 14rem; min-width: 0; font: inherit; padding: 0.75rem 1rem;
  background: var(--ink); color: var(--paper); border: 1px solid rgba(255,255,255,0.15); border-radius: 2px;
}
.signup input:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.signup button { font: inherit; cursor: pointer; }
.small { font-size: 0.9rem; color: var(--granite); }

footer { padding: 3rem 0; text-align: center; color: var(--granite); font-size: 0.9rem; border-top: 1px solid rgba(255,255,255,0.06); }
footer .piece { color: var(--amber); font-size: 1.4rem; display: block; margin-bottom: 0.5rem; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ---------- Photo gallery ---------- */
.gallery {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
}
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }
.photo { margin: 0; position: relative; overflow: hidden; background: var(--night); }
.photo.wide { grid-column: span 2; }
.photo.tall { grid-row: span 2; }
@media (max-width: 560px) { .photo.wide { grid-column: auto; } .photo.tall { grid-row: auto; } }
.photo img {
  width: 100%; height: 100%; min-height: 16rem; object-fit: cover;
  /* tone the bright daytime photos toward the book's autumn-night palette */
  filter: grayscale(0.55) sepia(0.25) contrast(1.05) brightness(0.78);
  transition: filter 0.6s, transform 0.6s;
}
.photo:hover img { filter: grayscale(0.1) sepia(0.1) brightness(0.92); transform: scale(1.02); }
.photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2.5rem 1.1rem 1rem;
  background: linear-gradient(180deg, transparent, rgba(10, 12, 16, 0.92) 45%);
  color: var(--mist); font-size: 0.93rem; line-height: 1.45;
}
.photo figcaption strong {
  display: block; font-family: var(--caps); font-weight: 500; letter-spacing: 0.08em;
  color: var(--amber); font-size: 1.1rem; margin-bottom: 0.2rem;
}
@media (hover: none), (max-width: 560px) {
  .photo { display: flex; flex-direction: column; }
  .photo img { min-height: 0; aspect-ratio: 4 / 3; height: auto; }
  .photo figcaption { position: static; background: var(--night); padding: 0.9rem 1.1rem 1.1rem; }
}

/* ---------- Order ---------- */
.order { text-align: center; }
.btn-large { font-size: 1.3rem; padding: 1rem 2.6rem; }
.section-head h2 em { font-style: italic; color: var(--amber); }

/* real cover image, once one exists */
.cover-img { width: 100%; max-width: 22rem; justify-self: center; box-shadow: 0 2rem 4rem rgba(0,0,0,0.55); }

/* ---------- Footer credits ---------- */
.credits { max-width: 46rem; margin: 1rem auto 0; text-align: left; }
.credits summary { cursor: pointer; text-align: center; font-family: var(--caps); letter-spacing: 0.08em; }
.credits ul { padding-left: 1.2rem; }
.credits li { margin: 0.3rem 0; }
.excerpt .prose p.fade-note { text-indent: 0; }
.text-tile {
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.6rem 1.4rem; min-height: 16rem;
  background:
    radial-gradient(circle at 80% 15%, rgba(224,165,74,0.18), transparent 55%),
    var(--slate);
}
.text-tile .tile-kicker { font-family: var(--caps); letter-spacing: 0.2em; color: var(--amber); font-size: 0.9rem; margin: 0; text-transform: lowercase; }
.text-tile h3 { font-family: var(--display); font-weight: 500; color: var(--paper); font-size: 2rem; margin: 0.2rem 0 0.6rem; }
.text-tile p { margin: 0; color: var(--mist); font-size: 0.98rem; line-height: 1.55; }
/* the cover file is small (260x337), so cap it near its native size to keep it crisp */
.hero .cover-img { max-width: 17rem; height: auto; transform: none; }
@media (max-width: 860px) { .hero .cover-img { order: -1; max-width: 14rem; margin: 0 auto; } }
/* full-width banner photo at the foot of the gallery */
.photo.full { grid-column: 1 / -1; }
.photo.full img { aspect-ratio: 3 / 1; min-height: 14rem; }
@media (max-width: 560px) { .photo.full img { aspect-ratio: 4 / 3; } }

/* ---------- Place-card photos ---------- */
.place { padding: 0 0 1.5rem; }
.place h3, .place p { padding: 0 1.4rem; }
.place h3 { margin-top: 1.1rem; }
.place-img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  filter: grayscale(0.55) sepia(0.25) contrast(1.05) brightness(0.78);
  transition: filter 0.6s;
}
.place:hover .place-img { filter: grayscale(0.1) sepia(0.1) brightness(0.92); }
/* Two place cards per row (2 x 2), one per row on phones. */
.places { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; background: none; }
@media (max-width: 640px) { .places { grid-template-columns: 1fr; } }
.place-img { aspect-ratio: 16 / 9; }
