:root {
  --paper: #fbf8f1;
  --paper-deep: #f3efe4;
  --ink: #1d3a2b;
  --ink-soft: #46604f;
  --sage: #8ea48c;
  --sage-wash: #dfe8d6;
  --line: #d8dfcf;
  --alert: #8a2f1f;
  /* Section colour: green for the baby naming, candle gold for Shabbat dinner. */
  --part: #8ea48c;
  --part-strong: #1d3a2b;
  --part-wash: #dfe8d6;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hebrew: 'Frank Ruhl Libre', 'SBL Hebrew', 'Times New Roman', serif;
  --scale: 1;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1rem/1.55 var(--sans); min-height: 100dvh; }
button, select, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .35; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, p, ol, dl, dd, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
#print { display: none; }

/* ---------- top ---------- */
.top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1.25rem, 5vw, 3.5rem) 1.25rem;
  border-bottom: 1px solid var(--line);
}
.brand h1 { font: italic 500 clamp(2.4rem, 6vw, 3.4rem)/0.95 var(--serif); letter-spacing: -.01em; }
.brand p { margin-top: .35rem; color: var(--ink-soft); font: 500 1.15rem/1.2 var(--serif); letter-spacing: .02em; }
.brand p span { font-family: var(--hebrew); font-size: 1.1em; margin-inline-start: .4em; }
.tools { display: flex; align-items: center; gap: .75rem; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper); }
.seg button {
  padding: .45rem .95rem; border-radius: 999px; font-size: .875rem; font-weight: 500; color: var(--ink-soft);
  min-height: 2.25rem; transition: background .2s var(--ease), color .2s var(--ease);
}
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.size { display: inline-flex; gap: 2px; }
.size button { min-width: 2.5rem; min-height: 2.5rem; border-radius: 999px; font-weight: 500; font-size: .9rem; color: var(--ink-soft); }
.size button:hover:not(:disabled) { background: var(--paper-deep); color: var(--ink); }

/* ---------- layout ---------- */
.layout { display: grid; gap: 0; padding-bottom: 11rem; }
.side { padding: 1rem clamp(1.25rem, 5vw, 3.5rem) 0; display: grid; gap: 1.25rem; align-content: start; }
.side > .seg { justify-self: start; max-width: 100%; }
.stage {
  padding: clamp(1.75rem, 5vw, 3.5rem) clamp(1.25rem, 5vw, 3.5rem) 0;
  max-width: 46rem; width: 100%;
  font-size: calc(1rem * var(--scale));
}
[data-view='ceremony'] .stage { margin-inline: auto; font-size: calc(1.2rem * var(--scale)); }
[data-view='ceremony'] .side { max-width: 46rem; width: 100%; margin-inline: auto; }

@media (min-width: 60rem) {
  [data-view='practice'] .layout { grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr); }
  [data-view='practice'] .side {
    padding: 2.5rem 2rem 2rem clamp(1.25rem, 5vw, 3.5rem);
    border-right: 1px solid var(--line); min-height: calc(100dvh - 8rem);
  }
  [data-view='practice'] .itinerary summary { display: none; }
  [data-view='practice'] .stage { padding-left: clamp(2rem, 6vw, 5rem); }
}

/* ---------- itinerary ---------- */
.itinerary summary {
  display: flex; gap: .75rem; align-items: baseline; cursor: pointer; list-style: none;
  padding: .6rem 0; font-size: .875rem; color: var(--ink-soft);
}
.itinerary summary::-webkit-details-marker { display: none; }
.itinerary summary span:first-child { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .75rem; color: var(--ink); }
.itinerary summary::after { content: ''; width: .45rem; height: .45rem; border: solid var(--ink-soft); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin-left: auto; align-self: center; }
.itinerary[open] summary::after { transform: rotate(-135deg); }
.shabbat { --part: #c2994a; --part-strong: #9a6a1c; --part-wash: #f1e4c6; }
.key { display: flex; gap: 1.25rem; font-size: .75rem; color: var(--ink-soft); padding: 0 0 .6rem .3rem; }
.key > span { display: inline-flex; align-items: center; gap: .5rem; }
.key .dot { background: var(--part); }
.steps { list-style: none; display: grid; }
.steps button {
  display: grid; grid-template-columns: 1.25rem 1fr; column-gap: .75rem; align-items: baseline;
  width: 100%; text-align: left; padding: .5rem 0; position: relative;
}
.dot { width: .625rem; height: .625rem; border-radius: 50%; border: 1.5px solid var(--part); justify-self: center; align-self: center; grid-row: span 2; }
.done .dot { background: var(--part); }
.current .dot { border-color: var(--part-strong); background: var(--part-strong); box-shadow: 0 0 0 4px var(--part-wash); }
.step-title { font: 500 1.2rem/1.25 var(--serif); color: var(--ink-soft); }
.current .step-title { color: var(--ink); font-weight: 600; }
.steps button:hover .step-title { color: var(--ink); }
.step-who { grid-column: 2; font-size: .75rem; color: var(--ink-soft); letter-spacing: .02em; }

.extras { display: grid; gap: 1.1rem; justify-items: start; margin-top: 1rem; padding: 1.25rem 0 .5rem; border-top: 1px solid var(--line); font-size: .875rem; }
.extras legend { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .5rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; padding: .3rem 0; cursor: pointer; color: var(--ink-soft); }
.check input { accent-color: var(--ink); width: 1rem; height: 1rem; margin-top: .2rem; }
.ghost { border: 1px solid var(--ink); border-radius: 999px; padding: .6rem 1.2rem; font-weight: 500; min-height: 2.75rem; transition: background .2s var(--ease), color .2s var(--ease); }
.ghost:hover { background: var(--ink); color: var(--paper); }
.fold { width: 100%; color: var(--ink-soft); }
.fold summary { cursor: pointer; font-weight: 500; color: var(--ink); padding: .25rem 0; }
.fold dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: .6rem 0; }
.fold dt { font-weight: 600; color: var(--ink); }
.fold .sources { grid-template-columns: 1fr; gap: 0; }
.fold .sources dd { margin-bottom: .6rem; }
.fold p { margin-top: .5rem; }

/* ---------- section ---------- */
.eyebrow { font-size: .75em; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--sage); }
.eyebrow.shabbat { color: var(--part-strong); }
.stage h2 { font: 500 clamp(2.2em, 6vw, 3.2em)/1.05 var(--serif); letter-spacing: -.01em; margin-top: .3em; outline: none; }
.subtitle { font: italic 400 1.35em/1.3 var(--serif); color: var(--ink-soft); margin-top: .2em; }
.sound { margin-top: .5em; font: 500 .8125em/1.3 var(--sans); letter-spacing: .04em; color: var(--ink-soft); }
.who { display: block; margin-top: .9em; font-size: .875em; font-weight: 500; color: var(--ink-soft); letter-spacing: .02em; }
.who select {
  appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2346604f' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right .1rem center / .6rem;
  border: 0; border-bottom: 1px solid var(--line); padding: .35rem 1.4rem .35rem 0; font-weight: 500; cursor: pointer; border-radius: 0;
}
.direction { margin-top: 2em; font-style: italic; font-size: .9375em; color: var(--ink-soft); max-width: 34em; padding-left: 1em; border-left: 1px solid var(--sage); }
.say { margin-top: 2em; }
.say p { font: 400 1.5em/1.45 var(--serif); max-width: 30em; text-wrap: pretty; }
.say p + p { margin-top: .8em; }
.say .said-by { font: 600 .75em/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--sage); margin-bottom: .7em; }
.story { display: block; margin-top: 1.5em; }
.story textarea {
  width: 100%; max-width: 40rem; padding: 1rem 1.1rem; background: transparent; border: 1px solid var(--line); border-radius: 6px;
  font: 400 1.35em/1.5 var(--serif); resize: vertical;
}
.story textarea::placeholder { color: var(--sage); }

/* ---------- prayer ---------- */
.prayer { margin-top: 2.25em; }
.prayer + .prayer { padding-top: 2em; border-top: 1px solid var(--line); }
.prayer header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .5em; }
.prayer h3 { font: 600 .75em/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--sage); }
.prayer.current h3 { color: var(--ink); }
.translit { font: 500 1.9em/1.5 var(--serif); margin-inline: -.12em; text-wrap: pretty; }
.w {
  font: inherit; color: var(--ink-soft); padding: .02em .12em; border-radius: .2em; line-height: 1.25;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.w:hover { background: var(--paper-deep); color: var(--ink); }
/* Emphasis without changing width, so nothing moves as the highlight travels. */
.w.on { background: var(--sage-wash); color: var(--ink); text-shadow: .022em 0 0 currentColor, -.022em 0 0 currentColor; }
.translation { margin-top: .9em; max-width: 36em; color: var(--ink); line-height: 1.6; }
.meaning { margin-top: .6em; max-width: 36em; font-size: .875em; color: var(--ink-soft); }
.link { margin-top: .9em; font-size: .8125em; font-weight: 500; color: var(--ink-soft); text-decoration: underline; text-underline-offset: .25em; text-decoration-color: var(--sage); min-height: 2rem; }
.prayer header .link { margin-top: 0; white-space: nowrap; }
.link:hover { color: var(--ink); }
.hebrew { margin-top: .5em; font: 400 1.9em/1.8 var(--hebrew); color: var(--ink); text-align: right; }
.hebrew span { padding: .05em .12em; border-radius: .2em; transition: background-color .18s var(--ease); }
.hebrew span.on { background: var(--sage-wash); }

.link + .link { margin-left: 1.25em; }
/* Word by word: transliteration with sound-it-out below, stacked per word. */
.translit.stack { display: flex; flex-wrap: wrap; gap: .5em .15em; font-size: 1.55em; margin-inline: -.35em; }
.stack .w { display: inline-flex; flex-direction: column; align-items: center; gap: .1em; padding: .25em .35em .3em; border-radius: .3em; text-shadow: none; }
.stack .tr { line-height: 1.15; }
.stack .ph { font: 500 .44em/1.3 var(--sans); letter-spacing: .03em; color: var(--ink-soft); }
.stack .w.on .tr { text-shadow: .022em 0 0 currentColor, -.022em 0 0 currentColor; }
.stack .w.on .ph { color: var(--ink); }

/* ---------- playback bar ---------- */
.bar {
  position: fixed; inset: auto 0 0 0; z-index: 5; background: var(--paper);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.progress { height: 3px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.status { font-size: .8125rem; color: var(--ink-soft); text-align: center; padding: .5rem 1.25rem 0; max-width: 44rem; margin: 0 auto; }
.status:empty { display: none; }
.status.error { color: var(--alert); font-weight: 500; }
.controls {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem .75rem; flex-wrap: wrap;
  padding: .7rem clamp(1rem, 5vw, 3.5rem); max-width: 72rem; margin: 0 auto;
}
.nav { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: 0 .75rem; border-radius: 999px; font-weight: 500; font-size: .9375rem; }
.nav:hover:not(:disabled) { background: var(--paper-deep); }
.playset { display: flex; align-items: center; gap: .35rem; }
.icon { width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; color: var(--ink-soft); }
.icon:hover { background: var(--paper-deep); color: var(--ink); }
.icon[aria-pressed='true'] { background: var(--sage-wash); color: var(--ink); }
.icon svg { width: 1.3rem; height: 1.3rem; }
.play {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 7rem; min-height: 3rem; padding: 0 1.2rem 0 1rem;
  border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600;
}
.play:disabled { opacity: .6; }
.play svg { width: 1.25rem; height: 1.25rem; }
.speeds button { padding: .35rem .6rem; min-height: 2rem; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.no-audio .playset, .no-audio .speeds, .no-audio .progress { visibility: hidden; }
@media (max-width: 43rem) {
  .nav-label { display: none; }
  .nav { padding: 0 .9rem; font-size: 1.15rem; }
  .controls { display: grid; grid-template-columns: auto 1fr auto; }
  .playset { justify-self: center; grid-column: 2; grid-row: 1; }
  .next { grid-column: 3; grid-row: 1; }
  .speeds { grid-column: 1 / -1; justify-self: center; }
  .no-audio .speeds { display: none; }
}

[data-view='ceremony'] .practice-only { display: none; }
[data-view='ceremony'] .nav-label { display: inline; }
[data-view='ceremony'] .nav { font-size: 1.05rem; min-height: 3.25rem; padding: 0 1rem; }
[data-view='ceremony'] .play { min-height: 3.5rem; min-width: 8.5rem; font-size: 1.1rem; }
[data-view='ceremony'] .controls { max-width: 46rem; }
@media (max-width: 43rem) {
  [data-view='ceremony'] .controls { flex-wrap: nowrap; gap: .25rem; }
  [data-view='ceremony'] .nav { font-size: 1rem; padding: 0 .5rem; }
  [data-view='ceremony'] .play { min-width: 7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- print ---------- */
.prints { display: flex; flex-wrap: wrap; gap: .5rem; }
.prints legend { float: left; width: 100%; }
@page { margin: 9mm; }
@media print {
  #app { display: none; }
  html, body { background: #fff; }
  #print { display: block; color: #16301f; font: 400 10.5pt/1.5 var(--sans); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* A fine double rule around every page. */
  .p-frame { position: fixed; inset: 0; border: .7pt solid #8ea48c; }
  .p-frame::after { content: ''; position: absolute; inset: 1.6mm; border: .3pt solid #8ea48c; }
  .p-sheet { width: 100%; border-collapse: collapse; }
  .p-sheet td { padding: 0 17mm; vertical-align: top; }
  .p-sheet .p-gap { height: 13mm; padding: 0; }

  .p-cover { text-align: center; padding: 4mm 0 9mm; }
  .p-cover.full { min-height: 228mm; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0; break-after: page; }
  .p-over { font: 500 8.5pt/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: #5d7860; }
  .p-cover h1 { font: italic 500 54pt/1 var(--serif); margin-top: 8pt; }
  .p-cover.full h1 { font-size: 96pt; margin-top: 14pt; }
  .p-he { font: 400 26pt/1.5 var(--hebrew); margin-top: 6pt; }
  .p-cover.full .p-he { font-size: 44pt; margin-top: 14pt; }
  .p-mean { font: italic 400 14pt/1.3 var(--serif); margin-top: 2pt; }
  .p-cover.full .p-mean { font-size: 19pt; margin-top: 6pt; }
  .p-orn { display: flex; align-items: center; justify-content: center; gap: 9pt; margin: 14pt auto; color: #8ea48c; }
  .p-orn i { display: block; width: 26mm; border-top: .5pt solid currentColor; }
  .p-orn svg { width: 15pt; height: 15pt; }
  .p-cover.full .p-orn { margin: 26pt auto; }
  .p-cover.full .p-orn i { width: 38mm; }
  .p-cover.full .p-orn svg { width: 22pt; height: 22pt; }
  .p-kind { font: 500 8.5pt/1.4 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: #46604f; }
  .p-from { font: italic 400 13pt/1.3 var(--serif); margin-top: 6pt; color: #46604f; }
  .p-cover.full .p-from { font-size: 17pt; margin-top: 12pt; }

  /* Jamie & Rachel's script */
  .p-sheet section { margin-bottom: 18pt; }
  .p-sheet h2 { font: 600 18pt/1.2 var(--serif); break-after: avoid; }
  .p-num { display: inline-block; min-width: 20pt; color: #6f8a70; font-weight: 500; }
  .p-sub { font-weight: 400; font-style: italic; }
  .p-who { font-size: 8pt; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #46604f; margin: 2pt 0 8pt 20pt; break-after: avoid; }
  .p-direction, .p-say, .p-prayer { margin-left: 20pt; break-inside: avoid; }
  .p-direction { font-style: italic; font-size: 9.5pt; color: #46604f; margin-bottom: 7pt; }
  .p-say { font: 400 13.5pt/1.45 var(--serif); margin-bottom: 7pt; orphans: 3; widows: 3; }
  .p-by { font: 600 8pt/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #46604f; }
  .p-prayer { margin-bottom: 11pt; }
  .p-prayer h3 { font: 600 7.5pt/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: #6f8a70; margin-bottom: 2pt; break-after: avoid; }
  .p-translit { font: 600 14pt/1.4 var(--serif); }
  .p-translation { font-size: 9.5pt; margin-top: 3pt; color: #2b4a38; }
  .p-about { font-size: 8.5pt; margin-top: 3pt; color: #5d7860; }

  /* Guest program: centred, with room to breathe. */
  .guest section { text-align: center; margin: 0 auto 22pt; max-width: 135mm; }
  .guest h2 { font: 500 22pt/1.2 var(--serif); letter-spacing: .01em; }
  .g-order h2 { font: 500 8.5pt/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: #5d7860; margin-bottom: 14pt; }
  .g-order ol { list-style: none; max-width: 112mm; margin: 0 auto; }
  .g-order li { display: flex; align-items: baseline; gap: 6pt; font: 500 15pt/1.75 var(--serif); }
  .g-order li i { flex: 1; border-bottom: .5pt dotted #8ea48c; transform: translateY(-3pt); }
  .g-who { font: italic 400 11.5pt/1 var(--serif); color: #46604f; }
  .g-part { break-inside: avoid; }
  .g-part .p-orn { margin: 0 auto 14pt; }
  .g-sub { font: italic 400 12pt/1.3 var(--serif); color: #46604f; margin-top: 1pt; }
  .p-sound { margin-left: 10pt; font-weight: 500; letter-spacing: .04em; text-transform: none; color: #6f8a70; }
  .g-sound { font: 500 8.5pt/1.3 var(--sans); letter-spacing: .04em; color: #5d7860; margin-top: 3pt; }
  .g-note { font-size: 9.5pt; color: #46604f; margin: 7pt auto 0; max-width: 105mm; }
  .g-prayer { margin-top: 13pt; break-inside: avoid; }
  .g-he { font: 400 15pt/1.7 var(--hebrew); }
  .g-tr { font: 600 13.5pt/1.4 var(--serif); margin-top: 1pt; }
  .g-en { font: italic 400 12pt/1.4 var(--serif); color: #2b4a38; margin-top: 2pt; }
  .g-about { font-size: 8.5pt; line-height: 1.45; color: #5d7860; margin: 5pt auto 0; max-width: 100mm; }
  .g-all { font: 600 15pt/1.3 var(--serif); margin-top: 13pt; }
  .g-all span { font: 600 7.5pt/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #6f8a70; margin-right: 7pt; }
  .g-end p { font: italic 500 22pt/1.2 var(--serif); }
}
