/* =====================================================================
   Ghazi Rayan, MD — Author Website
   Design system: flag-inspired navy + crimson on parchment, gilt accents
   Light / Dark theming via [data-theme] on <html>
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Brand — light theme defaults */
  --navy:        #0C2340;
  --navy-2:      #14315A;
  --red:         #A4243B;
  --red-bright:  #C8324A;
  --gold:        #B8912F;
  --gold-soft:   #C9A24B;

  --bg:          #F6F1E8;   /* parchment */
  --bg-alt:      #EFE7D8;   /* deeper parchment for alt bands */
  --surface:     #FFFFFF;
  --surface-2:   #FBF8F2;
  --ink:         #10233F;   /* primary text */
  --ink-soft:    #4A5568;   /* secondary text */
  --ink-faint:   #8A8578;
  --line:        rgba(12, 35, 64, 0.14);
  --line-soft:   rgba(12, 35, 64, 0.08);

  --hero-panel:  #0C2340;   /* dark panel inside light theme */
  --on-dark:     #F3EEE4;
  --on-dark-soft:#B9C2D4;

  /* Accents that stay usable in both themes */
  --accent-red:  var(--red);
  --accent-blue: var(--navy-2);

  /* Type */
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Scale & rhythm */
  --wrap: 1200px;
  --wrap-narrow: 860px;
  --radius: 4px;
  --radius-lg: 10px;
  --shadow-sm: 0 2px 10px rgba(12, 35, 64, 0.06);
  --shadow-md: 0 14px 40px rgba(12, 35, 64, 0.12);
  --shadow-lg: 0 30px 70px rgba(12, 35, 64, 0.18);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --header-h: 76px;
}

[data-theme="dark"] {
  --navy:        #0A1526;
  --navy-2:      #17335C;
  --red:         #E05265;
  --red-bright:  #F26076;
  --gold:        #D4B15F;
  --gold-soft:   #E0C476;

  --bg:          #0A1526;
  --bg-alt:      #0E1D34;
  --surface:     #10203A;
  --surface-2:   #142743;
  --ink:         #ECE6DA;
  --ink-soft:    #AEB8CB;
  --ink-faint:   #7C889E;
  --line:        rgba(236, 230, 218, 0.14);
  --line-soft:   rgba(236, 230, 218, 0.07);

  --hero-panel:  #06101F;
  --on-dark:     #F3EEE4;
  --on-dark-soft:#AEB8CB;

  --accent-red:  var(--red);
  --accent-blue: #6EA0E0;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 16px 44px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.6);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .45s var(--ease), color .45s var(--ease);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; color: var(--ink); }
::selection { background: var(--red); color: #fff; }

/* ---------- Layout helpers ---------- */
.wrap { width: min(100% - 44px, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 44px, var(--wrap-narrow)); margin-inline: auto; }
.section { padding: clamp(64px, 9vw, 128px) 0; position: relative; }
.section--alt { background: var(--bg-alt); }
.section--ink { background: var(--hero-panel); color: var(--on-dark); }
.section--ink h1, .section--ink h2, .section--ink h3 { color: var(--on-dark); }
.section--ink .eyebrow { color: var(--gold-soft); }
.section--ink p { color: var(--on-dark-soft); }

/* Signature tricolor rule — navy / red / gold ribbon */
.ribbon { display: inline-flex; gap: 4px; align-items: center; }
.ribbon span { display: block; height: 3px; border-radius: 2px; }
.ribbon span:nth-child(1) { width: 30px; background: var(--accent-blue); }
.ribbon span:nth-child(2) { width: 18px; background: var(--red); }
.ribbon span:nth-child(3) { width: 9px;  background: var(--gold); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  display: inline-block;
  margin-bottom: 18px;
}
.section-head { max-width: 720px; margin-bottom: clamp(38px, 5vw, 60px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-title { font-size: clamp(2rem, 4.4vw, 3.25rem); letter-spacing: -0.01em; }
.section-sub { margin-top: 18px; color: var(--ink-soft); font-size: 1.075rem; }
.section--ink .section-sub { color: var(--on-dark-soft); }

.lead { font-size: 1.18rem; color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; font-weight: 600; font-size: 0.95rem;
  border-radius: var(--radius); letter-spacing: 0.01em;
  transition: transform .25s var(--ease), background-color .25s var(--ease),
              color .25s var(--ease), box-shadow .25s var(--ease);
  will-change: transform;
}
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 8px 22px rgba(164,36,59,.28); }
.btn--primary:hover { background: var(--red-bright); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(164,36,59,.38); }
.btn--navy { background: var(--navy); color: var(--on-dark); }
[data-theme="dark"] .btn--navy { background: var(--navy-2); }
.btn--navy:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--ghost { border: 1.5px solid var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); }
.section--ink .btn--ghost { border-color: rgba(243,238,228,.3); color: var(--on-dark); }
.section--ink .btn--ghost:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.btn--lg { padding: 16px 34px; font-size: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: relative; z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), background-color .4s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--navy); color: var(--gold-soft);
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem;
  letter-spacing: 0.02em; border: 1.5px solid var(--gold-soft);
}
[data-theme="dark"] .brand-mark { background: var(--surface); }
.brand-text { line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.16rem; color: var(--ink); }
.brand-role { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-faint); }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 9px 15px; font-size: 0.92rem; font-weight: 500; color: var(--ink-soft);
  border-radius: var(--radius); position: relative; transition: color .2s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 4px; height: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.nav a.active { color: var(--ink); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--ink); transition: all .25s var(--ease); flex: none;
}
.theme-toggle:hover { border-color: var(--red); color: var(--red); transform: rotate(-15deg); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.menu-btn { display: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); place-items: center; }
.menu-btn svg { width: 22px; height: 22px; }

/* ---------- Hero (home) ---------- */
.hero { position: relative; padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(56px, 8vw, 104px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(30px, 5vw, 72px); align-items: center; }
.hero-eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.hero-eyebrow .eyebrow { margin: 0; }
.hero h1 {
  font-size: clamp(2.7rem, 6.3vw, 5rem); letter-spacing: -0.02em; margin-bottom: 8px;
}
.hero h1 .accent { color: var(--red); font-style: italic; }
.hero-tag { font-size: clamp(1.05rem, 2.2vw, 1.4rem); color: var(--ink-soft); font-weight: 400; margin-bottom: 26px; max-width: 30ch; font-family: var(--font-display); font-style: italic; }
.hero-desc { color: var(--ink-soft); max-width: 46ch; margin-bottom: 34px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-figure { position: relative; z-index: 1; }
.hero-portrait {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 1/1; background: var(--surface-2); box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.hero-frame {
  position: absolute; inset: -14px -14px auto auto; width: 62%; height: 62%;
  border: 2px solid var(--gold-soft); border-radius: var(--radius-lg); z-index: -1; opacity: .7;
}
.hero-badge {
  position: absolute; left: -18px; bottom: 34px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 20px;
  box-shadow: var(--shadow-md); max-width: 210px;
}
.hero-badge .num { font-family: var(--font-display); font-size: 1.9rem; color: var(--red); font-weight: 700; line-height: 1; }
.hero-badge .lbl { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; letter-spacing: 0.02em; }

.hero-bg-monogram {
  position: absolute; top: 50%; right: -6%; transform: translateY(-50%);
  font-family: var(--font-display); font-size: 46vw; font-weight: 900;
  color: var(--ink); opacity: 0.03; pointer-events: none; z-index: -1; line-height: 1;
}

/* ---------- Stats band ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); }
.stat { text-align: center; }
.stat .num { font-family: var(--font-display); font-size: clamp(2.3rem, 4.5vw, 3.4rem); font-weight: 700; color: var(--gold-soft); line-height: 1; }
.stat .lbl { margin-top: 12px; font-size: 0.86rem; letter-spacing: 0.05em; color: var(--on-dark-soft); text-transform: uppercase; }
.stats-note { text-align: center; margin-top: 44px; color: var(--on-dark-soft); font-size: 0.95rem; }

/* ---------- Intro split ---------- */
.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(34px, 5vw, 76px); align-items: center; }
.split.reverse .split-media { order: 2; }
.intro-portrait { position: relative; }
.intro-portrait .oval {
  width: min(340px, 100%); aspect-ratio: 4/5; margin-inline: auto;
  border-radius: 50%; overflow: hidden; border: 3px solid var(--surface); box-shadow: var(--shadow-md);
}
.intro-portrait .oval img { width: 100%; height: 100%; object-fit: cover; }
.intro-portrait::before {
  content: ""; position: absolute; inset: auto 0 -18px 0; height: 60%;
  background: radial-gradient(closest-side, rgba(164,36,59,.1), transparent); z-index: -1;
}
.body-copy p { color: var(--ink-soft); margin-bottom: 18px; }
.body-copy p:last-child { margin-bottom: 0; }
.body-copy strong { color: var(--ink); font-weight: 600; }

/* ---------- Series / book showcase ---------- */
.series-block { margin-bottom: clamp(48px, 7vw, 90px); }
.series-block:last-child { margin-bottom: 0; }
.series-label { display: flex; align-items: center; gap: 18px; margin-bottom: 32px; }
.series-label h3 { font-size: clamp(1.5rem, 3vw, 2.1rem); white-space: nowrap; }
.series-label .rule { flex: 1; height: 1px; background: var(--line); }
.series-label .count { font-size: 0.82rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }

.book-grid { display: grid; gap: clamp(22px, 3vw, 34px); }
.book-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.book-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.book-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
/* Centered flex variant for short rows (keeps card width consistent with 4-col) */
.book-grid--center { display: flex; flex-wrap: wrap; justify-content: center; }
.book-grid--center .book-card { flex: 0 1 268px; }

.book-card {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.book-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--line); }
.book-cover {
  position: relative; padding: 26px 26px 0; background:
    linear-gradient(180deg, var(--surface-2), var(--surface));
  display: flex; justify-content: center;
}
.book-cover-inner {
  width: 100%; max-width: 210px; aspect-ratio: 2/3; border-radius: 3px 6px 6px 3px;
  overflow: hidden; box-shadow: 0 16px 34px rgba(12,35,64,.22), -4px 0 0 rgba(0,0,0,.06);
  transition: transform .4s var(--ease);
}
[data-theme="dark"] .book-cover-inner { box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.book-card:hover .book-cover-inner { transform: translateY(-4px) rotate(-0.6deg); }
.book-cover-inner img { width: 100%; height: 100%; object-fit: cover; }
.book-body { padding: 22px 26px 26px; display: flex; flex-direction: column; flex: 1; }
.book-cat { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); font-weight: 600; margin-bottom: 8px; }
.book-title { font-size: 1.28rem; margin-bottom: 10px; letter-spacing: -0.01em; }
.book-authors { font-size: 0.86rem; color: var(--ink-faint); margin-bottom: 12px; font-style: italic; }
.book-excerpt { font-size: 0.93rem; color: var(--ink-soft); margin-bottom: 20px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.book-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.book-price { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--ink); }
.book-price .avail { font-family: var(--font-body); font-size: 0.8rem; font-weight: 500; color: var(--ink-faint); letter-spacing: 0.02em; }
.book-actions { display: flex; gap: 8px; }
.link-more { font-size: 0.9rem; font-weight: 600; color: var(--red); display: inline-flex; align-items: center; gap: 6px; padding: 8px 4px; }
.link-more:hover { gap: 10px; }
.link-more svg { width: 15px; height: 15px; transition: transform .2s var(--ease); }

/* Expanded book card styles for inline full descriptions */
.book-card.expanded .book-excerpt {
  display: none;
}
.book-card .book-full {
  display: none;
}
.book-card.expanded .book-full {
  display: block;
  font-size: 0.93rem;
  color: var(--ink-soft);
  margin-bottom: 20px;
  line-height: 1.6;
}
.book-card .book-full p {
  margin-bottom: 12px;
}
.book-card .book-full p:last-child {
  margin-bottom: 0;
}

/* Layout modifications when a card is expanded */
.book-grid.has-expanded {
  grid-template-columns: 1fr !important;
  display: block !important;
}
.book-grid.has-expanded .book-card:not(.expanded) {
  display: none !important;
}

@media (min-width: 769px) {
  .book-card.expanded {
    display: grid !important;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: flex-start;
  }
  .book-card.expanded .book-cover {
    height: 100%;
    padding: 40px;
    border-right: 1px solid var(--line-soft);
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .book-card.expanded .book-body {
    padding: 40px;
  }
}

/* Compact academic cards */
.acad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 2.6vw, 32px); }
.acad-card { text-align: center; }
.acad-cover {
  aspect-ratio: 2/3; border-radius: 3px 6px 6px 3px; overflow: hidden; margin-bottom: 16px;
  box-shadow: 0 14px 30px rgba(12,35,64,.18), -3px 0 0 rgba(0,0,0,.05);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease); background: var(--surface-2);
}
[data-theme="dark"] .acad-cover { box-shadow: 0 14px 34px rgba(0,0,0,.55); }
.acad-card:hover .acad-cover { transform: translateY(-6px) rotate(-0.8deg); box-shadow: var(--shadow-md); }
.acad-cover img { width: 100%; height: 100%; object-fit: cover; }
.acad-title { font-size: 1.02rem; font-family: var(--font-display); font-weight: 700; line-height: 1.25; }
.acad-meta { font-size: 0.78rem; color: var(--ink-faint); margin-top: 4px; letter-spacing: 0.03em; }

/* ---------- Pull quote ---------- */
.quote-block { text-align: center; max-width: 900px; margin-inline: auto; }
.quote-mark { font-family: var(--font-display); font-size: 5rem; line-height: 0.6; color: var(--gold-soft); display: block; margin-bottom: 10px; }
.quote-text { font-family: var(--font-display); font-size: clamp(1.5rem, 3.4vw, 2.4rem); font-style: italic; line-height: 1.35; letter-spacing: -0.01em; }
.quote-cite { margin-top: 26px; font-size: 0.9rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-soft); }

/* ---------- About page bits ---------- */
.page-hero { padding: clamp(56px, 8vw, 110px) 0 clamp(30px, 4vw, 48px); position: relative; }
.page-hero .eyebrow { color: var(--red); }
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); letter-spacing: -0.02em; }
.page-hero .page-lead { margin-top: 22px; max-width: 60ch; font-size: 1.15rem; color: var(--ink-soft); }

.about-hero-grid { display: grid; grid-template-columns: 1fr 0.75fr; gap: clamp(34px, 5vw, 70px); align-items: center; }
.about-portrait-stack { position: relative; }
.about-portrait-main { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.about-portrait-main img { width: 100%; aspect-ratio: 1/1; object-fit: cover; object-position: top; }
.about-portrait-tag {
  position: absolute; right: -16px; bottom: -16px; background: var(--red); color: #fff;
  padding: 14px 20px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  font-family: var(--font-display); font-style: italic; font-size: 1.05rem; max-width: 180px; line-height: 1.3;
}

.bio-section { display: grid; grid-template-columns: 240px 1fr; gap: clamp(28px, 4vw, 60px); align-items: start; }
.bio-section + .bio-section { margin-top: clamp(46px, 6vw, 80px); padding-top: clamp(46px, 6vw, 80px); border-top: 1px solid var(--line); }
.bio-marker .num { font-family: var(--font-display); font-size: 2rem; color: var(--red); font-weight: 700; }
.bio-marker h3 { font-size: 1.5rem; margin-top: 6px; }
.bio-marker .ribbon { margin-top: 16px; }

.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-left: 44px; padding-bottom: 30px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: 4px; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--red);
}
.tl-place { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.tl-detail { color: var(--ink-soft); font-size: 0.96rem; margin-top: 3px; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gallery figure { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.gallery figure.wide { grid-column: 1 / -1; }
.gallery figure.break { grid-column-start: 1; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .5s var(--ease); }
.gallery figure.wide img { aspect-ratio: 21/9; }
@media (max-width: 860px) {
  .gallery figure.wide img { aspect-ratio: 16/9; }
}
.gallery figure:hover img { transform: scale(1.05); }
.gallery figcaption { padding: 12px 16px; font-size: 0.84rem; color: var(--ink-faint); background: var(--surface); }

.creds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.cred {
  display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
}
.cred .ico { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.section--ink .cred { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); }
.section--ink .cred .ico { background: rgba(255,255,255,.09); color: var(--gold-soft); }
.cred .ico svg { width: 20px; height: 20px; }
.cred h4 { font-size: 1.02rem; margin-bottom: 3px; }
.cred p { font-size: 0.9rem; color: var(--ink-soft); }
.section--ink .cred p { color: var(--on-dark-soft); }
.section--ink .cred h4 { color: var(--on-dark); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(36px, 5vw, 70px); align-items: start; }
.contact-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: clamp(26px, 3.5vw, 40px); box-shadow: var(--shadow-sm); }
.contact-info-item { display: flex; gap: 16px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.contact-info-item:last-child { border-bottom: none; padding-bottom: 0; }
.contact-info-item:first-child { padding-top: 0; }
.contact-info-item .ico { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--navy) 8%, transparent); color: var(--navy); }
[data-theme="dark"] .contact-info-item .ico { background: rgba(110,160,224,.14); color: var(--accent-blue); }
.contact-info-item .ico svg { width: 21px; height: 21px; }
.contact-info-item h4 { font-size: 1.05rem; margin-bottom: 3px; }
.contact-info-item p, .contact-info-item a { font-size: 0.95rem; color: var(--ink-soft); }
.contact-info-item a:hover { color: var(--red); }

.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 8px; letter-spacing: 0.02em; }
.field input, .field textarea, .field select {
  width: 100%; padding: 14px 16px; font: inherit; font-size: 0.98rem; color: var(--ink);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 16%, transparent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-note { font-size: 0.84rem; color: var(--ink-faint); margin-top: 14px; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); max-width: 18ch; margin-inline: auto; }
.cta-band p { margin: 20px auto 34px; max-width: 52ch; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--hero-panel); color: var(--on-dark); padding: clamp(56px, 7vw, 84px) 0 34px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 44px; padding-bottom: 44px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer-brand .brand-mark { background: rgba(255,255,255,.06); }
.footer-about { color: var(--on-dark-soft); font-size: 0.95rem; margin-top: 20px; max-width: 42ch; }
.footer-col h4 { color: var(--on-dark); font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 18px; font-family: var(--font-body); font-weight: 600; }
.footer-col a { display: block; color: var(--on-dark-soft); padding: 6px 0; font-size: 0.95rem; transition: color .2s var(--ease), padding-left .2s var(--ease); }
.footer-col a:hover { color: var(--gold-soft); padding-left: 6px; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 28px; flex-wrap: wrap; }
.footer-bottom p { color: var(--on-dark-soft); font-size: 0.86rem; }
.footer-bottom a { color: var(--gold-soft); font-weight: 500; }
.footer-bottom a:hover { text-decoration: underline; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(6, 15, 30, 0.6);
  backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity .3s var(--ease);
}
.modal-overlay.open { display: flex; opacity: 1; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); max-width: 720px; width: 100%;
  max-height: 88vh; overflow: hidden; box-shadow: var(--shadow-lg); transform: translateY(16px) scale(.98);
  transition: transform .35s var(--ease); display: flex; flex-direction: column;
}
.modal-overlay.open .modal { transform: none; }
.modal-head { display: flex; gap: 24px; padding: 30px 32px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-cover { width: 96px; flex: none; aspect-ratio: 2/3; border-radius: 3px; overflow: hidden; box-shadow: var(--shadow-sm); }
.modal-cover img { width: 100%; height: 100%; object-fit: cover; }
.modal-head-text { flex: 1; }
.modal-cat { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); font-weight: 600; }
.modal-title { font-size: 1.7rem; margin: 8px 0; line-height: 1.15; }
.modal-price { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.modal-body { padding: 24px 32px; overflow-y: auto; }
.modal-body p { color: var(--ink-soft); margin-bottom: 16px; font-size: 0.97rem; }
.modal-foot { padding: 20px 32px 30px; border-top: 1px solid var(--line-soft); display: flex; gap: 12px; flex-wrap: wrap; }
.modal-close-icon {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow-sm); z-index: 2;
  border: none; cursor: pointer; color: var(--ink); transition: color 0.2s, background-color 0.2s;
}
.modal-close-icon:hover { color: var(--red); }
.modal-close-icon svg { width: 20px; height: 20px; }
.modal { position: relative; }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 90; background: var(--bg);
  transform: translateX(100%); transition: transform .4s var(--ease); padding: 32px 24px;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu a { font-family: var(--font-display); font-size: 1.6rem; padding: 14px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.mobile-menu a.active { color: var(--red); }
.mobile-menu .btn { margin-top: 24px; justify-content: center; }

@media (min-width: 861px) {
  .mobile-menu {
    display: none !important;
  }
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .06s; }
.reveal.d2 { transition-delay: .12s; }
.reveal.d3 { transition-delay: .18s; }
.reveal.d4 { transition-delay: .24s; }

/* ---------- Interactive Footer Link ---------- */
.interactive-footer-link {
  position: relative;
  color: var(--gold-soft) !important;
  font-weight: 500;
  text-decoration: none !important;
  display: inline-block;
  transition: color 0.3s var(--ease), text-shadow 0.3s var(--ease);
}
.interactive-footer-link::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: var(--red-bright);
  transform-origin: bottom right;
  transition: transform 0.3s var(--ease);
}
.interactive-footer-link:hover {
  color: #ffffff !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}
.interactive-footer-link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* ---------- Custom Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes floatMonogram {
  0%, 100% {
    transform: translateY(-50%) scale(1);
  }
  50% {
    transform: translateY(-52%) scale(1.02);
  }
}

/* Header Slide-in Animation */
.site-header {
  animation: slideDown 0.8s var(--ease) both;
}

/* Homepage Hero animations */
.hero-eyebrow {
  animation: fadeInLeft 0.8s var(--ease) both;
  animation-delay: 0.1s;
}
.hero h1 {
  animation: fadeInUp 0.8s var(--ease) both;
  animation-delay: 0.2s;
}
.hero-tag {
  animation: fadeInUp 0.8s var(--ease) both;
  animation-delay: 0.3s;
}
.hero-desc {
  animation: fadeInUp 0.8s var(--ease) both;
  animation-delay: 0.4s;
}
.hero-cta {
  animation: fadeInUp 0.8s var(--ease) both;
  animation-delay: 0.5s;
}
.hero-portrait {
  animation: fadeInRight 1s var(--ease) both;
  animation-delay: 0.2s;
}
.hero-frame {
  animation: scaleIn 1.2s var(--ease) both;
  animation-delay: 0.4s;
}
.hero-badge {
  animation: bounceIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 0.7s;
}
.hero-bg-monogram {
  animation: scaleIn 1.5s var(--ease) both, floatMonogram 8s ease-in-out infinite;
  animation-delay: 0s, 1.5s;
}

/* Page Hero Scroll-bypass Animations */
.page-hero .reveal {
  animation: fadeInUp 0.8s var(--ease) both;
}
.page-hero .reveal.d1 {
  animation: fadeInUp 0.8s var(--ease) both;
  animation-delay: 0.15s;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .book-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .acad-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
  .hero { padding-top: clamp(48px, 8vw, 80px); padding-bottom: clamp(48px, 8vw, 80px); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { max-width: 380px; margin-inline: auto; order: -1; }
  .hero-tag, .hero-desc { max-width: 100%; }
  .hero-frame { inset: -10px -10px auto auto; }
  .hero-badge { left: -10px; bottom: 24px; }
  .hero-bg-monogram { display: none; }
  .split, .about-hero-grid, .contact-grid { grid-template-columns: 1fr; }
  .split.reverse .split-media { order: -1; }
  .bio-section { grid-template-columns: 1fr; gap: 20px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 30px 20px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .about-portrait-stack { max-width: 420px; margin-inline: auto; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero h1 { font-size: clamp(2rem, 8.5vw, 2.8rem); line-height: 1.15; }
  .hero-figure { max-width: 290px; }
  .hero-frame { inset: -8px -8px auto auto; }
  .hero-badge {
    left: 10px;
    bottom: 16px;
    padding: 10px 14px;
    max-width: 165px;
  }
  .hero-badge .num { font-size: 1.45rem; }
  .hero-badge .lbl { font-size: 0.68rem; margin-top: 2px; line-height: 1.25; }
  .hero-cta { flex-direction: column; gap: 12px; width: 100%; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .book-grid.cols-2, .book-grid.cols-3, .book-grid.cols-4 { grid-template-columns: 1fr; }
  .acad-grid { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .creds { grid-template-columns: 1fr; }
  .series-label { flex-wrap: wrap; gap: 10px; }
  .series-label .rule { display: none; }
  .modal-head { flex-direction: column; }
  .modal-cover { width: 78px; }
  .footer-top { grid-template-columns: 1fr; }
  .brand-role { display: none; }
  .about-portrait-tag { right: 10px; bottom: -10px; padding: 10px 16px; font-size: 0.95rem; max-width: 150px; }
  .page-hero h1 { font-size: clamp(2rem, 7vw, 3rem); }
}

/* ---------- Accessibility ---------- */
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--red); color: #fff; padding: 10px 18px; border-radius: 4px; z-index: 300; }
.skip-link:focus { left: 8px; }
