/* ==========================================================================
   Dr. Byju H. - personal site
   Design tokens & layout. Visual design preserved 1:1 from the original;
   only additive, non-breaking enhancements (mobile nav, motion, a11y) added.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --ink: #16201b;
  --muted: #717a70;
  --green: #1b4332;
  --green-2: #2d6a4f;
  --line: #ecebe5;
  --line-2: #e3e6df;
  --wash: #f7f6f1;
  --maxw: 780px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Type scale - one consistent set of sizes */
  --fs-caption: 12px;   /* eyebrows, labels, captions */
  --fs-sm: 13.5px;      /* small UI, meta, links */
  --fs-md: 15px;        /* secondary body */
  --fs-base: 17px;      /* body */
  --fs-lead: 19px;      /* lede / intro */
  --fs-title: 22px;     /* card & book titles */
  --fs-h2: 28px;        /* section headings */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Instrument Sans", -apple-system, system-ui, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
  font-synthesis: none;
}

::selection { background: var(--green); color: #fff; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
img { max-width: 100%; display: block; }

/* Accessible focus ring for keyboard users only */
:focus-visible {
  outline: 2px solid var(--green-2);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */
header.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: transform 0.35s var(--ease), opacity 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
/* Subtle separator appears once the page is scrolled */
header.nav.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 20px rgba(22, 32, 27, 0.04);
}
/* Hidden over the home hero; slides in after the first fold */
header.nav.nav-hidden { transform: translateY(-100%); opacity: 0; pointer-events: none; }

.nav-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: "Instrument Serif";
  font-weight: 500;
  font-size: var(--fs-base);
  color: var(--green);
  letter-spacing: -0.01em;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: inherit;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.brandmark { width: 27px; height: 27px; flex: 0 0 auto; border-radius: 7px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

nav.links { display: flex; align-items: center; gap: 23px; font-size: var(--fs-sm); color: var(--muted); }
nav.links a { cursor: pointer; transition: color 0.18s var(--ease); position: relative; }
nav.links a:hover { color: var(--green); }
/* Active route indicator */
nav.links a.active { color: var(--green); }
nav.links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1.5px;
  background: var(--green);
  border-radius: 2px;
}

/* Primary CTA in nav */
.nav-cta {
  background: var(--green);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}
nav.links a.nav-cta:hover { background: #16382a; color: #fff; transform: translateY(-1px); }
.nav-cta.active { color: #fff; }
.nav-cta.active::after { display: none; }

/* Mobile menu toggle - hidden on desktop */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px;
  margin: -8px -8px -8px 0;
  color: var(--green);
}
.nav-toggle span {
  display: block;
  height: 1.6px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle span + span { margin-top: 5px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  nav.links {
    position: fixed;
    inset: 61px 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    font-size: var(--fs-base);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s var(--ease), opacity 0.28s var(--ease), visibility 0.28s var(--ease);
  }
  nav.links.open { transform: translateY(0); opacity: 1; visibility: visible; pointer-events: auto; }
  nav.links a { padding: 13px 32px; color: var(--ink); }
  nav.links a.active::after { display: none; }
  nav.links a.active { color: var(--green-2); }
  nav.links a.nav-cta { display: inline-block; margin: 10px 32px 6px; color: #fff; }
  nav.links a.nav-cta.active { color: #fff; }
}

/* --------------------------------------------------------------------------
   View routing
   -------------------------------------------------------------------------- */
.view { display: none; }
.view.on { display: block; animation: fade 0.5s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
/* Hero: name flanked by role labels, centered in the fold; slideshow band below */
.hero { min-height: calc(44vh + 68px); display: flex; align-items: center; padding: 36px 0; margin-top: -68px; }
.hero-row { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 40px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 30px; }
.hero-role { font-size: var(--fs-sm); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); font-weight: 500; }
.hero-role-l { text-align: left; }
.hero-role-r { text-align: right; }
.hero-row h1 { font-family: "Instrument Serif"; text-align: center; font-size: clamp(46px, 9vw, 116px); line-height: 0.95; white-space: nowrap; }

/* Slideshow band */
.hero-slideshow { position: relative; width: 100%; height: 50vh; min-height: 340px; max-height: 640px; background: #e4e4e0; overflow: hidden; }
.hero-slideshow .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s var(--ease); }
.hero-slideshow .slide.on { opacity: 1; }

/* Award - a feature section beneath About: photo + title + description + link */
.award-feature { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 36px; align-items: start; }
.award-photo { display: block; aspect-ratio: 3 / 2; border-radius: 6px; overflow: hidden; background: linear-gradient(135deg, #eff3ee, #dce7df); transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.award-photo:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(22, 32, 27, 0.10); }
.award-photo img { width: 100%; height: 100%; object-fit: cover; }
.award-body { align-self: stretch; display: flex; flex-direction: column; }
.award-body h2 { margin: 0; line-height: 1.15; font-size: var(--fs-title); }
.aw-title-link { color: var(--green); cursor: pointer; transition: color 0.2s var(--ease); }
.aw-title-link:hover { color: var(--green-2); }
.award-body .aw-k { font-size: var(--fs-sm); letter-spacing: 0; text-transform: none; color: var(--muted); font-weight: 400; margin-top: 6px; }
.aw-desc { font-size: var(--fs-base); line-height: 1.6; color: var(--ink); margin: auto 0 0; padding-top: 26px; max-width: 54ch; }

@media (max-width: 760px) {
  .hero { min-height: 40vh; align-items: center; padding: 0; margin-top: -72px; }
  .hero-row { grid-template-columns: 1fr; gap: 26px; text-align: center; }
  .hero-role { text-align: center; }
  .hero-row h1 { order: -1; white-space: normal; margin-bottom: 10px; }
  .hero-slideshow { height: 64vh; min-height: 360px; }
  .hero-slideshow .slide.focus-r { object-position: 68% center; }
  .award-feature { grid-template-columns: 1fr; gap: 20px; }
}
/* Global h1 (base for page headings; hero overrides to serif) */
h1 {
  font-family: "Fraunces";
  font-weight: 400;
  font-size: clamp(50px, 9.5vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--green);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
section { padding: 64px 0; border-top: 1px solid var(--line); }
/* ============================================================
   ONE eyebrow spec - used by every kicker across the site.
   (section labels, detail pages, book pages, cards, press feed)
   ============================================================ */
.label,
.detail .deyebrow,
.bp-eyebrow,
.card .ck,
.feed .ftext .o {
  font-size: var(--fs-caption);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green-2);
  font-weight: 500;
}
.label {
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.label .more {
  cursor: pointer;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 1px;
  transition: color 0.18s var(--ease);
}
.label .more:hover { color: var(--green); }
h2 {
  font-family: "Fraunces";
  font-weight: 500;
  font-size: var(--fs-h2);
  letter-spacing: -0.015em;
  color: var(--green);
  margin-bottom: 8px;
}
.lede { font-size: var(--fs-base); line-height: 1.6; color: var(--ink); max-width: 62ch; }
.lede a { color: var(--green); font-weight: 600; border-bottom: 1px solid var(--line-2); padding-bottom: 1px; transition: border-color 0.2s var(--ease); }
.lede a:hover { border-color: var(--green); }
.lede + .lede { margin-top: 14px; }

/* Firsts cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card {
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  background: #fff;
  position: relative;
  padding: 0;
  overflow: hidden;
  /* button reset */
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  display: block;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(22, 32, 27, 0.06); }
.card .cn { font-family: "Fraunces"; font-weight: 500; font-size: var(--fs-title); letter-spacing: -0.02em; color: var(--green); line-height: 1.15; margin-top: 20px; }
.card .cs { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.card .cs .dot { padding: 0 0.5em; color: var(--muted); }
.ph.cardimg { aspect-ratio: 16 / 10; border-radius: 0; }
.cardbody { padding: 18px 20px 20px; }

/* Detail (first) page */
.detail .deyebrow { position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0; background: none; border: none; padding: 4px 0; cursor: pointer; font-family: inherit; transition: color 0.2s var(--ease); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* Invisible hit-zone enlarges the tap target without shifting the button or its neighbours. */
.detail .deyebrow::before { content: ""; position: absolute; top: -14px; left: -16px; right: -24px; bottom: -14px; }
.detail .deyebrow:hover { color: var(--green); }
.detail .deyebrow .chev { flex: 0 0 auto; width: 5px; height: 8px; }
.detail h1.dt { font-family: "Fraunces"; font-weight: 400; font-size: clamp(34px, 6vw, 58px); color: var(--green); line-height: 1.04; letter-spacing: -0.02em; margin-top: 10px; }
.detail .dmeta { font-size: var(--fs-sm); color: var(--muted); margin-top: 6px; }
.detail .dbody { font-size: var(--fs-base); line-height: 1.6; color: var(--ink); max-width: 62ch; margin-top: 34px; }
.detail .dbody p { color: var(--ink); }
.detail .dbody p + p { margin-top: 14px; }
.srch { margin-top: 38px; }
.srch .label { margin-bottom: 16px; }
.src a { display: flex; gap: 16px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); transition: padding-left 0.2s var(--ease); }
.src a:last-child { border-bottom: none; }
.src a:hover { padding-left: 6px; }
.src .st { display: none; }
.src .sd { display: flex; flex-direction: column; gap: 3px; }
.src .sd .s-t { font-size: var(--fs-base); color: var(--ink); line-height: 1.4; }
.src .sd .s-t em { font-style: italic; color: inherit; }
.src .sd .s-pub { font-size: var(--fs-sm); color: var(--muted); }

/* Simple rows */
.rows .row { display: flex; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.rows .row:last-child { border-bottom: none; }
.rows .k { font-family: "Fraunces"; color: var(--green-2); font-size: var(--fs-sm); flex: 0 0 78px; padding-top: 3px; }
.rows .v { font-size: var(--fs-base); color: var(--ink); line-height: 1.5; }
.rows .v b { font-weight: 500; color: var(--green); }

.blist { list-style: none; }
.blist li { padding: 14px 0 14px 22px; border-bottom: 1px solid var(--line); font-size: var(--fs-base); color: var(--ink); line-height: 1.5; position: relative; }
.blist li:last-child { border-bottom: none; }
.blist li::before { content: ""; position: absolute; left: 2px; top: 23px; width: 6px; height: 6px; border-radius: 50%; background: var(--green-2); }
.blist li b { font-weight: 500; color: var(--green); }

/* Books - compact card: cover | text | CTA, one separator per book entry */
.book-item { padding: 30px 0; border-bottom: 1px solid var(--line); }
.label + .book-item { padding-top: 0; }
.book-item:last-child { border-bottom: none; }
.book { display: grid; grid-template-columns: 120px 1fr auto; gap: 30px; align-items: start; }
.book .cov { display: block; width: 120px; aspect-ratio: 2 / 3; border-radius: 3px; overflow: hidden; background: #f3f3ee; box-shadow: 0 2px 12px rgba(22, 32, 27, 0.07); transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.book .cov:hover { transform: translateY(-2px); box-shadow: 0 5px 16px rgba(22, 32, 27, 0.10); }
.book .cov img { width: 100%; height: 100%; object-fit: cover; }
.book .main { min-width: 0; align-self: stretch; display: flex; flex-direction: column; }
.book .bt { font-family: "Fraunces"; font-weight: 500; font-size: var(--fs-title); line-height: 1.2; letter-spacing: -0.02em; color: var(--green); }
.book .bt a { transition: color 0.2s var(--ease); }
.book .bt a:hover { color: var(--green-2); }
.book .bm { font-size: var(--fs-sm); color: var(--muted); margin-top: 7px; }
.book .bd { font-size: var(--fs-base); color: var(--ink); margin-top: auto; padding-top: 22px; line-height: 1.6; max-width: 54ch; }
.bcta { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-top: 4px; }
/* Dissertation note - full-width strip below the row */
.bstrip { background: var(--wash); border-radius: 6px; padding: 13px 20px; font-size: var(--fs-sm); color: var(--muted); margin: 22px 0 0; }
@media (max-width: 680px) {
  .book { grid-template-columns: 1fr; gap: 16px; }
  .book .cov { width: 150px; justify-self: center; margin: 16px 0 24px; }
  .book .bd { margin-top: 0; padding-top: 14px; max-width: none; }
  .book .bcta { grid-column: 1 / -1; flex-direction: row; margin-top: 4px; }
  .book .bcta .btn { width: 100%; text-align: center; padding: 12px 19px; }
}

.ctarow { margin-top: 16px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.btn { display: inline-block; background: var(--green); color: #fff; padding: 9px 19px; border-radius: 4px; font-size: var(--fs-sm); font-weight: 500; transition: background 0.2s var(--ease), transform 0.15s var(--ease); }
.btn:hover { background: #16382a; transform: translateY(-1px); }
.btn-2 { font-size: var(--fs-sm); color: var(--green); border-bottom: 1px solid transparent; padding-bottom: 2px; transition: border-color 0.2s var(--ease); }
.btn-2:hover { border-color: var(--green); }
.ytcard { display: block; }
.ytcard .ph { aspect-ratio: 16 / 9; }
.medlabel { font-size: var(--fs-caption); color: var(--green-2); margin-top: 8px; }
.revcard { background: var(--wash); border-radius: 4px; padding: 16px; min-height: 112px; display: flex; flex-direction: column; justify-content: center; }
.revcard .rq { font-family: "Fraunces"; font-size: var(--fs-md); color: var(--green); line-height: 1.5; }
.revcard .ra { font-size: var(--fs-caption); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }

/* Teaser pubs */
.tpub { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); transition: padding-left 0.2s var(--ease); }
.tpub:first-child { padding-top: 0; }
.tpub:hover { padding-left: 6px; }
.tpub .t { font-size: var(--fs-base); color: var(--ink); line-height: 1.4; }
.tpub .m { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.tpub .m .c { color: var(--green-2); }

/* Feed */
.feed a { display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); transition: padding-left 0.2s var(--ease); }
.feed a:first-child { padding-top: 0; }
.feed a:last-child { border-bottom: none; }
.feed a:hover { padding-left: 6px; }
.feed .thumb { aspect-ratio: 4 / 3; }
/* Real article image covering the placeholder; caption hides when it loads */
.thumbimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.ph:has(.thumbimg)::after { display: none; }
.feed .ftext { min-width: 0; }
.feed .ftext .t { font-size: var(--fs-base); color: var(--ink); line-height: 1.4; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .ftext .d { font-size: var(--fs-caption); color: var(--muted); margin-top: 5px; }

/* Research full */
.ptop { display: flex; flex-wrap: wrap; gap: 18px; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 20px; }
.filt { font-size: var(--fs-sm); color: var(--muted); background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; border-bottom: 1px solid transparent; transition: color 0.18s var(--ease), border-color 0.18s var(--ease); }
.filt:hover { color: var(--ink); }
.filt.on { color: var(--green); border-color: var(--green); }
.filt .fc { display: none; }
.pcount { display: none; }
/* Mobile: one line, bold selected name, count as a green circle beside it */
@media (max-width: 600px) {
  .filters { flex-wrap: nowrap; gap: 15px; justify-content: space-between; width: 100%; }
  .filt { font-size: var(--fs-sm); white-space: nowrap; }
  .filt.on { font-weight: 600; border-color: transparent; }
  .filt.on .fc { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; margin-left: 4px; border-radius: 50%; background: var(--green); color: #fff; font-size: 10px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; vertical-align: middle; }
}
#search { width: 100%; font-family: inherit; font-size: var(--fs-md); padding: 11px 0; border: none; border-bottom: 1px solid var(--line-2); background: none; color: var(--ink); margin: 14px 0 6px; }
#search::placeholder { color: #b3b8b0; }
#search:focus { outline: none; border-color: var(--green); }
.pcount { font-size: var(--fs-sm); color: var(--muted); }
.ygroup { margin-top: 34px; }
.ygroup .yh { font-family: "Instrument Sans"; font-weight: 500; font-size: var(--fs-caption); letter-spacing: 0.12em; color: var(--green-2); margin-bottom: 10px; }
.pub { padding: 15px 0; border-bottom: 1px solid var(--line); }
/* No stroke on the final item of any list */
.ygroup:last-child .pub:last-child { border-bottom: none; }
.tpub:last-child { border-bottom: none; }
.pub .t { font-size: var(--fs-base); line-height: 1.45; color: var(--ink); }
.pub .t a { background: linear-gradient(var(--green), var(--green)) no-repeat left 1.15em / 0 1px; transition: background-size 0.25s var(--ease), color 0.2s var(--ease); padding-bottom: 1px; }
.pub .t a:hover { background-size: 100% 1px; color: var(--green); }
.pub .m { font-size: var(--fs-sm); color: var(--muted); margin-top: 5px; }
.pub .m .c { color: var(--green-2); }

/* Page head */
.pagehead { padding: 40px 0 8px; }
.pagehead h1 { font-family: "Fraunces"; font-weight: 400; font-size: clamp(34px, 6vw, 58px); color: var(--green); line-height: 1.04; letter-spacing: -0.02em; }
.pagehead p { font-size: var(--fs-base); color: var(--muted); margin-top: 8px; max-width: 56ch; }

.clinks { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: var(--fs-md); }
.clinks a { color: var(--green); border-bottom: 1px solid var(--line-2); padding-bottom: 2px; }
.clinks a:hover { border-color: var(--green); }

footer { background: var(--green); color: #eaf2ec; padding: 66px 0 58px; margin-top: 56px; }
.foot-eyebrow { font-size: var(--fs-caption); letter-spacing: 0.2em; text-transform: uppercase; color: #9fc4ad; font-weight: 500; margin-bottom: 16px; }
.foot-head { font-family: "Instrument Serif"; font-weight: 400; font-size: clamp(40px, 7vw, 72px); line-height: 1; color: #fff; letter-spacing: -0.01em; margin: 0; }
.foot-sub { font-size: var(--fs-lead); line-height: 1.5; color: #d3e3d8; margin-top: 18px; max-width: 42ch; }
.foot-divider { height: 1px; background: rgba(255,255,255,0.14); margin: 32px 0 26px; }
.footlinks { display: flex; flex-wrap: wrap; gap: 14px 26px; }
.footlinks a { display: inline-flex; align-items: center; gap: 9px; color: #eaf2ec; font-size: var(--fs-md); transition: color 0.2s var(--ease); }
.footlinks a:hover { color: #fff; }
.fi { width: 20px; height: 20px; flex: 0 0 auto; }
.footlinks .fi { color: #eaf2ec; opacity: 0.9; }
.footlinks a:hover .fi { opacity: 1; }
footer ::selection { background: #fff; color: var(--green); }

/* --------------------------------------------------------------------------
   Visual placeholders (SVG bird washes)
   -------------------------------------------------------------------------- */
.ph {
  position: relative;
  background: linear-gradient(135deg, #eff3ee, #dce7df);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}
.ph .phbird { width: 38%; opacity: 0.15; }
.ph .phicon { width: 30%; opacity: 0.32; color: var(--green-2); }
.ph::after {
  content: attr(data-cap);
  position: absolute;
  left: 11px;
  bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-2);
  opacity: 0.85;
}
.ph .play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.ytcard:hover .ph .play,
.feed a:hover .ph .play { transform: translate(-50%, -50%) scale(1.08); }
.ph .play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 53%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #1b4332;
}

/* Detail hero image */
.dhero { aspect-ratio: 3 / 2; margin: 34px 0 0; border-radius: 6px; }

/* YouTube embed */
.ytwrap { position: relative; aspect-ratio: 16 / 9; margin: 34px 0 4px; border-radius: 6px; overflow: hidden; background: #000; }
.ytwrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* --------------------------------------------------------------------------
   Scroll-reveal (progressive enhancement; content visible without JS)
   -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Book detail pages (standalone, crawlable - /books/<slug>/)
   -------------------------------------------------------------------------- */
.bp-hero { display: grid; grid-template-columns: 224px 1fr; gap: 46px; padding: 38px 0 54px; align-items: start; }
.bp-cover { border-radius: 4px; overflow: hidden; box-shadow: 0 16px 44px rgba(22, 32, 27, 0.18); background: #f3f3ee; aspect-ratio: 2 / 3; }
.bp-cover img { width: 100%; height: 100%; object-fit: cover; }
.bp-info { align-self: stretch; display: flex; flex-direction: column; }
.bookpage h1 { font-weight: 400; font-size: clamp(34px, 6vw, 58px); line-height: 1.04; letter-spacing: -0.02em; color: var(--green); margin-top: -6px; }
.bp-meta { font-size: var(--fs-sm); color: var(--muted); margin-top: 16px; display: flex; flex-direction: column; gap: 4px; }
/* "Book" eyebrow doubles as a back link to the home Books section */
.bp-back { display: inline-flex; align-self: flex-start; align-items: center; gap: 10px; margin: 30px 0 22px; text-decoration: none; cursor: pointer; position: relative; transition: color 0.2s var(--ease); }
.bp-back:hover { color: var(--green); }
.bp-back .chev { flex: 0 0 auto; width: 5px; height: 8px; }
.bp-back::before { content: ""; position: absolute; top: -14px; left: -16px; right: -16px; bottom: -14px; }
.bp-blurb { font-size: var(--fs-base); line-height: 1.6; color: var(--ink); margin-top: 26px; max-width: 54ch; }
.bp-buy { margin-top: 28px; display: flex; gap: 16px 20px; align-items: center; flex-wrap: wrap; }
.bookpage section { padding: 44px 0; border-top: 1px solid var(--line); }
.bookpage section h2 { font-family: "Instrument Sans"; font-weight: 500; font-size: var(--fs-caption); letter-spacing: 0.2em; text-transform: uppercase; color: var(--green-2); margin-bottom: 22px; }
.bp-body { font-size: var(--fs-base); line-height: 1.6; color: var(--ink); max-width: 64ch; }
.bp-body p + p { margin-top: 15px; }
.bp-body a, .faq details > div a { color: var(--green); border-bottom: 1px solid var(--line-2); padding-bottom: 1px; transition: border-color 0.2s var(--ease); }
.bp-body a:hover, .faq details > div a:hover { border-color: var(--green); }
.bp-body h3 { font-family: "Fraunces"; font-weight: 600; font-size: var(--fs-lead); color: var(--green); margin: 24px 0 8px; }
.bp-quote { font-size: var(--fs-lead); line-height: 1.55; color: var(--green); max-width: 60ch; border-left: 2px solid var(--line-2); padding-left: 22px; }
.bp-quote + .bp-quote { margin-top: 24px; }
.bp-quote cite { display: block; font-style: normal; font-size: var(--fs-caption); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:first-of-type { border-top: none; }
.faq summary { font-size: var(--fs-base); font-weight: 500; color: var(--green); padding: 16px 0; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--green-2); font-size: 22px; line-height: 1; font-weight: 400; }
.faq details[open] summary::after { content: "\2013"; }
.faq details > div { font-size: var(--fs-base); line-height: 1.6; color: var(--ink); max-width: 62ch; padding-bottom: 18px; }
.related-book { display: inline-flex; align-items: flex-end; gap: 18px; }
.related-book img { width: 56px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 6px 18px rgba(22, 32, 27, 0.14); flex: 0 0 auto; }
.related-book .rb-text { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-md); color: var(--green); transition: color 0.2s var(--ease); }
.related-book .rb-label { font-size: var(--fs-caption); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.related-book:hover .rb-text { color: var(--green-2); }
@media (max-width: 680px) { .bp-hero { grid-template-columns: 150px 1fr; gap: 26px; } }
@media (max-width: 520px) {
  .bp-hero { grid-template-columns: 1fr; }
  .bp-cover { max-width: 190px; justify-self: center; margin: 6px 0 20px; }
  .bp-buy { margin-top: 38px; }
  .bp-buy .btn { width: 100%; text-align: center; }
}
