/* ═══════════════════════════════════════════════════════════════
   LEVIS VISION — BASE
   Reset, typography, bidirectional foundation, global surfaces.

   BIDI POLICY
   Every directional value in this project uses CSS logical
   properties (inline-start/end, margin-inline, inset-inline).
   Physical left/right appears ONLY where the property is
   genuinely physical — box-shadow offsets, background angles,
   and transform translations that mirror via [dir] overrides.
   ═══════════════════════════════════════════════════════════════ */

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor targets clear the fixed nav */
  scroll-padding-block-start: 6rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--fg-primary);
  font-family: var(--font-body);
  font-size: var(--t-body);
  font-weight: var(--w-book);
  line-height: var(--leading-body);
  letter-spacing: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
}

/* Locks scroll behind the menu / project overlay without the
   layout shifting as the scrollbar disappears. */
body[data-scroll-locked] {
  overflow: hidden;
  /* scrollbar-gutter reserves the space the bar occupied */
  scrollbar-gutter: stable;
}

/* ── LANGUAGE & DIRECTION ─────────────────────────────────────
   Hebrew leads with Heebo; English leads with Archivo. Both keep
   the other as fallback so a mixed string never falls to a
   system font mid-sentence.                                     */
:root:lang(he),
[lang="he"] {
  --font-display: 'Heebo', 'Archivo', system-ui, sans-serif;
  --font-body:    'Heebo', 'Archivo', system-ui, sans-serif;
}

:root:lang(en),
[lang="en"] {
  --font-display: 'Archivo', 'Heebo', system-ui, sans-serif;
  --font-body:    'Archivo', 'Heebo', system-ui, sans-serif;
}

/* Hebrew runs slightly larger at the same nominal size because
   Heebo's x-height is shorter than Archivo's. */
[lang="he"] body,
body[lang="he"] { font-size: 1.0625rem; }

/* Latin fragments inside Hebrew (brand names, TikTok, 4K, prices)
   must not reorder. Wrap them in <span class="ltr">. */
.ltr {
  unicode-bidi: isolate;
  direction: ltr;
}
.rtl {
  unicode-bidi: isolate;
  direction: rtl;
}
/* Numerals and currency inside RTL copy */
.num {
  unicode-bidi: isolate;
  direction: ltr;
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1;
}

/* ── TYPOGRAPHY ───────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--w-black);
  line-height: var(--leading-heading);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

h1 { font-size: var(--t-h1); line-height: var(--leading-tight); letter-spacing: var(--track-display); }
h2 { font-size: var(--t-h2); line-height: var(--leading-tight); letter-spacing: var(--track-display); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); }

p {
  text-wrap: pretty;
  max-width: var(--measure);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-base) var(--ease-out),
              opacity var(--dur-base) var(--ease-out);
}

strong, b { font-weight: var(--w-bold); }

ul, ol { list-style: none; }

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  /* Every interactive control clears the 44px minimum */
  min-block-size: var(--tap-min);
  min-inline-size: var(--tap-min);
}

input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

::selection {
  background: var(--ink-200);
  color: var(--ink-950);
}

/* ── FOCUS ────────────────────────────────────────────────────
   Never removed. Visible on every focusable thing, keyboard-only
   where the browser supports :focus-visible.                    */
:focus-visible {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-sm);
}

/* Elements that sit on light ground invert the ring */
.on-light :focus-visible { outline-color: var(--ink-950); }

/* ── HIDDEN MEANS HIDDEN ──────────────────────────────────────
   The browser's own `[hidden] { display: none }` is a user-agent
   rule, so ANY author rule that sets display beats it. A component
   styled `.thing { display: grid }` therefore stays laid out while
   carrying the hidden attribute, and a full-viewport overlay in
   that state swallows every click on the page while being
   invisible. Enforce the attribute globally instead of trusting
   each component to remember. */
[hidden] { display: none !important; }

/* ── NO-JS SAFETY ────────────────────────────────────────────
   The intro veil is a full-page plate. If scripting never runs,
   nothing would ever lift it and the site would be a black
   rectangle, so it starts retracted and only the script that can
   also lift it puts it up. `no-js` is removed by app.js on boot. */
html.no-js .veil {
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
}

/* ── SKIP LINK ───────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  inset-block-start: var(--sp-4);
  inset-inline-start: var(--sp-4);
  z-index: calc(var(--z-veil) + 1);
  padding: var(--sp-3) var(--sp-5);
  background: var(--white);
  color: var(--ink-950);
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus {
  transform: translateY(0);
}

/* ── SCREEN READER ONLY ──────────────────────────────────────── */
.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── LAYOUT PRIMITIVES ───────────────────────────────────────── */
.shell {
  inline-size: 100%;
  max-inline-size: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell-narrow {
  inline-size: 100%;
  max-inline-size: var(--max-w-text);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { position: relative; }

.section {
  padding-block: var(--section-y);
}
.section-lg {
  padding-block: var(--section-y-l);
}
.section-line {
  border-block-start: 1px solid var(--line-subtle);
}

/* ── CINEMATIC GRAIN ──────────────────────────────────────────
   A fixed noise plate over the whole document. Pointer-events
   none, aria-hidden, and removed entirely under reduced motion
   and high contrast (see tokens.css).                           */
.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
  /* No will-change here: this layer's opacity never animates, and
     hinting it would permanently promote a full-viewport blended
     surface that the compositor then has to keep alive on every
     frame — the exact cost this effect must not carry. */
  contain: strict;
}

/* ── VIGNETTE ────────────────────────────────────────────────
   Pulls the eye to centre frame. Purely physical, so radial
   geometry needs no RTL mirroring.                             */
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 120% 80% at 50% 45%,
    transparent 40%,
    rgba(5, 6, 7, 0.55) 100%
  );
}

/* ── EYEBROW / SECTION NUMBER ─────────────────────────────────
   The small tracked label that opens every section. Mirrors the
   logo's wide-tracked LEVIS.                                    */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--t-label);
  font-weight: var(--w-med);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--fg-muted);
}

.eyebrow::before {
  content: '';
  inline-size: clamp(24px, 4vw, 56px);
  block-size: 1px;
  background: var(--line-strong);
  flex: none;
}

.eyebrow-center {
  justify-content: center;
}
.eyebrow-center::after {
  content: '';
  inline-size: clamp(24px, 4vw, 56px);
  block-size: 1px;
  background: var(--line-strong);
  flex: none;
}

/* ── LEAD PARAGRAPH ──────────────────────────────────────────── */
.lead {
  font-size: var(--t-body-lg);
  font-weight: var(--w-light);
  line-height: var(--leading-relaxed);
  color: var(--fg-secondary);
  max-width: var(--measure);
}

.muted { color: var(--fg-muted); }
.center { text-align: center; }
.center p, .center .lead { margin-inline: auto; }

/* ── PRINT ───────────────────────────────────────────────────── */
@media print {
  .grain, .vignette, nav, .sound-toggle, .cursor { display: none !important; }
  body { background: #fff; color: #000; }
}
