/* ============================================================
   Torah and Stories with Rabbi Liff
   "An illuminated sefer" — light parchment (default) & candlelit dark.
   Deep navy + luminous gold · editorial · refined.
   ============================================================ */

/* ---------- Theme tokens ---------- */
:root {
  /* Fixed colors used over the dark cover image (both themes) */
  --on-dark:      #ece3d2;
  --on-dark-gold: #ecd07a;
  --on-dark-dim:  rgba(236,227,210,0.82);

  /* Type */
  --display: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --script:  "Pinyon Script", cursive;
  --body:    "EB Garamond", Georgia, "Times New Roman", serif;
  --ui:      "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  /* Space + motion */
  --container: 1140px;
  --measure: 66ch;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --r: 14px;
}

/* LIGHT (default) — warm parchment, navy headings, gold accents */
:root, :root[data-theme="light"] {
  --bg:        #f3ead7;
  --bg-2:      #eee3cd;
  --panel:     #fbf6ea;
  --panel-2:   #f5ecd8;
  --heading:   #16294a;
  --text:      #312e26;
  --text-dim:  #595241;
  --muted:     #8c8264;
  --accent:    #b0881c;
  --accent-strong: #8a6912;
  --link:      #8a6912;
  --line:      rgba(138, 105, 18, 0.26);
  --line-soft: rgba(138, 105, 18, 0.15);
  --glow:      rgba(176, 136, 28, 0.16);
  --grain:     0.045;
  --body-bg:
    radial-gradient(120% 80% at 50% -10%, rgba(201,162,39,0.10), rgba(201,162,39,0) 55%),
    radial-gradient(90% 60% at 100% 100%, rgba(176,136,28,0.08), transparent 60%),
    linear-gradient(180deg, #f5edda 0%, #efe5cf 100%);
  --shadow: 0 30px 60px -38px rgba(60,40,10,0.45);
}

/* DARK — candlelit beis medrash */
:root[data-theme="dark"] {
  --bg:        #0b1626;
  --bg-2:      #0d1a2e;
  --panel:     #122642;
  --panel-2:   #16294a;
  --heading:   #ecd07a;
  --text:      #ece3d2;
  --text-dim:  #cdc4b3;
  --muted:     #9a8c6f;
  --accent:    #c9a227;
  --accent-strong: #e6c558;
  --link:      #ecd07a;
  --line:      rgba(201, 162, 39, 0.18);
  --line-soft: rgba(201, 162, 39, 0.10);
  --glow:      rgba(201, 162, 39, 0.10);
  --grain:     0.05;
  --body-bg:
    radial-gradient(120% 90% at 88% -10%, rgba(201,162,39,0.16), rgba(201,162,39,0) 46%),
    radial-gradient(90% 70% at 6% 4%, rgba(36,64,110,0.55), rgba(13,26,46,0) 55%),
    linear-gradient(180deg, #0d1a2e 0%, #0b1626 100%);
  --shadow: 0 30px 60px -34px rgba(0,0,0,0.75);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.72;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--body-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--accent-strong); }
button { font-family: inherit; cursor: pointer; }

/* ---------- Accessibility ---------- */
.skip-link { position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: #1a1206; padding: .7em 1.2em;
  font-family: var(--ui); font-weight: 600; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(20px, 5vw, 44px); }
main { position: relative; z-index: 1; }
.section { padding-block: clamp(56px, 9vw, 116px); position: relative; }
.section--tight { padding-block: clamp(40px, 6vw, 72px); }

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.08; color: var(--heading); letter-spacing: .005em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
p { max-width: var(--measure); }
.lede { font-size: clamp(1.15rem, 2vw, 1.4rem); color: var(--text); font-style: italic; }
.script { font-family: var(--script); font-weight: 400; color: var(--accent-strong); line-height: .8; }
.eyebrow { font-family: var(--ui); font-weight: 600; font-size: .76rem; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.meta { font-family: var(--ui); font-size: .82rem; letter-spacing: .04em; color: var(--muted); }

.section-head { text-align: center; margin-bottom: clamp(34px, 5vw, 60px); }
.section-head .eyebrow { display: block; margin-bottom: .9rem; }

/* Ornamental divider — the "glowing path" motif */
.rule { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 1.4rem auto 0; max-width: 280px; }
.rule::before, .rule::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--accent) 70%, var(--accent)); }
.rule::after { transform: scaleX(-1); }
.rule span { width: 7px; height: 7px; transform: rotate(45deg); background: var(--accent-strong); box-shadow: 0 0 12px 2px var(--glow); flex: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .6em; font-family: var(--ui); font-weight: 600; font-size: .9rem; letter-spacing: .02em;
  padding: .82em 1.5em; border-radius: 999px; border: 1px solid var(--accent); color: var(--link); background: transparent; transition: all .3s var(--ease); }
.btn:hover { color: #1a1206; background: var(--accent); box-shadow: 0 8px 30px -12px var(--accent); transform: translateY(-1px); }
.btn .ic { width: 18px; height: 18px; }
.btn--ghost { border-color: var(--line); color: var(--text-dim); }
.btn--ghost:hover { border-color: var(--accent); background: transparent; color: var(--link); box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.link-more { font-family: var(--ui); font-weight: 600; font-size: .86rem; letter-spacing: .04em; color: var(--link); display: inline-flex; align-items: center; gap: .4em; }
.link-more::after { content: "→"; transition: transform .3s var(--ease); }
.link-more:hover::after { transform: translateX(4px); }

/* ---------- Header / Nav ---------- */
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px) saturate(120%);
  background: color-mix(in srgb, var(--bg) 80%, transparent); border-bottom: 1px solid var(--line-soft); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.32rem; color: var(--heading); display: inline-flex; align-items: baseline; gap: .28em; letter-spacing: .01em; }
.brand .amp { font-family: var(--script); font-size: 1.5rem; color: var(--accent-strong); line-height: 0; }
.brand:hover { color: var(--accent-strong); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); list-style: none; }
.nav-links a { font-family: var(--ui); font-weight: 500; font-size: .92rem; color: var(--text-dim); letter-spacing: .02em; position: relative; padding-block: 6px; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 0; background: var(--accent); transition: width .3s var(--ease); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--heading); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { width: 100%; }
.nav-toggle { display: none; background: none; border: 0; color: var(--heading); padding: 8px; }
.nav-toggle svg { width: 26px; height: 26px; }

/* Theme toggle */
.theme-toggle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent;
  color: var(--heading); display: grid; place-items: center; transition: border-color .3s var(--ease), transform .3s var(--ease), color .3s var(--ease); }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-strong); transform: rotate(12deg); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .ic-sun { display: none; }
.theme-toggle .ic-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: none; }

/* ---------- Hero (always over dark cover image) ---------- */
.hero { position: relative; min-height: clamp(640px, 96vh, 940px); min-height: clamp(640px, 92svh, 940px); display: flex; align-items: center; overflow: hidden; border-bottom: 1px solid var(--line-soft); background: #0b1626; }
/* Sections that are anchor targets need clearance from the sticky 70px header */
.section[id], #latest, #main { scroll-margin-top: 80px; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 70% center; opacity: .92; }
.hero-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,22,38,0.96) 0%, rgba(11,22,38,0.72) 38%, rgba(11,22,38,0.30) 70%, rgba(11,22,38,0.55) 100%),
    linear-gradient(180deg, rgba(11,22,38,0.5) 0%, rgba(11,22,38,0) 30%, rgba(11,22,38,0.85) 100%); }
.hero-inner { position: relative; z-index: 1; width: 100%; padding-block: 80px; }
.hero-title { line-height: .92; }
.hero-title .torah { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(4rem, 15vw, 11rem); color: var(--on-dark-gold); text-shadow: 0 2px 40px rgba(201,162,39,0.28); letter-spacing: .01em; }
.hero-title .stories { display: block; font-family: var(--script); font-weight: 400; font-size: clamp(3.2rem, 11vw, 8rem); color: var(--on-dark-gold); line-height: .7; margin-top: -.12em; margin-left: .04em; }
.hero-with { font-family: var(--body); font-style: italic; color: var(--on-dark); font-size: clamp(1.3rem, 3vw, 2rem); margin-top: 1.1rem; }
.hero-with strong { font-style: normal; font-weight: 600; color: var(--on-dark-gold); }
.hero-tagline { font-family: var(--ui); font-weight: 400; margin-top: 1.4rem; max-width: 46ch; color: var(--on-dark-dim); font-size: 1.02rem; line-height: 1.6; letter-spacing: .01em; }
.hero .btn-row { margin-top: 2.2rem; }
.hero .btn { border-color: var(--on-dark-gold); color: var(--on-dark-gold); }
.hero .btn:hover { background: var(--on-dark-gold); color: #1a1206; }
.hero .btn--ghost { border-color: rgba(236,227,210,0.4); color: var(--on-dark); }
.hero .btn--ghost:hover { border-color: var(--on-dark-gold); color: var(--on-dark-gold); background: transparent; }
.scroll-cue { position: absolute; left: 50%; bottom: 26px; z-index: 2; transform: translateX(-50%); color: var(--on-dark-gold); animation: bob 2.4s var(--ease) infinite; }
.scroll-cue svg { width: 26px; height: 26px; opacity: .85; }
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---------- Featured ---------- */
.featured { background: radial-gradient(80% 120% at 100% 0%, var(--glow), transparent 60%), linear-gradient(180deg, var(--panel), var(--bg-2)); border-block: 1px solid var(--line-soft); }
.featured-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.featured .parsha { font-family: var(--display); color: var(--heading); font-size: clamp(2.1rem, 4.5vw, 3.4rem); line-height: 1.05; margin-top: .3rem; }
.featured .title { color: var(--text); font-size: 1.2rem; margin-top: .5rem; }
.featured .desc { margin-top: 1.1rem; color: var(--text-dim); }
.featured .actions { margin-top: 1.6rem; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }

/* ---------- Spotify embed frame ---------- */
.player { border: 1px solid var(--line); border-radius: var(--r); padding: 10px;
  background: linear-gradient(180deg, var(--glow), rgba(0,0,0,0.06)); box-shadow: var(--shadow); }
.player iframe { display: block; width: 100%; border: 0; border-radius: 9px; }
.player--lg { padding: 12px; }

/* Native HTML5 player (mobile / iOS, where the Spotify embed bounces to the app) */
.player--native { padding: 16px; }
.np-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.np-art { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none;
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.np-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.np-kind { font-family: var(--ui); font-weight: 600; font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent-strong); }
.player--native .np-title { font-family: var(--display); font-weight: 700; font-size: 1.18rem;
  line-height: 1.2; color: var(--heading); }
.np-meta { font-family: var(--ui); font-size: .82rem; color: var(--muted); }
.np-audio { display: block; width: 100%; height: 44px; }
.np-spotify { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; font-size: .9rem; }
.np-spotify .ic { width: 1.05em; height: 1.05em; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { position: relative; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line-soft); border-radius: var(--r); padding: 26px 24px 22px; overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease); }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent)); transform: scaleY(0); transform-origin: top; transition: transform .4s var(--ease); }
.card:hover { transform: translateY(-4px); border-color: var(--line); box-shadow: var(--shadow), 0 0 50px -30px var(--glow); }
.card:hover::before { transform: scaleY(1); }
.card .card-badge { font-family: var(--ui); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-strong);
  border: 1px solid var(--line); border-radius: 999px; padding: .25em .7em; align-self: flex-start; margin-bottom: 14px; }
.card .card-parsha { font-family: var(--display); font-size: 1.55rem; color: var(--heading); line-height: 1.12; }
.card .card-desc { color: var(--text-dim); font-size: 1rem; margin-top: .7rem; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; gap: 12px; }

/* ---------- Archive ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding-block: 22px; border-block: 1px solid var(--line-soft); margin-bottom: 8px; }
.field { position: relative; }
.field input, .field select { font-family: var(--ui); font-size: .95rem; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .72em 1.1em; min-width: 240px; transition: border-color .25s var(--ease), box-shadow .25s var(--ease); }
.field select { min-width: 160px; padding-right: 2.4em; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23b0881c' stroke-width='1.6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1em center; }
.field input::placeholder { color: var(--muted); }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.field input { padding-left: 2.6em; }
.field .search-ic { position: absolute; left: 1em; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.result-count { font-family: var(--ui); font-size: .82rem; color: var(--muted); letter-spacing: .04em; }

.ep-list { list-style: none; padding: 0; }
.ep-row { display: grid; grid-template-columns: 1fr auto; gap: 18px 26px; align-items: start; padding: 26px 18px 26px 22px; border-bottom: 1px solid var(--line-soft); border-left: 2px solid transparent; transition: background .3s var(--ease), border-color .3s var(--ease); }
.ep-row:hover { background: linear-gradient(90deg, var(--glow), transparent 60%); border-left-color: var(--accent); }
.ep-row .ep-parsha { font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 1.95rem); color: var(--heading); line-height: 1.1; }
.ep-row .ep-parsha a { color: inherit; }
.ep-row .ep-parsha a:hover { color: var(--accent-strong); }
.ep-row .ep-metaline { font-family: var(--ui); font-size: .8rem; letter-spacing: .04em; color: var(--muted); margin-top: .5rem; display: flex; flex-wrap: wrap; gap: .5em 1.1em; align-items: center; }
.ep-row .ep-badge, .ep-badge { font-family: var(--ui); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-strong); border: 1px solid var(--line); border-radius: 999px; padding: .2em .6em; }
.ep-row .ep-desc { color: var(--text-dim); font-size: 1.02rem; margin-top: .7rem; max-width: 70ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-row .ep-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.play-btn { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--accent); display: grid; place-items: center; color: var(--link); background: var(--glow); transition: all .3s var(--ease); }
.play-btn svg { width: 18px; height: 18px; margin-left: 2px; }
.play-btn:hover { background: var(--accent); color: #1a1206; transform: scale(1.06); box-shadow: 0 0 26px -6px var(--accent); }

.pager { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 46px; }
.pager .meta { min-width: 130px; text-align: center; }
.pager button:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- Episode detail ---------- */
.detail-head { padding-top: clamp(40px, 7vw, 84px); }
.detail-head .back { margin-bottom: 1.6rem; }
.detail-head .parsha { font-family: var(--display); color: var(--heading); font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.02; margin-top: .4rem; }
.detail-head .title { color: var(--text); font-size: 1.25rem; margin-top: .7rem; }
.detail-meta { font-family: var(--ui); font-size: .85rem; letter-spacing: .05em; color: var(--muted); margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: .6em 1.4em; align-items: center; }
.detail-body { display: grid; grid-template-columns: 1fr; gap: 40px; max-width: 820px; }
.prose p { margin-bottom: 1.1rem; color: var(--text); font-size: 1.1rem; }

.shownotes { border: 1px solid var(--line-soft); border-radius: var(--r); background: linear-gradient(180deg, var(--panel), var(--bg-2)); padding: clamp(24px, 4vw, 38px); }
.shownotes h3 { color: var(--heading); margin-bottom: 1.2rem; }
.notes-grid { display: grid; gap: 1.3rem; }
.note-item .note-label { font-family: var(--ui); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: .35rem; }
.note-item .note-val { color: var(--text); }
.note-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--ui); font-size: .82rem; color: var(--text); background: var(--glow); border: 1px solid var(--line); border-radius: 999px; padding: .35em .85em; }
.notes-soon { color: var(--muted); font-style: italic; }

.detail-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 56px; border-top: 1px solid var(--line-soft); padding-top: 30px; }
.detail-nav a { display: flex; flex-direction: column; gap: .3rem; padding: 16px 20px; border: 1px solid var(--line-soft); border-radius: var(--r); transition: border-color .3s var(--ease), background .3s var(--ease); }
.detail-nav a:hover { border-color: var(--accent); background: var(--glow); }
.detail-nav .dir { font-family: var(--ui); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.detail-nav .np-title { font-family: var(--display); color: var(--heading); font-size: 1.15rem; }
.detail-nav .next { text-align: right; }

/* ---------- About ---------- */
.about-hero { position: relative; min-height: 60vh; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line-soft); overflow: hidden; background: #0b1626; }
.about-hero .hero-bg img { object-position: 72% 26%; }
.about-hero .container { position: relative; z-index: 1; padding-block: 56px; }
.about-hero h1 { color: var(--on-dark-gold); }
.about-hero .sub { font-family: var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-gold); font-size: .82rem; margin-top: 1rem; }
.about-body { display: grid; grid-template-columns: 1.6fr .9fr; gap: clamp(30px, 5vw, 56px); align-items: start; }
.about-portrait { margin: 0; border-radius: 50%; overflow: hidden; border: 3px solid var(--line); box-shadow: var(--shadow); position: sticky; top: 96px; aspect-ratio: 1; }
.about-portrait img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 18%; display: block; }
.about-body .prose p { font-size: 1.12rem; margin-bottom: 1.2rem; }
.about-body .prose p:first-of-type::first-letter { font-family: var(--display); float: left; font-size: 4.4rem; line-height: .82; color: var(--accent-strong); padding: .04em .12em 0 0; }
.works { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 14px; }
.work { border: 1px solid var(--line-soft); border-radius: var(--r); padding: 26px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); }
.work .kind { font-family: var(--ui); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-strong); }
.work h3 { margin: .5rem 0; }

/* ---------- Listen ---------- */
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.platform { display: flex; gap: 18px; align-items: center; padding: 24px; border: 1px solid var(--line-soft); border-radius: var(--r); background: linear-gradient(180deg, var(--panel), var(--bg-2)); transition: border-color .3s var(--ease), transform .3s var(--ease); }
.platform:hover { border-color: var(--accent); transform: translateY(-3px); }
.platform .p-ic { width: 42px; height: 42px; color: var(--accent-strong); flex: none; }
.platform .p-name { font-family: var(--display); font-size: 1.3rem; color: var(--heading); }
.platform .p-note { font-size: .98rem; color: var(--text-dim); }
.rss-field { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.rss-field code { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: .82rem; color: var(--accent-strong); background: var(--glow); border: 1px solid var(--line-soft); border-radius: 8px; padding: .5em .8em; }

/* ---------- Subscribe ---------- */
.subscribe { text-align: center; border-top: 1px solid var(--line-soft); background: radial-gradient(90% 140% at 50% 0%, var(--glow), transparent 60%); }
.badge-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 28px; }

/* ---------- About teaser ---------- */
.teaser { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 5vw, 60px); align-items: center; }
.teaser-photo { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; }
.teaser-photo img { width: 100%; aspect-ratio: 4/3.4; object-fit: cover; object-position: 18% 30%; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); padding-block: 60px 36px; position: relative; z-index: 1;
  background: linear-gradient(180deg, transparent, var(--glow)); }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: clamp(28px, 5vw, 64px); }
.footer-about p { color: var(--text-dim); font-size: 1rem; margin-top: 1rem; max-width: 42ch; }
.footer-logo { font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--heading); display: inline-flex; align-items: baseline; gap: .28em; }
.footer-logo .amp { font-family: var(--script); font-size: 1.7rem; color: var(--accent-strong); line-height: 0; }
.footer-social { display: flex; gap: 12px; margin-top: 1.5rem; }
.footer-social a { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent-strong); transition: all .3s var(--ease); }
.footer-social a:hover { border-color: var(--accent); background: var(--accent); color: #1a1206; transform: translateY(-2px); }
.footer-social .ic { width: 19px; height: 19px; }
.footer-col h4 { font-family: var(--ui); font-weight: 600; font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.1rem; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: .7rem; }
.footer-col ul a { font-family: var(--ui); font-size: .95rem; color: var(--text-dim); }
.footer-col ul a:hover { color: var(--link); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 8px 26px; justify-content: space-between; align-items: center;
  margin-top: 50px; padding-top: 26px; border-top: 1px solid var(--line-soft); font-family: var(--ui); font-size: .8rem; color: var(--muted); letter-spacing: .03em; }

/* ---------- Book + media (about page) ---------- */
.feature-split { display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
.book { flex: none; }
.book-shot { display: inline-block; background: #fbf9f3; border: 1px solid var(--line); border-radius: 12px; padding: 22px;
  box-shadow: var(--shadow); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.book:hover .book-shot { transform: translateY(-5px); box-shadow: var(--shadow), 0 0 60px -28px var(--glow); }
.book-shot img { width: 230px; max-width: 46vw; height: auto; display: block; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.yt { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #0b1626; box-shadow: var(--shadow); }
.yt iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.track-list { list-style: none; padding: 0; display: grid; gap: 2px; margin-top: 14px; }
.track-list a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; font-family: var(--ui); font-size: .96rem; color: var(--text); border: 1px solid transparent; transition: all .25s var(--ease); }
.track-list a:hover { background: var(--glow); border-color: var(--line-soft); color: var(--link); }
.track-list .t-ic { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent-strong); flex: none; font-size: .62rem; }
.track-list a:hover .t-ic { background: var(--accent); color: #1a1206; border-color: var(--accent); }
.track-list .t-ic svg { width: 13px; height: 13px; margin-left: 1px; }

/* Homepage media trio (book / music / watch) */
.media-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.media-card { display: flex; flex-direction: column; background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease); }
.media-card:hover { transform: translateY(-4px); border-color: var(--line); box-shadow: var(--shadow), 0 0 50px -30px var(--glow); }
.mc-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0b1626; }
.mc-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.media-card:hover .mc-thumb img { transform: scale(1.04); }
.mc-thumb.mc-book { display: grid; place-items: center; background: #fbf9f3; }
.mc-thumb.mc-book img { width: auto; height: 88%; object-fit: contain; }
.mc-play { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: rgba(11,22,38,.55); border: 1px solid rgba(255,255,255,.5);
  font-size: .8rem; backdrop-filter: blur(2px); transition: all .3s var(--ease); }
.media-card:hover .mc-play { background: var(--accent); color: #1a1206; border-color: var(--accent); }
.mc-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: .35rem; }
.mc-kind { font-family: var(--ui); font-weight: 600; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-strong); }
.mc-title { font-family: var(--display); color: var(--heading); font-size: 1.35rem; line-height: 1.1; }
.mc-card-link { margin-top: .4rem; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }
.stagger > * { opacity: 0; transform: translateY(16px); }
.stagger.in > * { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); }
.stagger.in > *:nth-child(1) { transition-delay: .04s; }
.stagger.in > *:nth-child(2) { transition-delay: .12s; }
.stagger.in > *:nth-child(3) { transition-delay: .2s; }
.stagger.in > *:nth-child(4) { transition-delay: .28s; }

.note-loading { color: var(--muted); font-style: italic; text-align: center; padding: 40px 0; }
.empty { text-align: center; color: var(--text-dim); padding: 60px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  body { font-size: 18px; }
  /* Shorter hero on tablet/mobile so the first section below peeks above the fold */
  .hero { min-height: clamp(480px, 78svh, 720px); }
  .featured-grid, .teaser, .feature-split { grid-template-columns: 1fr; }
  .feature-split { justify-items: center; text-align: center; }
  .feature-split .book { justify-self: center; }
  .teaser-photo { order: -1; }
  .cards { grid-template-columns: 1fr 1fr; }
  .media-trio { grid-template-columns: 1fr 1fr; }
  .detail-nav { grid-template-columns: 1fr; }
  .hero-bg img { object-position: 64% center; }
}
@media (max-width: 680px) {
  .nav-links { position: fixed; inset: 70px 0 auto 0; flex-direction: column; gap: 0; background: color-mix(in srgb, var(--bg) 97%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); padding: 8px 0; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { display: block; padding: 14px 26px; width: 100%; }
  .nav-links a::after { display: none; }
  .nav-toggle { display: inline-flex; }
  .cards { grid-template-columns: 1fr; }
  .media-trio { grid-template-columns: 1fr; }
  .ep-row { grid-template-columns: 1fr; }
  .ep-row .ep-actions { flex-direction: row; align-items: center; }
  .works, .about-body { grid-template-columns: 1fr; }
  .about-portrait { position: static; order: -1; max-width: 340px; justify-self: center; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .field input, .field select { width: 100%; min-width: 0; }
  .book-shot img { max-width: 60vw; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* iOS Safari mishandles background-attachment: fixed (jank + repaint). */
@media (hover: none) {
  body { background-attachment: scroll; }
}

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