:root {
  --void: #04060f;
  --deep: #0a1028;
  --ink: #eef1f8;
  --dim: #8992ae;
  --gold: #e8c368;
  --gold-hot: #fff3d0;
  --steel: #7fb4d4;
  --line: rgba(180, 205, 230, 0.14);

  --display: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --hebrew: "Frank Ruhl Libre", "Times New Roman", serif;

  --measure: 33rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============ The scene ============
   A floor receding to a horizon, a lit gate standing on it, and haze between
   the two. Everything here is decorative and sits behind the content. */

.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 52%, #16214d 0%, rgba(22, 33, 77, 0) 62%),
    linear-gradient(180deg, #070c20 0%, var(--void) 48%, #02030a 100%);
}

/* Horizon: the bright seam the floor runs toward. */
.scene::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  top: 52%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 195, 104, 0.55), transparent);
  box-shadow: 0 0 60px 12px rgba(232, 195, 104, 0.13);
}

/* Perspective floor. The gradients draw the lines; the 3D rotation supplies the
   depth; the scroll animation makes it read as motion toward the viewer. */
.floor {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 320vw;
  height: 130vh;
  margin-left: -160vw;
  transform: perspective(28vh) rotateX(66deg);
  transform-origin: 50% 0;
  background-image:
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 5.2vw),
    repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 5.2vw);
  animation: approach 9s linear infinite;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 26%, transparent 62%);
}

@keyframes approach {
  to { background-position: 0 5.2vw, 0 5.2vw; }
}

/* Depth haze sitting on the horizon so the floor dissolves rather than ends. */
.haze {
  position: absolute;
  left: 0;
  right: 0;
  top: 34%;
  height: 42%;
  background: radial-gradient(70% 100% at 50% 60%, rgba(30, 44, 100, 0.5), transparent 70%);
  filter: blur(30px);
}

/* The gate itself. */
/* Offset right so the gate and the headline share the frame instead of
   fighting over the same pixels. */
.portal {
  position: absolute;
  left: 73%;
  top: 52%;
  width: min(66vh, 58vw);
  transform: translate(-50%, -59%);
  opacity: 0.9;
  animation: breathe 11s ease-in-out infinite;
}

/* Once the text column takes the full width the gate has to step back behind
   it rather than beside it. */
@media (max-width: 62rem) {
  .portal {
    left: 50%;
    width: min(72vh, 96vw);
    opacity: 0.45;
  }
}

/* Darkens the side the copy sits on. Without it the arch strokes and floor
   lines cut straight through the headline. */
.scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      100deg,
      rgba(4, 6, 15, 0.94) 0%,
      rgba(4, 6, 15, 0.82) 30%,
      rgba(4, 6, 15, 0.35) 52%,
      transparent 68%
    ),
    /* The floor lines converge low and left, straight through the lede and the
       form — this second pass sinks them. */
    linear-gradient(180deg, transparent 42%, rgba(4, 6, 15, 0.6) 76%, rgba(4, 6, 15, 0.88) 100%);
}

@media (max-width: 62rem) {
  .scrim { background: rgba(4, 6, 15, 0.72); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

/* Drifting Hebrew glyphs — depth cues that also say what this place is for. */
.glyphs {
  position: absolute;
  inset: 0;
  font-family: var(--hebrew);
  color: var(--gold);
  pointer-events: none;
}

.glyphs span {
  position: absolute;
  font-size: var(--s, 1.4rem);
  opacity: 0;
  animation: rise var(--d, 26s) linear var(--delay, 0s) infinite;
}

@keyframes rise {
  0% { opacity: 0; transform: translateY(0) scale(0.65); }
  12% { opacity: 0.5; }
  70% { opacity: 0.16; }
  100% { opacity: 0; transform: translateY(-42vh) scale(1.5); }
}

/* Fine scanlines — the tell that this is a rendered space, not a photograph.
   Kept very low contrast so text stays crisp. */
.scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.022) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}

/* Vignette, to keep the eye in the middle. */
.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(100% 75% at 50% 45%, transparent 45%, rgba(2, 3, 10, 0.85) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .floor,
  .portal,
  .glyphs span { animation: none; }
  .glyphs span { opacity: 0.18; }
  html { scroll-behavior: auto; }
}

/* ============ Chrome ============ */

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.masthead {
  padding: 1.5rem 0 0;
}

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand svg { flex: none; }

.brand-name {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  line-height: 1.5;
}

.brand-name span {
  display: block;
  color: var(--gold);
}

/* Status pill — interface furniture, and it states the actual state. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(10, 16, 40, 0.5);
  backdrop-filter: blur(6px);
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(232, 195, 104, 0.6);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 7px rgba(232, 195, 104, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 195, 104, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .status::before { animation: none; }
}

/* Two lines of pill crowding the wordmark reads worse than no pill at all. */
@media (max-width: 34rem) {
  .status { display: none; }
}

/* ============ Hero ============ */

main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: clamp(2rem, 7vh, 5rem) 0 2.5rem;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0 0 1.6rem;
}

.eyebrow::after {
  content: "";
  flex: 1;
  max-width: 7rem;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.verse {
  font-family: var(--hebrew);
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  color: var(--gold);
  direction: rtl;
  text-align: left;
  margin: 0 0 0.35rem;
  text-shadow: 0 0 26px rgba(232, 195, 104, 0.35);
}

.verse-ref {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 2rem;
}

h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.5rem, 7.6vw, 4.9rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.35rem;
  max-width: 21ch;
  text-shadow: 0 0 70px rgba(120, 160, 255, 0.22);
}

h1 em {
  display: block;
  font-style: italic;
  color: var(--gold);
  text-shadow: 0 0 42px rgba(232, 195, 104, 0.4);
}

.lede {
  font-size: clamp(1rem, 1.9vw, 1.13rem);
  color: var(--dim);
  max-width: var(--measure);
  margin: 0 0 2.25rem;
}

.lede strong {
  color: var(--ink);
  font-weight: 500;
}

/* ============ Form ============ */

.signup { max-width: var(--measure); }

.field-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(9, 14, 34, 0.55);
  backdrop-filter: blur(10px);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.field-row:focus-within {
  border-color: rgba(232, 195, 104, 0.55);
  box-shadow: 0 0 0 1px rgba(232, 195, 104, 0.2), 0 0 40px rgba(232, 195, 104, 0.1);
}

.signup label.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

input[type="email"] {
  flex: 1 1 13rem;
  min-width: 0;
  padding: 0.8rem 0.9rem;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
}

input[type="email"]::placeholder { color: rgba(137, 146, 174, 0.75); }
input[type="email"]:focus { outline: none; }

button {
  flex: 0 0 auto;
  padding: 0.8rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #120e04;
  background: linear-gradient(180deg, var(--gold-hot), var(--gold));
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  transition: filter 0.2s, transform 0.12s, box-shadow 0.25s;
  box-shadow: 0 0 26px rgba(232, 195, 104, 0.28);
}

button:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 38px rgba(232, 195, 104, 0.45);
}

button:active { transform: translateY(1px); }

button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

button[disabled] {
  opacity: 0.5;
  cursor: progress;
  box-shadow: none;
}

.fineprint {
  font-size: 0.76rem;
  color: var(--dim);
  margin: 0.95rem 0 0;
  max-width: 30rem;
}

.msg {
  margin: 0.8rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  min-height: 1.4em;
}

.msg[data-state="error"] { color: #ffa8a8; }
.msg[data-state="ok"] { color: var(--gold); }

.thanks {
  max-width: var(--measure);
  padding: 1.4rem 1.5rem;
  border: 1px solid rgba(232, 195, 104, 0.35);
  border-radius: 4px;
  background: rgba(9, 14, 34, 0.6);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 60px rgba(232, 195, 104, 0.12);
}

.thanks h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.9rem;
  margin: 0 0 0.4rem;
  color: var(--gold);
}

.thanks p {
  color: var(--dim);
  margin: 0;
  font-size: 0.95rem;
}

[hidden] { display: none !important; }

/* ============ Pillars ============ */

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0;
  margin: 4rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.pillars li {
  padding: 1.75rem 1.5rem 0.5rem 0;
  border-right: 1px solid var(--line);
}

.pillars li:last-child { border-right: 0; }

@media (max-width: 46rem) {
  .pillars li {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 1.4rem 0;
  }
  .pillars li:last-child { border-bottom: 0; }
}

.pillars .idx {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 0.7rem;
}

.pillars h3 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0 0 0.4rem;
  line-height: 1.2;
}

.pillars p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--dim);
}

/* ============ Why a room ============ */

.why {
  padding: clamp(3.5rem, 10vh, 7rem) 0 1rem;
  border-top: 1px solid var(--line);
}

.why-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

@media (max-width: 62rem) {
  .why-grid { grid-template-columns: 1fr; }
}

.why h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  max-width: 20ch;
}

.why-lede {
  color: var(--dim);
  max-width: 34rem;
  margin: 0 0 2.5rem;
}

.reasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 48rem) {
  .reasons {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 2.5rem;
  }
}

.reasons li {
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.reasons h3 {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 500;
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

.reasons p {
  margin: 0;
  font-size: 0.89rem;
  color: var(--dim);
}

/* ---- The plan view ---- */

.why-map {
  margin: 0;
  position: sticky;
  top: 2rem;
}

@media (max-width: 62rem) {
  .why-map {
    position: static;
    max-width: 26rem;
    margin: 3rem auto 0;
  }
}

/* The scene's gate is fixed behind the whole page, and it is also an arch — the
   plan view needs its own surface or the two arches read as one muddle. */
.map-frame {
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(10, 16, 40, 0.82), rgba(4, 6, 15, 0.88));
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

.why-map svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.map-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  fill: var(--dim);
}

.why-map figcaption {
  margin-top: 1.25rem;
  font-size: 0.76rem;
  color: var(--dim);
  max-width: 24rem;
}

/* The desk and the two learners across it. */
.desk {
  fill: none;
  stroke: #b4cde6;
  stroke-opacity: 0.3;
  stroke-width: 1.2;
}

.seat {
  fill: var(--gold);
  animation: attend 4.4s ease-in-out infinite;
  animation-delay: var(--t, 0s);
}

/* The chavrusa itself — the thread between the pair. */
.link {
  stroke: var(--gold);
  stroke-opacity: 0.45;
  stroke-width: 1.2;
}

/* An idea travelling back and forth across the table. */
.pulse {
  fill: var(--gold-hot);
  animation: shuttle 4.4s ease-in-out infinite;
  animation-delay: var(--t, 0s);
}

.halo {
  animation: attend 4.4s ease-in-out infinite;
  animation-delay: var(--t, 0s);
}

@keyframes shuttle {
  0%, 100% { transform: translateX(-33px); }
  50% { transform: translateX(33px); }
}

@keyframes attend {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* The maggid shiur walking the floor, table to table. */
.rebbe {
  fill: var(--gold-hot);
  animation: rounds 26s ease-in-out infinite;
}

@keyframes rounds {
  0%   { transform: translate(165px, 130px); }
  14%  { transform: translate(140px, 188px); }
  28%  { transform: translate(190px, 188px); }
  44%  { transform: translate(190px, 266px); }
  58%  { transform: translate(140px, 266px); }
  72%  { transform: translate(140px, 344px); }
  86%  { transform: translate(190px, 344px); }
  100% { transform: translate(165px, 130px); }
}

@media (prefers-reduced-motion: reduce) {
  .seat,
  .pulse,
  .halo,
  .rebbe { animation: none; }
  .rebbe { transform: translate(165px, 188px); }
}

/* ============ Footer ============ */

footer {
  padding: 2.5rem 0 2.25rem;
  font-size: 0.73rem;
  color: rgba(137, 146, 174, 0.8);
  border-top: 1px solid var(--line);
  margin-top: 3.5rem;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  align-items: baseline;
  justify-content: space-between;
}

.disclaimer {
  margin: 0;
  max-width: 46rem;
}

.colophon {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
