:root {
  --bg: #f5efe2;
  --paper: #fffbf1;
  --ink: #1d1f2a;
  --muted: #545a64;
  --accent: #1e3f73;
  --accent-soft: #e8effa;
  --line: #d4c8b2;
  --brick: #a14b3b;
  --gold: #b88a2e;
  --canal: #2d5f61;
}

:root[data-theme="delft"] {
  --bg: #f5efe2;
  --paper: #fffbf1;
  --ink: #1d1f2a;
  --muted: #545a64;
  --accent: #1e3f73;
  --accent-soft: #e8effa;
  --line: #d4c8b2;
  --brick: #a14b3b;
  --gold: #b88a2e;
  --canal: #2d5f61;
}

:root[data-theme="jerusalem"] {
  --bg: #f7f0df;
  --paper: #fffaf0;
  --ink: #2a1f15;
  --muted: #6a5748;
  --accent: #7b4b20;
  --accent-soft: #f5e7cf;
  --line: #d9c39e;
  --brick: #93522d;
  --gold: #af7e2f;
  --canal: #5a6c46;
}

:root[data-theme="modern"] {
  --bg: #edf1f6;
  --paper: #ffffff;
  --ink: #1d2430;
  --muted: #5a6675;
  --accent: #21486f;
  --accent-soft: #e5eef8;
  --line: #c9d5e4;
  --brick: #4b5f7b;
  --gold: #3f6d9f;
  --canal: #2c5965;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Crimson Text", Georgia, serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, #f0e0c6 0%, transparent 34%),
    radial-gradient(circle at 84% 12%, #dce5f8 0%, transparent 36%),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 47px,
      rgba(30, 63, 115, 0.05) 48px,
      transparent 49px
    ),
    var(--bg);
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
.brand,
.button,
.kicker,
.subtitle,
.nav-link,
label {
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
}

.hero {
  padding: 4.8rem 1.2rem 3rem;
  border-bottom: 1px solid var(--line);
}

.top-nav {
  width: min(980px, calc(100% - 2.4rem));
  margin: 0;
  position: fixed;
  top: 0.8rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.9rem;
  z-index: 1000;
  background: rgba(255, 250, 240, 0.96);
  border: 1px solid #cdbfa7;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 24px rgba(35, 38, 47, 0.08);
}

.top-nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.theme-select {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0.15rem 0.55rem;
  font-size: 0.8rem;
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.nav-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.hero-content {
  max-width: 980px;
  margin: 2rem auto 0;
}

.kicker {
  margin: 0;
  color: var(--brick);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

h1 {
  margin: 0.4rem 0 0.8rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
}

.hero-content p {
  max-width: 62ch;
  font-size: 1.2rem;
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.button {
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  text-decoration: none;
  font-weight: 700;
}

.button.solid {
  background: linear-gradient(120deg, var(--accent) 0%, #2e588f 100%);
  color: #fff;
  border: 1px solid #15325a;
}

.button.ghost {
  border: 1px solid #3f5e8b;
  color: #214573;
  background: rgba(248, 250, 255, 0.68);
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem 1.2rem 3rem;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  margin-top: 1rem;
  box-shadow: 0 6px 16px rgba(39, 43, 52, 0.06);
}

.pill-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  background: linear-gradient(120deg, var(--accent-soft) 0%, #f1f6ff 100%);
  border: 1px solid #ccd7ec;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-family: "Assistant", sans-serif;
  font-size: 0.85rem;
}

.section-header p {
  margin-top: 0.2rem;
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
  padding: 0.8rem;
  border: 1px dashed #bcae96;
  border-radius: 10px;
  background: #fffcf4;
}

.toggles label {
  font-weight: 600;
  font-size: 0.95rem;
}

.search-bar {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.9rem;
  background: #fffdfa;
}

.search-bar label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.search-bar input {
  width: 100%;
  border: 1px solid #c5beb2;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font-size: 1rem;
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
  margin-bottom: 0.55rem;
}

.search-bar select {
  width: 100%;
  border: 1px solid #c5beb2;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font-size: 1rem;
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
}

.search-summary {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
}

.my-siddur {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.9rem;
  background: #fffdfa;
}

.my-siddur h3 {
  margin: 0;
}

.my-siddur-note {
  margin: 0.25rem 0 0.55rem;
  color: var(--muted);
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
}

.my-siddur-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.my-siddur-controls input,
.my-siddur-controls select,
.my-siddur-controls button {
  border: 1px solid #c5beb2;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font-size: 0.95rem;
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
}

.my-siddur-controls button {
  background: linear-gradient(120deg, #f2f5fd 0%, #eef8f9 100%);
  color: #214573;
  font-weight: 700;
  cursor: pointer;
}

.prayer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.7rem;
}

.nav-pill {
  text-decoration: none;
  color: #264b7a;
  border: 1px solid #c9d7ef;
  background: linear-gradient(120deg, #eef3fe 0%, #f8f1df 100%);
  font-weight: 700;
}

.group-title {
  margin: 1.25rem 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
  color: #2a4d7d;
  font-size: 1.18rem;
}

.service-intro {
  margin-top: 1rem;
  padding: 0.8rem;
  border: 1px solid #d5c4a8;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 247, 231, 0.94) 0%, rgba(240, 246, 255, 0.94) 100%);
}

.service-title {
  margin: 0;
}

.service-subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
}

.spinoza-quote {
  margin: 0.55rem 0 0;
  padding-left: 0.7rem;
  border-left: 4px solid var(--gold);
  font-style: italic;
}

.spinoza-quote span {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  color: var(--muted);
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.88rem;
}

.prayer-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
  background: #fffef9;
}

.prayer-card h3 {
  margin: 0;
}

.prayer-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.share-link-button {
  border: 1px solid #becee8;
  background: linear-gradient(120deg, #eff4ff 0%, #f5fbf8 100%);
  color: #264b7a;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.service-tags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.service-tag {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
}

.subtitle {
  margin: 0.1rem 0 0;
  color: var(--muted);
}

.text-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.hebrew {
  font-size: 1.28rem;
  line-height: 1.75;
}

.layer {
  border-top: 1px solid var(--line);
  margin-top: 0.75rem;
  padding-top: 0.6rem;
}

.layer h4 {
  margin: 0;
}

.layer p {
  margin: 0.2rem 0 0;
}

.source-note {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-family: "Assistant", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
}

.change-log {
  margin-top: 0.85rem;
  padding: 0.7rem;
  border: 1px dashed #c7b189;
  border-radius: 10px;
  background: #fff8e8;
}

.change-log h4 {
  margin: 0;
}

.change-log p {
  margin: 0.2rem 0 0;
}

.hidden-layer {
  display: none;
}

.hidden-card {
  display: none;
}

.target-prayer {
  border-color: #2d5f61;
  box-shadow: 0 0 0 2px rgba(45, 95, 97, 0.18);
}

footer {
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  color: #44505d;
  background: linear-gradient(180deg, transparent 0%, rgba(238, 229, 209, 0.36) 100%);
}

footer a {
  color: #1f4372;
}

@media (max-width: 760px) {
  .top-nav {
    width: calc(100% - 1rem);
    top: 0.4rem;
    padding: 0.45rem 0.65rem;
  }

  .top-nav-links {
    gap: 0.45rem;
  }

  .theme-switcher {
    font-size: 0.75rem;
  }

  .theme-select {
    font-size: 0.75rem;
    padding: 0.12rem 0.45rem;
  }

  .text-grid {
    grid-template-columns: 1fr;
  }

  .hero-content p {
    font-size: 1.05rem;
  }

  .group-title {
    font-size: 1.06rem;
  }
}
