/* =========================================================
   Public site. Two looks share one layout:
   body.theme-grimoire (default) and body.theme-crimson
   ========================================================= */

body.theme-grimoire {
  --bg: #e9dcc3; --surface: #f3e9d4; --text: #24170f; --muted: #6b5240;
  --accent: #6e1414; --accent2: #7a5a2e; --onaccent: #f3e9d4; --line: rgba(36,23,15,.22);
  --display: 'IM Fell English', Georgia, serif; --body: 'IM Fell English', Georgia, serif;
  --logo: 'Cinzel Decorative', Georgia, serif;
  --glow: radial-gradient(ellipse at center, transparent 50%, rgba(90,60,30,.35) 100%),
          radial-gradient(circle at 15% 20%, rgba(120,80,40,.12), transparent 30%),
          radial-gradient(circle at 80% 75%, rgba(120,80,40,.15), transparent 35%);
}
body.theme-crimson {
  --bg: #0a0607; --surface: #140b0d; --text: #efe4d6; --muted: #a8968a;
  --accent: #8e0f1b; --accent2: #c9a45c; --onaccent: #f5e9da; --line: rgba(201,164,92,.25);
  --display: 'Cinzel', Georgia, serif; --body: 'Cormorant Garamond', Georgia, serif;
  --logo: 'Cinzel', Georgia, serif;
  --glow: radial-gradient(ellipse 60% 50% at 75% 20%, rgba(142,15,27,.35), transparent 70%),
          radial-gradient(ellipse 50% 40% at 10% 95%, rgba(142,15,27,.18), transparent 70%);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font-family: var(--body); font-size: 19px; line-height: 1.6; }
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--glow); }
.site-head, main, .site-foot { position: relative; z-index: 1; }
main { flex: 1; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; color: var(--text); }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; }
.logo { font-family: var(--logo); font-size: 22px; letter-spacing: .06em; text-decoration: none; }
.site-head nav { display: flex; gap: 26px; flex-wrap: wrap; }
.site-head nav a { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.site-head nav a:hover, .site-head nav a.active { color: var(--accent); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; padding-top: 48px; padding-bottom: 80px; }
.ornament { color: var(--accent2); letter-spacing: .6em; font-size: 14px; margin-bottom: 14px; }
.eyebrow { font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: var(--accent2); }
.hero h1 { font-size: clamp(46px, 7.5vw, 92px); line-height: 1.02; margin: 16px 0 20px; }
.tag { font-size: 21px; line-height: 1.55; color: var(--muted); max-width: 540px; font-style: italic; }
.btns { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 14px 26px; font-family: var(--body); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  background: var(--accent); color: var(--onaccent); border: 1px solid var(--accent); transition: filter .2s, background .2s; }
.btn:hover { filter: brightness(1.15); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent2); }

/* ---------- covers ---------- */
.hero-book { display: flex; flex-direction: column; align-items: center; }
.cover-link { display: block; width: 100%; max-width: 330px; text-decoration: none; }
.cover { aspect-ratio: 2 / 3; width: 100%; max-width: 330px; position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  text-align: center; padding: 28px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.cover b { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; position: relative; }
.cover i { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; font-style: normal; margin-top: 12px; position: relative; }
.cover.has-img { padding: 0; overflow: hidden; }
.cover.has-img img { width: 100%; height: 100%; object-fit: cover; }
.cover.has-img::before, .cover.has-img::after { display: none; }
.coverlabel { margin-top: 18px; font-size: 13px; letter-spacing: .1em; color: var(--muted); text-decoration: none; text-align: center; }
.coverlabel:hover { color: var(--accent); }

/* ---------- sections ---------- */
.section { padding-top: 48px; padding-bottom: 64px; border-top: 1px solid var(--line); }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.section-h h2, .about-teaser h2 { font-size: clamp(30px, 4vw, 44px); }
.section-h a { color: var(--accent2); font-size: 13px; letter-spacing: .15em; text-transform: uppercase; text-decoration: none; }
.page-head { text-align: center; padding-top: 40px; padding-bottom: 48px; }
.page-title { font-size: clamp(42px, 6vw, 72px); }
.empty { text-align: center; font-style: italic; color: var(--muted); font-size: 21px; padding: 32px 0 48px; }

/* ---------- feed ---------- */
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; align-items: start; padding-bottom: 32px; }
.post { position: relative; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.pf { position: absolute; top: 10px; left: 10px; z-index: 2; font: 600 10px/1 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 9px; background: rgba(0,0,0,.65); color: #fff; border-radius: 3px; }
.embed { background: #000; }
.embed iframe { display: block; width: 100%; border: 0; }
.embed-tiktok iframe { height: 740px; }
.embed-instagram iframe { height: 700px; background: #fff; }
.embed-fbvideo iframe, .embed-ytshort iframe { aspect-ratio: 9 / 16; height: auto; }
.embed-fbwatch iframe, .embed-youtube iframe { aspect-ratio: 16 / 9; height: auto; }
.embed-fbpost { background: #fff; }
.embed-fbpost iframe { height: 620px; }
.post-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.post-body { padding: 16px 18px 18px; }
.post:not(:has(.embed, .post-img)) .post-body { padding-top: 44px; }
.post h3 { font-size: 24px; line-height: 1.2; margin-bottom: 8px; }
.post p { font-size: 17px; line-height: 1.5; margin-bottom: .6em; }
.post small { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); letter-spacing: .05em; }
.post small a { color: var(--accent2); }
.linkcard { display: inline-block; margin: 4px 0 10px; color: var(--accent); font-size: 15px; letter-spacing: .08em; text-transform: uppercase; }
.pager { display: flex; justify-content: center; align-items: center; gap: 20px; padding: 16px 0 64px; color: var(--muted); }

/* ---------- about ---------- */
.about-teaser { display: grid; grid-template-columns: 260px 1fr; gap: 48px; align-items: center; }
.about-teaser:not(:has(.portrait)) { grid-template-columns: 1fr; text-align: center; }
.about-teaser:not(:has(.portrait)) .btn { margin: 0 auto; }
.about-teaser .lead { font-size: 21px; color: var(--muted); font-style: italic; margin: 16px 0 24px; max-width: 640px; }
.about-teaser:not(:has(.portrait)) .lead { margin-left: auto; margin-right: auto; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about { display: grid; grid-template-columns: 340px 1fr; gap: 56px; align-items: start; padding-bottom: 80px; }
.about.no-photo { grid-template-columns: 1fr; max-width: 760px; }
.prose p { font-size: 20px; line-height: 1.75; }

/* ---------- books ---------- */
.book { display: grid; grid-template-columns: 280px 1fr; gap: 56px; align-items: start; padding: 48px 0; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.book:first-of-type { border-top: 0; padding-top: 0; }
.book h2 { font-size: clamp(32px, 4vw, 48px); margin: 10px 0 18px; }
.book-info p { font-size: 19px; line-height: 1.7; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 48px 0 40px; text-align: center; margin-top: 24px; }
.foot-name { font-family: var(--logo); font-size: 24px; letter-spacing: .06em; }
.socials { list-style: none; padding: 0; margin: 20px 0 0; display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
.socials a, .foot-links a { font-size: 13px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.socials a:hover, .foot-links a:hover { color: var(--accent); }
.foot-links { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; margin-top: 14px; }
.copy { margin-top: 24px; font-size: 13px; color: var(--muted); }

/* =========================================================
   The Grimoire flourishes
   ========================================================= */
.theme-grimoire .logo { font-size: 20px; }
.theme-grimoire .hero h1::first-letter, .theme-grimoire .page-title::first-letter { color: var(--accent); }
.theme-grimoire .cover { background: linear-gradient(160deg, #3a2414, #1d120a); border: 8px solid #2a1a0e;
  box-shadow: inset 0 0 0 2px #a8834a, 0 30px 60px rgba(60,30,10,.5); }
.theme-grimoire .cover b { color: #e9d3a4; }
.theme-grimoire .cover i { color: #a8834a; }
.theme-grimoire .cover::before { content: ""; position: absolute; top: 20%; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #a32a2a, #5a0c0c); box-shadow: 0 4px 10px rgba(0,0,0,.5); }
.theme-grimoire .cover::after { content: "✠"; position: absolute; top: calc(20% + 22px); font-size: 40px; line-height: 1; color: #e3b0a0; }
.theme-grimoire .post { box-shadow: 0 6px 18px rgba(60,30,10,.18); }
.theme-grimoire .pf { background: var(--accent); }
.theme-grimoire .portrait img { border: 8px solid #2a1a0e; box-shadow: inset 0 0 0 2px #a8834a, 0 20px 40px rgba(60,30,10,.35); }

/* =========================================================
   Crimson Court flourishes
   ========================================================= */
.theme-crimson .hero h1, .theme-crimson .page-title { letter-spacing: .05em; }
.theme-crimson .cover { background: linear-gradient(180deg, #1a0a0d 0%, #3b0a12 55%, #0a0405 100%);
  border: 1px solid var(--accent2); outline: 1px solid var(--accent2); outline-offset: 6px; }
.theme-crimson .cover i { color: var(--accent2); }
.theme-crimson .cover::before { content: ""; position: absolute; top: 18%; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #e9d9c0, #8e0f1b 60%, #2a0508); box-shadow: 0 0 60px rgba(142,15,27,.8); }
.theme-crimson .cover.has-img { outline-offset: 6px; }
.theme-crimson .btn:not(.ghost) { box-shadow: 0 0 30px rgba(142,15,27,.4); }
.theme-crimson .portrait img { border: 1px solid var(--accent2); outline: 1px solid var(--accent2); outline-offset: 6px; }
.theme-crimson .post p { font-size: 18px; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  body { font-size: 18px; }
  .site-head { justify-content: center; text-align: center; }
  .site-head nav { justify-content: center; gap: 18px; }
  .hero { grid-template-columns: 1fr; padding-top: 16px; gap: 40px; text-align: center; }
  .hero .tag { margin-left: auto; margin-right: auto; }
  .hero .btns { justify-content: center; }
  .cover, .cover-link { max-width: 260px; }
  .about-teaser, .about, .book { grid-template-columns: 1fr; gap: 28px; }
  .about-teaser .portrait, .about .portrait { max-width: 280px; margin: 0 auto; }
  .book-cover { max-width: 240px; margin: 0 auto; }
  .feed { grid-template-columns: 1fr; }
}
