/* ============================================================
   JIDE BADMUS — Redesigned Stylesheet
   Aesthetic: Editorial / Literary Magazine
   Typography: Cormorant Garamond (display) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES — LIGHT MODE
   ============================================================ */
:root {
  /* Core palette */
  --color-bg:         #faf8f4;
  --color-surface:    #ffffff;
  --color-surface-2:  #f3efe8;
  --color-border:     #e2ddd4;
  --color-text:       #1a1714;
  --color-text-2:     #5c5650;
  --color-text-3:     #9c9690;

  /* Accent — warm amber/gold drawn from the hero image */
  --color-accent:     #b8892a;
  --color-accent-2:   #d4a843;
  --color-accent-bg:  rgba(184, 137, 42, 0.08);

  /* Semantic */
  --color-heading:    #1a1714;
  --color-link:       #b8892a;
  --color-link-hover: #8c6820;

  /* Header */
  --header-bg:        rgba(250, 248, 244, 0.95);
  --header-border:    rgba(26, 23, 20, 0.08);
  --header-height:    72px;

  /* Card */
  --card-bg:          #ffffff;
  --card-shadow:      0 2px 12px rgba(26, 23, 20, 0.07), 0 1px 3px rgba(26, 23, 20, 0.05);
  --card-shadow-hover: 0 12px 40px rgba(26, 23, 20, 0.14), 0 4px 12px rgba(26, 23, 20, 0.08);

  /* Typography */
  --font-display:     'Cormorant Garamond', Georgia, serif;
  --font-body:        'DM Sans', system-ui, sans-serif;

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

  /* Motion */
  --ease-out:         cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:      cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast:    150ms;
  --duration-base:    300ms;
  --duration-slow:    600ms;
}

/* ============================================================
   CSS CUSTOM PROPERTIES — DARK MODE
   ============================================================ */
[data-theme="dark"] {
  --color-bg:         #100f0d;
  --color-surface:    #1c1a17;
  --color-surface-2:  #252320;
  --color-border:     #2e2c28;
  --color-text:       #f0ece4;
  --color-text-2:     #a09a92;
  --color-text-3:     #6e6860;

  --color-accent:     #d4a843;
  --color-accent-2:   #e8c46a;
  --color-accent-bg:  rgba(212, 168, 67, 0.1);

  --color-heading:    #f0ece4;
  --color-link:       #d4a843;
  --color-link-hover: #e8c46a;

  --header-bg:        rgba(16, 15, 13, 0.96);
  --header-border:    rgba(240, 236, 228, 0.08);

  --card-bg:          #1c1a17;
  --card-shadow:      0 2px 12px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  --card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* System dark mode default */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg:         #100f0d;
    --color-surface:    #1c1a17;
    --color-surface-2:  #252320;
    --color-border:     #2e2c28;
    --color-text:       #f0ece4;
    --color-text-2:     #a09a92;
    --color-text-3:     #6e6860;
    --color-accent:     #d4a843;
    --color-accent-2:   #e8c46a;
    --color-accent-bg:  rgba(212, 168, 67, 0.1);
    --color-heading:    #f0ece4;
    --color-link:       #d4a843;
    --color-link-hover: #e8c46a;
    --header-bg:        rgba(16, 15, 13, 0.96);
    --header-border:    rgba(240, 236, 228, 0.08);
    --card-bg:          #1c1a17;
    --card-shadow:      0 2px 12px rgba(0,0,0,0.3);
    --card-shadow-hover: 0 12px 40px rgba(0,0,0,0.5);
  }
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--duration-slow) var(--ease-out),
              color var(--duration-slow) var(--ease-out);
  overflow-x: hidden;
}

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

a {
  color: var(--color-link);
  transition: color var(--duration-fast) ease;
}
a:hover { color: var(--color-link-hover); }

ul { list-style: none; }

::selection {
  background-color: var(--color-accent);
  color: #fff;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-heading);
  line-height: 1.15;
  font-weight: 600;
}

.section-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  display: block;
  margin-bottom: 0.75rem;
}

.section-heading {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  font-style: italic;
  color: var(--color-heading);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 2rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  white-space: nowrap;
}

.btn--primary {
  background-color: var(--color-accent);
  color: #fff;
  border: 1.5px solid var(--color-accent);
}
.btn--primary:hover {
  background-color: var(--color-link-hover);
  border-color: var(--color-link-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184, 137, 42, 0.35);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}
.btn--outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background-color: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
  height: var(--header-height);
  transition: background-color var(--duration-base) ease,
              border-color var(--duration-base) ease;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  height: 32px;
  width: auto;
  /* In dark mode we invert the black logo */
  transition: filter var(--duration-base) ease;
}

[data-theme="dark"] .logo-img {
  filter: invert(1) brightness(2);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
  display: none; /* shown at small sizes if logo-img fails */
}

.main-nav .nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-2);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 3px;
  position: relative;
  transition: color var(--duration-fast) ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0.75rem; right: 0.75rem;
  height: 1.5px;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--duration-base) var(--ease-out);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
}

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

.nav-link--accent {
  color: var(--color-accent) !important;
  border: 1.5px solid var(--color-border);
  padding: 0.4rem 0.9rem;
}
.nav-link--accent:hover {
  background-color: var(--color-accent-bg);
  border-color: var(--color-accent);
}
.nav-link--accent::after { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Theme toggle button */
.theme-toggle {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-2);
  border-radius: 50%;
  transition: color var(--duration-fast) ease,
              background-color var(--duration-fast) ease;
  font-size: 1rem;
}
.theme-toggle:hover {
  color: var(--color-accent);
  background-color: var(--color-accent-bg);
}

.toggle-icon { display: none; }
.toggle-icon--sun { display: block; }
[data-theme="dark"] .toggle-icon--sun { display: none; }
[data-theme="dark"] .toggle-icon--moon { display: block; }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  position: relative;   /* establishes stacking context */
  z-index: 1100;        /* above header(1000), nav drawer(950), overlay(940) */
  flex-shrink: 0;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  pointer-events: none;
}

.hamburger span {
  display: block;
  height: 2.5px;          /* bolder: was 1.5px */
  width: 24px;
  background-color: var(--color-text);
  border-radius: 3px;
  transition: transform 0.3s var(--ease-out),
              opacity   0.2s ease,
              width     0.2s ease;
  transform-origin: center center;
}

/* Third bar slightly shorter for visual interest */
.hamburger span:nth-child(3) {
  width: 16px;
  align-self: flex-end;
}

/* Open state: three bars animate into bold ✕ */
.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
  width: 24px;
}
.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
  width: 24px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: var(--header-height);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.05);
  transition: transform 8s var(--ease-out);
}

.hero:hover .hero-bg {
  transform: scale(1);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 8, 5, 0.3) 0%,
    rgba(10, 8, 5, 0.55) 50%,
    rgba(10, 8, 5, 0.75) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  max-width: 780px;
  animation: fadeUp 1.2s var(--ease-out) both;
}

.hero-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-accent-2);
  margin-bottom: 2rem;
  animation: fadeUp 1s var(--ease-out) 0.2s both;
}

.hero-quote {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  font-weight: 300;
  font-style: italic;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 1.25rem;
  animation: fadeUp 1s var(--ease-out) 0.35s both;
}

.quote-mark {
  font-size: 1.2em;
  line-height: 0;
  vertical-align: -0.15em;
  color: var(--color-accent-2);
  font-style: normal;
}

.hero-cite {
  display: block;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.06em;
  margin-bottom: 2.5rem;
  font-style: normal;
  animation: fadeUp 1s var(--ease-out) 0.5s both;
}

.hero-content .btn {
  animation: fadeUp 1s var(--ease-out) 0.65s both;
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  animation: fadeIn 1s ease 1.2s both;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.5));
  animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-text {
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-section {
  padding: var(--space-xl) 2rem;
  background-color: var(--color-bg);
  transition: background-color var(--duration-slow) ease;
}

.about-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 6rem;
  align-items: start;
}

.about-portrait {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
}

.portrait-frame {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 3/4;
}

/* On mobile the portrait container is constrained — give the decorative
   shadow offset room so it doesn't get clipped by the viewport edge */
@media (max-width: 860px) {
  .portrait-frame {
    overflow: visible; /* allow ::before shadow to show */
  }
  .portrait-img {
    border-radius: 4px;
    object-fit: contain;  /* maintain full image display on mobile */
    background-color: var(--color-surface-2);
  }
  .bio-portrait {
    padding-right: 14px; /* accommodate the 10px translate offset + border */
  }
}

.portrait-frame::before {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1.5px solid var(--color-accent);
  border-radius: 4px;
  transform: translate(10px, 10px);
  z-index: 0;
  pointer-events: none;
  transition: transform var(--duration-base) ease;
}

@media (max-width: 860px) {
  .portrait-frame::before {
    transform: translate(6px, 6px); /* smaller offset so it doesn't clip */
  }
}

.about-portrait:hover .portrait-frame::before {
  transform: translate(6px, 6px);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: contain;    /* show full circular icon — don't crop a square into 3:4 */
  object-position: center;
  display: block;
  position: relative;
  z-index: 1;
  background-color: var(--color-surface-2); /* fill the frame behind transparent areas */
}

.portrait-stat {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 1.25rem;
  background-color: var(--color-surface-2);
  border-radius: 4px;
  border: 1px solid var(--color-border);
  transition: background-color var(--duration-base) ease;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-accent);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-2);
}

.about-text {
  padding-top: 0.5rem;
}

.about-body {
  margin-bottom: 2rem;
}

.about-body p {
  color: var(--color-text-2);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-body a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) ease;
}
.about-body a:hover { border-color: var(--color-accent); }

/* ============================================================
   SECTION DIVIDER
   ============================================================ */
.section-divider {
  padding: 4rem 2rem;
  background-color: var(--color-surface-2);
  transition: background-color var(--duration-slow) ease;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.divider-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.divider-rule {
  flex: 1;
  height: 1px;
  background-color: var(--color-border);
}

.divider-heading {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 300;
  font-style: italic;
  white-space: nowrap;
  color: var(--color-heading);
}

/* ============================================================
   WORKS GRID
   ============================================================ */
.works-section {
  padding: var(--space-lg) 2rem;
  background-color: var(--color-bg);
  transition: background-color var(--duration-slow) ease;
}

.works-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.work-card {
  background-color: var(--card-bg);
  overflow: hidden;
  transition: background-color var(--duration-base) ease,
              box-shadow var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
  border-radius: 2px;
}

.work-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-3px);
}

.work-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.work-card__image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.work-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.work-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 5, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-base) ease;
}

.work-card__cta {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--duration-base) ease,
              transform var(--duration-base) var(--ease-out);
}

.work-card:hover .work-card__image {
  transform: scale(1.05);
}
.work-card:hover .work-card__overlay {
  background: rgba(10, 8, 5, 0.55);
}
.work-card:hover .work-card__cta {
  opacity: 1;
  transform: translateY(0);
}

.work-card__body {
  padding: 1.5rem;
  border-top: 1px solid var(--color-border);
  transition: border-color var(--duration-base) ease;
}

.work-card:hover .work-card__body {
  border-color: var(--color-accent);
}

.work-card__tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.6rem;
}

.work-card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-heading);
  line-height: 1.2;
  margin-bottom: 0.6rem;
  transition: color var(--duration-fast) ease;
}

.work-card:hover .work-card__title {
  color: var(--color-accent);
}

.work-card__excerpt {
  font-size: 0.87rem;
  color: var(--color-text-3);
  line-height: 1.6;
  /* Clamp to 2 lines (Improvement 1) */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   CTA BAND
   ============================================================ */
.cta-band {
  background-color: var(--color-surface-2);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-lg) 2rem;
  transition: background-color var(--duration-slow) ease;
}

.cta-band__inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cta-band__label {
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.4rem;
}

.cta-band__heading {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--color-heading);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.cta-band__sub {
  font-size: 0.92rem;
  color: var(--color-text-2);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  /* padding-top removed — email row (first child) provides its own top padding.
     When email row is absent, footer-inner gets padding via its own rule. */
  transition: background-color var(--duration-slow) ease;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-lg) 2rem var(--space-md);  /* top padding handles pages without email row */
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
}

/* When email row precedes footer-inner, reduce top padding to avoid double spacing */
.footer-email-row + .footer-inner {
  padding-top: var(--space-md);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  font-style: italic;
  color: var(--color-heading);
  text-decoration: none;
  display: block;
  margin-bottom: 0.75rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--color-text-2);
  line-height: 1.6;
}

.footer-heading {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-3);
  margin-bottom: 1rem;
  /* Override font-family for headings set globally */
  font-family: var(--font-body) !important;
}

.footer-nav ul li {
  margin-bottom: 0.5rem;
}

.footer-nav a {
  font-size: 0.9rem;
  color: var(--color-text-2);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}
.footer-nav a:hover { color: var(--color-accent); }

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-social a {
  font-size: 0.88rem;
  color: var(--color-text-2);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: color var(--duration-fast) ease;
}
.footer-social a:hover { color: var(--color-accent); }
.footer-social i { width: 16px; text-align: center; font-size: 0.95rem; }

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: 1.25rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.footer-bottom p {
  font-size: 0.78rem;
  color: var(--color-text-3);
}

.footer-credit {
  font-size: 0.75rem;
  color: var(--color-text-3);
  margin-top: 0.35rem;
}

.footer-credit a {
  color: var(--color-text-3);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--duration-fast) ease,
              border-color var(--duration-fast) ease;
}

.footer-credit a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.back-to-top {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-accent-bg);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.8rem;
  transition: background-color var(--duration-fast) ease,
              transform var(--duration-fast) ease;
}
.back-to-top:hover {
  background-color: var(--color-accent);
  color: #fff;
  transform: translateY(-3px);
}

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50%       { opacity: 0.8; transform: scaleY(1.3); }
}

/* Scroll-reveal utility (JS adds .revealed) */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out),
              transform 0.7s var(--ease-out);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ============================================================
   MOBILE NAV OVERLAY (backdrop)
   ============================================================ */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 5, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 940;
  opacity: 0;
  transition: opacity var(--duration-base) ease;
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}

/* ============================================================
   RESPONSIVE — TABLET & MOBILE  (≤ 860px)
   ============================================================ */
@media (max-width: 860px) {

  /* ── Hamburger button ─────────────────────────────────── */
  .menu-toggle {
    display: flex;
  }

  /* When nav is open, give the toggle a subtle background so the ✕ 
     is visible against both the header and the drawer edge */
  .menu-toggle[aria-expanded="true"] {
    background-color: var(--color-surface-2);
    border-radius: 50%;
  }

  /* ── Nav drawer slides in from right ──────────────────── */
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 85vw);
    height: 100dvh;          /* dynamic viewport height — avoids browser chrome issues */
    background-color: var(--color-surface);
    border-left: 1px solid var(--color-border);
    z-index: 950;
    /* Padding: top clears the fixed header; sides & bottom give breathing room */
    padding: 0;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-out);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.18);
    overflow: hidden;        /* nothing bleeds outside the drawer */
  }

  .main-nav.nav-open {
    transform: translateX(0);
  }

  /* ── Drawer header strip (echoes the site header) ─────── */
  .main-nav::before {
    content: '';
    display: block;
    height: var(--header-height);
    background-color: var(--color-surface-2);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
  }

  /* ── Nav list inside drawer ───────────────────────────── */
  .main-nav .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem 0 2rem;
    overflow-y: auto;
    flex: 1;
  }

  /* ── Each nav item ────────────────────────────────────── */
  .main-nav .nav-list > li {
    margin: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .main-nav .nav-list > li:last-child {
    border-bottom: none;
    margin-top: 0.5rem;
    /* No padding here — the nav-link inside handles its own padding */
  }

  .nav-link {
    /* Reset desktop styles */
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-2);
    padding: 1.1rem 1.75rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: none; /* border is on the <li> now */
    transition: background-color var(--duration-fast) ease,
                color var(--duration-fast) ease;
  }

  /* Arrow chevron on each item */
  .nav-link::after {
    content: '';           /* override desktop underline */
    display: block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid var(--color-text-3);
    border-bottom: 1.5px solid var(--color-text-3);
    transform: rotate(-45deg) translateY(-1px);
    transition: border-color var(--duration-fast) ease,
                transform var(--duration-fast) ease;
    flex-shrink: 0;
    background: none;
    height: auto;
    width: auto;
    position: static;
    bottom: auto;
    left: auto;
    margin-left: auto;
  }

  .nav-link:hover,
  .nav-link.active {
    background-color: var(--color-accent-bg);
    color: var(--color-accent);
  }

  .nav-link.active {
    font-weight: 500;
    color: var(--color-accent);
    border-left: 3px solid var(--color-accent);
    padding-left: calc(1.75rem - 3px);
  }

  .nav-link.active::after,
  .nav-link:hover::after {
    border-color: var(--color-accent);
    transform: rotate(-45deg) translateY(-1px);
  }

  /* INKspired accent pill — full-width tap target in drawer */
  .nav-link--accent {
    color: var(--color-accent) !important;
    background-color: var(--color-accent-bg) !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 1.1rem 1.75rem !important;
    border-left: 3px solid var(--color-accent) !important;
    padding-left: calc(1.75rem - 3px) !important;
  }

  .nav-link--accent::after {
    display: none !important; /* no chevron on accent */
  }

  /* ── Layout fixes ─────────────────────────────────────── */
  .about-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-portrait {
    position: static;
    max-width: 280px;
    margin: 0 auto;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 540px) {
  :root {
    --header-height: 64px;
    --space-xl: 4rem;
    --space-lg: 3rem;
  }

  .hero {
    margin-top: var(--header-height);
  }

  .hero-quote {
    font-size: 1.6rem;
  }

  .works-grid {
    grid-template-columns: 1fr;
    gap: 20px; /* maintain consistent gap on all screen sizes */
  }

  .work-card {
    border-bottom: 1px solid var(--color-border);
  }

  .cta-band__inner {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .footer-bottom {
    padding: 1rem 2rem;
  }

  .divider-inner {
    gap: 1rem;
  }
}


/* ============================================================
   PAGE HERO (about.html, books.html, etc.)
   ============================================================ */
.page-hero {
  margin-top: var(--header-height);
  background-color: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-lg) 2rem;
  text-align: center;
  transition: background-color var(--duration-slow) ease;
}

.page-hero__inner {
  max-width: 700px;
  margin: 0 auto;
  animation: fadeUp 0.9s var(--ease-out) both;
}

.page-hero__title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--color-heading);
  line-height: 1.05;
  margin-bottom: 0.75rem;
}

.page-hero__sub {
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-3);
}


/* ============================================================
   BIO SECTION (about.html)
   ============================================================ */
.bio-section {
  padding: var(--space-xl) 2rem;
  background-color: var(--color-bg);
  transition: background-color var(--duration-slow) ease;
}

.bio-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 5rem;
  align-items: start;
}

.bio-portrait {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.bio-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background-color: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.bio-fact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 1.25rem 0.75rem;
  background-color: var(--color-surface);
  text-align: center;
  transition: background-color var(--duration-base) ease;
}

.fact-number {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--color-accent);
  line-height: 1;
}

.fact-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-3);
  line-height: 1.3;
}

.bio-cta {
  width: 100%;
  justify-content: center;
}

.bio-text {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.bio-block {
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-border);
}

.bio-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.bio-block p {
  color: var(--color-text-2);
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 0.9rem;
}
.bio-block p:last-child { margin-bottom: 0; }

.bio-block a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) ease;
}
.bio-block a:hover { border-color: var(--color-accent); }

.bio-block .section-label {
  margin-bottom: 1rem;
}

.bio-quote {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--color-accent);
  background-color: var(--color-accent-bg);
  border-radius: 0 4px 4px 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--color-text-2);
  line-height: 1.5;
}

.inline-btn {
  margin-top: 1.25rem;
}

/* Contact actions */
.contact-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Secondary CTA bar */
.secondary-cta {
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 1.75rem 2rem;
  transition: background-color var(--duration-slow) ease;
}

.secondary-cta__inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.secondary-cta__link {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-2);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--duration-fast) ease;
}
.secondary-cta__link:hover { color: var(--color-accent); }
.secondary-cta__link i { font-size: 0.75rem; transition: transform var(--duration-fast) ease; }
.secondary-cta__link:hover i { transform: translateX(4px); }

.secondary-cta__divider {
  color: var(--color-border);
  font-size: 1.2rem;
}


/* ============================================================
   BOOK FEATURED (books.html)
   ============================================================ */
.book-featured {
  padding: var(--space-xl) 2rem;
  background-color: var(--color-bg);
  transition: background-color var(--duration-slow) ease;
}

.book-featured__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 6rem;
  align-items: center;
}

.book-3d-wrap {
  position: relative;
  perspective: 800px;
}

.book-3d-img {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  display: block;
  border-radius: 4px;
  box-shadow: 
    -8px 8px 20px rgba(0,0,0,0.25),
    -16px 16px 40px rgba(0,0,0,0.15);
  transform: rotateY(-8deg) rotateX(2deg);
  transition: transform var(--duration-slow) var(--ease-out),
              box-shadow var(--duration-slow) var(--ease-out);
}

.book-featured:hover .book-3d-img,
.book-3d-wrap:hover .book-3d-img {
  transform: rotateY(-2deg) rotateX(0deg);
  box-shadow: 
    -4px 4px 12px rgba(0,0,0,0.2),
    -8px 8px 24px rgba(0,0,0,0.12);
}

.book-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  background-color: var(--color-accent-bg);
  border: 1px solid var(--color-accent);
  padding: 0.3rem 0.75rem;
  border-radius: 2px;
  margin-bottom: 1rem;
  display: inline-block;
}

.book-featured__title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 600;
  color: var(--color-heading);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.book-featured__author {
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-3);
  margin-bottom: 1.5rem;
}

.book-featured__desc {
  font-size: 1rem;
  color: var(--color-text-2);
  line-height: 1.85;
  margin-bottom: 2rem;
}

.book-featured__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}


/* ============================================================
   BOOKS GRID (books.html)
   ============================================================ */
.books-section {
  padding: var(--space-lg) 2rem var(--space-md);
  background-color: var(--color-bg);
  transition: background-color var(--duration-slow) ease;
}

.books-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.book-card {
  background-color: var(--card-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out),
              background-color var(--duration-base) ease,
              border-color var(--duration-base) ease;
}

.book-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
  border-color: var(--color-accent);
}

.book-card__cover-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
  background-color: var(--color-surface-2);
}

.book-card__cover-wrap--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1410, #3d2b1a);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.placeholder-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  font-style: italic;
  color: rgba(255,255,255,0.75);
  text-align: center;
  line-height: 1.2;
}

.book-card__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.book-card:hover .book-card__cover {
  transform: scale(1.04);
}

.book-card__cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 5, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-base) ease;
}

.book-card:hover .book-card__cover-overlay {
  background: rgba(10, 8, 5, 0.5);
}

.btn--sm {
  padding: 0.6rem 1.4rem;
  font-size: 0.72rem;
  /* Desktop: hidden until hover */
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--duration-base) ease,
              transform var(--duration-base) var(--ease-out),
              background-color var(--duration-fast) ease;
}

.book-card:hover .btn--sm,
.dl-card:hover .btn--sm {
  opacity: 1;
  transform: translateY(0);
}

/* Touch/mobile: always visible — no hover state on touchscreen */
@media (hover: none), (max-width: 860px) {
  .btn--sm {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
}

.book-card__body {
  padding: 1.5rem;
}

.book-card__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-heading);
  margin-top: 0.4rem;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.book-card__desc {
  font-size: 0.87rem;
  color: var(--color-text-3);
  line-height: 1.65;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card__link {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap var(--duration-fast) ease, color var(--duration-fast) ease;
}
.book-card__link:hover { gap: 0.7rem; color: var(--color-link-hover); }
.book-card__link i { font-size: 0.7rem; }

/* Load More */
.load-more-wrap {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  padding-bottom: var(--space-md);
}

.load-more-btn {
  min-width: 200px;
  justify-content: center;
  gap: 0.6rem;
  position: relative;
}

.load-more-btn__icon {
  transition: transform var(--duration-base) var(--ease-out);
}

.load-more-btn.loaded .load-more-btn__icon {
  display: none; /* hide the chevron when all loaded */
}

.load-more-btn.loaded {
  opacity: 1;                            /* fully visible */
  pointer-events: none;                  /* non-clickable */
  cursor: default;
  background-color: var(--color-surface-2);
  border-color: var(--color-border);
  color: var(--color-text-3);            /* muted — signals completion not error */
}


/* ============================================================
   ANTHOLOGIES SECTION (books.html)
   ============================================================ */
.anthologies-section {
  padding: var(--space-lg) 2rem;
  background-color: var(--color-bg);
  transition: background-color var(--duration-slow) ease;
}

.anthologies-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.anthology-item {
  display: flex;
  gap: 1rem;
  padding: 2rem;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-surface);
  transition: background-color var(--duration-base) ease,
              border-color var(--duration-base) ease;
}

.anthology-item:hover {
  background-color: var(--color-accent-bg);
  border-color: var(--color-accent);
}

.anthology-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-accent);
  opacity: 0.4;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.anthology-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.anthology-desc {
  font-size: 0.85rem;
  color: var(--color-text-3);
  line-height: 1.6;
}


/* ============================================================
   RESPONSIVE — new pages
   ============================================================ */
@media (max-width: 860px) {
  .bio-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .bio-portrait {
    position: static;
    max-width: 320px;
    margin: 0 auto;
  }

  .book-featured__inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .book-featured__inner .book-3d-wrap {
    max-width: 260px;
    margin: 0 auto;
  }

  .anthologies-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  .page-hero {
    padding: var(--space-md) 1.5rem;
  }

  .books-grid {
    grid-template-columns: 1fr;
  }

  .anthologies-grid {
    grid-template-columns: 1fr;
  }

  .book-featured__actions,
  .contact-actions {
    flex-direction: column;
  }

  .secondary-cta__inner {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .secondary-cta__divider {
    display: none;
  }
}


/* ============================================================
   INKSPIRED HERO (inkspired.html)
   ============================================================ */
.inkspired-hero {
  position: relative;
  height: 70vh;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: var(--header-height);
  text-align: center;
}

.inkspired-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  transition: transform 8s var(--ease-out);
}
.inkspired-hero:hover .inkspired-hero__bg { transform: scale(1); }

.inkspired-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 60, 40, 0.65) 0%,
    rgba(0, 40, 25, 0.82) 100%
  );
}

.inkspired-hero__content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  animation: fadeUp 1s var(--ease-out) both;
}

.inkspired-logo-mark {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.inkspired-ink {
  color: #ffffff;
  display: inline-block;
  padding: 0.1em 0.25em;
  border: 3px solid rgba(255,255,255,0.5);
}

.inkspired-spired {
  color: var(--color-accent-2);
  font-style: italic;
  font-weight: 300;
}

.inkspired-hero__sub {
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.75);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Intro band */
.inkspired-intro {
  background-color: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 2rem;
  transition: background-color var(--duration-slow) ease;
}

.inkspired-intro__inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.inkspired-intro p {
  font-size: 0.9rem;
  color: var(--color-text-2);
}

.inkspired-intro a { color: var(--color-accent); text-decoration: none; }
.inkspired-intro a:hover { text-decoration: underline; }

.btn--sm-inline {
  padding: 0.55rem 1.2rem;
  font-size: 0.72rem;
  flex-shrink: 0;
}


/* ============================================================
   DOWNLOADS SECTION
   ============================================================ */
.downloads-section {
  padding: var(--space-md) 2rem var(--space-lg);
  background-color: var(--color-bg);
  transition: background-color var(--duration-slow) ease;
}

.downloads-header {
  max-width: 1200px;
  margin: 0 auto 1.5rem;
}

.downloads-count {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--color-text-3);
  text-align: center;
  margin-top: 0.75rem;
  letter-spacing: 0.05em;
}

/* Filter tabs */
.filter-tabs {
  max-width: 1200px;
  margin: 0 auto 2.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-tab {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  border-radius: 2px;
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text-2);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.filter-tab:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.filter-tab.active {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* Download grid */
.download-grid {
  max-width: 1200px;
  margin: 0 auto 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

/* Download card */
.dl-card {
  background-color: var(--card-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out),
              background-color var(--duration-base) ease,
              border-color var(--duration-base) ease;
}

.dl-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-5px);
  border-color: var(--color-accent);
}

@media (hover: none) {
  .dl-card:hover {
    transform: none;
    box-shadow: none;
  }
}

.dl-card.filtered-out {
  display: none !important;
}

.dl-card__cover-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
  background-color: var(--color-surface-2);
}

.dl-card__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.dl-card:hover .dl-card__cover { transform: scale(1.04); }

.dl-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.dl-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-base) ease;
}

.dl-card:hover .dl-card__overlay { background: rgba(0,0,0,0.5); }

.dl-card__body {
  padding: 1rem 1rem 0.9rem;
}

.dl-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-heading);
  line-height: 1.2;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dl-card__author {
  font-size: 0.78rem;
  color: var(--color-text-3);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dl-card__link {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap var(--duration-fast) ease;
}
.dl-card__link:hover { gap: 0.55rem; }
.dl-card__link i { font-size: 0.65rem; }


/* ============================================================
   FIXED BACK-TO-TOP BUTTON (global)
   ============================================================ */
.back-to-top-fixed {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--color-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  z-index: 500;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--duration-base) ease,
              transform var(--duration-base) ease,
              background-color var(--duration-fast) ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  text-decoration: none;
}

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

.back-to-top-fixed:hover {
  background-color: var(--color-link-hover);
  color: #fff;           /* keep icon white against the darker hover background */
  transform: translateY(-3px);
}


/* ============================================================
   RESPONSIVE — download page
   ============================================================ */
@media (max-width: 860px) {
  .inkspired-intro__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* At 860px keep a comfortable multi-column grid */
  .download-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
  }
}

@media (max-width: 540px) {
  .inkspired-hero { height: 60vh; min-height: 360px; }

  /* Single column — cards look identical to desktop: cover top, body below */
  .download-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Ensure dl-card resets any previous horizontal overrides */
  .dl-card {
    display: block;       /* override any grid that was set */
    border-radius: 4px;
    border-bottom: none; /* card border already handles separation */
  }

  /* Cover stays aspect-ratio 3/4 — same as desktop */
  .dl-card__cover-wrap {
    aspect-ratio: 3/4;
    height: auto;
    border-radius: 4px 4px 0 0;
  }

  /* Body padding same as desktop dl-card__body default */
  .dl-card__body {
    padding: 1rem 1rem 0.9rem;
    display: block;       /* override flex from previous version */
  }

  /* Typography unchanged from desktop */
  .dl-card__title { font-size: 1.05rem; -webkit-line-clamp: 2; }
  .dl-card__author { font-size: 0.78rem; }

  /* Overlay always visible on touch — tap the cover to download */
  .dl-card__overlay {
    background: rgba(0, 0, 0, 0.35) !important;
  }

  .filter-tabs { gap: 0.4rem; flex-wrap: wrap; }
  .filter-tab { font-size: 0.68rem; padding: 0.45rem 0.8rem; }

  .back-to-top-fixed { bottom: 1.25rem; right: 1.25rem; }
}

/* ============================================================
   TOUCH / NO-HOVER DEVICES
   Show all overlay buttons and card CTAs that are normally
   hidden behind :hover — touch screens have no hover state
   ============================================================ */
@media (hover: none) {
  /* Download grid cards */
  .dl-card__overlay      { background: rgba(0, 0, 0, 0.45) !important; }
  .dl-card__link         { display: inline-flex !important; }

  /* Books grid cards */
  .book-card__cover-overlay { background: rgba(10, 8, 5, 0.45) !important; }

  /* Works grid cards */
  .work-card__overlay    { background: rgba(10, 8, 5, 0.45) !important; }
  .work-card__cta        { opacity: 1 !important; transform: translateY(0) !important; }

  /* Overlay buttons (btn--sm) */
  .btn--sm               { opacity: 1 !important; transform: none !important; }

  /* Book card hover title colour — apply statically */
  .book-card .book-card__title { color: var(--color-accent); }
}


/* ============================================================
   BREADCRUMB BAR (book detail pages)
   ============================================================ */
.breadcrumb-bar {
  margin-top: var(--header-height);
  background-color: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  padding: 0.9rem 2rem;
  transition: background-color var(--duration-slow) ease;
}

.breadcrumb-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: gap var(--duration-fast) ease, color var(--duration-fast) ease;
}
.breadcrumb-link:hover { gap: 0.65rem; color: var(--color-link-hover); }
.breadcrumb-link i { font-size: 0.7rem; }

.breadcrumb-sep { color: var(--color-border); }

.breadcrumb-current {
  color: var(--color-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}


/* ============================================================
   BOOK DETAIL (download.html & all individual download pages)
   ============================================================ */
.book-detail {
  padding: var(--space-lg) 2rem var(--space-xl);
  background-color: var(--color-bg);
  transition: background-color var(--duration-slow) ease;
}

.book-detail__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 5rem;
  align-items: start;
}

/* Cover column */
.book-detail__cover-col {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.book-detail__cover-wrap {
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    -10px 12px 30px rgba(0, 0, 0, 0.22),
    -20px 24px 60px rgba(0, 0, 0, 0.12);
  transform: perspective(900px) rotateY(-6deg) rotateX(2deg);
  transition: transform var(--duration-slow) var(--ease-out),
              box-shadow var(--duration-slow) var(--ease-out);
}

.book-detail__cover-col:hover .book-detail__cover-wrap {
  transform: perspective(900px) rotateY(-1deg) rotateX(0deg);
  box-shadow:
    -4px 6px 16px rgba(0, 0, 0, 0.15),
    -8px 12px 32px rgba(0, 0, 0, 0.1);
}

.book-detail__cover-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Download counter badge */
.download-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-accent-bg);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 0.5rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--color-text-2);
  transition: background-color var(--duration-base) ease;
  text-align: center;
}

.download-badge i {
  color: var(--color-accent);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Info column */
.book-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.book-detail__title {
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  font-weight: 600;
  font-style: italic;
  color: var(--color-heading);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.book-detail__author {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text-2);
  margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
}

.book-detail__author a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) ease;
}
.book-detail__author a:hover { border-color: var(--color-accent); }

/* Star rating */
.book-detail__rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1.75rem;
}

.book-detail__rating i {
  color: var(--color-accent);
  font-size: 0.85rem;
}

.rating-count {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--color-text-3);
  margin-left: 0.4rem;
  letter-spacing: 0.05em;
}

/* Description */
.book-detail__desc {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.book-detail__desc p {
  font-size: 1rem;
  color: var(--color-text-2);
  line-height: 1.85;
  margin-bottom: 0.9rem;
}
.book-detail__desc p:last-child { margin-bottom: 0; }

/* Metadata table */
.book-detail__meta {
  display: grid;
  gap: 0;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.meta-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.87rem;
}

.meta-row:last-child { border-bottom: none; }

.book-detail__meta dt {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--color-text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
}

.book-detail__meta dd {
  color: var(--color-text-2);
  line-height: 1.5;
}

/* CTA buttons */
.book-detail__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.btn--lg {
  padding: 1rem 2.25rem;
  font-size: 0.85rem;
}

/* Share strip */
.book-detail__share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.share-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-3);
}

.share-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--color-surface-2);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-2);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background-color var(--duration-fast) ease,
              color var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              transform var(--duration-fast) ease;
}
.share-btn:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
}


/* ============================================================
   COMMENTS SECTION (book detail pages)
   ============================================================ */
.comments-section {
  padding: var(--space-lg) 2rem;
  background-color: var(--color-surface-2);
  border-top: 1px solid var(--color-border);
  transition: background-color var(--duration-slow) ease;
}

.comments-inner {
  max-width: 820px;
  margin: 0 auto;
}

/* Make Disqus respect dark mode as best we can */
[data-theme="dark"] #disqus_thread {
  filter: invert(0.88) hue-rotate(180deg);
}


/* ============================================================
   MORE DOWNLOADS SECTION (book detail pages)
   ============================================================ */
.more-downloads {
  padding: var(--space-lg) 2rem;
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-border);
  transition: background-color var(--duration-slow) ease;
  text-align: center;
}

.more-downloads__inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.more-downloads__heading {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--color-heading);
  margin-bottom: 2.5rem;
  line-height: 1.1;
}

.more-downloads__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  width: 100%;
  margin-bottom: 0.5rem;
}

.more-dl-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background-color: var(--card-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) ease;
}

.more-dl-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--color-accent);
}

.more-dl-card__cover {
  aspect-ratio: 3/4;
  overflow: hidden;
  background-color: var(--color-surface-2);
}

.more-dl-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.more-dl-card:hover .more-dl-card__cover img {
  transform: scale(1.04);
}

.more-dl-card__info {
  padding: 0.75rem 1rem 1rem;
}

.more-dl-card__info h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-heading);
  line-height: 1.2;
  margin-bottom: 0.25rem;
  transition: color var(--duration-fast) ease;
}

.more-dl-card:hover .more-dl-card__info h4 {
  color: var(--color-accent);
}

.more-dl-card__info p {
  font-size: 0.75rem;
  color: var(--color-text-3);
  line-height: 1.4;
}


/* ============================================================
   RESPONSIVE — book detail pages
   ============================================================ */
@media (max-width: 860px) {
  .book-detail__inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .book-detail__cover-col {
    position: static;
    max-width: 280px;
    margin: 0 auto;
  }

  .more-downloads__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .book-detail {
    padding: var(--space-md) 1.25rem var(--space-lg);
  }

  .book-detail__cover-col {
    max-width: 220px;
  }

  .book-detail__actions {
    flex-direction: column;
  }

  .btn--lg { width: 100%; justify-content: center; }

  .meta-row {
    grid-template-columns: 110px 1fr;
    font-size: 0.82rem;
  }

  .more-downloads__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .breadcrumb-current { display: none; }
}


/* ============================================================
   BOOK LOADING STATE (download.html)
   ============================================================ */
.book-loading {
  margin-top: var(--header-height);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  color: var(--color-text-3);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.book-loading__spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ============================================================
   BOOK ERROR STATE (download.html)
   ============================================================ */
.book-error {
  margin-top: var(--header-height);
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background-color: var(--color-bg);
  transition: background-color var(--duration-slow) ease;
}

.book-error__inner {
  text-align: center;
  max-width: 480px;
  animation: fadeUp 0.7s var(--ease-out) both;
}

.book-error__icon {
  font-size: 3.5rem;
  color: var(--color-border);
  margin-bottom: 1.5rem;
  display: block;
}

.book-error__title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 300;
  font-style: italic;
  color: var(--color-heading);
  margin-bottom: 0.75rem;
}

.book-error__msg {
  font-size: 0.95rem;
  color: var(--color-text-2);
  line-height: 1.7;
  margin-bottom: 2rem;
}


/* ============================================================
   404 PAGE
   ============================================================ */
.not-found-section {
  margin-top: var(--header-height);
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  background-color: var(--color-bg);
  transition: background-color var(--duration-slow) ease;
}

.not-found-inner {
  text-align: center;
  max-width: 520px;
  animation: fadeUp 0.8s var(--ease-out) both;
}

.not-found-code {
  font-family: var(--font-display);
  font-size: clamp(6rem, 16vw, 10rem);
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  color: var(--color-border);
  margin-bottom: 0;
  letter-spacing: -0.04em;
  /* Subtle accent underline */
  background: linear-gradient(135deg, var(--color-border) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.not-found-title {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 300;
  font-style: italic;
  color: var(--color-heading);
  margin-bottom: 1rem;
}

.not-found-msg {
  font-size: 0.97rem;
  color: var(--color-text-2);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.not-found-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}


/* ============================================================
   IMPROVEMENT 2 — Books page: styled cover placeholder
   ============================================================ */
.book-cover-placeholder--typed {
  background-color: var(--color-surface-2);
  width: 100%;
  height: 100%;          /* fill the parent cover-wrap which owns aspect-ratio */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem;
  border-radius: 4px;
  color: var(--color-text-2);
  font-family: var(--font-display);
  font-style: italic;
  line-height: 1.3;
  transition: background-color var(--duration-base) ease,
              color var(--duration-base) ease;
}

[data-theme="dark"] .book-cover-placeholder--typed {
  background-color: var(--color-surface-2);
  color: var(--color-text-2);
}


/* ============================================================
   IMPROVEMENT 3 — INKspired: search input
   ============================================================ */
.library-search-wrap {
  max-width: 1200px;
  margin: 0 auto 0;
  padding: 0 0 0.5rem;
}

.library-search {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 1.5rem;
  padding: 0.75rem 1.1rem 0.75rem 2.75rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 3px;
  outline: none;
  transition: border-color var(--duration-fast) ease,
              background-color var(--duration-base) ease,
              box-shadow var(--duration-fast) ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239c9690' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.85rem center;
  background-size: 1rem;
}

.library-search:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-bg);
}

.library-search::placeholder {
  color: var(--color-text-3);
}

.library-search-no-results {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-3);
  font-size: 0.9rem;
  font-family: var(--font-body);
  grid-column: 1 / -1;
}

.library-search-no-results.visible {
  display: block;
}


/* ============================================================
   IMPROVEMENT 6 — Mobile: prose line-height & max-width
   ============================================================ */
@media (max-width: 768px) {
  p, li, blockquote {
    line-height: 1.8;
  }
}

/* max-width only when the text column is full-width (single-column layout) */
@media (max-width: 860px) {
  .bio-text,
  .about-text,
  .book-detail__desc,
  .book-featured__desc,
  article p {
    max-width: 65ch;
  }
}


/* ============================================================
   IMPROVEMENT 7 — Nav: aria-current active indicator
   ============================================================ */
nav a.active,
nav a[aria-current="page"] {
  font-weight: 500;
}

/* Desktop underline — only on screens where nav is horizontal */
@media (min-width: 861px) {
  nav a.active::after,
  nav a[aria-current="page"]::after {
    transform: scaleX(1) !important;
  }
}


/* ============================================================
   IMPROVEMENT 5 — Testimonial attribution
   ============================================================ */
.bio-quote__attribution {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--color-text-3);
  font-family: var(--font-body);
  letter-spacing: 0.04em;
}


/* ============================================================
   IMPROVEMENT 10 — Footer email capture
   ============================================================ */
.footer-email-row {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-md) 2rem;
  background-color: var(--color-surface);
  transition: background-color var(--duration-slow) ease;
}

.footer-email-row__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.footer-email-row__label {
  flex-shrink: 0;
}

.footer-email-row__label p {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-2);
  margin-bottom: 0.15rem;
}

.footer-email-row__label small {
  font-size: 0.75rem;
  color: var(--color-text-3);
}

.footer-email-form {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}

.footer-email-input {
  flex: 1;
  padding: 0.7rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 3px;
  outline: none;
  transition: border-color var(--duration-fast) ease,
              background-color var(--duration-base) ease;
  min-width: 0;
}

.footer-email-input:focus {
  border-color: var(--color-accent);
}

.footer-email-input::placeholder {
  color: var(--color-text-3);
}

.footer-email-btn {
  padding: 0.7rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background-color: var(--color-accent);
  border: 1.5px solid var(--color-accent);
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--duration-fast) ease,
              transform var(--duration-fast) ease;
}

.footer-email-btn:hover {
  background-color: var(--color-link-hover);
  border-color: var(--color-link-hover);
  transform: translateY(-1px);
}

.footer-email-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.footer-email-msg {
  font-size: 0.78rem;
  font-family: var(--font-body);
  padding: 0.35rem 0;
  display: none;
}
.footer-email-msg.success { color: #2d7a3a; display: block; }
.footer-email-msg.error   { color: #c0392b; display: block; }

@media (max-width: 600px) {
  .footer-email-row__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .footer-email-form {
    width: 100%;
    max-width: 100%;
  }
}


/* ============================================================
   IMPROVEMENT 4 — About stats band (above bio section)
   ============================================================ */
.about-stats-band {
  background-color: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  padding: 2rem;
  transition: background-color var(--duration-slow) ease;
}

.about-stats-band__inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background-color: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.about-stats-band .bio-fact {
  background-color: var(--color-surface);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: background-color var(--duration-base) ease;
}

@media (max-width: 600px) {
  .about-stats-band__inner {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ============================================================
   ACCESSIBILITY — visually hidden (screen-reader only)
   ============================================================ */
.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;
}


/* ============================================================
   SEARCH — link-style button (for "clear the search")
   ============================================================ */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-accent);
  font-family: var(--font-body);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--color-link-hover); }


/* ============================================================
   CUSTOM CURSOR — literary / minimal two-layer
   Only active on pointer-fine devices (mouse/trackpad)
   cursor.js creates and animates the elements
   ============================================================ */

/* Hide browser cursor globally on pointer-fine devices */
@media (pointer: fine) {
  *,
  *::before,
  *::after {
    cursor: none !important;
  }
}

/* ── Shared base ─────────────────────────────────────────── */
.jb-cursor-dot,
.jb-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;       /* never block clicks */
  z-index: 99999;
  border-radius: 50%;
  will-change: transform;
  transition: opacity 0.25s ease;
  /* translate(-50%,-50%) so the element is centred on the cursor point */
}

/* ── Inner dot ───────────────────────────────────────────── */
.jb-cursor-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-text);   /* ink-black in light, cream in dark */
  margin-left: -3px;                      /* centre offset */
  margin-top:  -3px;
  transition: opacity 0.25s ease,
              background-color 0.2s ease,
              width 0.2s ease,
              height 0.2s ease,
              margin 0.2s ease;
}

/* ── Outer ring ──────────────────────────────────────────── */
.jb-cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--color-text);
  opacity: 0.5;
  margin-left: -17px;
  margin-top:  -17px;
  transition: opacity 0.25s ease,
              border-color 0.25s ease,
              width 0.3s var(--ease-out),
              height 0.3s var(--ease-out),
              margin 0.3s var(--ease-out),
              background-color 0.25s ease;
  background-color: transparent;
}

/* ── Hover state — over links / buttons / cards ──────────── */
.jb-cursor-ring--hover {
  width: 50px;
  height: 50px;
  margin-left: -25px;
  margin-top:  -25px;
  border-color: var(--color-accent);
  opacity: 0.7;
  background-color: var(--color-accent-bg);
}

.jb-cursor-dot--hover {
  background-color: var(--color-accent);
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  margin-top:  -3.5px;
}

/* ── Press state ─────────────────────────────────────────── */
.jb-cursor-ring--press {
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top:  -14px;
  opacity: 0.9;
}

.jb-cursor-dot--press {
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  margin-top:  -2.5px;
}

/* ── Dark mode adjustments ───────────────────────────────── */
[data-theme="dark"] .jb-cursor-dot {
  background-color: var(--color-text);    /* cream/off-white */
}

[data-theme="dark"] .jb-cursor-ring {
  border-color: var(--color-text);
  opacity: 0.4;
}

[data-theme="dark"] .jb-cursor-ring--hover {
  border-color: var(--color-accent);      /* amber in dark mode */
  opacity: 0.65;
}

[data-theme="dark"] .jb-cursor-dot--hover {
  background-color: var(--color-accent);
}
