/* ============================================
   THE LAST CHIEF — Memorial & Book Landing Page
   ============================================ */

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Custom Properties --- */
:root {
  /* Earth tones */
  --color-earth-dark: #3b2f2f;
  --color-earth-medium: #6b4226;
  --color-earth-light: #a0785a;

  /* Warm neutrals */
  --color-cream: #faf3e8;
  --color-warm-white: #fffdf8;
  --color-warm-gray: #d4c5b2;

  /* Navy accent */
  --color-navy: #1b2a4a;
  --color-navy-light: #2c4066;

  /* Muted red accent */
  --color-red-muted: #8b3a3a;
  --color-red-hover: #a04545;

  /* Text */
  --color-text: #2d2420;
  --color-text-light: #6b5d52;

  /* Overlay */
  --color-overlay: rgba(27, 42, 74, 0.72);

  /* Fonts */
  --font-heading: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-accent: "Cormorant Garamond", Georgia, serif;

  /* Type scale */
  --fs-hero-title: clamp(2.5rem, 6vw, 4.2rem);
  --fs-hero-sub: clamp(0.95rem, 2.5vw, 1.4rem);
  --fs-section: clamp(1.75rem, 4vw, 2.75rem);
  --fs-body: 1.125rem;
  --fs-small: 0.875rem;
  --fs-caption: 0.8125rem;

  /* Line heights */
  --lh-heading: 1.2;
  --lh-body: 1.75;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 8rem;

  /* Widths */
  --max-width: 1200px;
  --max-text: 720px;
}

/* --- SVG Background Patterns (data URIs) --- */
:root {
  /*
   * Lakota-inspired diamond lattice — thin crossed diagonals forming a
   * repeating diamond grid. Used at very low opacity on navy sections to
   * evoke both traditional beadwork geometry and a police badge grid.
   */
  --pattern-navy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 20 L20 0 L40 20 L20 40 Z' fill='none' stroke='%23ffffff' stroke-width='0.6' stroke-opacity='0.07'/%3E%3C/svg%3E");

  /*
   * Subtle dot grid — small dots on a warm-parchment diagonal offset.
   * Used at very low opacity on cream sections to suggest aged paper.
   */
  --pattern-cream: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='1' fill='%236B4226' fill-opacity='0.09'/%3E%3C/svg%3E");
}

/* --- Base --- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-cream);
  /* Warm parchment radial glow + dot grain */
  background-image:
    var(--pattern-cream),
    radial-gradient(
      ellipse 120% 80% at 50% 40%,
      #fff8ee 0%,
      var(--color-cream) 60%,
      #ede0cc 100%
    );
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-earth-medium);
  text-decoration: none;
}

a:hover {
  color: var(--color-red-muted);
}

/* --- Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-md);
  }
}

.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;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  background: var(--color-navy);
  color: #fff;
  padding: var(--space-xs) var(--space-sm);
  z-index: 1000;
  border-radius: 0 0 4px 4px;
  font-size: var(--fs-small);
}

.skip-link:focus {
  top: 0;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(27, 42, 74, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform: translateY(-100%);
  transition: transform 0.4s ease;
}

.nav--visible {
  transform: translateY(0);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav__brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-cream);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav__brand-icon {
  width: 20px;
  height: 32px;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav__brand:hover {
  color: #fff;
}

.nav__toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-cream);
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.nav__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav__links {
  display: none;
  list-style: none;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: rgba(27, 42, 74, 0.98);
  padding: var(--space-sm) 0;
  flex-direction: column;
  text-align: center;
}

.nav__links--open {
  display: flex;
}

.nav__links li a {
  display: block;
  padding: 12px var(--space-md);
  position: relative;
  color: var(--color-warm-gray);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav__links li a:not(.nav__cta)::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: var(--space-md);
  right: var(--space-md);
  height: 1px;
  background: var(--color-earth-light);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.nav__links li a:not(.nav__cta):hover::after,
.nav__links li a:not(.nav__cta):focus::after {
  transform: scaleX(1);
}

.nav__links li a:hover,
.nav__links li a:focus {
  color: #fff;
}

.nav__cta {
  color: var(--color-cream) !important;
  background: var(--color-red-muted);
  border-radius: 4px;
  margin: 8px var(--space-md);
  display: inline-block !important;
  padding: 8px 20px !important;
}

.nav__cta:hover {
  background: var(--color-red-hover);
  color: #fff !important;
}

@media (min-width: 1024px) {
  .nav__toggle {
    display: none;
  }

  .nav__links {
    display: flex;
    position: static;
    background: none;
    padding: 0;
    flex-direction: row;
    align-items: center;
    gap: 0;
  }

  .nav__links li a {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .nav__cta {
    margin: 0 0 0 8px;
    padding: 6px 16px !important;
    font-size: 0.8rem !important;
  }
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Mobile: full-bleed background portrait */
  background: url("../images/rich-motorcycle.jpg") center top / cover no-repeat
    var(--color-navy);
}

/* Diamond lattice texture layer — sits between photo and overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--pattern-navy);
  background-size: 40px 40px;
  /* Vignette: fade the pattern out toward center so text stays readable */
  -webkit-mask-image: radial-gradient(
    ellipse 80% 80% at 50% 50%,
    transparent 30%,
    black 100%
  );
  mask-image: radial-gradient(
    ellipse 80% 80% at 50% 50%,
    transparent 30%,
    black 100%
  );
  pointer-events: none;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  /* Mobile: gradient darker at bottom where text sits */
  background: linear-gradient(
    to bottom,
    rgba(27, 42, 74, 0.6) 0%,
    rgba(27, 42, 74, 0.88) 50%,
    rgba(0, 0, 0, 0.75) 100%
  );
  z-index: 1;
}

/* Mobile: centered text over full-bleed photo */
.hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.hero__content {
  text-align: center;
  max-width: 560px;
}

/* Hide the portrait img on mobile — the bg image handles it */
.hero__photo-wrap {
  display: none;
}

/* Desktop: two-column layout, photo as real img */
@media (min-width: 900px) {
  .hero {
    background: var(--color-navy);
  }

  .hero__overlay {
    background: linear-gradient(
      135deg,
      rgba(27, 42, 74, 0.98) 0%,
      rgba(27, 42, 74, 0.85) 55%,
      rgba(27, 42, 74, 0.4) 100%
    );
  }

  .hero__inner {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xl);
  }

  .hero__content {
    text-align: center;
    max-width: 520px;
  }

  .hero__subtitle-break {
    display: block;
  }

  .hero__photo-wrap {
    display: block;
    width: clamp(280px, 28vw, 400px);
    flex-shrink: 0;
  }
}

.hero__photo {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  display: block;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--space-sm);
}

.hero__eyebrow-rule {
  flex: 1;
  height: 1px;
  background: var(--color-earth-light);
  opacity: 0.7;
}

.hero__eyebrow-text {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-earth-light);
  white-space: nowrap;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: var(--fs-hero-title);
  font-weight: 900;
  color: var(--color-earth-light);
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
  text-shadow:
    0 2px 24px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(160, 120, 90, 0.2);
}

.hero__title-rule {
  color: var(--color-earth-light);
  opacity: 0.6;
  width: clamp(140px, 30%, 200px);
  margin: 0 auto var(--space-sm);
}

.hero__title-rule svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero__subtitle {
  font-family: var(--font-accent);
  font-size: var(--fs-hero-sub);
  font-weight: 400;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-md);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.hero__dates {
  font-family: var(--font-body);
  font-size: clamp(0.8rem, 3.5vw, 1.05rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.hero__badge {
  display: table;
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-cream);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 24px;
  border-radius: 4px;
}

.hero__scroll {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255, 255, 255, 0.6);
  animation: bounce 2s ease-in-out infinite;
}

.hero__scroll:hover {
  color: #fff;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

/* --- Sections --- */
.section {
  padding: var(--space-lg) 0;
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-md);
}

@media (min-width: 640px) {
  .section__header {
    margin-bottom: var(--space-lg);
  }
}

.section__label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-earth-light);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.section__title {
  font-family: var(--font-heading);
  font-size: var(--fs-section);
  font-weight: 700;
  color: var(--color-earth-dark);
  line-height: var(--lh-heading);
}

.section__body {
  max-width: var(--max-text);
  margin: 0 auto var(--space-md);
  text-align: left;
}

@media (min-width: 640px) {
  .section__body {
    margin-bottom: var(--space-lg);
  }
}

.section__body p {
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

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

/* --- Decorative Divider --- */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  max-width: 420px;
  margin: var(--space-sm) auto;
  color: var(--color-earth-medium);
  position: relative;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-earth-medium),
    transparent
  );
}

.divider__icon--star {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.divider__icon--feather {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  filter: invert(35%) sepia(40%) saturate(600%) hue-rotate(355deg)
    brightness(80%);
}

/* --- Image Grids --- */
.image-grid {
  display: grid;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.image-grid--2col {
  grid-template-columns: 1fr;
}

.image-grid--3col {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .image-grid--2col {
    grid-template-columns: repeat(2, 1fr);
  }
  .image-grid--3col {
    grid-template-columns: repeat(2, 1fr);
  }
  .image-grid {
    gap: var(--space-sm);
  }
}

@media (min-width: 1024px) {
  .image-grid--3col {
    grid-template-columns: repeat(3, 1fr);
  }
  .image-grid {
    gap: var(--space-md);
  }
}

.image-grid--small {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Image Cards --- */
.image-card {
  background: var(--color-warm-white);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  cursor: pointer;
}

.image-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.image-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.image-card:hover img {
  transform: scale(1.02);
}

.image-card figcaption {
  font-family: var(--font-accent);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-light);
  padding: 10px 14px;
  text-align: center;
  font-style: italic;
}

.image-card--wide {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.image-card--wide img {
  aspect-ratio: 16 / 10;
}

.image-card--portrait img {
  aspect-ratio: 3 / 4;
  object-position: center top;
}

.image-card--wide.image-card--top img {
  aspect-ratio: 4 / 3;
}

.image-card--top img {
  object-position: center 20%;
}

/* --- Callout --- */
.callout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-warm-white);
  border: 1px solid var(--color-warm-gray);
  border-radius: 8px;
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  text-align: center;
}

.callout__image {
  max-width: 240px;
  cursor: pointer;
}

.callout__image img {
  border-radius: 4px;
}

.callout__quote {
  font-family: var(--font-accent);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-style: italic;
  color: var(--color-earth-medium);
  line-height: 1.5;
}

.callout__caption {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-top: var(--space-xs);
}

@media (min-width: 640px) {
  .callout {
    flex-direction: row;
    text-align: left;
  }
}

/* --- Book Section --- */
.section--book {
  position: relative;
  background: var(--color-navy);
  color: var(--color-cream);
  overflow: hidden;
}

.section--book::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--pattern-navy);
  background-size: 40px 40px;
  /* Heavier toward edges, fades out in the center reading area */
  -webkit-mask-image: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    transparent 20%,
    black 100%
  );
  mask-image: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    transparent 20%,
    black 100%
  );
  pointer-events: none;
}

/* Ensure content sits above the pattern pseudo-element */
.section--book > .container {
  position: relative;
  z-index: 1;
}

.section--book .section__label {
  color: var(--color-earth-light);
}

.section--book .section__title {
  color: #fff;
}

.book-promo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .book-promo {
    flex-direction: row;
    align-items: flex-start;
  }
}

.book-cover {
  flex-shrink: 0;
  width: 260px;
  /* perspective on the wrapper so the book rotates in 3D */
  perspective: 1000px;
  perspective-origin: 50% 50%;
  /* extra left margin makes room so the spine doesn't get clipped */
  margin-left: 28px;
  transition: transform 0.4s ease;
}

.book-cover:hover {
  transform: translateY(-6px);
}

/* Rotating 3-D book wrapper */
.book-cover__book {
  position: relative;
  transform-style: preserve-3d;
  /* Resting: angled left so spine depth is already visible */
  transform: rotateY(-22deg);
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.book-cover:hover .book-cover__book {
  /* Open toward viewer on hover */
  transform: rotateY(-8deg);
}

/* ── Spine ── flat strip to the left of the front cover */
.book-cover__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  /* sits immediately left of the front cover face */
  right: 100%;
  width: 28px;
  background: linear-gradient(to right, #1a0f0a, #3b2520 80%, #4a2e20);
  border-radius: 3px 0 0 3px;
  border: 2px solid #7a5a3a;
  border-right: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* In the 3D scene the spine is the left face — tilt it back */
  transform-origin: right center;
  transform: rotateY(-75deg);
  backface-visibility: hidden;
}

.book-cover__spine-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-earth-light);
  white-space: nowrap;
  opacity: 0.85;
}

/* ── Front cover face ── */
.book-cover__inner {
  background: linear-gradient(160deg, #4a3328 0%, #2a1f1f 60%, #1c1410 100%);
  border: 2px solid var(--color-earth-light);
  border-left-color: #5a3a25;
  border-radius: 0 6px 6px 0;
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  box-shadow:
    6px 12px 40px rgba(0, 0, 0, 0.6),
    2px 4px 12px rgba(0, 0, 0, 0.4);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Subtle diagonal sheen */
.book-cover__inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.07) 0%,
    transparent 45%,
    rgba(0, 0, 0, 0.1) 100%
  );
  pointer-events: none;
}

/* ── Page edges — right side of book ── */
.book-cover__pages {
  position: absolute;
  top: 4px;
  left: 100%;
  bottom: 4px;
  width: 12px;
  background: repeating-linear-gradient(
    to bottom,
    #ede4d8 0px,
    #ede4d8 1px,
    #d8ccbd 1px,
    #d8ccbd 2px
  );
  border-radius: 0 2px 2px 0;
  box-shadow: 3px 0 6px rgba(0, 0, 0, 0.25);
  /* Tilt the pages to match the 3D angle */
  transform-origin: left center;
  transform: rotateY(75deg);
  backface-visibility: hidden;
}

.book-cover__badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-cream);
  background: var(--color-red-muted);
  padding: 4px 16px;
  border-radius: 2px;
  margin-bottom: var(--space-md);
}

.book-cover__title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--color-cream);
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}

.book-cover__subtitle {
  font-family: var(--font-accent);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--color-warm-gray);
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

.book-cover__author {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--color-earth-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.book-info {
  max-width: var(--max-text);
}

.book-info p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--space-sm);
}

.book-quote {
  margin-top: var(--space-md);
  padding-left: var(--space-md);
  border-left: 3px solid var(--color-earth-light);
}

.book-quote p {
  font-family: var(--font-accent);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-style: italic;
  color: rgba(255, 255, 255, 0.9) !important;
  line-height: 1.6;
}

.book-quote cite {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-style: normal;
  color: var(--color-earth-light);
  margin-top: var(--space-xs);
}

/* --- Download Section --- */
.section--download {
  position: relative;
  background: linear-gradient(
    180deg,
    var(--color-navy) 0%,
    var(--color-navy-light) 100%
  );
  padding: var(--space-lg) 0 var(--space-xl);
  overflow: hidden;
}

.section--download::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--pattern-navy);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(
    ellipse 60% 60% at 50% 50%,
    transparent 10%,
    black 100%
  );
  mask-image: radial-gradient(
    ellipse 60% 60% at 50% 50%,
    transparent 10%,
    black 100%
  );
  pointer-events: none;
}

.section--download > .container {
  position: relative;
  z-index: 1;
}

.section--download .section__label,
.section--download .section__title {
  color: #fff;
}

.section--download .section__label {
  color: rgba(255, 255, 255, 0.7);
}

.download-intro {
  max-width: 640px;
  margin: 0 auto var(--space-lg);
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-accent);
  font-size: 1.2rem;
  line-height: 1.6;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  max-width: 900px;
  margin: 0 auto;
  align-items: stretch;
}

@media (min-width: 820px) {
  .download-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

.download-card .download-card__meta {
  margin-bottom: 0;
}

.download-card {
  background: var(--color-warm-white);
  border: 1px solid var(--color-warm-gray);
  border-radius: 6px;
  padding: var(--space-lg);
  color: var(--color-text);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.download-card__icon {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-warm-white);
  background: var(--color-earth-medium);
  padding: 6px 14px;
  border-radius: 3px;
  margin-bottom: var(--space-sm);
}

.download-card__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-earth-dark);
  margin-bottom: var(--space-sm);
  line-height: 1.25;
}

.download-card__text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.download-card__button,
.download-card__button:link,
.download-card__button:visited {
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--color-red-muted);
  border: none;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}

.download-card__button:hover,
.download-card__button:focus,
.download-card__button:active {
  background: var(--color-red-hover);
  color: #fff;
}

.download-card__button:focus-visible {
  outline: 2px solid var(--color-earth-medium);
  outline-offset: 2px;
  color: #fff;
}

.download-card__meta {
  margin-top: var(--space-sm);
  font-size: var(--fs-small);
  color: var(--color-text-light);
  font-family: var(--font-body);
}

.kindle-steps {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-warm-gray);
}

.kindle-steps__summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-earth-dark);
  letter-spacing: 0.02em;
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.kindle-steps__summary::-webkit-details-marker {
  display: none;
}

.kindle-steps__summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 6px solid var(--color-earth-medium);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.kindle-steps[open] > .kindle-steps__summary::before {
  transform: rotate(90deg);
}

.kindle-steps__summary:hover {
  color: var(--color-red-muted);
}

.kindle-steps__summary:hover::before {
  border-left-color: var(--color-red-muted);
}

.kindle-steps__summary:focus-visible {
  outline: 2px solid var(--color-earth-medium);
  outline-offset: 3px;
  border-radius: 2px;
}

.kindle-steps__list {
  margin: var(--space-sm) 0 var(--space-sm) 1.25rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
}

.kindle-steps__list li {
  margin-bottom: var(--space-sm);
  padding-left: 0.25rem;
}

.kindle-steps__list--bullets {
  list-style: disc;
}

.kindle-steps__list li:last-child {
  margin-bottom: 0;
}

.kindle-steps__list a {
  color: var(--color-red-muted);
  text-decoration: underline;
}

.kindle-steps__list a:hover {
  color: var(--color-red-hover);
}

.kindle-steps__list code,
.kindle-steps__note code {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 0.92em;
  background: var(--color-cream);
  padding: 1px 6px;
  border-radius: 3px;
}

.kindle-steps__note {
  font-size: var(--fs-small);
  color: var(--color-text-light);
  line-height: 1.55;
  padding: var(--space-sm);
  background: var(--color-cream);
  border-left: 3px solid var(--color-earth-light);
  border-radius: 0 3px 3px 0;
}

.hero__badge--download {
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.hero__badge--download:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

/* --- Stay in Touch Section --- */
.section--touch {
  background: var(--color-cream);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-warm-gray);
}

.touch-card {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.touch-card__title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  font-weight: 700;
  color: var(--color-earth-dark);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.03em;
}

.touch-card__text {
  font-family: var(--font-accent);
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
}

.touch-form {
  text-align: left;
}

.touch-form__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

@media (min-width: 560px) {
  .touch-form__row {
    grid-template-columns: 1fr 1fr;
  }
}

.touch-form__field {
  display: block;
  margin-bottom: var(--space-sm);
}

.touch-form__row .touch-form__field {
  margin-bottom: 0;
}

.touch-form__label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: 4px;
}

.touch-form__optional {
  text-transform: none;
  font-weight: 400;
  color: var(--color-warm-gray);
  letter-spacing: 0;
}

.touch-form__input {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-warm-white);
  border: 1px solid var(--color-warm-gray);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.touch-form__input::placeholder {
  color: var(--color-warm-gray);
}

.touch-form__input:focus {
  border-color: var(--color-earth-medium);
  box-shadow: 0 0 0 3px rgba(107, 66, 38, 0.12);
}

.touch-form__textarea {
  resize: vertical;
  min-height: 110px;
  font-family: var(--font-body);
  line-height: 1.5;
}

.touch-form__checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: var(--space-sm) 0;
  font-size: 0.95rem;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}

.touch-form__checkbox input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--color-earth-medium);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

.touch-form__submit-row {
  text-align: center;
  margin-top: var(--space-sm);
}

.touch-form__button {
  padding: 12px 36px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--color-earth-medium);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.touch-form__button:hover,
.touch-form__button:focus {
  background: var(--color-earth-dark);
  color: #fff;
}

.touch-form__button:focus-visible {
  outline: 2px solid var(--color-red-muted);
  outline-offset: 2px;
}

.touch-success p {
  font-family: var(--font-accent);
  font-size: 1.15rem;
  color: var(--color-earth-dark);
  padding: var(--space-md) 0;
  text-align: center;
}

/* --- Footer --- */
.footer {
  background: var(--color-earth-dark);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: var(--space-md) 0;
}

.footer__memorial {
  font-family: var(--font-accent);
  font-size: 1rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-xs);
}

.footer__copyright {
  font-size: var(--fs-small);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: var(--space-sm);
}

.lightbox[hidden] {
  display: none;
}

.lightbox--active {
  opacity: 1;
}

.lightbox__figure {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox__caption {
  font-family: var(--font-accent);
  font-size: 1.25rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
  margin-top: var(--space-sm);
  text-align: center;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  z-index: 1001;
  transition: color 0.2s;
  padding: 4px 12px;
}

.lightbox__close:hover {
  color: #fff;
}

.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 3rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 16px;
  z-index: 1001;
}

.lightbox__prev {
  left: 8px;
}
.lightbox__next {
  right: 8px;
}

.lightbox__prev:hover,
.lightbox__next:hover {
  color: #fff;
}

.lightbox__counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, 0.5);
}

/* --- Fade-in Animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.fade-in--visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: 200;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--color-earth-medium);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    background 0.2s ease;
  pointer-events: none;
}

.back-to-top--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--color-earth-dark);
}

/* --- Focus styles --- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-earth-medium);
  outline-offset: 2px;
}

/* --- Print --- */
@media print {
  .nav,
  .lightbox,
  .hero__scroll,
  .signup-form,
  .signup-card__privacy {
    display: none !important;
  }
  .hero {
    min-height: auto;
    padding: var(--space-md);
  }
  .hero__overlay {
    background: rgba(27, 42, 74, 0.4);
  }
  .section {
    padding: var(--space-md) 0;
  }
  .fade-in {
    opacity: 1;
    transform: none;
  }
}
