:root {
  --ink: #5a382a;
  --ink-strong: #342018;
  --text: #30241f;
  --muted: #776a62;
  --line: #dfd2c5;
  --paper: #ffffff;
  --mineral: #faf6f0;
  --sand: #eadbc9;
  --sky: #dceef3;
  --gold: #bd7a32;
  --coral: #b9654e;
  --sage: #7f7763;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 16px clamp(22px, 5vw, 78px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--ink-strong); }
.brand-name {
  font-family: "PT Serif", Georgia, serif;
  font-size: 24px;
  line-height: 0.98;
}

.primary-nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 46px); font-weight: 500; }
.primary-nav a { padding: 12px 0; }
.primary-nav a:not(.nav-donate):hover { color: var(--coral); }
.primary-nav .nav-donate { padding: 14px 28px; border-radius: 8px; background: var(--ink); color: white; }
.nav-community-menu { position: relative; }
.nav-community-menu summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
}
.nav-community-menu summary::-webkit-details-marker { display: none; }
.nav-community-menu summary svg { width: 16px; height: 16px; transition: transform 180ms ease; }
.nav-community-menu[open] summary svg { transform: rotate(180deg); }
.nav-community-menu > nav {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  display: none;
  width: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 40px rgba(52, 32, 24, 0.14);
  transform: translateX(-50%);
}
.nav-community-menu:hover > nav,
.nav-community-menu:focus-within > nav,
.nav-community-menu[open] > nav { display: grid; }
.primary-nav .nav-community-menu nav a { padding: 12px 15px; border-bottom: 1px solid var(--line); font-size: 14px; }
.primary-nav .nav-community-menu nav a:last-child { border-bottom: 0; }
.primary-nav .nav-community-menu nav a:hover { background: var(--mineral); color: var(--coral); }

.nav-toggle {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}
.nav-toggle span:not(.sr-only) {
  position: absolute;
  left: 9px;
  width: 24px;
  height: 1px;
  background: currentColor;
  transition: transform 220ms ease, top 220ms ease;
}
.nav-toggle span:not(.sr-only):nth-of-type(2) { top: 15px; }
.nav-toggle span:not(.sr-only):nth-of-type(3) { top: 25px; }
.site-header.is-open .nav-toggle span:not(.sr-only):nth-of-type(2) { top: 20px; transform: rotate(45deg); }
.site-header.is-open .nav-toggle span:not(.sr-only):nth-of-type(3) { top: 20px; transform: rotate(-45deg); }

.hero {
  display: grid;
  grid-template-columns: minmax(400px, 0.9fr) minmax(520px, 1.35fr);
  min-height: 670px;
  align-items: center;
  overflow: hidden;
  padding: 70px 0 36px clamp(22px, 7vw, 112px);
}
.hero-copy { position: relative; z-index: 2; padding: 20px 0 60px; }
h1, h2, h3 { letter-spacing: 0; }
.hero h1 {
  max-width: 720px;
  margin: 0;
  color: var(--ink);
  font-family: "PT Serif", Georgia, serif;
  font-size: clamp(66px, 6.5vw, 105px);
  font-weight: 400;
  line-height: 0.91;
}
.hero p { max-width: 545px; margin: 26px 0 30px; font-size: 21px; }
.hero-illustration { align-self: end; margin-left: -120px; overflow: hidden; }
.hero-illustration img { width: 112%; max-width: none; transform: translateX(2%); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 56px;
  padding: 0 26px;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
}
.button svg, .text-link svg, .city-card svg { width: 22px; height: 22px; }
.button-dark { background: var(--ink-strong); color: white; }
.button-dark:hover { background: var(--coral); }

.communities { padding: 70px clamp(22px, 5.5vw, 88px) 92px; background: var(--mineral); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 36px; max-width: 1320px; margin: 0 auto 30px; }
.section-heading h2, .mission h2, .contact-band h2 {
  margin: 0;
  color: var(--ink);
  font-family: "PT Serif", Georgia, serif;
  font-size: clamp(44px, 5vw, 74px);
  font-weight: 400;
  line-height: 0.98;
}
.section-heading p { max-width: 440px; margin: 0 0 7px; color: var(--muted); font-size: 17px; }

.city-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 1320px; margin: 0 auto; }
.city-card {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.city-card:hover { transform: translateY(-3px); border-color: var(--coral); box-shadow: 0 20px 45px rgba(90, 56, 42, 0.11); }
.city-card-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 26px 28px 0; color: var(--ink); }
.city-card strong { font-family: "PT Serif", Georgia, serif; font-size: clamp(38px, 4vw, 58px); font-weight: 400; line-height: 1; }
.city-card img { position: absolute; left: 3%; right: 3%; bottom: 0; width: 94%; height: 74%; object-fit: contain; object-position: center bottom; }

.location-menu { position: relative; width: min(100%, 330px); margin: 0 0 18px; }
.location-menu summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mineral);
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.location-menu summary::-webkit-details-marker { display: none; }
.location-menu summary svg { width: 18px; height: 18px; transition: transform 180ms ease; }
.location-menu[open] summary svg { transform: rotate(180deg); }
.location-menu nav {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 36px rgba(52, 32, 24, 0.14);
}
.location-menu nav a { display: flex; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.location-menu nav a:last-child { border-bottom: 0; }
.location-menu nav a:hover { background: var(--mineral); color: var(--coral); }
.location-menu nav small { color: var(--muted); }
.times-embed { min-height: 172px; margin: 12px 0 8px; padding: 22px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.times-fallback { color: var(--muted); }
.loading-line {
  display: block;
  width: 82%;
  height: 16px;
  margin: 10px 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--sand) 20%, #f7eee3 50%, var(--sand) 80%);
  background-size: 220% 100%;
  animation: loadingSweep 1.5s ease-in-out infinite;
}
.loading-line.short { width: 54%; }
.times-fallback p { margin: 16px 0 0; font-size: 13px; }
.times-embed table { width: 100% !important; border: 0 !important; background: transparent !important; }
.times-embed td { padding: 0 !important; }
.times-embed .CLTable { width: 100% !important; background: transparent !important; border: 0 !important; }
.times-embed .CLHeadingBold { color: var(--ink) !important; font-family: "PT Serif", Georgia, serif !important; font-size: 24px !important; font-weight: 400 !important; text-align: left !important; }
.times-embed .CLheading { color: var(--text) !important; font-family: "Manrope", sans-serif !important; font-size: 15px !important; text-align: left !important; }
.times-embed .CLdate { color: var(--muted) !important; font-family: "Manrope", sans-serif !important; font-size: 14px !important; }
.times-embed .CLtime { color: var(--ink) !important; font-family: "PT Serif", Georgia, serif !important; font-size: 34px !important; }
.times-embed .CLLink { color: var(--ink) !important; font-family: "Manrope", sans-serif !important; font-size: 13px !important; }
.times-credit { margin: 14px 0; color: var(--muted); font-size: 13px; }
.times-credit a, .text-link { text-decoration: underline; text-underline-offset: 5px; }
.text-link { display: inline-flex; align-items: center; gap: 12px; margin-top: 8px; color: var(--ink); font-weight: 600; }

.mission { padding: 76px clamp(22px, 6.5vw, 104px); background: var(--mineral); }
.service-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 1320px; margin: 0 auto; }
.service-card { display: flex; min-height: 360px; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.service-card:hover { border-color: var(--coral); }
.service-icon { display: grid; width: 34px; height: 34px; place-items: center; color: var(--gold); }
.service-icon svg { width: 32px; height: 32px; stroke-width: 1.6; }
.service-links strong { margin-top: 12px; color: var(--ink); font-family: "PT Serif", Georgia, serif; font-size: 28px; font-weight: 400; }
.service-links small { margin-top: 10px; color: var(--muted); font-size: 14px; }
.service-links .explore { margin-top: auto; font-weight: 600; text-decoration: underline; text-underline-offset: 5px; }
.shabbat-service-card .card-location { margin-top: 3px; }
.shabbat-service-card .times-embed { min-height: 112px; margin: 10px 0; padding: 10px 0; }
.shabbat-service-card .times-embed .CLHeadingBold { font-size: 18px !important; }
.shabbat-service-card .times-embed .CLheading { font-size: 12px !important; }
.shabbat-service-card .times-embed .CLdate { font-size: 11px !important; }
.shabbat-service-card .times-embed .CLtime { font-size: 25px !important; }
.compact-location-menu { width: 100%; margin: 0 0 12px; }
.compact-location-menu summary { min-height: 40px; }
.shabbat-service-card .explore { margin-top: 0; }

.contact-band { position: relative; display: grid; grid-template-columns: 1fr 0.8fr 1fr; gap: 48px; align-items: center; overflow: hidden; padding: 64px clamp(22px, 6.5vw, 104px); background: var(--ink-strong); color: white; }
.contact-band h2 { color: white; }
.contact-band p { margin: 12px 0 0; color: rgba(255,255,255,0.72); }
.contact-details { display: grid; gap: 16px; }
.contact-details a { display: grid; gap: 2px; }
.contact-details span { color: var(--gold); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.donate-callout { padding-left: 46px; border-left: 1px solid rgba(255,255,255,0.32); }
.donate-callout h3 { margin: 0; font-family: "PT Serif", Georgia, serif; font-size: 34px; font-weight: 400; line-height: 1.05; }
.button-outline { min-width: 240px; margin-top: 24px; color: white; }
.button-outline:hover { background: white; color: var(--ink); }

.site-footer { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; padding: 38px clamp(22px, 6.5vw, 104px); border-top: 1px solid var(--line); }
.footer-brand .brand-name { font-size: 20px; }
.site-footer nav { display: flex; gap: 28px; font-size: 14px; }
.site-footer > p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }

body { animation: pageFade 520ms ease both; }
.hero-copy { animation: quietRise 620ms 80ms ease both; }
.hero-illustration { animation: quietRise 700ms 180ms ease both; }
.city-card { animation: quietRise 560ms ease both; }
.city-card:nth-child(1) { animation-delay: 80ms; }
.city-card:nth-child(2) { animation-delay: 140ms; }
.city-card:nth-child(3) { animation-delay: 200ms; }
.city-card:nth-child(4) { animation-delay: 260ms; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@keyframes pageFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes quietRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loadingSweep { from { background-position: 180% 0; } to { background-position: -40% 0; } }

@media (max-width: 1200px) {
  .service-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; padding-right: 22px; }
  .hero-copy { padding-bottom: 0; }
  .hero-illustration { margin: -40px -22px 0 12%; }
  .contact-band { grid-template-columns: 1fr 1fr; }
  .donate-callout { grid-column: 1 / -1; padding: 30px 0 0; border-top: 1px solid rgba(255,255,255,0.32); border-left: 0; }
}

@media (max-width: 820px) {
  .site-header { min-height: 74px; padding: 12px 18px; }
  .brand-name { font-size: 18px; }
  .nav-toggle { display: block; }
  .primary-nav { position: absolute; top: 100%; left: 0; right: 0; display: none; align-items: stretch; flex-direction: column; gap: 0; padding: 12px 18px 20px; border-bottom: 1px solid var(--line); background: white; }
  .site-header.is-open .primary-nav { display: flex; }
  .primary-nav a { padding: 14px; }
  .primary-nav .nav-donate { margin-top: 6px; text-align: center; }
  .nav-community-menu { width: 100%; }
  .nav-community-menu summary { justify-content: space-between; padding: 14px; }
  .nav-community-menu > nav,
  .nav-community-menu:hover > nav,
  .nav-community-menu:focus-within > nav,
  .nav-community-menu[open] > nav {
    position: static;
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }
  .primary-nav .nav-community-menu nav a { padding: 11px 20px; }
  .hero { min-height: auto; padding: 52px 20px 0; }
  .hero h1 { font-size: clamp(56px, 16vw, 76px); }
  .hero p { font-size: 18px; }
  .hero-illustration { margin: 10px -80px 0 -40px; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 15px; }
  .city-grid { grid-template-columns: 1fr; }
  .city-card { min-height: 260px; }
  .mission { padding: 64px 20px; }
  .service-links { grid-template-columns: 1fr; }
  .service-card { min-height: 320px; }
  .contact-band { grid-template-columns: 1fr; padding: 54px 20px; }
  .donate-callout { grid-column: auto; }
  .site-footer { grid-template-columns: 1fr; padding: 34px 20px; }
  .site-footer nav { flex-wrap: wrap; gap: 14px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body, .hero-copy, .hero-illustration, .city-card, .loading-line { animation: none; }
  .city-card, .reveal { transition: none; }
  .reveal { opacity: 1; transform: none; }
}
