/* ============================================================================
   MGNTION — RESPONSIVE SYSTEM

   Eight tiers, each designed rather than interpolated. The rule throughout:
   a handheld gets FEWER things at FULL size, never everything at reduced size.

     xs   320-375   small phones      one column, stanza hero, 44px targets
     sm   376-429   standard phones   more air, larger display type
     md   430-599   large phones      two-up grids return
     ts   600-833   small tablets     nav returns, plates go 16:10
     tl   834-1023  large tablets     two-column argument, desktop rhythm
     lap  1024-1439 laptops           full desktop composition
     dt   1440-1919 desktops          the reference design
     uw   1920+     ultrawide         wider measure, larger gutters, capped text

   Loaded last so it wins on equal specificity.
   ========================================================================= */

/* ============================================================================
   TOUCH BASELINE — applies to every coarse pointer regardless of width
========================================================================== */
@media (pointer: coarse) {
  /* momentum and rubber-banding, contained so a nested scroller never
     drags the page behind it */
  html, body { -webkit-overflow-scrolling: touch; }
  .arch__scroll, .cs__scroll, .dg__panel, .menu {
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }

  /* nothing relies on hover: every hover affordance gets a resting state */
  .range__row::before { transform: scaleX(0); }
  .range__row:active::before { transform: scaleX(1); }
  .action:active::before { transform: scaleY(1); }
  .action:active .action__t, .action:active .action__x { color: var(--ink); }
  .tok:active { border-color: var(--acc); background: rgba(var(--acc-rgb), .12); }
  .cap::before { transform: translateY(101%); }
  .cap:active::before { transform: translateY(0); }

  /* 44px minimum on every control */
  .langs button { min-width: 44px; min-height: 44px; }
  .nav__contact { min-height: 44px; padding-inline: .85rem; }
  .dg__zoom button { min-width: 46px; min-height: 46px; font-size: 15px; }
  .foot-b__idx a { padding-block: .55rem; }
  .close__mail { padding-block: .6rem; }
  .plate__watch { min-height: 46px; padding-inline: 1.1rem; }
  .sub__h { min-height: 56px; }
  .cs__j, .cs__fb, .arch__backb, .arch__live { min-height: 46px; }
  .film__x { min-height: 44px; display: inline-flex; align-items: center; }

  /* tap highlight is the browser's, not ours */
  a, button { -webkit-tap-highlight-color: rgba(var(--acc-rgb), .18); }
}

/* the custom cursor is desktop-only; make sure nothing reserves space for it */
@media (hover: none) { .cursor, .cursor-dot { display: none !important; } }

/* A floor that applies at every width. A 15px link is a poor target for a
   mouse too; the handheld rules below raise these further to 44px. */
.nav__mark, .langs button, .plate__watch { min-height: 36px; }
.langs button { min-width: 36px; }
.foot-b__idx a, .foot-b__bot a, .close__mail {
  min-height: 34px; display: inline-flex; align-items: center;
}
.nav__links a { min-height: 40px; display: inline-flex; align-items: center; }
.nav__mark { display: inline-flex; align-items: center; }

/* Target sizing is also width-driven, not only pointer-driven. A 320px
   viewport is a handheld whatever the browser claims about its pointer, some
   touch laptops report `fine`, and 834px is an iPad. Runs to 1023 so every
   tablet is covered; a mouse loses nothing from a larger target. */
@media (max-width: 1023px) {
  .nav__mark { min-height: 44px; display: inline-flex; align-items: center; }
  .nav__links a { min-height: 44px; display: inline-flex; align-items: center; }
  .nav__contact, .nav__menu { min-height: 44px; }
  .langs button { min-width: 44px; min-height: 44px; }
  .foot-b__idx a { min-height: 44px; display: inline-flex; align-items: center; }
  .foot-b__bot a { min-height: 44px; display: inline-flex; align-items: center; }
  .close__mail { min-height: 44px; display: inline-flex; align-items: center; }
  .plate__watch { min-height: 46px; padding-inline: 1.1rem; }
  .dg__zoom button { min-width: 46px; min-height: 46px; font-size: 15px; }
  .sub__h { min-height: 56px; }
  .cs__j, .cs__fb, .arch__backb, .arch__live { min-height: 46px; }
  .arch__back, .cs__back { min-height: 44px; }
  .film__x { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .spec li { min-height: 36px; display: inline-flex; align-items: center; }
}

/* ============================================================================
   MOBILE MENU — a surface, not a dropdown
========================================================================== */
.nav__menu {
  display: none; align-items: center; justify-content: center; gap: .55rem;
  min-height: 44px; min-width: 44px; padding-inline: .5rem;
}
.nav__burger { position: relative; width: 20px; height: 12px; display: block; }
.nav__burger i {
  position: absolute; inset-inline: 0; height: 1.5px; background: var(--warm);
  transition: transform var(--d-mid) var(--e-inout), opacity var(--d-fast) linear;
}
.nav__burger i:first-child { top: 0; }
.nav__burger i:last-child { bottom: 0; }
[aria-expanded='true'] .nav__burger i:first-child { transform: translateY(5.25px) rotate(45deg); }
[aria-expanded='true'] .nav__burger i:last-child  { transform: translateY(-5.25px) rotate(-45deg); }
.nav__menut {
  font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .18em;
  text-transform: uppercase; color: var(--warm-2);
}
[data-lang='he'] .nav__menut, [data-lang='ar'] .nav__menut {
  font-family: var(--f-body); letter-spacing: .04em; font-size: var(--t-sm); font-weight: 600;
}

.menu {
  position: fixed; inset: 0; z-index: 7500; background: var(--void);
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + 2rem) var(--gut) 2rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 560ms var(--e-mask);
  overflow-y: auto;
}
.menu[hidden] { display: none; }
.menu.is-open { clip-path: inset(0 0 0 0); }
.menu::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(90% 50% at 50% 0%, rgba(201,162,39,.10), transparent 60%);
}
.menu__nav { position: relative; display: grid; }
.menu__nav a {
  display: grid; grid-template-columns: 3rem 1fr; align-items: baseline; gap: 1rem;
  padding-block: clamp(.7rem, 2.2vh, 1.2rem);
  border-bottom: 1px solid var(--rule);
  opacity: 0; transform: translateY(14px);
  transition: opacity 520ms var(--e-out), transform 520ms var(--e-out), color var(--d-fast) var(--e-out);
  transition-delay: calc(var(--i) * 55ms + 120ms);
}
.menu.is-open .menu__nav a { opacity: 1; transform: none; }
.menu__nav a span:first-child { color: var(--warm-3); }
.menu__t {
  font-size: clamp(2rem, 11vw, 3.4rem); letter-spacing: -.035em; line-height: 1;
}
[data-lang='he'] .menu__t, [data-lang='ar'] .menu__t { text-transform: none; letter-spacing: 0; line-height: 1.25; }
.menu__nav a:active .menu__t, .menu__nav a:focus-visible .menu__t { color: var(--gold); }
.menu__nav a:active span:first-child { color: var(--gold); }

.menu__foot {
  position: relative; margin-top: auto; padding-top: 2rem;
  display: grid; gap: .9rem;
  opacity: 0; transition: opacity 520ms var(--e-out) 380ms;
}
.menu.is-open .menu__foot { opacity: 1; }
.menu__langs { display: flex; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.menu__langs button {
  flex: 1; min-height: 52px; background: var(--void); color: var(--warm-2);
  font-family: var(--f-body); font-size: var(--t-sm); font-weight: 600;
  transition: background var(--d-fast) var(--e-out), color var(--d-fast) var(--e-out);
}
.menu__langs button[aria-current='true'] { background: var(--gold); color: var(--ink); }
.menu__mail { color: var(--warm-3); padding-block: .5rem; }
body.menu-open { overflow: hidden; }

/* ============================================================================
   xs · 320-375 — SMALL PHONES
   One column everywhere. The hero becomes stanzas. Nothing is halved.
========================================================================== */
@media (max-width: 375px) {
  :root { --gut: 1.15rem; --act-pad: clamp(3.2rem, 9vh, 5rem); }

  .nav { height: 56px; }
  .nav__menut { display: none; }          /* the icon alone at this width */
  .nav__contact { display: none; }        /* Contact lives in the menu here */
  .langs { display: none; }               /* language lives in the menu here */

  .hero__sub { font-size: .98rem; }
  .range__t { font-size: 1.18rem; }
  .range__d { display: none; }            /* the descriptor is noise at 320 */
  .spec li { font-size: .72rem; padding: .4rem .62rem; }
  .mom__c { grid-template-columns: 2.2rem 1fr; }
  .method__grid, .ag__points { grid-template-columns: 1fr; }
  .foot-b__idx { grid-template-columns: 1fr; }
}

/* ============================================================================
   sm · 376-429 — STANDARD PHONES
   The reference handheld. More air than xs, display type a step larger.
========================================================================== */
@media (min-width: 376px) and (max-width: 429px) {
  :root { --gut: 1.4rem; }
  .langs { display: none; }
  .nav__contact { display: none; }
  .range__d { font-size: .68rem; opacity: .75; }
}

/* ============================================================================
   md · 430-599 — LARGE PHONES
   Enough width for two-up grids to return without cramping.
========================================================================== */
@media (min-width: 430px) and (max-width: 599px) {
  :root { --gut: 1.6rem; }
  .langs { display: none; }
  .method__grid, .ag__points { grid-template-columns: repeat(2, 1fr); }
  .prin { grid-template-columns: repeat(2, 1fr); }
  .cstrip--3, .cstrip--4 { grid-template-columns: repeat(2, 1fr); }
  .am { grid-template-columns: repeat(3, 1fr); }
}

/* every handheld shares these, whatever the exact width */
@media (max-width: 599px) {
  .nav__menu { display: inline-flex; margin-inline-start: auto; }
  .nav__links { display: none; }

  /* the stanza gap: the hero reads as three couplets, not five lines */
  .hero__line.is-stanza { margin-top: .42em; }
  .hero { padding-block: 4.5rem 1.75rem; }
  .hero__top .mono { display: none; }
  .hero__bottom { margin-top: 1.75rem; }

  /* full-bleed plates: an immersive preview should touch both edges */
  .reveal .plate, .shot__frame, .cplate__frame {
    margin-inline: calc(var(--gut) * -1); width: calc(100% + var(--gut) * 2);
    border-inline: 0;
  }
  .plate { aspect-ratio: 4 / 5; }
  .plate--sub { aspect-ratio: 4 / 5; }

  /* actions become full-width rows with real height */
  .actions { flex-direction: column; }
  .action { min-width: 0; width: 100%; min-height: 58px; padding: 1.1rem; }

  /* the gate reads as a title card, not a squeezed header */
  .gate__meta { flex-direction: row; justify-content: space-between; }
  .gate__kind { max-width: none; }
}

/* ============================================================================
   ts · 600-833 — SMALL TABLETS
   Navigation returns. Layout is still single-column but at generous scale.
========================================================================== */
@media (min-width: 600px) and (max-width: 833px) {
  :root { --gut: 2.2rem; --act-pad: clamp(5rem, 13vh, 9rem); }
  .nav__menu { display: inline-flex; margin-inline-start: auto; }
  .nav__links { display: none; }
  .nav__contact { display: inline-flex; }

  .arg { grid-template-columns: 1fr; gap: 3rem; }
  .method__grid { grid-template-columns: repeat(2, 1fr); }
  .ag__points { grid-template-columns: repeat(2, 1fr); }
  .plate, .plate--sub { aspect-ratio: 16 / 10; }
  .mom__c { grid-template-columns: 3.5rem 1fr; }
  .mom__c p { grid-column: 2; }
  .cstrip--4 { grid-template-columns: repeat(2, 1fr); }
  .shot:nth-child(even), .shot:nth-child(3n) { max-width: 100%; }
}

/* ============================================================================
   tl · 834-1023 — LARGE TABLETS
   The two-column argument returns; rhythm approaches desktop.
========================================================================== */
@media (min-width: 834px) and (max-width: 1023px) {
  :root { --gut: 2.8rem; }
  .nav__links { display: flex; gap: 1.1rem; }
  .nav__menu, .nav__contact { display: none; }
  .arg { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 2.6rem; }
  .method__grid { grid-template-columns: repeat(2, 1fr); }
  .plate, .plate--sub { aspect-ratio: 16 / 9; }
  .mom__c { grid-template-columns: 4rem minmax(0,1fr) minmax(0,1.1fr); }
}

/* ============================================================================
   lap · 1024-1439 — LAPTOPS
========================================================================== */
@media (min-width: 1024px) and (max-width: 1439px) {
  :root { --gut: 3.2rem; }
  .nav__menu { display: none; }
}

/* ============================================================================
   dt · 1440-1919 — DESKTOP, the reference design
========================================================================== */
@media (min-width: 1440px) { .nav__menu { display: none; } }

/* ============================================================================
   uw · 1920+ — ULTRAWIDE
   More gutter, not more text. Measure stays readable; type grows once.
========================================================================== */
@media (min-width: 1920px) {
  :root { --gut: clamp(4.5rem, 6vw, 9rem); --max: 1840px; }
  .arg__body { max-width: 52ch; }
  .prose p, .ch__body { max-width: 68ch; }
  .wrapA { max-width: 1360px; }
  .cwrap { max-width: 1240px; }
  .dg { height: clamp(560px, 62vh, 880px); }
  .am { max-width: 1360px; }
}
@media (min-width: 2560px) {
  :root { --max: 2200px; }
  .hero__line { font-size: calc(min(var(--t-mega), 12rem) * var(--fit, 1)); }
}

/* ============================================================================
   SHORT VIEWPORTS — phones in landscape, small laptops
========================================================================== */
@media (max-height: 560px) and (orientation: landscape) {
  .hero, .close { min-height: auto; padding-block: 5rem 3rem; }
  .gate { min-height: auto; padding-block: 3.5rem; }
  .stat { min-height: auto; padding-block: 3.5rem; }
  .chero { min-height: auto; padding-block: 3.5rem; }
  .menu { justify-content: flex-start; padding-top: calc(var(--nav-h) + 1rem); }
  .menu__t { font-size: clamp(1.5rem, 6vh, 2.2rem); }
}
