/* =========================================================
   Jules Paul, author site
   ========================================================= */

:root {
  --bg: #1b2820;
  --bg-alt: #bdd2a7;
  --bg-dark: #425c1c;
  --ink: #1f1b16;
  --ink-soft: #4a4239;
  --ink-light: #f5f1e8;
  --ink-light-soft: rgba(245, 241, 232, 0.72);
  --rule: rgba(245, 241, 232, 0.18);
  --accent: #6e2100;
  --accent-hover: #4a1600;
  --mark: var(--ink-light-soft);
  --color-primary: #425c1c;
  --color-variation: #6a8740;
  --accent-light: #bdd2a7;

  --serif: "Alegreya", "Garamond", "Georgia", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sans-sc: "Alegreya Sans SC", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sans-alegreya: "Alegreya Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --max: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-light);
  font-family: var(--sans-sc);
  font-size: 19px;
  line-height: 1.6;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

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

h1, h2, h3 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 1.05;
  font-weight: 400;
  text-transform: none;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
  font-variant: small-caps;
  font-weight: 500;
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

p {
  margin: 0 0 1em;
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  background: var(--bg);
  box-shadow: 0 0 0 100vmax var(--bg);
  clip-path: inset(0 -100vmax);
  z-index: 5;
}

.brand {
  justify-self: start;
}

.site-nav {
  justify-self: end;
}

.brand {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink-light);
  border: none;
}

.site-nav {
  font-family: var(--sans-sc);
  font-style: normal;
  font-weight: 400;
  font-size: 1.25rem;
  text-transform: lowercase;
}

.site-nav a {
  margin-left: 1.75rem;
  color: var(--ink-light);
  border: none;
  letter-spacing: 0.04em;
}

.site-nav a:hover {
  color: var(--ink-light);
  opacity: 0.75;
}

/* Hamburger toggle button (visible only at <= 640px) */

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 0.5rem;
  width: 44px;
  height: 44px;
  color: var(--ink-light);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--ink-light);
  outline-offset: 2px;
}

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 24px;
  height: 18px;
}

.nav-toggle-bars span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: top 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { top: 8px; }
.nav-toggle-bars span:nth-child(3) { top: 16px; }

.site-header.is-open .nav-toggle-bars span:nth-child(1) {
  top: 8px;
  transform: rotate(45deg);
}

.site-header.is-open .nav-toggle-bars span:nth-child(2) {
  opacity: 0;
}

.site-header.is-open .nav-toggle-bars span:nth-child(3) {
  top: 8px;
  transform: rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  margin: 0;
  padding: 4rem 1.5rem;
  overflow: visible;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  z-index: 0;
  clip-path: inset(0);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
  clip-path: inset(0);
}

.hero-text {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--ink-light);
  max-width: 720px;
  margin: 0 auto;
}


.photo-placeholder,
.cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-text .genre {
  display: inline-block;
  font-family: var(--sans-sc);
  font-style: normal;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  line-height: 1.3;
  color: var(--ink-light);
  background: var(--accent);
  padding: 0.65rem 1.4rem;
  border-radius: 2px;
  margin: 2rem 0 1rem;
}

.hero-text .tagline {
  font-family: var(--sans-sc);
  font-style: normal;
  font-size: 1.9rem;
  letter-spacing: 0.04em;
  line-height: 1.3;
  color: var(--ink-light);
  margin-bottom: 0;
}

.hero-blurb {
  font-size: 1.1rem;
  max-width: 38ch;
}

.hero-cta {
  position: relative;
  z-index: 2;
  margin: 2rem 0 0;
  text-align: center;
}

.pledge-cta {
  text-align: center;
  margin: 2.25rem 0 4rem;
}

/* Pledge: 4-column horizontal row, each card has a photo above its text. */

.pledge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
}

.pledge-card {
  display: flex;
  flex-direction: column;
}

.pledge-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: rgba(245, 241, 232, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.pledge-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pledge-photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans-sc);
  font-size: 0.9rem;
  color: var(--ink-light-soft);
  letter-spacing: 0.08em;
}

.pledge-text {
  font-family: var(--sans-sc);
  font-size: 1.15rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--ink-light);
  margin: 0;
}

@media (max-width: 800px) {
  .pledge-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 500px) {
  .pledge-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Button ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans-sc);
  font-size: 1.05rem;
  text-transform: lowercase;
  letter-spacing: 0.06em;
  color: var(--ink-light);
  background: var(--accent);
  padding: 0.85rem 1.6rem;
  border: none;
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--accent-hover);
  color: var(--ink-light);
}

.btn-translucent {
  background: rgba(110, 33, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(245, 241, 232, 0.18);
}

.btn-translucent:hover {
  background: rgba(110, 33, 0, 0.78);
}

/* ---------- Sections ---------- */

.section {
  padding: 4.5rem max(1.5rem, calc((100vw - var(--max)) / 2 + 1.5rem));
}

.section-alt {
  background: var(--bg-alt);
  color: var(--ink);
  --mark: var(--accent);
}

.section-dark {
  background: var(--bg-dark);
  color: var(--ink-light);
  --mark: var(--ink-light-soft);
}

/* Sticky-stack scroll: each section sticks at top, the next slides up over it */

.stack > .hero,
.stack > .section {
  position: sticky;
  top: var(--sticky-offset, 0px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stack > .hero {
  min-height: 65vh;
}

.stack > .section {
  min-height: 50vh;
}

/* Extend each section's background down 50vh via an absolute pseudo-element,
   so when the section sticks the body doesn't peek through below it.
   The pseudo-element is absolute (no impact on offsetHeight / sticky math). */
.stack > .hero,
.stack > .section {
  isolation: isolate;
}

.stack > .hero::after,
.stack > .section::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 50vh;
  background-color: var(--section-bleed, var(--bg));
  z-index: -1;
  pointer-events: none;
}

.stack > #tired-of { --section-bleed: var(--bg); }
.stack > #intro    { --section-bleed: #34481c; }
.stack > #pledge   { --section-bleed: var(--bg); }

/* Signup is the final section before the footer.
   Don't bleed it; otherwise the light green extends below the dark footer. */
.stack > #signup::after {
  display: none;
}

/* Intro section: photo on left 2/3, green card overlay on right 1/2 */

#intro {
  background: var(--color-primary);
  padding: 4.5rem max(1.5rem, calc((100vw - var(--max)) / 2 + 1.5rem));
}

#about {
  background: var(--bg);
  padding: 4.5rem max(1.5rem, calc((100vw - var(--max)) / 2 + 1.5rem));
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
}

.about-photo {
  height: 50vh;
  overflow: hidden;
  border-radius: 2px;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 33% 30%;
  display: block;
  -webkit-transform: scale(1.2);
  transform: scale(1.2);
  -webkit-transform-origin: 33% 30%;
  transform-origin: 33% 30%;
  will-change: transform;
}

#contact .about-photo img {
  object-position: 15% 35%;
  -webkit-transform: scale(1.45);
  transform: scale(1.45);
  -webkit-transform-origin: 15% 35%;
  transform-origin: 15% 35%;
}

#about .about-content {
  color: var(--ink-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#about .about-content p {
  font-family: var(--sans-sc);
  font-size: 1.4rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--ink-light);
  margin-bottom: 1.25rem;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.btn.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: none;
}

.btn.social-btn svg {
  display: block;
}

/* Free story page */

.hero-text-left {
  text-align: left;
  margin: 0;
  max-width: none;
  width: 100%;
  padding: 0 max(1.5rem, calc((100vw - var(--max)) / 2 + 1.5rem));
  align-self: stretch;
}

.hero-text-left h1,
.hero-text-left .tagline {
  text-align: left;
  margin-left: 0;
  margin-right: auto;
  white-space: nowrap;
}

#story-intro {
  background: var(--bg);
}

#story-signup {
  background: var(--color-primary);
}

#story-intro .free-text p {
  font-family: var(--serif);
  font-style: normal;
  font-size: 1.4rem;
  line-height: 1.55;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-light);
  margin-bottom: 1rem;
}

.free-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}

.free-text {
  color: var(--ink-light);
}

.free-text p {
  font-family: var(--sans-sc);
  font-size: 1.25rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--ink-light);
  margin-bottom: 1.25rem;
}

.free-photo {
  position: relative;
  width: 100%;
  background: rgba(245, 241, 232, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.free-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.free-photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans-sc);
  font-size: 1rem;
  color: var(--ink-light-soft);
  letter-spacing: 0.08em;
}

.free-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.free-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.free-field span {
  font-family: var(--sans-sc);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--ink-light-soft);
}

.free-field input {
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  background: #f5f1e8;
  color: var(--ink);
  border: 1px solid rgba(245, 241, 232, 0.18);
  border-radius: 2px;
  outline: none;
  text-transform: none;
  transition: border-color 0.15s ease;
}

.free-field input:focus {
  border-color: var(--accent);
}

.free-form .btn {
  align-self: flex-start;
  margin-top: 0.5rem;
  cursor: pointer;
}

@media (max-width: 800px) {
  .free-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-text-left h1,
  .hero-text-left .tagline {
    white-space: normal;
  }
}

/* Privacy policy page */

.privacy-article {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  color: var(--ink-light);
  font-family: var(--sans-alegreya);
  font-size: 1.1rem;
  line-height: 1.65;
  text-transform: none;
}

.privacy-article p,
.privacy-article ul,
.privacy-article li {
  text-transform: none;
}

.privacy-header {
  margin-bottom: 2rem;
}

.privacy-article h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1.1;
  text-transform: none;
  margin: 0 0 0.5rem;
  color: var(--ink-light);
}

.privacy-article h2 {
  font-family: var(--sans-sc);
  font-style: normal;
  font-weight: 500;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  margin: 2.5rem 0 1rem;
  color: var(--ink-light);
  padding-bottom: 0;
}

.privacy-article h2::after {
  display: none;
}

.privacy-article h3 {
  font-family: var(--sans-alegreya);
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: none;
  margin: 1.5rem 0 0.5rem;
  color: var(--ink-light);
}

.privacy-article p {
  margin: 0 0 1rem;
}

.privacy-article ul {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.privacy-article li {
  margin-bottom: 0.6rem;
}

.privacy-article a {
  color: var(--accent-light);
  border-bottom: 1px solid currentColor;
}

.privacy-article em {
  font-style: italic;
  color: var(--ink-light-soft);
}

.privacy-article strong {
  font-weight: 700;
}

.privacy-updated {
  font-family: var(--sans-sc);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--ink-light-soft);
  margin: 0;
}

.site-footer .footer-copy a {
  color: var(--ink-light-soft);
  border-bottom: 1px solid currentColor;
  margin-left: 0.5rem;
  text-transform: none;
}

.site-footer .footer-copy a:hover {
  color: var(--ink-light);
}

/* Contact page */

#contact {
  background: var(--bg);
  padding: 4.5rem max(1.5rem, calc((100vw - var(--max)) / 2 + 1.5rem));
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  max-width: var(--max);
  margin: 0 auto;
}

.contact-text {
  color: var(--ink-light);
}

.contact-text p {
  font-family: var(--sans-sc);
  font-size: 1.4rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--ink-light);
  margin-bottom: 1.25rem;
}

.contact-text a {
  color: var(--accent-light);
}

.contact-text a:hover {
  color: var(--accent-light);
  opacity: 0.8;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-field span {
  font-family: var(--sans-sc);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--ink-light-soft);
}

.contact-field input,
.contact-field textarea {
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  background: #f5f1e8;
  color: var(--ink);
  border: 1px solid rgba(245, 241, 232, 0.18);
  border-radius: 2px;
  outline: none;
  text-transform: none;
  transition: border-color 0.15s ease;
  resize: vertical;
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-color: var(--accent);
}

.contact-form .btn {
  align-self: flex-start;
  margin-top: 0.5rem;
}

#tired-of {
  background: var(--bg);
  padding-top: 7rem;
}

.intro-wrap {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
}

.intro-photo {
  grid-column: 1 / 5;
  grid-row: 1;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

/* Padding-bottom trick reserves a 3:4 box reliably on every browser
   (iOS Safari can mis-compute aspect-ratio when the element is also a
   grid item, leaving the container at zero height). */
.intro-photo::before {
  content: "";
  display: block;
  padding-bottom: 133.333%;
}

.intro-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 33% 30%;
  display: block;
  -webkit-transform: scale(1.2);
  transform: scale(1.2);
  -webkit-transform-origin: 33% 30%;
  transform-origin: 33% 30%;
  will-change: transform;
}

.intro-card {
  grid-column: 4 / 7;
  grid-row: 1;
  z-index: 2;
  background: var(--color-variation);
  padding: 1.5rem 1.4rem;
  border-radius: 2px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
}

.intro-card p {
  font-family: var(--serif);
  font-style: normal;
  font-size: 1.4rem;
  line-height: 1.55;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-light);
  margin-bottom: 1rem;
}

.intro-card p:last-child {
  margin-bottom: 0;
}

.intro-card em {
  font-style: italic;
  font-weight: 400;
}

.section h2.intro-heading {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 7vw, 5rem);
  letter-spacing: -0.01em;
  line-height: 1.05;
  text-transform: none;
  text-align: right;
  color: var(--ink-light);
  max-width: var(--max);
  margin: 0 auto 1.5rem;
  padding-bottom: 0;
}

.section h2.intro-heading::after {
  display: none;
}

/* Promise box: floats over hero/tired-of boundary */

.promise-box {
  position: relative;
  z-index: 5;
  margin: -3rem auto;
  width: calc(100% - 3rem);
  max-width: 720px;
  padding: 1.5rem 2rem;
  background: var(--color-primary);
  border-radius: 2px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  opacity: 0;
  transform: translateY(80px) scale(0.96);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.promise-box.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.promise-text {
  font-family: var(--sans-sc);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.35;
  margin: 0;
  color: var(--ink-light);
  text-wrap: balance;
}

/* Pledge: black/charcoal, centered text block */

#pledge {
  background: var(--bg);
}

/* Section alignment overrides */

#tired-of h2 {
  margin-left: 0;
  margin-right: auto;
  max-width: calc(var(--max) * 2 / 3);
  text-align: left;
}

#tired-of .accent-list {
  margin-left: 0;
  margin-right: auto;
  max-width: calc(var(--max) * 2 / 3);
  text-align: left;
}

#tired-of h2::after {
  margin-left: 0;
  margin-right: auto;
}

#tired-of .section-tagline {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

#pledge h2 {
  margin-left: auto;
  margin-right: auto;
  max-width: calc(var(--max) * 2 / 3);
  text-align: center;
}

#pledge .accent-list {
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

#pledge h2::after {
  margin-left: auto;
  margin-right: auto;
}

/* Scroll-in fade: stagger inner content as each section enters view */

.stack > .section h2,
.stack > .section .intro-heading,
.stack > .section .accent-list li,
.stack > .section .section-tagline,
.stack > .section .intro-photo,
.stack > .section .intro-card,
.stack > .section .signup-form,
.stack > .section .about-photo,
.stack > .section .about-content,
.stack > .section .contact-text,
.stack > .section .contact-form,
.stack > .section .free-text,
.stack > .section .free-photo,
.stack > .section .free-form {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.stack > .section.in-view h2,
.stack > .section.in-view .intro-heading,
.stack > .section.in-view .accent-list li,
.stack > .section.in-view .section-tagline,
.stack > .section.in-view .intro-photo,
.stack > .section.in-view .intro-card,
.stack > .section.in-view .signup-form,
.stack > .section.in-view .about-photo,
.stack > .section.in-view .about-content,
.stack > .section.in-view .contact-text,
.stack > .section.in-view .contact-form,
.stack > .section.in-view .free-text,
.stack > .section.in-view .free-photo,
.stack > .section.in-view .free-form {
  opacity: 1;
  transform: translateY(0);
}

.stack > .section.in-view h2,
.stack > .section.in-view .intro-heading {
  transition-delay: 0.1s;
}

.stack > .section.in-view .intro-photo {
  transition-delay: 0.2s;
}

.stack > .section.in-view .intro-card {
  transition-delay: 0.55s;
}

.stack > .section.in-view .accent-list li:nth-child(1) { transition-delay: 0.25s; }
.stack > .section.in-view .accent-list li:nth-child(2) { transition-delay: 0.35s; }
.stack > .section.in-view .accent-list li:nth-child(3) { transition-delay: 0.45s; }
.stack > .section.in-view .accent-list li:nth-child(4) { transition-delay: 0.55s; }
.stack > .section.in-view .accent-list li:nth-child(5) { transition-delay: 0.65s; }

.stack > .section.in-view .section-tagline {
  transition-delay: 0.75s;
}

.stack > .section.in-view .signup-form {
  transition-delay: 0.4s;
}

.stack > .section.in-view .about-photo {
  transition-delay: 0.2s;
}

.stack > .section.in-view .about-content {
  transition-delay: 0.45s;
}

.stack > .section.in-view .contact-text {
  transition-delay: 0.2s;
}

.stack > .section.in-view .contact-form {
  transition-delay: 0.4s;
}

.site-footer {
  position: relative;
  background: var(--bg);
}

.section-alt .section-tagline {
  color: var(--ink);
}

.section-dark .section-tagline {
  color: var(--ink-light);
}

.section h2,
.section .prose,
.section .books-grid,
.section .accent-list {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.section h2 {
  font-family: var(--serif);
  font-style: italic;
  font-variant: normal;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-transform: lowercase;
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
  margin-bottom: 1.75rem;
}

.section h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  background: var(--mark);
  margin: 1rem auto 0;
}

.prose {
  max-width: 60ch;
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ---------- Accent list ---------- */

.accent-list {
  list-style: none;
  padding: 0;
  margin: 0 auto 2.5rem;
  max-width: 56ch;
  font-size: 1.4rem;
  line-height: 1.5;
}

.accent-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 1.1rem;
  text-wrap: pretty;
}

.accent-list li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--mark);
  font-size: 1.1em;
  line-height: inherit;
}

.section-tagline {
  font-family: var(--sans-sc);
  text-align: center;
  font-style: normal;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  letter-spacing: 0.04em;
  line-height: 1.35;
  max-width: 50ch;
  margin: 0 auto;
  text-wrap: balance;
}

/* ---------- Books grid ---------- */

.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.book {
  text-align: left;
}

.book-cover {
  aspect-ratio: 2 / 3;
  background: #fff;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(31, 27, 22, 0.08);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book h3 {
  margin-top: 0.5rem;
}

.book-meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.book-blurb {
  font-size: 1rem;
  color: var(--ink-soft);
}

.book-links {
  font-family: var(--sans);
  font-size: 0.9rem;
}

/* ---------- Email signup ---------- */

.section-signup {
  text-align: center;
}

.signup-form {
  max-width: 640px;
  margin: 1.5rem auto 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.signup-form input[type="email"],
.signup-form input[type="text"] {
  flex: 1 1 180px;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  background: #f5f1e8;
  color: var(--ink);
  border: 1px solid rgba(31, 27, 22, 0.2);
  border-radius: 2px;
  outline: none;
  text-transform: none;
  transition: border-color 0.15s ease;
}

.signup-form input[type="email"]:focus,
.signup-form input[type="text"]:focus {
  border-color: var(--accent);
}

.signup-form .btn {
  flex: 0 0 auto;
  cursor: pointer;
}

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

/* ---------- Footer ---------- */

.site-footer {
  padding: 2rem max(1.5rem, calc((100vw - var(--max)) / 2 + 1.5rem));
  font-family: var(--sans-alegreya);
  font-size: 0.95rem;
  text-transform: none;
  color: var(--ink-light-soft);
  background: var(--bg);
  position: relative;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy {
  margin: 0;
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--ink-light-soft);
  border: none;
  transition: color 0.15s ease;
}

.footer-icons a:hover {
  color: var(--ink-light);
}

.footer-icons svg {
  display: block;
}

/* ---------- Responsive ---------- */

@media (max-width: 800px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding-top: 1.25rem;
  }

  .brand,
  .site-nav {
    justify-self: center;
  }

  .site-nav a {
    margin: 0 0.75rem;
  }

  .hero {
    margin: 1.5rem auto 3rem;
    padding: 3rem 1.25rem;
    text-align: center;
    overflow: hidden;
  }

  .stack > .hero {
    margin: 0;
    overflow: hidden;
  }

  .hero-bg,
  .hero-overlay {
    clip-path: inset(0);
  }

  .hero-text {
    max-width: 100%;
  }

  #intro {
    padding: 3rem 1.25rem;
  }

  .intro-wrap {
    grid-template-columns: 1fr;
  }

  .intro-photo,
  .intro-card {
    grid-column: 1 / 2;
  }

  .intro-photo {
    grid-row: 1;
  }

  .intro-card {
    grid-row: 2;
    margin: -2.5rem 1rem 0;
    padding: 1.5rem 1.25rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo {
    height: 50vw;
    max-height: 60vh;
  }

  #about .about-content {
    height: auto;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }


  .books-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    gap: 3rem;
  }

  .section {
    padding: 3rem 1.5rem;
  }
}

@media (max-width: 640px) {
  /* Hamburger layout: brand on left, hamburger on right, nav drops below when open. */
  .site-header {
    grid-template-columns: 1fr auto;
    grid-auto-rows: auto;
    gap: 0;
    padding: 1.25rem 1.5rem;
  }

  .brand {
    justify-self: start;
  }

  .nav-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-self: stretch;
    display: none;
    flex-direction: column;
    padding: 0.75rem 0 0.25rem;
    text-align: left;
  }

  .site-header.is-open .site-nav {
    display: flex;
  }

  .site-nav a {
    display: block;
    margin: 0;
    padding: 0.75rem 0;
    font-size: 1.35rem;
    border-bottom: 1px solid var(--rule);
  }

  .site-nav a:last-child {
    border-bottom: 0;
  }
}
