/* Yeshiva Nishmas Chaim — cinematic dark */
:root {
  --night: #121110;      /* page background */
  --night-2: #1b1917;    /* raised surfaces */
  --walnut: #5a3a22;     /* bookshelf tone, used for hairlines/depth */
  --gold: #d6b45f;       /* matches the film's name tags; used sparingly */
  --bone: #ede6da;       /* text */
  --smoke: #8a837a;      /* secondary text */
  --rule: rgba(237, 230, 218, .14);
  --font: "Archivo", system-ui, sans-serif;      /* bold condensed headlines */
  --text: "Geist", system-ui, sans-serif;        /* body, UI, secondary type */
  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 38rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font-family: var(--text);
  font-size: 1.0625rem;
  font-weight: 350;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Display type: condensed, heavy */
.display, .hero h1, .page-title, .day-body h2, .site-footer h2, .lead-rabbi h2 {
  font-family: var(--font);
  font-weight: 800;
  font-stretch: 68%;
  letter-spacing: -.005em;
  line-height: .92;
}

/* Header */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem var(--gutter);
}
.brand { text-decoration: none; }
.brand { display: block; line-height: 0; }
.brand img { height: clamp(52px, 5vw, 68px); width: auto; }
.brand-name { font-weight: 700; font-stretch: 75%; font-size: 1.3rem; line-height: 1.05; display: block; }
.nav { display: flex; gap: 1.75rem; }
.nav a { text-decoration: none; font-size: .95rem; color: rgba(237,230,218,.7); padding: .25rem 0; transition: color .15s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--bone); }
.nav .label-short { display: none; }
@media (max-width: 720px) { .nav .label-full { display: none; } .nav .label-short { display: inline; } }
.nav-toggle { display: none; background: none; border: 0; color: var(--bone); font: 400 1rem var(--text); cursor: pointer; padding: .5rem; }
@media (max-width: 720px) {
  .nav-toggle { display: block; position: relative; z-index: 11; }
  .nav {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; align-items: center; gap: 1.5rem;
    background: var(--night); transform: translateY(-100%); transition: transform .3s ease;
  }
  .nav.open { transform: none; }
  .nav a { font-size: 2.5rem; font-weight: 800; font-stretch: 68%; color: var(--bone); }
}

/* Home hero */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; background: var(--night); }
.hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(18,17,16,.75) 0%, rgba(18,17,16,0) 18%),
    linear-gradient(to top, rgba(18,17,16,.92) 0%, rgba(18,17,16,.2) 55%, rgba(18,17,16,.35) 100%);
}
.hero-content { position: relative; z-index: 1; padding: 0 var(--gutter) clamp(3rem, 9vh, 5.5rem); width: 100%; }
.hero h1 { font-size: clamp(3.4rem, 11vw, 10rem); margin: 0 0 2rem; }
.hero h1 span { display: block; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.btn-film {
  font-family: var(--text) !important;
  display: inline-flex; align-items: center; gap: .7rem; cursor: pointer;
  background: transparent; color: var(--gold); border: 1px solid var(--gold);
  font-size: 1rem; font-weight: 500; padding: .8rem 1.3rem;
  transition: background .15s, color .15s;
}
.btn-film:hover { background: var(--gold); color: var(--night); }
.btn-film svg { width: 12px; height: 12px; }
.hero-place { font-size: .95rem; color: var(--smoke); }

/* Scrolling day timeline */
.day {
  padding: clamp(4rem, 10vw, 7rem) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start;
}
.day-now { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; }
.now-inner { width: 100%; }
.now-time { margin: 0; display: flex; align-items: baseline; gap: .6rem; }
.now-clock { font-family: var(--font); font-weight: 800; font-stretch: 68%; font-size: clamp(6rem, 17vw, 16rem); line-height: .85; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.now-ampm { font-size: clamp(1.1rem, 2vw, 1.6rem); font-weight: 300; color: var(--smoke); }
.now-label { margin: 1.25rem 0 0; font-size: clamp(1.6rem, 3vw, 2.6rem); font-weight: 200; letter-spacing: -.03em; color: rgba(237,230,218,.8); }
.day-now.is-work .now-clock { color: var(--gold); }
.day-now.swap .now-inner { animation: nowIn .45s ease; }
@keyframes nowIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.day-body { padding: clamp(2rem, 9svh, 6rem) 0; }
.day-body h2 { font-size: clamp(2.8rem, 5.5vw, 5rem); margin: 0 0 1rem; }
.day-sub { margin: 0 0 2.5rem; color: var(--smoke); max-width: 24rem; }
.day-line { --progress: 0; list-style: none; margin: 0; padding: 0 0 0 2rem; position: relative; }
.day-line::before, .day-line::after { content: ""; position: absolute; left: 5px; top: .9rem; bottom: .9rem; width: 2px; background: var(--rule); }
.day-line::after { background: var(--bone); transform-origin: top; transform: scaleY(var(--progress)); }
.day-line li { position: relative; display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 1.75rem 0; align-items: baseline; }
.day-line li::before {
  content: ""; position: absolute; left: calc(-2rem + 1px); top: 2.35rem; width: 10px; height: 10px; border-radius: 50%;
  background: var(--night); border: 2px solid var(--smoke); z-index: 1; transition: background .2s, border-color .2s, transform .2s;
}
.day-line li.is-past::before { background: var(--bone); border-color: var(--bone); }
.day-line li.is-now::before { transform: scale(1.4); }
.day-line time { color: var(--smoke); font-variant-numeric: tabular-nums; font-size: .95rem; }
.day-line span {
  font-family: var(--text); font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.1; font-weight: 200; letter-spacing: -.035em;
  color: rgba(237,230,218,.38); transition: color .25s, font-weight .25s;
}
.day-line li.is-now span { color: var(--bone); font-weight: 600; }
.day-line li.is-now time { color: var(--bone); }
.day-line .is-work { padding: 5rem 0; margin: .75rem 0; }
.day-line .is-work::before { display: none; }
.day-line .is-work::after { content: ""; position: absolute; left: calc(-2rem + 4px); top: 0; bottom: 0; width: 4px; background: var(--gold); z-index: 1; }
.day-line .is-work time { color: var(--gold); }
.day-line .is-work.is-now span { color: var(--gold); }
@media (max-width: 860px) {
  .day { grid-template-columns: 1fr; }
  .day-now { height: auto; z-index: 2; background: var(--night); padding: 1rem 0 .75rem; margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); border-bottom: 1px solid var(--rule); }
  .now-clock { font-size: 4.5rem; }
  .now-label { margin-top: .25rem; font-size: 1.4rem; }
  .day-body { padding-top: 1rem; }
  .day-line li { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .day-line::after { transform: none; }
  .nav, .day-line span, .day-line li::before { transition: none; }
  .day-now .now-inner { animation: none !important; }
}

/* Inner pages */
.page { padding: clamp(7rem, 15vw, 10rem) var(--gutter) clamp(4rem, 10vw, 7rem); }
.page-title { font-size: clamp(3.5rem, 10vw, 8rem); margin: 0 0 2.5rem; }
.lede { font-size: clamp(1.35rem, 2.3vw, 1.8rem); font-weight: 250; letter-spacing: -.02em; line-height: 1.38; max-width: 40rem; margin: 0 0 4.5rem; }
.prose { max-width: var(--measure); color: rgba(237,230,218,.85); }
.prose p { margin: 0 0 1.25rem; }
.split { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1.5rem 4rem; padding: 2.5rem 0; border-top: 1px solid var(--rule); }
.split h2 { font-size: 1.5rem; font-weight: 400; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
.schedule { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.schedule li { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.schedule li span:first-child { color: var(--smoke); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .split { grid-template-columns: 1fr; }
  .schedule li { grid-template-columns: 1fr; gap: 0; }
}

/* Faculty */
.leads { list-style: none; margin: 0 0 5rem; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.lead-rabbi figure { margin: 0 0 1.25rem; aspect-ratio: 4 / 5; overflow: hidden; background: var(--night-2); }
.lead-rabbi img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .4s ease; }
.lead-rabbi:hover img, .lead-rabbi:focus-within img { filter: none; }
.lead-rabbi h2 { font-size: clamp(2rem, 3.6vw, 3rem); margin: 0 0 .35rem; }
.lead-rabbi p { margin: 0; color: var(--gold); }
.staff-title { font-size: 1rem; font-weight: 600; color: var(--smoke); margin: 0 0 .5rem; }
.staff { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.staff li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.staff .name { font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 300; letter-spacing: -.025em; }
.staff .role { color: var(--smoke); }
@media (max-width: 640px) {
  /* The two Roshei Yeshiva stay side by side, equal, on phones */
  .leads { gap: .75rem; margin-bottom: 3.5rem; }
  .lead-rabbi figure { margin-bottom: .75rem; }
  .lead-rabbi h2 { font-size: clamp(1.2rem, 5.6vw, 1.6rem); }
  .lead-rabbi p { font-size: .9rem; }
  .staff li { flex-direction: column; gap: 0; }
}
@media (hover: none) { .lead-rabbi img { filter: none; } }

/* Gallery */
.gallery { columns: 3 18rem; column-gap: .75rem; }
.gallery button { display: block; width: 100%; margin: 0 0 .75rem; padding: 0; border: 0; background: var(--night-2); cursor: zoom-in; break-inside: avoid; }
.gallery img { width: 100%; height: auto; transition: opacity .2s; }
.gallery button:hover img { opacity: .85; }

/* Overlays (photo viewer, film) */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(8,8,7,.96); display: none; align-items: center; justify-content: center; padding: 3.5rem 1rem; }
.overlay.open { display: flex; }
.overlay img { max-height: 100%; max-width: 100%; object-fit: contain; }
.overlay .frame { width: min(1100px, 100%); aspect-ratio: 16 / 9; }
.overlay iframe { width: 100%; height: 100%; border: 0; }
.overlay-close, .overlay-prev, .overlay-next { position: absolute; background: none; border: 0; color: var(--bone); cursor: pointer; font: 400 1rem var(--text); padding: .75rem; }
.overlay-close { top: .5rem; right: .75rem; }
.overlay-prev { left: .25rem; top: 50%; transform: translateY(-50%); font-size: 2.2rem; }
.overlay-next { right: .25rem; top: 50%; transform: translateY(-50%); font-size: 2.2rem; }

/* Footer / contact */
.site-footer { border-top: 1px solid var(--rule); padding: clamp(4rem, 9vw, 6rem) var(--gutter) 2rem; }
.site-footer h2 { font-size: clamp(2.8rem, 6vw, 5rem); margin: 0 0 2.5rem; }
.contact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.contact-grid h3 { font-size: .9rem; font-weight: 500; color: var(--smoke); margin: 0 0 .5rem; }
.contact-grid p { margin: 0; }
.contact-grid a { text-decoration: none; border-bottom: 1px solid rgba(214,180,95,.5); }
.contact-grid a:hover { color: var(--gold); border-bottom-color: var(--gold); }
.footer-logo { height: 44px; width: auto; }
.footer-base { display: flex; align-items: center; gap: .9rem; margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-size: .875rem; color: var(--smoke); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .contact-grid { grid-template-columns: 1fr; } }

/* Connected for Life campaign strip (shown Nov 14-16 and before; hidden after) */
.site-header { top: var(--strip-h, 0px); }
.cfl-strip { position: relative; z-index: 5; display: flex; align-items: center; gap: 1.5rem; padding: .55rem var(--gutter); background: #f4f2ee; color: #16263b; font-size: .9rem; }
.cfl-mark { display: block; line-height: 0; flex: none; }
.cfl-mark img { height: 32px; width: auto; }
.cfl-msg { margin: 0; line-height: 1.3; }
.cfl-msg strong { color: #9c7330; font-weight: 600; }
.cfl-msg .m-short { display: none; }
.cfl-strip.is-live .cfl-msg { font-weight: 600; }
.cfl-strip.is-live .m-when::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c0392b; margin-right: .5rem; vertical-align: .1em; animation: cflPulse 1.6s ease-in-out infinite; }
@keyframes cflPulse { 50% { opacity: .3; } }
.cfl-go { margin-left: auto; flex: none; background: #c9a45c; color: #16263b; font-weight: 600; text-decoration: none; padding: .45rem .95rem; white-space: nowrap; transition: background .15s, color .15s; }
.cfl-go:hover { background: #16263b; color: #fff; }
.cfl-x { flex: none; background: none; border: 0; color: #16263b; opacity: .55; font: 400 1.3rem/1 var(--text); cursor: pointer; padding: .2rem .35rem; }
.cfl-x:hover { opacity: 1; }
@media (max-width: 720px) {
  .cfl-strip { gap: .75rem; padding: .5rem 1rem; font-size: .85rem; }
  .cfl-mark img { height: 26px; }
  .cfl-msg .m-full { display: none; }
  .cfl-msg .m-short { display: inline; }
}
@media (prefers-reduced-motion: reduce) { .cfl-strip.is-live .m-when::before { animation: none; } }

/* Strip entrance + goal count-up */
.cfl-strip.pop { animation: cflDrop .6s cubic-bezier(.2,.9,.3,1.15) both; }
.cfl-strip.pop > * { animation: cflRise .5s ease both; }
.cfl-strip.pop > :nth-child(1) { animation-delay: .25s; }
.cfl-strip.pop > :nth-child(2) { animation-delay: .35s; }
.cfl-strip.pop > :nth-child(3) { animation-delay: .45s; }
.cfl-strip.pop > :nth-child(4) { animation-delay: .5s; }
@keyframes cflDrop { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cflRise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.cfl-msg [data-count] { font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .cfl-msg .m-short { display: flex; flex-direction: column; line-height: 1.25; font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) { .cfl-strip.pop, .cfl-strip.pop > * { animation: none; } }

/* Logos: flat white */
.brand img, .footer-logo { filter: brightness(0) invert(1); }
