/* ═══════════════════════════════════════════════════════════════
   DIRIGO — shared stylesheet
   Paper-white, editorial, photography-led. Hebrew RTL first.
   ═══════════════════════════════════════════════════════════════ */

:root{
  --paper:#ffffff;
  --paper-soft:#f5f5f4;
  --ink:#000000;
  --ink-soft:rgba(0,0,0,.58);
  --ink-faint:rgba(0,0,0,.32);
  --line:rgba(0,0,0,.12);
  --slate:#445867;
  --blue:#1a72a7;
  --cyan:#22b9ea;
  /* RTL reads right-to-left, so the logo's dark→cyan run starts at the right. */
  --cyan-deep:#1a9fd2;
  --brand-grad:linear-gradient(to left,var(--slate) 0%,var(--blue) 52%,var(--cyan-deep) 100%);
  --shell:min(1440px,92vw);
  --ease:cubic-bezier(.22,1,.36,1);
  --grain:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='.5'/></svg>");
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;overflow-x:clip}
body{
  margin:0;background:var(--paper);color:var(--ink);
  font-family:"Assistant",system-ui,"Segoe UI",sans-serif;font-weight:300;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
}
img{max-width:100%;display:block}
a{color:inherit;text-decoration:none}
h1,h2,h3{font-family:"Assistant",system-ui,sans-serif;margin:0}
/* Browsers hand every <figure> `margin: 1em 40px`. Most blocks reset it, but
   the ones that did not left the photograph floating inside its own frame —
   40px of paper down each side of a phone screen, which is what made the
   mobile layout read as unbounded. */
figure{margin:0}

/* Page-wide film grain. Multiply keeps it a tint on paper, not a haze. */
.grain{
  position:fixed;inset:-120%;z-index:60;pointer-events:none;
  opacity:.5;mix-blend-mode:multiply;background-image:var(--grain);
  animation:grain 7s steps(6) infinite;
}
@keyframes grain{
  0%{transform:translate(0,0)}20%{transform:translate(-3%,2%)}40%{transform:translate(2%,-3%)}
  60%{transform:translate(-2%,-2%)}80%{transform:translate(3%,1%)}100%{transform:translate(0,0)}
}

/* ── hero ────────────────────────────────────────────────────── */
.hero{
  position:relative;overflow:hidden;min-height:100svh;
  container-type:inline-size;background:var(--paper);isolation:isolate;
}
.corridor{position:absolute;inset:0;pointer-events:none}
.corridor-stage{position:absolute;inset:0;transform-style:preserve-3d}
.card{
  position:absolute;overflow:hidden;backface-visibility:hidden;
  /* On paper the near cards need a ground, or they bleed edgelessly into it. */
  box-shadow:0 24px 48px -28px rgba(21,23,27,.45),0 0 0 1px rgba(21,23,27,.05);
}
.card img{width:100%;height:100%;object-fit:cover;filter:contrast(1.04) saturate(1.06)}

/* Legibility scrim, inverted for paper: a bright core under the type that
   falls off before it reaches the near cards at the frame edge. */
.hero-veil{
  position:absolute;inset:0;pointer-events:none;z-index:2;
  background:
    radial-gradient(54% 47% at 50% 47%,rgba(255,255,255,.97) 0%,rgba(255,255,255,.86) 40%,rgba(255,255,255,.5) 62%,rgba(255,255,255,0) 80%),
    linear-gradient(to bottom,var(--paper) 0%,rgba(255,255,255,0) 22%,rgba(255,255,255,0) 62%,var(--paper) 100%);
}
.hero-inner{
  position:relative;z-index:4;min-height:100svh;
  width:var(--shell);margin-inline:auto;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;padding-block:8rem 5rem;
}
.eyebrow{
  display:inline-flex;align-items:center;gap:.9rem;
  font-size:.92rem;font-weight:500;letter-spacing:.3em;text-transform:uppercase;
  color:var(--ink-soft);margin:0 0 2.1rem;padding-inline-start:.3em;
}
.eyebrow::before,.eyebrow::after{
  content:"";width:clamp(18px,3vw,42px);height:1px;background:var(--cyan);opacity:.8;
}
.page-head .eyebrow::before{display:none}

.hero p.lede{
  position:relative;max-width:46ch;margin:2.6rem 0 0;padding-block-start:2.2rem;
  font-size:clamp(1.02rem,1.55vw,1.18rem);line-height:1.85;
  color:var(--ink-soft);text-wrap:pretty;
}
.hero p.lede::before{
  content:"";position:absolute;inset-block-start:0;inset-inline-start:50%;
  width:74px;height:1px;transform:translateX(50%);
  background:linear-gradient(to left,transparent,var(--cyan),transparent);
}
.hero .lede-lead{display:block;margin-bottom:.5rem;color:var(--ink);font-weight:500}
.actions{display:flex;flex-wrap:wrap;gap:1rem;justify-content:center;margin-top:3rem}
.scroll-cue{
  position:absolute;inset-block-end:2.4rem;inset-inline:0;z-index:4;
  display:flex;flex-direction:column;align-items:center;gap:.75rem;
  font-size:.7rem;letter-spacing:.3em;color:var(--ink-faint);
}
.scroll-rail{
  width:1px;height:52px;background:linear-gradient(to bottom,var(--ink),transparent);
  transform-origin:top;animation:rail 2.6s ease-in-out infinite;
}
@keyframes rail{0%,100%{transform:scaleY(.35);opacity:.5}50%{transform:scaleY(1);opacity:1}}

/* ── buttons ───────────────────────────────────────────────────
   The label rides above a fill that wipes in from the reading edge, so the
   hover has a direction instead of only swapping colour. */
.btn{
  position:relative;isolation:isolate;overflow:hidden;
  display:inline-flex;align-items:center;gap:.75rem;
  padding:1rem 1.7rem;
  border-radius:999px;font-size:1rem;font-weight:500;letter-spacing:.01em;
  border:1px solid var(--line);
  transition:color .4s var(--ease),border-color .4s var(--ease);
  will-change:transform;
}
.btn::before{
  content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;
  transform:scaleX(0);transform-origin:right center;
  transition:transform .55s var(--ease);
}
.btn:hover::before{transform:scaleX(1)}
.btn .txt{position:relative}
.btn .arrow{
  position:relative;flex:none;display:grid;place-items:center;
  opacity:.75;transition:opacity .4s var(--ease),transform .5s var(--ease);
}
.btn:hover .arrow{opacity:1;transform:translateX(-5px)}
.btn-solid{background:var(--cyan);color:var(--ink);border-color:var(--cyan)}
.btn-solid::before{background:var(--ink)}
.btn-solid:hover{color:var(--paper);border-color:var(--ink)}
.btn-ghost{background:transparent;color:var(--ink)}
.btn-ghost::before{background:var(--ink)}
.btn-ghost:hover{color:var(--paper);border-color:var(--ink)}

.rise{opacity:0;transform:translateY(26px);animation:rise 1.15s var(--ease) forwards}
@keyframes rise{to{opacity:1;transform:none}}

/* ═══ WORLDS — the three divisions ═══════════════════════════════
   Pinned while the track advances sideways. In RTL the track's start edge is
   the right one, so later panels sit off-screen to the LEFT and advancing
   means translating in +X. Each panel is a two-column composition: type on
   the reading side, photography on the far side, overlapping at the seam. */
.worlds{position:relative;background:var(--paper)}
.worlds-pin{position:sticky;top:0;height:100svh;overflow:hidden}

.worlds-head{
  position:absolute;inset-block-start:0;inset-inline:0;z-index:6;
  width:var(--shell);margin-inline:auto;padding-block:6.4rem 0;
  display:flex;align-items:baseline;justify-content:space-between;gap:2rem;
  pointer-events:none;
}
.worlds-head h2{font-weight:600;letter-spacing:-.01em;font-size:clamp(1rem,1.7vw,1.35rem)}
/* Latin runs need their own direction or bidi reorders "01 / 03" to "03 / 01". */
.worlds-count{direction:ltr;margin:0;font-size:.78rem;letter-spacing:.28em;color:var(--ink-faint)}
.worlds-count b{color:var(--ink);font-weight:700}

.worlds-track{display:flex;width:300vw;height:100%;will-change:transform}
.world{
  position:relative;width:100vw;height:100%;flex:none;
  display:grid;grid-template-columns:1.02fr .98fr;align-items:center;
  column-gap:clamp(2rem,4vw,5rem);
  padding-inline:max(4vw,calc((100vw - var(--shell)) / 2));
  padding-block:10rem 6rem;
}
.world-text{position:relative;z-index:3;min-width:0}
.world-index{
  direction:ltr;text-align:right;margin:0 0 1.4rem;
  font-size:.76rem;letter-spacing:.28em;color:var(--ink-faint);
}

/* Photography lives inside the letterforms; the fill also drifts on scroll,
   so the image parallaxes *within* the type rather than behind it. */
.world-title{
  font-weight:800;line-height:.9;letter-spacing:-.03em;
  font-size:clamp(2.6rem,6.2vw,6.4rem);margin:0;
  background-size:130% auto;
  background-position:var(--fill-x,50%) 50%;
}
@supports ((-webkit-background-clip:text) or (background-clip:text)){
  .world-title{
    -webkit-background-clip:text;background-clip:text;color:transparent;
    /* A hairline keeps the glyphs readable where the photo goes pale. */
    -webkit-text-stroke:.5px rgba(21,23,27,.22);
  }
}
/* Without text clipping an image behind solid type is worse than no image. */
@supports not ((-webkit-background-clip:text) or (background-clip:text)){
  .world-title{background-image:none!important;color:var(--ink)}
}
.world-copy{
  max-width:40ch;margin:2rem 0 0;font-size:clamp(.96rem,1.25vw,1.06rem);
  line-height:1.9;color:var(--ink-soft);
}
.world-cta{margin-top:2.4rem;width:max-content}

/* Slabs ride at their own rate and lean into the type column, so the seam
   between columns reads as depth rather than as a gutter. */
.world-media{position:relative;height:min(66vh,560px);min-width:0}
.world-slab{
  position:absolute;overflow:hidden;border-radius:2px;
  box-shadow:0 40px 80px -40px rgba(21,23,27,.5),0 0 0 1px rgba(21,23,27,.06);
  will-change:transform;
}
.world-slab img{width:100%;height:100%;object-fit:cover}
.world-slab.a{inset-block-start:0;inset-inline-start:-9%;width:60%;aspect-ratio:3/4;z-index:1}
.world-slab.b{inset-block-end:0;inset-inline-end:0;width:46%;aspect-ratio:4/5;z-index:2}

.worlds-rail{
  position:absolute;inset-block-end:1.1rem;
  inset-inline:max(4vw,calc((100vw - var(--shell)) / 2));
  height:1px;background:rgba(21,23,27,.10);z-index:6;
}
.worlds-rail-fill{display:block;height:100%;background:var(--ink);transform:scaleX(0);transform-origin:right}

.reveal{opacity:0;transform:translateY(30px);transition:opacity .9s var(--ease),transform .9s var(--ease)}
.reveal.in{opacity:1;transform:none}

/* Below the pin threshold the horizontal conceit stops helping: unpin it and
   let the three worlds stack as full-width acts. */
@media(max-width:900px){
  .worlds{height:auto!important}
  .worlds-pin{position:static;height:auto;overflow:visible}
  .worlds-head{position:static;width:var(--shell);padding-block:5.5rem 2rem}
  .worlds-track{width:100%;flex-direction:column;height:auto;transform:none!important}
  .world{
    width:100%;height:auto;grid-template-columns:1fr;
    padding-block:3.5rem 4.5rem;border-block-end:1px solid var(--line);
  }
  .world:last-child{border-block-end:0}
  .world-title{font-size:clamp(2.4rem,11vw,4rem)}
  .world-media{height:auto;margin-top:2.8rem;display:flex;align-items:flex-start}
  .world-slab{position:relative;inset:auto!important;transform:none!important}
  .world-slab.a{width:58%}
  .world-slab.b{width:42%;margin-inline-start:-10%;margin-block-start:16%}
  .worlds-rail{display:none}
  /* The leaning slabs (worlds-scroll.js) poke a few px past the edge; clip
     does not make a scroll container, so nothing else changes. */
  .worlds{overflow-x:clip}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .card{animation-play-state:paused!important}
  .grain,.scroll-rail{animation:none}
  .rise{animation-duration:.01ms}
  .reveal{opacity:1;transform:none;transition:none}
  .world-slab{transform:none!important}
}

/* ── the GPU corridor ────────────────────────────────────────────
   Sits where the DOM cards were. The page grain is dropped over the
   hero because the shader already grains those pixels. */
.hero-gl{display:block;width:100%;height:100%;pointer-events:none}
.corridor-stage:has(.hero-gl){display:block}
body.gl-hero .hero .grain{display:none}
/* hero, portrait — copy in the upper half, stream underneath it */
@media(max-width:760px){
  .hero-inner{justify-content:flex-start;padding-block:7.5rem 3rem}
  .hero-veil{
    background:
      radial-gradient(88% 34% at 50% 30%,rgba(255,255,255,.97) 0%,rgba(255,255,255,.9) 52%,rgba(255,255,255,0) 82%),
      linear-gradient(to bottom,var(--paper) 0%,rgba(255,255,255,0) 26%,rgba(255,255,255,0) 74%,var(--paper) 100%);
  }
  .hero .actions{margin-top:2.2rem}
  .scroll-cue{inset-block-end:1.2rem}
}