/* ==========================================================================
   THE DIGITAL CURATOR - DESIGN SYSTEM SPECIFICATION (DARK MODE ADAPTATION)
   Project: Mary Costello | Writer Portfolio
   ========================================================================== */

/* 1. Imports & Fonts */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;500;600&display=swap');

/* 2. Color System & Custom Variables */
:root {
  /* ======================================================================
     SURFACE COLORS
     Warm, deep-dark charcoal tones instead of generic black.
     ====================================================================== */
  --surface: #0d0b0c;
  --surface-bright: #1c181a;
  --surface-container-lowest: #070607;
  --surface-container-low: #131011;
  --surface-container: #1b1719;
  --surface-container-high: #241f21;
  --surface-container-highest: #2e282b;

  /* Soft glassmorphism header surface (--surface at 75% opacity) */
  --surface-glass: rgba(13, 11, 12, 0.75);
  --surface-glass-strong: rgba(13, 11, 12, 0.94);

  /* ======================================================================
     ON-SURFACE TEXT COLORS
     Soft off-white tones for luxurious low contrast.
     ====================================================================== */
  --on-surface: #e4dfdb;
  --on-surface-soft: #DCD7CE;
  --on-surface-dim: #c7c3b7;
  --on-surface-variant: #a59f9a;
  --on-surface-muted: #837c77;

  /* ======================================================================
     BRAND ACCENTS
     ====================================================================== */
  --primary: #7a1530;
  --primary-container: #4a0a1d;
  --secondary: #765a24;
  --secondary-bright: #c5a059;

  /* ======================================================================
     OUTLINE & SHADOWS
     ====================================================================== */
  --outline-variant: rgba(228, 223, 219, 0.15);
  --shadow-rgb: 7, 6, 7;
  --rule-thin: 1px;

  /* ======================================================================
     8-POINT SPACING SCALE  (base = 0.5rem / 8px)
     ====================================================================== */
  --space-3xs: 0.125rem;   /*   2px */
  --space-2xs: 0.25rem;    /*   4px */
  --space-xs:  0.5rem;     /*   8px */
  --space-sm:  0.75rem;    /*  12px */
  --space-md:  1rem;       /*  16px */
  --space-lg:  1.5rem;     /*  24px */
  --space-xl:  2rem;       /*  32px */
  --space-2xl: 2.5rem;     /*  40px */
  --space-3xl: 5rem;       /*  80px */

  /* ======================================================================
     TYPOGRAPHY SCALE
     Georgia (headings) / Source Sans 3 (body). 7-step modular-ish scale.
     ====================================================================== */
  --text-xs:   0.75rem;    /*  12px  — tiny labels, meta data */
  --text-sm:   0.875rem;   /*  14px  — small body, nav, buttons */
  --text-base: 1rem;       /*  16px  — body */
  --text-md:   1.125rem;   /*  18px  — large body, small headings */
  --text-lg:   1.25rem;    /*  20px  — section headings, quotes */
  --text-xl:   1.5rem;     /*  24px  — larger headings */
  --text-2xl:  2rem;       /*  32px  — page headings */

  /* ======================================================================
     RADIUS TOKENS
     ====================================================================== */
  --radius-sm:  2px;       /* book covers, tight corners */
  --radius-md:  4px;       /* cards, frames */
  --radius-btn: 6px;       /* buttons */

  /* ======================================================================
     LAYOUT TOKENS
     ====================================================================== */
  --section-padding-x: 2rem;
  --container-max: 1100px;
  --container-wide: 1200px;
  --container-text: 700px;
  --hero-image-mobile-max: 300px;
  --book-card-cover-max: 17rem;
  --book-detail-cover-max: 20rem;

  /* ======================================================================
     ANIMATION
     ====================================================================== */
  --transition-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
  --duration-short: 0.2s;
  --duration-medium: 0.4s;

}

/* 3. Base Styles & Global Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--surface);
  color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Source Sans 3', sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  background-color: var(--surface);
}

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

/* Screen-reader / SEO-only heading (no visual or layout impact) */
.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;
}

a {
  color: var(--on-surface);
  text-decoration: none;
  transition: color var(--duration-short) var(--transition-smooth);
}

/* 4. Typography Scale */
.display-lg {
  font-family: 'Georgia', serif;
  font-size: 3.75rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--on-surface-dim);
  margin-bottom: var(--space-xl);
}

.headline-md {
  font-family: 'Georgia', serif;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--on-surface);
}

.body-lg {
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--text-base);
  font-weight: 300;
  line-height: 1.6;
  color: var(--on-surface-dim);
}

.label-sm {
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--secondary-bright);
}

/* 5. Sticky Navigation Header (Glassmorphism) */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  /* The "No-Line" Rule: Define header boundary using a subtle tonal transition, not a border */
  box-shadow: 0 4px 30px rgba(var(--shadow-rgb), 0.1);
  transition: background-color var(--duration-short) var(--transition-smooth);
}

.site-header.is-scrolled {
  background-color: var(--surface-glass-strong);
}

.header-container {
  position: relative;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Georgia', serif;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface);
  position: relative;
  display: inline-block;
}

.nav-menu {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.nav-link {
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--on-surface-dim);
  position: relative;
  padding: 0.25rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--rule-thin);
  background-color: var(--secondary-bright);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-short) var(--transition-smooth);
}

.nav-link:hover {
  color: var(--on-surface);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
}

/* Mobile Menu Button */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--on-surface);
  margin: 5px 0;
  transition: transform var(--duration-short) var(--transition-smooth), opacity var(--duration-short);
}

/* 6. Layout & Generous White Space (+25% Breathing Room) */
.section {
  padding: clamp(6rem, 12vw, 10rem) var(--section-padding-x);
  position: relative;
}

.section-container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.section-title {
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
  position: relative;
}

.section-title h2 {
  margin-bottom: 0.5rem;
}

/* Background Color Shifts for Structural boundaries (Strict No-Line Rule) */
.surface-base {
  background-color: var(--surface);
}

.surface-wash {
  background-color: var(--surface-container-low);
}

/* 7. Custom Component: Academic Hero */
.academic-hero {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding-top: 8rem;
  padding-bottom: 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  position: relative;
  z-index: 10;
  align-self: center;
}

.hero-title-wrapper {
  position: relative;
  margin-bottom: 2rem;
}

/* Strict 2-font system: Headings -> Georgia, Body/Nav -> Source Sans 3 */
h1, h2, h3,
.display-lg, .headline-md,
.about-quote-card p, .press-quote {
  font-family: 'Georgia', serif;
}

body, p, a,
.hero-label, .hero-subtitle, .body-lg, .label-sm, .btn, .nav-link,
.press-author, .contact-method-title, .footer-link, .footer-literary-link {
  font-family: 'Source Sans 3', sans-serif;
}

.hero-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-size: clamp(var(--text-md), 1.4vw, var(--text-lg));
  font-weight: 300;
  line-height: 1.5;
  color: var(--on-surface-variant);
  max-width: 480px;
  margin-top: 0;
  margin-bottom: var(--space-xl);
}

.hero-ctas {
  display: flex;
  gap: var(--space-lg);
}

.hero-ctas .btn {
  min-width: 160px;
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
  justify-self: end;
  overflow: hidden;
}

.hero-image-frame {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(var(--shadow-rgb), 0.4);
}

.hero-image-frame img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.hero-image-bg-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  background-image:
    linear-gradient(to right, var(--surface) 0%, transparent 22%, transparent 78%, var(--surface) 100%),
    linear-gradient(to top, var(--surface) 0%, transparent 20%, transparent 80%, var(--surface) 100%);
  border-radius: var(--radius-md);
}

/* 8. Buttons & Actions */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all var(--duration-short) var(--transition-smooth);
  border: 1px solid transparent;
  text-align: center;
}

.btn-primary {
  background: var(--secondary-bright);
  color: var(--surface-container-lowest);
}

.btn-primary:hover {
  background: var(--secondary);
  transform: translateY(-2px);
}

.btn-secondary {
  /* Solid warm-neutral surface fill, distinct from the mustard primary */
  background: var(--surface-container-high);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
}

.btn-secondary:hover {
  background: var(--surface-container-highest);
  color: var(--on-surface);
  border-color: var(--outline-variant);
  transform: translateY(-2px);
}

a:focus-visible,
button:focus-visible {
  outline: var(--space-3xs) solid var(--secondary-bright);
  outline-offset: var(--space-2xs);
}

.carousel-slide-link:focus-visible {
  outline-offset: calc(var(--space-2xs) * -1);
}

/* Gold prestige callout */
.btn-gold {
  background: transparent;
  color: var(--on-surface);
  position: relative;
  padding: 0.75rem 0;
  border-radius: 0;
}

.btn-gold:hover {
  color: var(--on-surface-soft);
}

/* 9. About Section Styles */
#about {
  padding: clamp(4rem, 8vw, 6rem) var(--section-padding-x);
}

.about-container {
  max-width: var(--container-text);
  margin: 0 auto;
  text-align: left;
}

.about-heading {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  margin-bottom: var(--space-lg);
  color: var(--on-surface-soft);
}

.about-container > p {
  font-size: var(--text-md);
  line-height: 1.65;
  color: var(--on-surface-dim);
  margin-bottom: var(--space-lg);
  text-align: left;
}

.about-container > p:last-child {
  margin-bottom: 0;
}

.about-quote-card {
  background: transparent;
  padding: var(--space-xl) var(--space-lg);
  border-radius: 0;
  position: relative;
  text-align: left;
  margin: var(--space-2xl) 0;
  overflow: hidden;
}

.about-quote-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rule-thin);
  background: var(--secondary-bright);
  opacity: 0.36;
}

.about-quote-card p {
  font-family: 'Georgia', serif;
  font-size: var(--text-md);
  font-weight: 300;
  font-style: italic;
  line-height: 1.65;
  color: var(--on-surface);
  margin: 0;
}

/* 9b. Books Carousel */
.books-section {
  padding: clamp(4rem, 8vw, 6rem) var(--section-padding-x);
}

.books-container {
  max-width: var(--container-max);
  margin: 0 auto;
  text-align: left;
}

.books-heading {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  margin-bottom: 0.75rem;
  color: var(--on-surface-soft);
}

.books-section .books-heading {
  margin-bottom: var(--space-2xl);
}

.carousel {
  position: relative;
}

.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.carousel-viewport {
  overflow: hidden;
  margin: 0 2.5rem;
  width: 100%;
}

.carousel-track {
  display: flex;
  gap: var(--space-lg);
  transition: transform 450ms ease-in-out;
}

.carousel-slide {
  flex: 0 0 220px;
  text-align: center;
}

.book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: visible;
  background: var(--surface-container);
  margin-bottom: 0.75rem;
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.book-cover:hover {
  transform: scale(1.07);
  box-shadow: 0 16px 48px rgba(var(--shadow-rgb), 0.5);
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
}

.book-cover-year {
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 1.5;
  color: var(--secondary-bright);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.25rem;
}

.book-cover-title {
  font-family: 'Georgia', serif;
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--on-surface);
  display: block;
  line-height: 1.25;
}

.carousel-slide-link,
.carousel-slide-link:visited {
  text-decoration: none;
  color: inherit;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: none;
  border: none;
  padding: 0.75rem;
  color: var(--on-surface);
  opacity: 0.4;
  cursor: pointer;
  transition: color var(--duration-short) var(--transition-smooth), opacity var(--duration-medium) var(--transition-smooth);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-arrow:hover {
  color: var(--secondary-bright);
  opacity: 1;
}

.carousel-arrow--disabled {
  opacity: 0.15;
  pointer-events: none;
}

.carousel-arrow--left {
  left: 0;
}

.carousel-arrow--right {
  right: 0;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: 2.5rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-container-highest);
  border: none;
  cursor: pointer;
  transition: background var(--duration-short), transform var(--duration-short) var(--transition-smooth);
  padding: 0;
}

.carousel-dot.active {
  background: var(--secondary-bright);
  transform: scale(1.25);
}

.carousel-dot:hover {
  background: var(--on-surface-variant);
}

/* 10. Books Section (Tonal Cards & No-Line separation) */
.books-page-container {
  max-width: min(70vw, 1300px);
  margin: 0 auto;
}

.books-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* A nested surface-container-lowest card placed on a surface-container-low section */
.book-card {
  background-color: var(--surface-container-lowest);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
  transition: background-color var(--duration-short) var(--transition-smooth), transform var(--duration-short) var(--transition-smooth), box-shadow var(--duration-short) var(--transition-smooth);
}

.book-card:hover {
  background-color: var(--surface-bright);
  transform: translateY(-4px);
  /* Ambient "Ghost" Shadow */
  box-shadow: 0px 24px 48px rgba(var(--shadow-rgb), 0.4);
}

.book-cover-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, var(--surface-container-high) 0%, var(--surface-container-lowest) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(var(--shadow-rgb), 0.2);
}

.cover-title {
  font-family: 'Georgia', serif;
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--on-surface);
  line-height: 1.2;
}

.cover-year {
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--text-xs);
  color: var(--on-surface-muted);
  letter-spacing: 0.1em;
}

.book-details {
  display: flex;
  flex-direction: column;
}

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

.book-title {
  margin-bottom: 0.25rem;
  font-family: 'Georgia', serif;
}

.book-description {
  margin-bottom: var(--space-xs);
  max-width: var(--container-text);
}

/* 10b. Zigzag Card Layout */
.book-card-image {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: var(--book-card-cover-max);
  justify-self: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(var(--shadow-rgb), 0.3);
  transition: transform var(--duration-medium) var(--transition-smooth), box-shadow var(--duration-medium) var(--transition-smooth);
}
.book-card-image img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}
.book-card:hover .book-card-image {
  transform: scale(1.03);
  box-shadow: 0 16px 40px rgba(var(--shadow-rgb), 0.5);
}

.book-card-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.book-card-content .btn {
  align-self: center;
  margin-top: var(--space-sm);
}

.book-card:nth-child(even) .book-card-image {
  order: 2;
}
.book-card:nth-child(even) .book-card-content {
  order: 1;
}

.book-card-blurb {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-purchase-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.book-year {
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.5;
  color: var(--secondary-bright);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* 10c. Individual Book Page */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--on-surface-variant);
  margin-bottom: 3rem;
  transition: color var(--duration-short) var(--transition-smooth);
}
.back-link:hover {
  color: var(--on-surface);
}

.book-page-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.book-page-cover {
  width: 100%;
  max-width: var(--book-detail-cover-max);
  justify-self: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(var(--shadow-rgb), 0.4);
}
.book-page-cover img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.book-page-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.book-page-blurb {
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--text-base);
  font-weight: 300;
  line-height: 1.7;
  color: var(--on-surface-dim);
}
.book-page-blurb p {
  margin-bottom: 1.25rem;
}
.book-page-blurb p:last-child {
  margin-bottom: 0;
}

.book-page-praise {
  margin-top: 4rem;
}

.praise-heading {
  margin-bottom: 2rem;
}

/* 11. Praise / Press Cards (used on book detail pages) */
.press-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-2xl);
}

.press-card {
  background-color: var(--surface-container);
  padding: 2.5rem;
  border-radius: var(--radius-md);
  transition: background-color var(--duration-short) var(--transition-smooth), transform var(--duration-short) var(--transition-smooth);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.press-card:hover {
  background-color: var(--surface-bright);
  transform: translateY(-4px);
}

.press-quote {
  font-family: 'Georgia', serif;
  font-size: var(--text-md);
  font-weight: 300;
  line-height: 1.4;
  margin-bottom: var(--space-lg);
  font-style: italic;
}

.press-source {
  font-family: 'Source Sans 3', sans-serif;
  display: flex;
  flex-direction: column;
}

.press-author {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--on-surface);
}

.press-publication {
  font-size: var(--text-xs);
  color: var(--secondary-bright);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-xs);
}

/* 11b. Press List */
.press-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  margin-top: 4rem;
}

.press-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--outline-variant);
}

.press-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.press-item .label-sm {
  font-size: var(--text-sm);
  color: var(--on-surface);
}

.press-context {
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--text-base);
  font-weight: 300;
  line-height: 1.5;
  color: var(--secondary-bright);
  margin: 0;
}

.press-item .btn {
  align-self: flex-start;
  min-width: 200px;
  margin-top: var(--space-md);
}

/* 13. Footer Styles */
.site-footer {
  background-color: var(--surface-container-lowest);
  padding: 4rem var(--section-padding-x);
}

.footer-container {
  max-width: var(--container-wide);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xl);
}

.footer-links {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.footer-link {
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--on-surface-variant);
}

.footer-nav .footer-link {
  font-weight: 500;
}

.footer-bottom .footer-link {
  font-weight: 400;
}

.footer-link:hover {
  color: var(--on-surface);
}

.footer-logo {
  font-size: var(--text-base);
  max-width: 100%;
}

.footer-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
  /* No line rule applies to borders here - separating with simple opacity/spacing */
}

.footer-copyright {
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.5;
  color: var(--on-surface-muted);
}

/* 13b. Contact Blocks (3-column) */
.contact-blocks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-top: 3rem;
  align-items: stretch;
}

.contact-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Subtle vertical divider between columns on wide screens */
.contact-block + .contact-block {
  border-left: 1px solid var(--outline-variant);
  padding-left: 3rem;
}

.contact-heading {
  font-family: 'Georgia', serif;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--on-surface-soft);
  margin: 0;
}

.contact-body {
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--text-base);
  font-weight: 300;
  line-height: 1.6;
  color: var(--secondary-bright);
  margin: 0;
}

.contact-link {
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--text-sm);
  color: var(--on-surface);
  text-decoration: none;
  margin-top: auto;
  transition: color var(--duration-short) var(--transition-smooth);
}

.contact-link:hover {
  color: var(--on-surface);
}

/* 14. Responsive Layout Adjustments */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .academic-hero {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding-top: 7rem;
    padding-bottom: 4rem;
  }

  .hero-image-wrapper {
    grid-row: 1;
    justify-self: center;
    max-width: 360px;
  }

  .hero-image-frame img {
    object-position: top center;
  }

  .hero-content {
    text-align: left;
  }

  .hero-ctas {
    justify-content: center;
  }

  .contact-blocks {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .contact-block + .contact-block {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--outline-variant);
    padding-top: 2.5rem;
    margin-top: 2.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding-x: 1rem;
  }

  #about,
  .site-footer {
    padding-inline: var(--space-lg);
  }

  .site-header {
    background-color: var(--surface);
  }

.books-page-container {
    max-width: 100%;
  }

  .header-container {
    padding: 1rem 1rem;
  }

  .logo {
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-base);
  }

  .mobile-nav-toggle {
    flex-shrink: 0;
    margin-left: auto;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--surface);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem 1rem;
    gap: 0.25rem;
    max-height: calc(100vh - 100%);
    overflow-y: auto;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 12px 30px rgba(var(--shadow-rgb), 0.4);
    transition: transform var(--duration-medium) var(--transition-smooth), opacity var(--duration-medium) var(--transition-smooth), visibility var(--duration-medium);
    pointer-events: none;
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-link {
    display: block;
    font-size: var(--text-base);
    padding: 0.85rem 0.5rem;
  }

  /* Hero: natural scroll on mobile, no rigid vertical lock */
  .academic-hero {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding-top: 7rem;
    padding-bottom: 4rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    gap: 0;
    align-content: start;
  }

  .hero-image-wrapper {
    grid-row: 1;
    max-height: none;
    max-width: 360px;
    justify-self: center;
    align-self: start;
  }

  .hero-image-frame,
  .hero-image-wrapper img {
    height: auto;
  }

  .hero-content {
    grid-row: 2;
    align-self: start;
    text-align: center;
    max-width: 85%;
    margin: -3.75rem auto 0;
    padding: 0 2rem;
  }

  .hero-subtitle {
    display: block;
    text-align: left;
    font-size: var(--text-base);
    margin-bottom: var(--space-lg);
  }

  .hero-label {
    font-size: var(--text-xs);
    margin-bottom: var(--space-sm);
  }

  .about-quote-card {
    padding: var(--space-lg);
    margin: 2rem 0;
  }

  .hero-ctas {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    margin: 0 auto;
    gap: var(--space-lg);
  }

  .hero-ctas .btn {
    flex: 0 0 auto;
    width: 44vw;
    max-width: 220px;
    padding: 0.85rem 1.25rem;
    font-size: var(--text-sm);
  }

  .display-lg {
    font-size: clamp(2.25rem, 9vw, 3.25rem);
    margin-bottom: var(--space-md);
  }

  .mobile-nav-toggle {
    display: block;
    z-index: 1001;
  }

  .mobile-nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .book-card {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
    justify-items: center;
  }

  .book-cover-placeholder {
    width: 140px;
  }

  .book-meta {
    justify-content: center;
  }

  .book-card:nth-child(even) .book-card-image,
  .book-card:nth-child(even) .book-card-content {
    order: 0;
  }

  .book-card-image {
    width: 240px;
    max-width: 100%;
  }

  .book-page-layout {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .back-link {
    margin-bottom: 2rem;
  }

  .carousel-viewport {
    margin: 0 2rem;
  }

  .carousel-track {
    gap: var(--space-lg);
  }

  .carousel-slide {
    flex: 0 0 200px;
  }

  .carousel-arrow {
    padding: 0.5rem;
  }

  .carousel-arrow svg {
    width: 20px;
    height: 20px;
  }

  .footer-nav {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
  }

  .footer-container {
    gap: var(--space-xl);
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm) var(--space-lg);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-sm);
  }

  .press-item .btn {
    align-self: center;
  }

  .book-purchase-links {
    flex-direction: column;
    align-items: center;
  }

  .book-purchase-links .btn {
    width: 100%;
    max-width: 280px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .section.academic-hero {
    min-height: 100dvh;
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-xl);
  }

  .hero-image-wrapper {
    max-width: min(78vw, var(--hero-image-mobile-max));
  }

  .hero-content {
    margin-top: calc(var(--space-lg) * -2);
  }

  .display-lg {
    font-size: clamp(2rem, 8vw, 2.75rem);
  }

  .hero-label {
    font-size: var(--text-xs);
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

  .header-container {
    padding: 0.875rem 0.875rem;
  }

  .logo {
    max-width: 72%;
    font-size: var(--text-sm);
  }

  .footer-logo {
    max-width: 100%;
    font-size: var(--text-base);
  }

  .section {
    padding: clamp(5rem, 14vw, 6rem) var(--section-padding-x);
  }

  .hero-ctas {
    flex-direction: column;
    gap: var(--space-md);
  }

  .hero-ctas .btn {
    width: 100%;
  }

  .book-card {
    padding: 1.25rem;
  }

  .book-card-image {
    width: 200px;
    max-width: 100%;
  }

  .press-card {
    padding: 1.75rem;
  }

  .carousel-viewport {
    margin: 0 1.75rem;
  }

  .carousel-track {
    gap: 0;
  }

  .carousel-slide {
    flex: 0 0 100%;
  }

  .book-cover {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  .carousel-arrow {
    padding: 0.5rem;
  }

  .carousel-arrow svg {
    width: 18px;
    height: 18px;
  }

}

/* Large monitors */
@media (min-width: 1400px) {
  .academic-hero {
    min-height: 100vh;
    padding-top: 10rem;
    padding-bottom: 6rem;
  }

  .display-lg {
    font-size: 4.5rem;
  }

  .hero-subtitle {
    max-width: 520px;
  }
}

/* Large / ultrawide monitors */
@media (min-width: 1600px) {
  .header-container {
    max-width: 1320px;
  }

  .section-container {
    max-width: var(--container-wide);
  }

  .footer-container {
    max-width: 1320px;
  }
}
