/* Sephardic Community Bet Din — scbdny.org */

:root {
  --bg: #f5f5f8;
  --surface: #e9e9f1;
  --ink: #1b1b4f;            /* the seal's navy */
  --muted: #4c4c74;
  --paper: #ffffff;
  --inverse-soft: #c4c4e2;
  --tint-1: #dcdcee;
  --tint-2: #c9c9e3;
  --tint-3: #b8b8d9;

  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-he: "Frank Ruhl Libre", "Times New Roman", serif;

  --step-small: 0.9375rem;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.25rem, 1.3rem + 3.6vw, 4.5rem);
  --step-statement: clamp(1.5rem, 1.1rem + 1.1vw, 2rem);
  --step-figure: clamp(64px, 7vw, 112px);

  --margin: clamp(20px, 2.2vw, 32px);
  --gap: clamp(16px, 2vw, 28px);
  --section: clamp(96px, 12vw, 200px);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; border-radius: 2px; }
::selection { background: var(--ink); color: var(--paper); }
mark { background: none; color: inherit; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.he { font-family: var(--font-he); font-weight: 500; }

h2 {
  font-size: var(--step-head);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

/* Button — square, one fill */
.button {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 26px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  font-size: var(--step-body);
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 200ms var(--ease-out);
}
.button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: #2b2b6e; }
}

/* ---------- Hero: one word, cropped ---------- */
.hero {
  position: relative;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr;
  padding: 28px var(--margin) 0;
}
.hero-top { grid-column: 1 / -1; }
.hero-seal {
  grid-column: 2; grid-row: 2;
  width: clamp(180px, 22vw, 340px); height: auto;
  margin-top: clamp(40px, 6vh, 80px);
  align-self: start;
}
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--gap);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: var(--step-small);
  text-decoration: none;
}
.wordmark img { width: 44px; height: 44px; }
.hero-nav { display: flex; gap: clamp(16px, 2.4vw, 36px); }
.hero-nav a {
  text-decoration: none;
  font-size: var(--step-small);
  font-weight: 500;
  position: relative;
}
.hero-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .hero-nav a:hover::after { transform: scaleX(1); }
}
.hero-lede {
  grid-column: 1; grid-row: 2;
  margin-top: clamp(56px, 9vh, 112px);
  max-width: 34ch;
  display: grid;
  gap: 28px;
  justify-items: start;
}
.lede { font-size: var(--step-lead); line-height: 1.35; }

.hero-word {
  grid-column: 1 / -1;
  align-self: end;
  margin-top: clamp(140px, 10vw, 160px) !important;
  margin: 0 0 -0.16em;
  font-weight: 600;
  font-size: clamp(180px, 25vw, 600px);
  line-height: 0.8;
  letter-spacing: -0.05em;
  white-space: nowrap;
  margin-left: -0.045em;
  transform-origin: 30% 100%;
}
.giant { display: block; }

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-word {
      animation: word-settle linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }
    @keyframes word-settle { to { transform: scale(0.93) translateY(-2%); } }
  }
}

/* ---------- The letter, as a letter ---------- */
.letter {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding: var(--section) var(--margin);
  background: var(--ink);
  color: var(--paper);
  align-items: start;
}
.letter-head {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: 20px;
  align-items: end;
  margin-bottom: clamp(48px, 6vw, 88px);
}
.letter-head h2 { grid-column: 1 / span 6; grid-row: 1 / span 2; align-self: end; }
.letter-head p { grid-column: 7 / span 6; }
.letter-head a { color: var(--paper); text-underline-offset: 3px; }
.letter-scan { grid-column: 1 / span 6; }
.letter-scan img { width: 100%; height: auto; background: var(--paper); }
.letter-scan a { display: block; transition: transform 240ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .letter-scan a:hover { transform: translateY(-4px); }
}
.letter-scan figcaption { color: var(--inverse-soft); }
.sheet-label { text-align: center; color: var(--muted); font-family: var(--font); font-size: var(--step-small); margin: -8px 0 24px; text-indent: 0 !important; }
.letter-head h2 { color: var(--paper); }
.letter-head .letter-note { color: var(--inverse-soft); font-size: var(--step-small); }
.sheet {
  grid-column: 7 / span 6;
  max-width: 760px;
  background: var(--paper);
  color: #23233f;
  padding: clamp(32px, 6vw, 88px) clamp(28px, 5.5vw, 84px) clamp(40px, 6vw, 96px);
  font-family: var(--font-he);
  font-size: var(--step-body);
  line-height: 1.7;
  font-weight: 400;
}
.sheet-head { display: grid; gap: 28px; margin-bottom: 44px; }
.sheet-from { text-align: center; font-size: var(--step-lead); line-height: 1.35; }
.sheet-from strong { font-weight: 700; color: var(--ink); }
.sheet-date { text-align: right; font-style: italic; }
.sheet-title {
  text-align: center;
  font-family: var(--font-he);
  font-size: var(--step-lead);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--ink);
  margin: 0 0 32px;
}
.sheet p + p { text-indent: 2em; }
.sheet-sign { margin: 48px 0 0 auto; width: fit-content; max-width: 100%; display: grid; gap: 20px; }
.sheet-sign p { text-indent: 0 !important; }
.sheet-sign strong { font-weight: 700; color: var(--ink); }

/* ---------- Ledger ---------- */
.ledger {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding: var(--section) var(--margin);
  align-items: center;
}
.ledger-head { grid-column: 1 / span 5; display: grid; gap: 48px; }

.ledger-head .soft { color: var(--muted); display: block; }
.ledger-figure { max-width: 420px; }
.ledger-figure img { aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) contrast(1.05); }
figcaption { margin-top: 12px; font-size: var(--step-small); color: var(--muted); line-height: 1.4; }
.ledger-rows { grid-column: 7 / span 6; display: grid; gap: 20px; }
.ledger .row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: baseline;
  column-gap: var(--gap);
}
.ledger .num {
  font-size: var(--step-figure);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variant-numeric: lining-nums;
}
.ledger dd { font-size: var(--step-small); line-height: 1.4; }

/* ---------- Services at poster scale ---------- */
.services {
  padding: clamp(120px, 20vh, 220px) var(--margin);
  background: var(--surface);
}
.service-list { display: grid; row-gap: 0.35em; font-size: var(--step-head); }
.service {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: first baseline;
  transition: color 200ms var(--ease-out);
}
.service h2, .service h3 {
  grid-column: 1 / span 8;
  font-size: 1em;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}
.service-title h2 { color: var(--muted); font-weight: 500; }
.service p { grid-column: 9 / span 4; font-size: var(--step-body); line-height: 1.45; letter-spacing: 0; }
@media (hover: hover) and (pointer: fine) {
  .service-list:hover .service:not(.service-title):not(:hover) h3 { color: var(--muted); }
}

/* ---------- The record (Genizah) ---------- */
.record {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding: var(--section) var(--margin);
  align-items: center;
}
.record-figure { grid-column: 1 / span 6; }
.record-figure .frame { overflow: hidden; aspect-ratio: 4 / 5; }
.record-figure img { width: 100%; height: 100%; object-fit: cover; }
.record-text { grid-column: 8 / span 5; display: grid; gap: 24px; }
.record-text p { font-size: var(--step-lead); line-height: 1.4; }
.record-text p + p { font-size: var(--step-body); line-height: 1.55; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .record-figure img, .band-frame img {
      animation: drift linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
    @keyframes drift { from { transform: scale(1.12) translateY(-3%); } to { transform: scale(1.02) translateY(3%); } }
  }
}

/* ---------- Story: two columns, highlighted words ---------- */
.story { padding: 120px var(--margin); background: var(--paper); }
.story h2 { margin-bottom: 56px; }
.story-text {
  columns: 2;
  column-gap: 32px;
  font-size: var(--step-statement);
  line-height: 1.18;
  color: var(--muted);
  text-wrap: pretty;
  letter-spacing: -0.01em;
}
.story-text strong { color: var(--ink); font-weight: 500; }
.story-text mark {
  color: var(--ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 0.1em;
}
.story-text .h1 { background: var(--tint-1); }
.story-text .h2 { background: var(--tint-2); }
.story-text .h3 { background: var(--tint-3); }
.story-text .h-strong { background: var(--ink); color: var(--paper); }
.story-link { text-decoration: none; }
.story-link mark { transition: background-color 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .story-link:hover mark { background: #2b2b6e; }
}

/* ---------- Band ---------- */
.band { padding: 0 var(--margin) var(--section); background: var(--paper); }
.band-frame { overflow: hidden; aspect-ratio: 21 / 9; }
.band-frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }

/* ---------- Dayanim roster ---------- */
.roster {
  padding: var(--section) var(--margin);
  background: var(--ink);
  color: var(--paper);
}
.roster-heading { color: var(--paper); margin-bottom: 72px; }
.roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-lead);
  line-height: 1.25;
}
.roster-table th, .roster-table td {
  text-align: left;
  font-weight: 400;
  vertical-align: baseline;
  padding: 0 var(--gap) 0.55em 0;
}
.roster-table th { width: 30%; font-weight: 500; }
.roster-table td:nth-child(2) { width: 38%; }
.roster-table td { color: var(--inverse-soft); }
.roster-notes { margin-top: 48px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); color: var(--inverse-soft); }
.roster-notes p:first-child { grid-column: 1 / span 6; color: var(--paper); }
.roster-notes p:last-child { grid-column: 8 / span 5; }

/* ---------- Board ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding: var(--section) var(--margin);
  align-items: end;
}
.board-figure { grid-column: 1 / span 5; }
.board-figure img { aspect-ratio: 3 / 4; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.board-list { grid-column: 7 / span 6; }
.board-list h2 { margin-bottom: 40px; }
.board-list ul {
  columns: 2;
  column-gap: var(--gap);
  font-size: var(--step-lead);
  line-height: 1.5;
  letter-spacing: -0.015em;
}
.board-list li { break-inside: avoid; }
.board-list .role {
  display: block;
  margin-bottom: 10px;
  font-size: var(--step-small);
  letter-spacing: 0;
  line-height: 1.3;
  color: var(--muted);
}

/* ---------- Contact ---------- */
.contact {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 40px var(--margin) 28px;
  background: var(--ink);
  color: var(--paper);
}
.contact h2 { color: var(--paper); }
.contact-top { display: grid; gap: 20px; max-width: 60ch; }
.contact-why { font-size: var(--step-lead); }
.topics { border: 0; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.topics legend { padding: 0; margin-bottom: 12px; font-size: var(--step-small); color: var(--inverse-soft); }
.topics label { position: relative; cursor: pointer; }
.topics input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.topics span {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 20px;
  background: #2a2a66;
  font-size: var(--step-small);
  font-weight: 500;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), transform 160ms var(--ease-out);
}
.topics label:active span { transform: scale(0.97); }
.topics input:checked + span { background: var(--paper); color: var(--ink); }
.topics input:focus-visible + span { outline: 3px solid var(--paper); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .topics label:hover input:not(:checked) + span { background: #36367a; }
}
.contact-email {
  align-self: end;
  margin: clamp(96px, 16vh, 200px) 0 clamp(48px, 8vh, 96px);
  display: block;
  text-decoration: none;
  font-size: clamp(48px, 9.4vw, 170px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.05em;
  white-space: nowrap;
  transition: color 220ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .contact-email:hover { color: var(--inverse-soft); }
}
.contact-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
  font-size: var(--step-small);
  color: var(--inverse-soft);
}

/* ---------- Footer ---------- */
.site-footer {
  display: grid;
  grid-template-rows: auto auto auto auto;
  padding: 40px var(--margin) 20px;
  background: var(--paper);
  color: var(--ink);
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  font-size: var(--step-small);
  line-height: 1.5;
  color: var(--muted);
}
.footer-cols > :nth-child(1) { grid-column: 1 / span 3; }
.footer-cols > :nth-child(2) { grid-column: 5 / span 2; }
.footer-cols > :nth-child(3) { grid-column: 8 / span 5; }
.footer-cols .first { color: var(--ink); font-weight: 500; margin-bottom: 4px; }
.footer-cols a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.footer-seal { justify-self: start; width: clamp(96px, 12vw, 160px); height: auto; margin: clamp(80px, 12vw, 160px) 0 40px; }
.footer-word { width: 100%; height: auto; display: block; overflow: visible; }
.footer-word text { font-family: var(--font); font-weight: 600; font-size: 60px; letter-spacing: -0.04em; fill: var(--ink); }
.legal { margin-top: 20px; font-size: var(--step-small); color: var(--muted); }

/* ---------- Reveal ---------- */
.js [data-reveal] > *, .js tr[data-reveal], .js .row[data-reveal], .js .service[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 75ms);
}
.js tr[data-reveal] > *, .js .row[data-reveal] > *, .js .service[data-reveal] > * { opacity: 1; transform: none; }
.js [data-reveal].is-in > *, .js tr[data-reveal].is-in, .js .row[data-reveal].is-in, .js .service[data-reveal].is-in {
  opacity: 1;
  transform: none;
}
.js figure[data-reveal] > *, .js .band[data-reveal] > * { transform: translateY(32px); }
.js .no-delay, .js .no-delay > * { transition-duration: 200ms !important; transition-delay: 0ms !important; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] > *, .js tr[data-reveal], .js .row[data-reveal], .js .service[data-reveal] {
    transform: none !important;
    transition: opacity 400ms linear;
  }
}

/* ---------- Tablet ---------- */
@media (max-width: 1000px) {
  .letter-head { display: grid; grid-template-columns: 1fr; }
  .letter-head h2, .letter-head p { grid-column: 1; grid-row: auto; }
  .letter-scan { grid-column: 1 / -1; max-width: 640px; justify-self: center; margin-bottom: 40px; }
  .sheet { grid-column: 1 / -1; justify-self: center; }
  .page-seal { width: 160px; }
  .hero { min-height: 0; }
  .hero-word { margin-top: 200px !important; font-size: 33vw; }
  .ledger-head { grid-column: 1 / span 5; }
  .ledger-rows { grid-column: 6 / -1; }
  .service h2, .service h3 { grid-column: 1 / span 7; }
  .service p { grid-column: 8 / -1; }
  .record-text { grid-column: 7 / -1; }
  .roster-table th { width: 34%; }
}

/* ---------- Phone ---------- */
@media (max-width: 680px) {
  :root { --margin: 20px; }
  .hero { padding-top: 20px; grid-template-columns: 1fr; min-height: 100svh; }
  .hero-seal { grid-column: 1; grid-row: 3; width: 38vw; margin-top: 40px; position: relative; z-index: 2; }
  .hero-top { position: relative; z-index: 2; }
  .wordmark span { max-width: 9ch; line-height: 1.15; font-size: 0.9375rem; }
  .hero-nav { gap: 14px; }
  .hero-nav a { font-size: 0.9375rem; }
  .hero-lede { position: relative; z-index: 2; max-width: 52%; margin-top: 48px; gap: 24px; }
  .lede { font-size: 1.0625rem; }
  .button { padding: 0 14px; font-size: var(--step-small); white-space: nowrap; }
  .hero-word {
    position: absolute;
    top: 50%;
    right: -0.18em;
    margin: 0;
    writing-mode: vertical-rl;
    font-size: 58vw;
    line-height: 0.82;
    transform: translateY(-50%);
    animation: none !important;
  }

  .letter, .ledger, .record, .board { display: block; }
  .letter-head { margin-bottom: 40px; }
  .letter-scan { margin-bottom: 32px; }
  .sheet { padding: 32px 22px 40px; font-size: 1.0625rem; line-height: 1.65; }
  .sheet p + p { text-indent: 1.25em; }
  .page-seal { display: none; }

  .ledger-head { gap: 36px; margin-bottom: 56px; }
  .ledger-head h2 { font-size: 1.75rem; }
  .ledger-rows { gap: 28px; }
  .ledger .row { grid-template-columns: 1fr; row-gap: 6px; }
  .ledger .num { font-size: 15vw; }
  .ledger dd { grid-column: 1 / -1; font-size: 0.9375rem; }

  .service-list { font-size: 11vw; row-gap: 28px; }
  .service { display: block; }
  .service p { margin-top: 10px; padding-left: var(--margin); font-size: 1rem; }

  .record-figure { margin-bottom: 40px; }

  .story-text { columns: 1; font-size: 1.25rem; line-height: 1.25; }
  .story-link { display: block; margin-top: 24px; }

  .band-frame { aspect-ratio: 4 / 3; }

  .roster-heading { margin-bottom: 40px; }
  .roster-notes { display: grid; grid-template-columns: 1fr; row-gap: 20px; }
  .roster-notes p:first-child, .roster-notes p:last-child { grid-column: 1; }
  .roster-table, .roster-table tbody, .roster-table tr, .roster-table th, .roster-table td { display: block; width: auto !important; }
  .roster-table tr { margin-bottom: 22px; }
  .roster-table th { font-size: 1.375rem; padding: 0 0 4px; }
  .roster-table td { font-size: 0.9375rem; padding: 0; line-height: 1.45; }

  .board-figure { margin-bottom: 48px; }
  .board-list ul { font-size: 1.25rem; }

  .contact { min-height: 0; }
  .contact-email { font-size: 11.5vw; white-space: normal; margin: 128px 0 40px; }
  .footer-seal { margin: 56px 0 24px; }
  .contact-email span { display: block; }
  .contact-foot { flex-direction: column; gap: 12px; font-size: 0.9375rem; }

  .footer-cols { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .footer-cols > :nth-child(n) { grid-column: auto; }
  .footer-cols > .credits { grid-column: 1 / -1; }
  .legal { font-size: 0.8125rem; }
}

.roster-table .title { display: block; color: var(--inverse-soft); font-weight: 400; }

/* ---------- Inner pages ---------- */
.page-head {
  padding: 28px var(--margin) clamp(72px, 9vw, 140px);
  display: grid;
  gap: clamp(72px, 10vw, 160px);
}
.page-head { grid-template-columns: minmax(0, 1fr) auto; }
.page-head .hero-top { grid-column: 1 / -1; }
.page-seal { grid-column: 2; grid-row: 2; margin-top: 0; }
.page-title { grid-column: 1; grid-row: 2; display: grid; gap: 28px; justify-items: start; align-content: end; }
.page-title h1 {
  font-size: clamp(3.25rem, 1.5rem + 7vw, 8.5rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.page-title .lede { max-width: 40ch; }
.page-title h1 { max-width: 12ch; }
.hero-nav a[aria-current="page"]::after { transform: scaleX(1); }

.button-inverse { background: var(--paper); color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .button-inverse:hover { background: var(--tint-1); }
}
.contact-foot a { color: inherit; text-underline-offset: 3px; }

/* ---------- Contact form ---------- */
.form-section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding: clamp(72px, 8vw, 128px) var(--margin) var(--section);
  background: var(--paper);
}
.form-aside { grid-column: 1 / span 4; display: grid; gap: 20px; align-content: start; }
.form-aside a { text-underline-offset: 3px; }
.form-figure { margin-top: 28px; max-width: 360px; }
.form-figure img { aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.contact-form { grid-column: 6 / span 7; display: grid; gap: 28px; }
.contact-form .topics span { background: var(--surface); color: var(--ink); }
.contact-form .topics input:checked + span { background: var(--ink); color: var(--paper); }
.contact-form .topics input:focus-visible + span { outline: 3px solid var(--ink); }
.contact-form .topics legend { color: var(--muted); }
@media (hover: hover) and (pointer: fine) {
  .contact-form .topics label:hover input:not(:checked) + span { background: var(--tint-1); }
}
.field { display: grid; gap: 8px; }
.field label { font-weight: 500; }
.field .optional { font-weight: 400; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  font-size: var(--step-body);
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--surface);
  border-radius: 0;
  padding: 14px 16px;
  min-height: 52px;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); background: var(--paper); }
.field [aria-invalid="true"] { border-color: #a3123a; }
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.contact-form button { border: 0; cursor: pointer; font-family: inherit; }
.contact-form button[disabled] { opacity: 0.6; cursor: progress; }
.form-status { font-size: var(--step-body); }
.form-status.is-error { color: #a3123a; }
.page-contact .band { padding-top: 0; background: var(--paper); }

@media (max-width: 1000px) {
  .form-aside { grid-column: 1 / -1; margin-bottom: 48px; }
  .contact-form { grid-column: 1 / -1; }
  .form-figure { display: none; }
}
@media (max-width: 680px) {
  .page-head { gap: 64px; padding-bottom: 56px; }
  .field-row { grid-template-columns: 1fr; }
}

/* Dayanim portraits */
.roster-table .ph { width: clamp(88px, 8.5vw, 132px) !important; padding-right: clamp(16px, 2vw, 28px); vertical-align: top; }
.roster-table .ph img { width: clamp(72px, 7vw, 104px); max-width: none; height: auto; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.roster-table tr { vertical-align: top; }
.roster-table tbody th, .roster-table tbody td { padding-bottom: 32px; vertical-align: top; }
@media (max-width: 680px) {
  .roster-table tr { display: grid !important; grid-template-columns: 80px 1fr; column-gap: 16px; }
  .roster-table .ph { grid-row: 1 / span 3; padding: 0; width: 80px !important; }
  .roster-table .ph img { width: 80px; }
  .roster-table tbody th, .roster-table tbody td { padding-bottom: 0; }
}

/* Phone header: seal alone, so all four page links fit */
@media (max-width: 680px) {
  .wordmark span { display: none; }
  .hero-nav { gap: 16px; }
}
