:root {
  --night: #1F1813;
  --night-2: #2A2018;
  --parchment: #F6EFE0;
  --paper: #FBF7EE;
  --gold: #C9A55C;
  --gold-soft: #E3CC94;
  --olive: #6B7F3B;
  --ember: #9B4E2B;
  --ink: #2C1E10;
  --ink-soft: #5E4D38;
  --rule: rgba(92, 70, 40, 0.16);
  --measure: 34rem;
  --gutter: clamp(16px, 5vw, 48px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --parchment: #1B1510;
    --paper: #231B14;
    --ink: #EDE3CF;
    --ink-soft: #B3A285;
    --rule: rgba(201, 165, 92, 0.16);
    --olive: #9DB561;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--parchment); color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif; font-size: 1.0625rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: "Playfair Display", Georgia, serif; font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; margin: 0; }
p { margin: 0; }
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 var(--gutter); }

/* ── Night sky opening ── */
.sky {
  background: radial-gradient(120% 90% at 80% 10%, #3A2C1F 0%, var(--night) 55%, #150F0B 100%);
  color: #F3E8D2; position: relative; overflow: hidden;
  padding: max(28px, env(safe-area-inset-top)) 0 clamp(56px, 9vw, 96px);
}
.sky::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 22%, #F5E6C8 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 68%, #F5E6C8 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 46% 14%, #F5E6C8 50%, transparent 51%),
    radial-gradient(1px 1px at 58% 82%, #F5E6C8 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 71% 40%, #F5E6C8 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 72%, #F5E6C8 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 93% 18%, #F5E6C8 50%, transparent 51%),
    radial-gradient(1px 1px at 7% 52%, #F5E6C8 50%, transparent 51%),
    radial-gradient(1px 1px at 37% 44%, #F5E6C8 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 64% 6%, #F5E6C8 50%, transparent 51%);
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: "Playfair Display", serif; font-size: 1.05rem; color: #F3E8D2; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.topbar nav { display: flex; gap: 18px; font-size: .95rem; }
.topbar nav a { color: rgba(243, 232, 210, .75); text-decoration: none; padding: 6px 0; }
.topbar nav a:hover { color: #fff; }
@media (max-width: 560px) { .topbar nav .optional { display: none; } }

.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center; margin-top: clamp(32px, 7vw, 72px); position: relative; }
@media (min-width: 820px) { .hero { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
.hero h1 { font-size: clamp(2.6rem, 8vw, 5rem); font-weight: 700; color: #FBF3E2; letter-spacing: -0.025em; }
.hero .lede { margin-top: 18px; font-size: clamp(1.1rem, 2.4vw, 1.3rem); font-weight: 300; max-width: 30rem; color: rgba(243, 232, 210, .85); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border-radius: 999px; font-family: "Playfair Display", serif; font-size: 1.05rem; font-weight: 600;
  text-decoration: none; border: 1px solid transparent; transition: background .2s ease, transform .2s ease;
}
.btn-primary { background: var(--gold); color: #24190F; }
.btn-primary:hover { background: var(--gold-soft); }
.btn-quiet { border-color: rgba(243, 232, 210, .35); color: #F3E8D2; }
.btn-quiet:hover { background: rgba(243, 232, 210, .08); }
.btn:active { transform: scale(.98); }
.next-feast { margin-top: 26px; font-size: 1rem; color: var(--gold-soft); }
.next-feast strong { font-weight: 600; color: #FBF3E2; }

.moon-wrap { justify-self: center; text-align: center; max-width: 300px; }
#moon { width: min(62vw, 240px); height: auto; display: block; margin: 0 auto;
  filter: drop-shadow(0 0 32px rgba(245, 230, 200, .18)); animation: rise 1.6s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tonight { margin-top: 16px; font-size: .95rem; line-height: 1.55; color: rgba(243, 232, 210, .72); }
@media (prefers-reduced-motion: reduce) { #moon { animation: none; } .btn { transition: none; } }

/* ── Sections ── */
section { padding: clamp(56px, 9vw, 104px) 0; }
section + section { border-top: 1px solid var(--rule); }
.section-head { max-width: var(--measure); margin-bottom: 36px; }
.section-head h2 { font-size: clamp(1.9rem, 4.4vw, 2.75rem); }
.section-head p { margin-top: 12px; color: var(--ink-soft); }

/* The seven appointed times — a real sequence */
.feasts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.feast a {
  display: grid; grid-template-columns: 2.4rem 1fr; column-gap: 14px; row-gap: 2px;
  padding: 18px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; border-radius: 6px;
}
.feast a:hover { background: rgba(201, 165, 92, .08); }
.feast-num { grid-row: span 3; font-family: "Playfair Display", serif; font-size: 1.6rem; color: var(--gold); line-height: 1; padding-top: 4px; }
.feast-name { font-family: "Playfair Display", serif; font-size: 1.3rem; font-weight: 600; }
.feast-date { color: var(--ember); font-weight: 600; }
.feast-meta { color: var(--ink-soft); font-size: .93rem; }
.feast.is-next a { background: rgba(107, 127, 59, .09); }
.feast.is-next .feast-name::after { content: "Next"; margin-left: 10px; font-family: "Source Serif 4", serif; font-size: .8rem; font-weight: 600; color: var(--olive); vertical-align: middle; }
@media (min-width: 820px) {
  .feast a { grid-template-columns: 3rem minmax(0, 1.2fr) minmax(0, 1fr); align-items: baseline; }
  .feast-num { grid-row: span 2; }
  .feast-date { text-align: right; }
  .feast-meta { grid-column: 2 / 4; }
}

/* What you can study — reading rows, not cards */
.study { display: grid; gap: 28px 56px; }
@media (min-width: 760px) { .study { grid-template-columns: 1fr 1fr; } }
.study h3 { font-size: 1.35rem; margin-bottom: 6px; }
.study p { color: var(--ink-soft); max-width: 30rem; }

/* Install */
.devices { display: grid; gap: 20px; }
@media (min-width: 820px) { .devices { grid-template-columns: repeat(3, 1fr); } }
.device { background: var(--paper); border: 1px solid var(--rule); border-radius: 18px; padding: 24px 22px; }
.device.is-yours { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 165, 92, .18); }
.device h3 { font-size: 1.3rem; }
.device .yours { display: none; font-size: .85rem; color: var(--olive); font-weight: 600; margin-top: 2px; }
.device.is-yours .yours { display: block; }
.device ol { margin: 14px 0 0; padding-left: 1.3rem; }
.device li { margin-bottom: 6px; color: var(--ink-soft); }
.device li strong { color: var(--ink); font-weight: 600; }
.install-cta { margin-top: 28px; }
.install-cta .btn-primary { color: #24190F; }

/* How dates are set */
.prose { max-width: var(--measure); }
.prose p + p { margin-top: 14px; }
.prose p { color: var(--ink-soft); }
.prose a { color: var(--ember); }

footer { background: var(--night); color: rgba(243, 232, 210, .72); padding: 40px 0 max(40px, env(safe-area-inset-bottom)); font-size: .95rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 32px; justify-content: space-between; align-items: center; }
footer a { color: var(--gold-soft); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .links { display: flex; flex-wrap: wrap; gap: 18px; }

a:focus-visible, .btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* ── Inner pages ── */
.pagebar { background: var(--night); padding: max(14px, env(safe-area-inset-top)) 0 14px; }
.pagebar .topbar { margin: 0; }
.crumbs { font-size: .9rem; color: var(--ink-soft); padding-top: 22px; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span[aria-hidden] { margin: 0 6px; opacity: .6; }

.page-hero { padding: clamp(28px, 6vw, 56px) 0 8px; }
.page-hero h1 { font-size: clamp(2.3rem, 7vw, 3.8rem); font-weight: 700; letter-spacing: -0.025em; }
.page-hero .hebrew { font-size: 1.5rem; color: var(--ink-soft); margin-top: 6px; direction: rtl; text-align: left; }
.page-hero .tagline { margin-top: 16px; font-size: clamp(1.1rem, 2.5vw, 1.3rem); font-style: italic; max-width: 36rem; }
.page-hero .facts { margin-top: 10px; color: var(--ember); font-weight: 600; font-size: .98rem; }

.feast-band { height: 6px; border-radius: 3px; margin-top: 22px; max-width: 12rem; }

.next-box {
  margin: 28px 0 8px; padding: 20px 22px; border-radius: 18px; background: var(--paper);
  border: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between;
}
.next-box .when { font-family: "Playfair Display", serif; font-size: 1.35rem; font-weight: 600; }
.next-box .sub { color: var(--ink-soft); font-size: .95rem; margin-top: 2px; }
.next-box .btn-primary { color: #24190F; }

.article { display: grid; gap: 40px; padding: 24px 0 72px; }
@media (min-width: 980px) { .article { grid-template-columns: minmax(0, 1fr) 17rem; gap: 64px; } }
.article-body { max-width: 40rem; }
.article-body h2 { font-size: clamp(1.6rem, 3.6vw, 2.1rem); margin: 44px 0 14px; }
.article-body h2:first-child { margin-top: 8px; }
.article-body h3 { font-size: 1.2rem; margin: 26px 0 8px; }
.article-body p { margin: 0 0 14px; }
.article-body .takeaway { border-left: 3px solid var(--gold); padding: 4px 0 4px 18px; font-style: italic; font-size: 1.12rem; margin: 8px 0 8px; }

.aside { align-self: start; position: sticky; top: 20px; display: grid; gap: 22px; }
@media (max-width: 979px) { .aside { position: static; } }
.aside h2 { font-size: 1.15rem; margin-bottom: 8px; }
.aside ol, .aside ul { margin: 0; padding-left: 1.2rem; color: var(--ink-soft); }
.aside li { margin-bottom: 4px; }
.aside a { color: var(--ink); }
.aside .current { font-weight: 600; color: var(--ember); }

.verses { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.verses blockquote { margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--rule); }
.verses p { margin: 0; }
.verses cite { display: block; margin-top: 4px; font-style: normal; font-weight: 600; color: var(--ember); font-size: .93rem; }

.paleo { display: grid; gap: 10px; margin: 6px 0 16px; }
.paleo-word { font-size: 2rem; direction: rtl; color: var(--ember); }
.letter { display: grid; grid-template-columns: 3rem 2rem 1fr; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--paper); border: 1px solid var(--rule); }
.letter .glyph { font-family: "Noto Sans Phoenician", "Source Serif 4", serif; font-size: 1.8rem; text-align: center; color: var(--ink); }
.letter .heb { font-size: 1.4rem; text-align: center; color: var(--ember); }
.letter b { font-weight: 600; }
.letter small { display: block; color: var(--ink-soft); font-size: .9rem; }

.station { padding: 20px 22px; border-radius: 18px; background: var(--paper); border: 1px solid var(--rule); }
.station .where { color: var(--ink-soft); font-size: .95rem; margin-top: -6px; margin-bottom: 12px; }
.prayer { padding: 18px 22px; border-radius: 16px; background: rgba(107,127,59,.08); border: 1px solid rgba(107,127,59,.18); font-style: italic; }

.pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--rule); padding-top: 22px; margin-top: 40px; flex-wrap: wrap; }
.pager a { text-decoration: none; max-width: 48%; }
.pager small { display: block; color: var(--ink-soft); }
.pager span { font-family: "Playfair Display", serif; font-size: 1.15rem; font-weight: 600; }

/* Feasts hub */
.hub { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.hub a { display: grid; grid-template-columns: 2.4rem 1fr; gap: 4px 14px; padding: 22px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.hub a:hover { background: rgba(201,165,92,.08); }
.hub .n { grid-row: span 3; font-family: "Playfair Display", serif; font-size: 1.6rem; color: var(--gold); line-height: 1.1; }
.hub .t { font-family: "Playfair Display", serif; font-size: 1.4rem; font-weight: 600; }
.hub .g { color: var(--ink-soft); }
.hub .d { color: var(--ember); font-weight: 600; font-size: .95rem; }

/* Calendar page */
.year { margin-top: 48px; }
.year h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.year h2 .status { font-family: "Source Serif 4", serif; font-size: .95rem; font-weight: 600; color: var(--olive); }
.year h2 .status.projected { color: #5B6EA8; }
@media (prefers-color-scheme: dark) { .year h2 .status.projected { color: #8FA0D4; } }
.year .note { color: var(--ink-soft); font-style: italic; margin-top: 8px; max-width: 44rem; }
.year h3 { font-size: 1.25rem; margin: 26px 0 10px; }
table.dates { width: 100%; border-collapse: collapse; font-size: .98rem; }
table.dates th, table.dates td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.dates th { font-weight: 600; color: var(--ink-soft); font-size: .88rem; }
table.dates td.date { color: var(--ember); font-weight: 600; white-space: nowrap; }
table.dates td small { color: var(--ink-soft); display: block; }
table.dates tr.past td { opacity: .5; }
table.dates tr.now td { background: rgba(107,127,59,.1); }
table.dates a { color: inherit; }
@media (max-width: 560px) {
  table.dates thead { display: none; }
  table.dates tr { display: block; border-bottom: 1px solid var(--rule); padding: 8px 0; }
  table.dates td { display: block; border: 0; padding: 2px 4px; }
}
