/* "Luz" design (approved Demo 1): cream and terracotta, Fraunces headings, Inter body. */
@font-face { font-family: Fraunces; src: url("fonts/fraunces.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Fraunces; src: url("fonts/fraunces-ext.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Fraunces; src: url("fonts/fraunces-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Fraunces; src: url("fonts/fraunces-italic-ext.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; src: url("fonts/inter-ext.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --bg: #fbf6ec; --ink: #2a2118; --muted: #5c4b3a; --accent: #8c3b1f; --sand: #e9b48f;
  --band: #f2e8d6; --line: #e5d8c2; --navy: #0c1428; --sky: #93cddd; --surface: #ffffff;
  --verse: #4a3b2c; --pillar-0: #f2d9c6; --pillar-1: #dde7d8; --pillar-2: #e4dcef;
  --inverse-bg: #2a2118; --inverse-fg: #fbf6ec; --footer-note: #d2c3ae;
  --tint-green: #dde7d8; --tint-green-ink: #3c4a38; --tint-clay: #f2d9c6; --tint-clay-ink: #6a3a22;
  --tag-free-bg: #dde7d8; --tag-free-ink: #2a3a26;
  --on-sand: #2a2118; --on-accent: #ffffff; --accent-fill: #8c3b1f;
  --serif: Fraunces, Georgia, serif; --sans: Inter, system-ui, sans-serif;
}
/* Dark theme: the device setting, unless the reader chose light; or the reader's own choice
   (theme.js sets data-theme). The two blocks must stay identical (tests/test_theme.py). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17130e; --ink: #f1e8d9; --muted: #cdbfa9; --accent: #e8a07c; --verse: #d9cbb4;
    --band: #221b14; --line: #3a3025; --surface: #211a13;
    --pillar-0: #3a2a20; --pillar-1: #25302a; --pillar-2: #2d2a3a; --inverse-bg: #2b2219;
    --tint-green: #25302a; --tint-green-ink: #cfe0c9; --tint-clay: #3a2a20; --tint-clay-ink: #f0c9ad;
    --tag-free-bg: #25302a; --tag-free-ink: #cfe0c9;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17130e; --ink: #f1e8d9; --muted: #cdbfa9; --accent: #e8a07c; --verse: #d9cbb4;
  --band: #221b14; --line: #3a3025; --surface: #211a13;
  --pillar-0: #3a2a20; --pillar-1: #25302a; --pillar-2: #2d2a3a; --inverse-bg: #2b2219;
  --tint-green: #25302a; --tint-green-ink: #cfe0c9; --tint-clay: #3a2a20; --tint-clay-ink: #f0c9ad;
  --tag-free-bg: #25302a; --tag-free-ink: #cfe0c9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Dates are filled by calendar.js; without it the empty slots (and their separator) vanish. */
.study-date:empty, .study-weekday:empty, .date-part:has(time:empty) { display: none; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; margin: 0; }
h2 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 8px; }
p { margin: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding-top: 56px; padding-bottom: 24px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.lead { margin-bottom: 32px; }
.eyebrow { font-size: 15px; font-weight: 600; color: var(--accent); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* Header: in flow on study pages (.header-solid), overlaid on the dark hero on home. */
.header-solid { background: var(--bg); }
.site-header { position: relative; z-index: 5; }
.header-hero { position: absolute; left: 0; right: 0; top: 0; color: #fff; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 20px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-weight: 700; font-size: 24px; flex-grow: 1; }
.brand-logo { border-radius: 10px; flex: none; }
.header-hero .brand-logo { box-shadow: 0 0 0 2px rgba(251, 246, 236, 0.75); }
.main-nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-weight: 500; font-size: 16px; }

.lang-menu { position: relative; font-size: 15px; font-weight: 600; }
.lang-menu summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; cursor: pointer; list-style: none; border: 1px solid rgba(127, 127, 127, .55); border-radius: 8px; transition: border-color .15s ease; }
.lang-menu summary:hover { border-color: currentColor; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: ""; width: 7px; height: 7px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s ease; }
.lang-menu[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.lang-list { position: absolute; right: 0; top: 100%; z-index: 20; margin: 4px 0 0; padding: 6px; list-style: none; min-width: 170px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 24px rgba(42, 33, 24, .18); }
.lang-list a, .lang-list [aria-current] { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: inherit; text-decoration: none; }
.lang-list a:hover { background: var(--band); }
.lang-list [aria-current] { font-weight: 700; background: var(--band); color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .lang-list { animation: menu-in .15s ease; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
.flag { flex: none; width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); }
.pill { display: inline-block; padding: 12px 26px; border-radius: 999px; font-weight: 600; font-size: 16px; }
.pill-accent { background: var(--accent-fill); color: var(--on-accent); padding: 10px 22px; }
.pill-dark { background: var(--ink); color: var(--bg); }
.pill-sand { background: var(--sand); color: var(--on-sand); }
.pill-outline { border: 2px solid var(--ink); padding: 10px 24px; }
.pill-outline-light { border: 2px solid #fff; color: #fff; padding: 10px 24px; }

.hero { position: relative; min-height: 720px; background: radial-gradient(ellipse at 50% 30%, #1d2c52, var(--navy) 70%); color: #fff; display: flex; align-items: center; justify-content: center; text-align: center; }
.hero { overflow: hidden; }
.hero-media { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 0; background: rgba(12, 20, 40, .62); }
.hero-inner { position: relative; z-index: 1; max-width: 760px; padding: 140px 24px 96px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hero h1 { font-size: clamp(36px, 7vw, 64px); }
.hero-sub { font-size: 20px; color: #ede7db; max-width: 560px; }
.badge { background: var(--sky); color: #1b1b1b; font-size: 13px; font-weight: 600; padding: 4px 14px; border-radius: 999px; }
.play { display: inline-block; margin-top: 8px; }

.today { padding-top: 64px; padding-bottom: 32px; }
.today-text { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.featured-study { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
a.featured-study { display: inline-block; }
.featured-soon { display: none; }
/* Past the last study (set by calendar.js): say so instead of repeating the final study. */
body[data-calendar="finished"] .featured-study { display: none; }
body[data-calendar="finished"] .featured-soon { display: block; font: 700 clamp(26px, 4vw, 38px)/1.2 var(--serif); max-width: 720px; }
.display { font-size: clamp(32px, 5vw, 60px); line-height: 1.08; }
.verse { font-family: var(--serif); font-size: 22px; line-height: 1.5; max-width: 720px; color: var(--verse); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.grid { display: grid; gap: 20px; }
.grid-products { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.grid-240 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-260 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-280 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { background: var(--pillar-0); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 10px; min-height: 190px; }
.card.pillar-1 { background: var(--pillar-1); }
.card.pillar-2 { background: var(--pillar-2); }
.card.pillar-3 { background: var(--inverse-bg); color: var(--inverse-fg); }
.card h3 { font-size: 26px; }
.card .cta { margin-top: auto; font-weight: 600; }
.series-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.series-card h3 { font-size: 24px; }
.spaced { margin-top: 28px; }
.book { border-radius: 20px; padding: 36px; font-family: var(--serif); font-size: 30px; font-weight: 700; }
.book span { display: block; font: 500 15px var(--sans); margin-top: 6px; }
.book-green { background: var(--tint-green); } .book-green span { color: var(--tint-green-ink); }
.book-clay { background: var(--tint-clay); } .book-clay span { color: var(--tint-clay-ink); }
.band { background: var(--band); padding: 64px 0; margin-top: 48px; }
.featured-resource { display: flex; flex-wrap: wrap; gap: 36px; align-items: center; background: var(--surface); border-radius: 20px; padding: 24px; margin-bottom: 24px; }
.featured-cover { flex: 0 1 320px; min-width: 0; max-width: 100%; height: auto; border-radius: 14px; display: block; }
.featured-text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.featured-text h3 { font-size: 32px; }
.product { background: var(--surface); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.cover-placeholder { background: var(--band); }
.featured-cover.cover-placeholder { width: 320px; aspect-ratio: 1; }
.product .cover { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.product-info { padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.product-info strong { font-size: 16px; }
.tag { font-size: 13px; font-weight: 600; padding: 2px 12px; border-radius: 999px; }
.tag-free { background: var(--tag-free-bg); color: var(--tag-free-ink); }
.tag-paid { background: var(--accent-fill); color: var(--on-accent); padding: 4px 16px; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.story { max-width: 880px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 72px; padding-bottom: 72px; }

.site-footer { background: var(--inverse-bg); color: var(--inverse-fg); padding: 56px 0 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.offline { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 72px; padding-bottom: 72px; }
.offline h1 { font-size: clamp(34px, 5vw, 52px); }
.support-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.yape summary { cursor: pointer; list-style: none; }
.yape summary::-webkit-details-marker { display: none; }
.yape[open] { background: var(--band); border: 1px solid var(--sand); border-radius: 16px; padding: 12px 20px 16px; }
.yape[open] summary { border: 0; padding-left: 0; }
.yape .yape-number { font: 700 28px/1.2 var(--serif); margin: 8px 0 4px; user-select: all; }
.yape-number:empty, .yape-holder:empty { display: none; }
.yape-copy { border: 0; cursor: pointer; margin-top: 12px; font-family: inherit; }
.yape .yape-holder { color: var(--muted); font-size: 15px; }
.copyright { width: 100%; font-size: 14px; color: var(--footer-note); }

/* Study page: reading layout (centered header, tinted verse and exegesis cards, gold ornaments). */
.study { max-width: 760px; padding-top: 24px; padding-bottom: 72px; }
.study-header { text-align: center; padding: 24px 0 8px; }
.study-kicker { font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 20px; }
.study-date { display: block; font: italic 600 22px/1.3 var(--serif); color: var(--accent); }
.study-weekday { display: block; font-size: 14px; color: var(--muted); text-transform: capitalize; }
.study h1 { font-size: clamp(32px, 6vw, 48px); margin: 16px 0 20px; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 8px; color: var(--accent); }
.ornament span { width: 72px; height: 1px; background: var(--sand); }
.ornament i { font-style: normal; font-size: 14px; }
.translation-pending { margin-top: 24px; padding: 14px 20px; background: var(--band); border-left: 4px solid var(--accent); border-radius: 8px; font-size: 16px; }
.verse-card { margin: 24px 0 36px; padding: 28px 32px; background: var(--band); border-radius: 16px; text-align: center; font: italic 400 clamp(20px, 3vw, 24px)/1.5 var(--serif); }
.verse-card footer { font: 600 14px var(--sans); font-style: normal; letter-spacing: .06em; color: var(--muted); margin-top: 12px; }
.study section { margin-bottom: 32px; }
.study h2 { font-size: 28px; margin-bottom: 12px; padding-top: 14px; position: relative; }
.study h2::before { content: ""; position: absolute; top: 0; left: 0; width: 36px; height: 2px; background: var(--sand); }
.study p { margin-bottom: 1em; }
.exegesis { background: var(--band); border-left: 4px solid var(--sand); border-radius: 0 16px 16px 0; padding: 28px 32px; }
.keyword { text-align: center; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.keyword-original { display: block; font: 700 clamp(30px, 9vw, 64px)/1.1 var(--serif); overflow-wrap: anywhere; }
.keyword-translit { display: block; font: italic 400 18px var(--serif); color: var(--accent); margin-top: 6px; }
.orig { font-weight: 700; border-bottom: 1px dotted var(--accent); }
.orig[lang="he"] { unicode-bidi: isolate; }
[lang="grc"], [lang="he"] { font-family: "Gentium Plus", "Noto Serif", "Times New Roman", var(--serif); }
[lang="he"] { font-family: "Noto Serif Hebrew", "SBL Hebrew", "Times New Roman", var(--serif); }
.steps { padding-left: 1.6em; display: grid; gap: 12px; }
.steps li::marker { color: var(--accent); font-weight: 700; font-family: var(--serif); }
.study .prayer { text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 28px 8px; margin-top: 40px; font: italic 400 20px/1.55 var(--serif); }
.study .prayer h2 { font: 600 13px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); padding-top: 0; margin-bottom: 12px; }
.study .prayer h2::before { display: none; }
.study-share { margin-top: 32px; text-align: center; }
[data-share] { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; font-weight: 600; background: none; color: inherit; }
[data-share].pill-accent { background: var(--accent-fill); color: var(--on-accent); }
.share-icon { flex: none; }
.study-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px 16px; margin-top: 40px; }
.study-nav a[rel="prev"] { justify-self: start; }
.study-nav a[rel="next"] { justify-self: end; grid-column: 3; }
.study-nav a { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ink); border-radius: 999px; padding: 10px 22px; font-weight: 600; }
.study-nav .icon { flex: none; }
.study-nav .all-link { grid-column: 2; border-color: transparent; text-decoration: underline; }
@media (max-width: 520px) {
  .study-nav { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .study-nav a { min-width: 0; padding: 10px 14px; justify-content: center; text-align: center; }
  .study-nav a[rel="next"] { grid-column: 2; }
  .study-nav .all-link { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
}
.study-index h1 { font-size: clamp(32px, 5vw, 48px); margin-bottom: 8px; }
.study-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.study-list a { display: flex; flex-direction: column; gap: 4px; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.study-list-title { font-family: var(--serif); font-size: 22px; font-weight: 700; line-height: 1.2; }
.study-search { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.study-search[hidden], .study-search [hidden], [data-study-list][hidden] { display: none; }
.study-search input { font: inherit; font-size: 18px; width: 100%; max-width: 560px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); }
.verse-text { font-style: italic; font-size: 15px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.verse-ref { font-style: italic; font-size: 14px; color: var(--muted); }
.search-excerpt mark { background: var(--band); color: inherit; border-radius: 3px; padding: 0 2px; }

.credit { width: 100%; font-size: 13px; color: var(--footer-note); opacity: .8; }
.credit a { text-decoration: underline; text-underline-offset: 3px; }
.credit a:hover, .credit a:focus-visible { opacity: 1; }
.page-hero { background: var(--band); padding: 72px 0 64px; }
.page-hero-inner { max-width: 820px; display: flex; flex-direction: column; gap: 18px; }
.page-hero h1 { font-size: clamp(36px, 6vw, 60px); }
.page-tagline { font-family: var(--serif); font-size: clamp(22px, 3.2vw, 30px); font-weight: 700; color: var(--accent); line-height: 1.25; }
.page-lead { font-size: clamp(19px, 2.4vw, 22px); line-height: 1.6; }
.page-hero p:not([class]), .about-bio p, .about-quote p, .page-band > .container > p { font-size: 18px; line-height: 1.7; }
.about-bio { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 48px; align-items: start; padding-top: 72px; padding-bottom: 24px; }
.about-photo { aspect-ratio: 4 / 5; width: 100%; height: auto; object-fit: cover; object-position: 55% 30%; border-radius: 20px; background: var(--surface); }
.about-bio-text { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.about-bio h2, .page-band h2 { font-size: clamp(26px, 3.6vw, 34px); }
.about-quote { max-width: 820px; display: flex; flex-direction: column; gap: 20px; padding-top: 56px; padding-bottom: 24px; }
.about-quote-lead { color: var(--muted); }
.about-quote blockquote { margin: 0; padding: 32px 36px; background: var(--inverse-bg); color: var(--inverse-fg); border-radius: 24px; font-family: var(--serif); font-size: clamp(24px, 3.6vw, 34px); font-weight: 700; line-height: 1.3; }
.page-band { background: var(--band); margin-top: 56px; padding: 64px 0 72px; }
.page-band-inner { max-width: 820px; display: flex; flex-direction: column; gap: 18px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 12px 0; }
.action-card { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; min-height: 140px; }
.action-card p, .action-card span { font-size: 16px; line-height: 1.5; }
.action-card .action-card-title { font-family: var(--serif); font-size: 22px; font-weight: 700; }
.action-card-share [data-share] { margin-top: auto; border: 0; }
.action-card-donate .support-actions { margin-top: auto; }
.action-card-share .action-card-title + p { margin-bottom: 8px; }
.support-body { display: flex; flex-direction: column; gap: 28px; max-width: 820px; padding-top: 40px; padding-bottom: 72px; }
.page-closing { display: flex; flex-direction: column; gap: 12px; }
.page-band-inner p.placeholder { font-size: 15px; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 16px; }
@media (max-width: 800px) {
  .about-bio { grid-template-columns: 1fr; gap: 28px; padding-top: 48px; }
  .about-photo { aspect-ratio: 5 / 4; object-position: 50% 30%; max-width: 560px; }
  .card-grid { grid-template-columns: 1fr; }
  .about-quote blockquote { padding: 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  .card, .series-card, .book, .pill, .study-list a, a.product { transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s; }
  .card:hover, .series-card:hover, a.book:hover, .study-list a:hover, a.product:hover { transform: translateY(-5px); box-shadow: 0 14px 28px rgba(42, 33, 24, .16); text-decoration: none; }
  .hero-inner > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-inner > :nth-child(2) { animation-delay: .15s; } .hero-inner > :nth-child(3) { animation-delay: .3s; }
  .hero-inner > :nth-child(4) { animation-delay: .45s; } .hero-inner > :nth-child(5) { animation-delay: .6s; }
  .play svg { animation: pulse 2.4s ease-in-out infinite; }
  .hero-media { animation: kenburns 26s ease-in-out infinite alternate; }
}
.video-frame { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: 64px 16px 24px; background: rgba(12, 20, 40, .94); }
.video-frame iframe { width: min(960px, 100%); aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; background: #000; }
.video-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; color: var(--ink); font: 400 28px/1 var(--sans); cursor: pointer; }
@keyframes rise { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.14) translate(-1.5%, -1%); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* The header wraps onto several rows on phones; keep it clear of the hero content. */
@media (max-width: 720px) {
  .hero-inner { padding-top: 230px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.theme-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: inherit; cursor: pointer; }
.theme-switch svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .55; transition: opacity .15s ease, color .15s ease; }
.theme-switch[aria-checked="false"] .theme-icon-light, .theme-switch[aria-checked="true"] .theme-icon-dark { color: var(--accent); opacity: 1; }
.header-hero .theme-switch[aria-checked="false"] .theme-icon-light, .header-hero .theme-switch[aria-checked="true"] .theme-icon-dark { color: var(--sand); }
.theme-switch-track { position: relative; width: 36px; height: 20px; border-radius: 999px; background: rgba(127, 127, 127, .5); transition: background .15s ease; }
.theme-switch[aria-checked="true"] .theme-switch-track { background: var(--accent-fill); }
.theme-switch-dot { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--on-accent); transition: transform .15s ease; }
.theme-switch[aria-checked="true"] .theme-switch-dot { transform: translateX(16px); }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-left: auto; }

.install-fab { position: fixed; right: 16px; bottom: 16px; z-index: 20; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px 0 18px; border: 0; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 8px 22px rgba(0, 0, 0, .3); transition: transform .2s ease, box-shadow .2s ease; }
.install-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0, 0, 0, .34); }
.install-icon { flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .install-fab { animation: install-in .6s cubic-bezier(.2, .7, .2, 1) both, install-ring 2.8s ease-out 1.2s infinite; }
  .install-fab:hover .install-icon { animation: install-bob .7s ease-in-out infinite; }
}
@keyframes install-in { from { opacity: 0; transform: translateY(24px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes install-ring { 0% { box-shadow: 0 8px 22px rgba(0, 0, 0, .3), 0 0 0 0 rgba(232, 160, 124, .55); } 70%, 100% { box-shadow: 0 8px 22px rgba(0, 0, 0, .3), 0 0 0 16px rgba(232, 160, 124, 0); } }
@keyframes install-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (max-width: 720px) { .site-footer { padding-bottom: 88px; } }

.study-complete { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 36px; }
.study-complete .pill:disabled { opacity: .75; cursor: default; }
.complete-message { margin: 0; font: italic 600 20px/1.4 var(--serif); color: var(--accent); text-align: center; }
.confetti { position: absolute; top: 20px; left: 50%; width: 0; height: 0; pointer-events: none; }
.confetti i { position: absolute; width: 8px; height: 14px; border-radius: 2px; opacity: 0; background: var(--accent); }
.confetti i:nth-child(3n + 1) { background: var(--sand); }
.confetti i:nth-child(3n + 2) { background: var(--accent-fill); }
@media (prefers-reduced-motion: no-preference) {
  .celebrate .confetti i { animation: confetti-burst 1.4s cubic-bezier(.2, .7, .3, 1) forwards; }
  .confetti i:nth-child(1) { --x: -120px; --y: -90px; --r: -200deg; }
  .confetti i:nth-child(2) { --x: -80px; --y: -130px; --r: 160deg; }
  .confetti i:nth-child(3) { --x: -40px; --y: -150px; --r: -120deg; }
  .confetti i:nth-child(4) { --x: 0; --y: -160px; --r: 220deg; }
  .confetti i:nth-child(5) { --x: 40px; --y: -150px; --r: -180deg; }
  .confetti i:nth-child(6) { --x: 80px; --y: -130px; --r: 140deg; }
  .confetti i:nth-child(7) { --x: 120px; --y: -90px; --r: -240deg; }
  .confetti i:nth-child(8) { --x: -60px; --y: -60px; --r: 100deg; }
  .confetti i:nth-child(9) { --x: 60px; --y: -60px; --r: -100deg; }
  .confetti i:nth-child(10) { --x: 0; --y: -100px; --r: 300deg; }
}
@keyframes confetti-burst {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 90px)) rotate(var(--r)); }
}
