/* Neritation. The eight sections, the post page, the 404. */

/* ---- 1. Hero ---- */
.hero { position: relative; }
.hero__pin {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: calc(var(--header-h) + 2rem) 3rem;
}
/* The scrub. The pin is sticky for (section height - 100vh) of scroll, so a 300vh
   section pins for 200vh: the first 100vh a hold at p=0, the second the scrub, and the
   pin releases exactly when p reaches 1. */
.hero-scrub .hero { height: 300vh; }
.hero-scrub .hero__pin { position: sticky; top: 0; height: 100svh; min-height: 0; padding-block: var(--header-h) 0; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}
/* Copy at the inline start, mark at the inline end. */
.hero__copy { display: flex; flex-direction: column; gap: 3.5rem; max-inline-size: var(--measure); }
.hero-scrub .hero__copy { display: grid; }
.hero-scrub .hero__beat { grid-area: 1 / 1; }
.hero__beat { display: flex; flex-direction: column; gap: 1.5rem; will-change: opacity; }
.hero__beat .display { max-inline-size: 14ch; }
.hero__cta { margin-block-start: 0.5rem; }
/* The script drives these. Without it everything is visible, stacked, in reading order. */
.hero-scrub .hero__beat--2, .hero-scrub .hero__cta { opacity: 0; }
.hero-scrub .hero__cta { visibility: hidden; }

.hero__mark { display: grid; place-items: center; }
.hero__mark .mark {
  width: min(100%, 72vh, 640px);
  aspect-ratio: 1;
  transform-origin: 50% 50%;
  will-change: transform;
}
.hero--static .hero__pin { animation: hero-fade 400ms var(--ease) both; }
@keyframes hero-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 767px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__mark {
    position: absolute;
    inset: var(--header-h) 0 0 0;
    z-index: 0;
    pointer-events: none;
    align-items: center;
  }
  /* End state at 0.85 scale, behind the copy at 0.35. Starlight over the bluest pixel is 10.6:1. */
  .hero__mark .mark { width: min(85vw, 85vh); opacity: 0.35; transform: scale(0.85); }
  .hero__copy { position: relative; z-index: 1; }
  .hero--mobile .hero__mark .mark { animation: hero-mark-enter 900ms var(--ease) both; }
  @keyframes hero-mark-enter { from { opacity: 0; transform: scale(0.8); } to { opacity: 0.35; transform: scale(0.85); } }
}

/* ---- 2. Disciplines rail ---- */
.rail { overflow: clip; }
.rail__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.rail__head .section__head { margin-block-end: 0; }
.rail__controls { display: flex; gap: 0.5rem; margin-block-end: 0.5rem; flex: none; }
.rail__btn {
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--void-edge);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--starlight);
  transition: border-color var(--dur), opacity var(--dur);
}
.rail__btn:hover { border-color: var(--dust); }
.rail__btn[disabled] { opacity: 0.3; cursor: default; }
/* The chevron points along the inline axis: next points left in RTL. */
.rail__btn--prev svg { transform: scaleX(-1); }
[dir="rtl"] .rail__btn--prev svg { transform: none; }
[dir="rtl"] .rail__btn--next svg { transform: scaleX(-1); }

.rail__viewport { margin-block-start: clamp(2rem, 1.5rem + 2vw, 3rem); }
.rail__track {
  --edge: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0 var(--edge);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--edge);
  scrollbar-width: none;
}
.rail__track::-webkit-scrollbar { display: none; }
.rail__panel {
  flex: 0 0 min(82vw, 380px);
  scroll-snap-align: start;
  min-height: 26rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem;
  border: 1px solid var(--void-edge);
  border-radius: 24px;
  background: var(--void-raised);
  color: var(--text-indigo);
}
.rail__glyph { width: 3.25rem; height: 3.25rem; margin-block-end: auto; }
.rail__label { color: var(--starlight); font-size: var(--fs-h3); }
.rail__body { color: var(--text-muted); line-height: 1.6; }
.rail__panel--close {
  background: linear-gradient(160deg, color-mix(in srgb, var(--ajna-indigo) 38%, var(--void-raised)), var(--void-raised) 70%);
  border-color: color-mix(in srgb, var(--ajna-indigo) 40%, var(--void-edge));
}
.rail__panel--close .rail__body { color: var(--starlight); }
.rail__cta { margin-block-start: 0.5rem; }
.rail__progress { height: 2px; background: var(--void-edge); margin-block-start: 2rem; position: relative; border-radius: 2px; overflow: hidden; }
.rail__progress-bar {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--w, 10%);
  background: var(--starlight);
  opacity: 0.7;
  transition: width 120ms linear;
}

@media (max-width: 767px) {
  .rail__head { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .rail__controls { margin-block-end: 0; }
}

/* ---- 3. Logo wall ---- */
.wall { padding-block: clamp(3rem, 2rem + 3vw, 5rem); border-block: 1px solid var(--void-edge); }
.wall__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 2.5rem clamp(2rem, 5vw, 4.5rem);
}
/* Monochrome at rest, one treatment for all. */
.wall__item img { height: 2rem; width: auto; filter: grayscale(1) brightness(1.6); opacity: 0.55; transition: opacity var(--dur); }
.wall__item img:hover { opacity: 0.9; }

/* ---- 4. Method ---- */
.method__grid { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 2rem clamp(2rem, 6vw, 6rem); align-items: start; }
/* Hebrew index labels run 4 to 6 characters: a narrower column. */
html:lang(he) .method__grid { grid-template-columns: 7.5rem minmax(0, 1fr); }
.method__index {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.method__index a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.45rem 0;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--dur);
}
.method__index a::before {
  content: "";
  width: 1.5rem; height: 0.375rem;
  border-radius: var(--radius-pill);
  background: var(--void-edge);
  flex: none;
  transition: width var(--dur) var(--ease), background var(--dur);
}
.method__index a:hover { color: var(--starlight); }
.method__index .is-active a { color: var(--starlight); font-weight: 500; }
.method__index .is-active a::before { width: 2.5rem; background: var(--text-indigo); }
.method__stages { list-style: none; margin: 0; padding: 0; }
.stage {
  padding-block: clamp(2rem, 1.5rem + 2vw, 3.25rem);
  border-top: 1px solid var(--void-edge);
  display: grid; gap: 0.875rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.stage:last-child { border-bottom: 1px solid var(--void-edge); }
.stage__label { font-size: var(--fs-h3); }
.stage__line { font-size: 1.125rem; line-height: 1.6; max-inline-size: var(--measure); }
.stage__output { color: var(--text-secondary); font-size: 0.9375rem; }
.stage__output-label { color: var(--starlight); font-weight: 500; }
@media (max-width: 767px) {
  .method__grid, html:lang(he) .method__grid { grid-template-columns: 1fr; }
  .method__index {
    top: var(--header-h);
    z-index: 5;
    flex-direction: row; flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    padding-block: 0.75rem;
    background: color-mix(in srgb, var(--void) 92%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  .method__index a::before { width: 0.9rem; }
  .method__index .is-active a::before { width: 1.5rem; }
}

/* ---- 5. Work ---- */
.work__rows { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--void-edge); }
.work__row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto;
  gap: 1.5rem 3rem;
  padding-block: 2.25rem;
  border-top: 1px solid var(--void-edge);
  align-items: start;
}
.work__client { font-size: var(--fs-h3); }
.work__tags { margin-block-start: 0.5rem; color: var(--text-secondary); font-size: 0.875rem; }
.work__problem { color: var(--text-muted); }
.work__outcome { margin-block-start: 0.5rem; color: var(--starlight); }
.work__meta { color: var(--text-secondary); font-size: 0.875rem; white-space: nowrap; text-align: end; }
@media (max-width: 767px) {
  .work__row { grid-template-columns: 1fr; gap: 1rem; }
  .work__meta { text-align: start; }
}

/* ---- 6. Who we work with. No mark, no figure, no second colour. ---- */
.who { position: relative; padding-block: calc(var(--section-y) * 1.15); }
.who__inner { display: flex; flex-direction: column; gap: 2rem; }
.who__statement { font-size: var(--fs-h2); max-inline-size: 20ch; margin-block-end: 1rem; }
.who p { font-size: var(--fs-lg); line-height: 1.65; max-inline-size: var(--measure); }
html:lang(he) .who p { line-height: 1.72; }
/* Two hairlines, 112px, the mark's resting channel width, in lifted Ajna. */
.who__rule { position: absolute; width: 112px; height: 1px; background: var(--text-indigo); }
.who__rule--top { top: 0; inset-inline-end: var(--gutter); }
.who__rule--bottom { bottom: 0; inset-inline-start: var(--gutter); }

/* ---- 7. Writing ---- */
.writing__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.writing__head .section__head { margin-block-end: 0; }
.writing__all { margin-block-end: 0.5rem; }
.writing .cards { margin-block-start: clamp(2rem, 1.5rem + 2vw, 3rem); }

/* ---- 8. Apply ---- */
.apply__body { max-inline-size: 640px; }
.apply__submit { margin-block-start: 1rem; display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; }
.apply__under { color: var(--text-secondary); font-size: 0.9375rem; max-inline-size: 40ch; }

/* ---- Post, page, 404 ---- */
.post__head { margin-block-end: 2.5rem; }
.post__title { font-size: var(--fs-h2); }
.post__meta { margin-block-start: 1.25rem; color: var(--text-secondary); font-size: 0.9375rem; }
.post__figure { margin-block-end: 2.5rem; }
.post__figure img { border-radius: var(--radius); width: 100%; }
.post__foot { margin-block-start: 4rem; padding-block-start: 2rem; border-top: 1px solid var(--void-edge); }
.not-found { min-height: 60vh; display: flex; align-items: center; }

/* ---- Under construction (template-parts/maintenance-page.php) ---- */
.maintenance {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.75rem;
  padding: 2rem;
  text-align: center;
}
.maintenance__mark { width: min(40vw, 220px); margin-block-end: 1.5rem; }
.maintenance__mark .mark { width: 100%; height: auto; display: block; }
.maintenance__name {
  font-family: var(--font-mono, "Geist Mono", monospace);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0;
}
.maintenance__title { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.1; margin: 0; }
.maintenance__body { color: var(--text-muted); margin: 0; }
