:root {
  --bg: #f3eee5;
  --bg-card: #fffaf3;
  --ink: #2a1f16;
  --muted: #6a5748;
  --line: #e2d4c2;
  --copper: #9b4a24;
  --copper-dark: #7a3518;
  --gold: #b8893e;
  --gold-soft: #e8d5a8;
  --shadow: 0 10px 28px rgba(80, 50, 20, 0.08);
  --radius: 18px;
  --header-h: 4rem;
  --font-ui: "Source Sans 3", "Segoe UI", sans-serif;
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-he: "Frank Ruhl Libre", "Times New Roman", serif;
  --max: 70rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(200, 140, 70, 0.09), transparent 50%),
    radial-gradient(900px 400px at 110% 0%, rgba(155, 74, 36, 0.06), transparent 45%),
    var(--bg);
  min-height: 100%;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--copper-dark); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--copper); }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 100;
}
.skip:focus { left: 0.75rem; top: 0.75rem; }

.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(243, 238, 229, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: var(--header-h);
}
.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.15;
}
.logo span { display: block; font-family: var(--font-he); font-size: 0.78rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.nav { display: flex; gap: 1.15rem; flex-wrap: wrap; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--copper); }

/* Hero */
.hero { padding: 3rem 0 2rem; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.75rem; font-weight: 700; color: var(--copper); margin: 0 0 0.7rem;
}
.hero h1, .page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 0.8rem;
  letter-spacing: -0.02em;
}
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; margin: 0 0 1.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border-radius: 999px; padding: 0.7rem 1.2rem; font-weight: 650; font-size: 0.98rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  font-family: inherit; line-height: 1.2; min-height: 2.75rem;
}
.btn-primary { background: var(--copper); color: #fff; }
.btn-primary:hover { background: var(--copper-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--copper); color: var(--copper-dark); background: var(--bg-card); }

/* Cards / sections */
section { padding: 2rem 0; }
.section-title {
  font-family: var(--font-display); font-size: 1.8rem; margin: 0 0 0.4rem; font-weight: 600;
}
.section-intro { color: var(--muted); margin: 0 0 1.4rem; max-width: 40rem; }

.kumlern {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow);
  display: grid; gap: 0.35rem;
}
.kumlern h2 { font-family: var(--font-display); font-size: 1.7rem; margin: 0; }
.kumlern .when { font-size: 1.15rem; font-weight: 650; }
.kumlern .where { margin: 0; }
.tbc { color: var(--muted); font-size: 0.95rem; margin: 0.6rem 0 0; }

.seder-block { margin: 0 0 2.4rem; }
.seder-label, .masechta-label {
  display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap;
  margin: 0 0 0.7rem;
}
.seder-label { border-bottom: 1px solid var(--line); padding-bottom: 0.45rem; }
.seder-label h2 { font-family: var(--font-display); font-size: 1.55rem; margin: 0; }
.masechta-label h3 { font-size: 1.2rem; margin: 0; }
.he-inline { font-family: var(--font-he); font-weight: 500; }
.perek-label { font-weight: 700; color: var(--muted); font-size: 0.92rem; letter-spacing: 0.04em; text-transform: uppercase; margin: 1rem 0 0.6rem; }

.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1rem;
}
.song-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.song-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(80,50,20,0.12); color: inherit; }
.song-card img { aspect-ratio: 1; object-fit: cover; width: 100%; background: #eee5d6; }
.song-card .meta { padding: 0.85rem 0.95rem 1rem; }
.song-card .ref { font-size: 0.8rem; font-weight: 700; color: var(--copper); letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 0.25rem; }
.song-card h3 { margin: 0 0 0.15rem; font-size: 1.05rem; }
.song-card .he { font-family: var(--font-he); font-size: 1.15rem; direction: rtl; text-align: right; margin: 0; }
.song-card .credit { color: var(--muted); font-size: 0.85rem; margin: 0.35rem 0 0; }

.note {
  background: #f8f1e4;
  border: 1px dashed var(--gold);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  color: var(--ink);
}

/* Song page */
.crumb { font-size: 0.9rem; color: var(--muted); margin: 1.3rem 0 1rem; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--copper); }
.song-layout {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding-bottom: 2rem;
}
@media (max-width: 780px) {
  .song-layout { grid-template-columns: 1fr; }
}
.cover-col img {
  width: 100%; border-radius: 16px; box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.song-kicker { color: var(--copper); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; margin: 0 0 0.4rem; }
.song-page-title { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 0.2rem; }
.song-he-title { font-family: var(--font-he); font-size: clamp(1.6rem, 4vw, 2.3rem); direction: rtl; text-align: right; margin: 0 0 0.8rem; font-weight: 500; }
.credits { color: var(--muted); margin: 0 0 1rem; font-size: 0.98rem; }

.player-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem;
  margin: 0 0 1rem;
}
audio { width: 100%; height: 2.8rem; }
.video-wrap { position: relative; aspect-ratio: 16/9; background: #1a120c; border-radius: 12px; overflow: hidden; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.text-block { margin: 1.6rem 0; }
.text-block h2 { font-family: var(--font-display); font-size: 1.35rem; margin: 0 0 0.7rem; }
.he-text {
  font-family: var(--font-he);
  direction: rtl; text-align: right;
  font-size: 1.45rem; line-height: 1.95;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem 1.3rem;
}
.en-text { font-size: 1.05rem; line-height: 1.75; color: #3a2c22; }
.source {
  font-size: 0.85rem; color: var(--muted); margin-top: 0.8rem;
}

/* Listen / playlist */
.listen-layout {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 1.6rem;
  padding: 1.4rem 0 3rem;
}
@media (max-width: 840px) {
  .listen-layout { grid-template-columns: 1fr; }
}
.now-playing {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  position: sticky; top: calc(var(--header-h) + 0.8rem);
}
.now-playing img { width: 100%; border-radius: 12px; margin-bottom: 0.9rem; aspect-ratio: 1; object-fit: cover; }
.now-playing h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 0.15rem; }
.now-sub { color: var(--muted); margin: 0 0 0.8rem; }
.controls { display: flex; align-items: center; justify-content: center; gap: 0.6rem; margin: 0.6rem 0; }
.icon-btn {
  width: 3rem; height: 3rem; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 1.1rem; color: var(--ink);
}
.icon-btn.play { width: 3.6rem; height: 3.6rem; background: var(--copper); color: #fff; border-color: var(--copper); font-size: 1.25rem; }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.seek { width: 100%; accent-color: var(--copper); }
.times { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.queue button, .queue a.q-item {
  width: 100%; display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 0.75rem;
  align-items: center; text-align: left; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 12px; padding: 0.45rem 0.6rem;
  cursor: pointer; font: inherit; color: inherit; text-decoration: none;
}
.queue button[aria-current="true"], .queue a.q-item[aria-current="true"] {
  border-color: var(--copper); background: #fff6ea;
}
.queue img { width: 3.2rem; height: 3.2rem; border-radius: 8px; object-fit: cover; }
.queue .q-title { font-weight: 650; }
.queue .q-sub { font-size: 0.85rem; color: var(--muted); }
.queue .q-dur { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 1rem;
}
.site-footer p { margin: 0.3rem 0; }

@media (max-width: 640px) {
  .hero { padding-top: 2rem; }
  .header-inner { flex-wrap: wrap; padding: 0.4rem 0; }
  .nav { gap: 0.85rem; }
  .he-text { font-size: 1.28rem; }
  .now-playing { position: static; }
}

.recording { margin: 0 0 1.2rem; }
.recording-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.1rem 0 0.35rem;
}
.recording .credits { margin-bottom: 0.45rem; }
