/* TR Lighting — shared styles */
:root {
  --bg: #0a0908;
  --bg-soft: #15130f;
  --fg: #f3ece0;
  --fg-mute: rgba(243, 236, 224, 0.55);
  --fg-faint: rgba(243, 236, 224, 0.28);
  --rule: rgba(243, 236, 224, 0.14);
  --champagne: #d9c9a8;
  --gold: #b8a274;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* Type scale — single authoritative source */
  --type-micro:   12px;    /* index nums, filter counts */
  --type-label:   13px;    /* nav, kickers, filters, buttons */
  --type-meta:    14.5px;  /* secondary metadata (cat, loc, year) */
  --type-body:    16px;    /* descriptions, summary paragraphs */
  --type-reading: 17px;    /* long-form copy (detail, hero body) */
  --track-en:     0.14em;  /* letter-spacing for EN uppercase only */

  /* Secondary text contrast — stronger than --fg-mute (55%), used for body descriptions */
  --fg-soft: rgba(243, 236, 224, 0.72);

  --header-height: 72px;
}

[dir="rtl"] {
  --serif: "Frank Ruhl Libre", Georgia, serif;
  --sans: "Assistant", system-ui, sans-serif;
  /* Hebrew: larger base sizes, zero tracking */
  --type-label:   17px;
  --type-meta:    15.5px;
  --type-body:    17px;
  --type-reading: 18px;
  --track-en:     0;
  --fg-soft: rgba(243, 236, 224, 0.80);
}

[data-palette="ivory"] {
  --bg: #f3ece0;
  --bg-soft: #ece4d4;
  --fg: #1c1814;
  --fg-mute: rgba(28, 24, 20, 0.55);
  --fg-soft: rgba(28, 24, 20, 0.72);
  --fg-faint: rgba(28, 24, 20, 0.25);
  --rule: rgba(28, 24, 20, 0.14);
  --champagne: #8a7a5c;
  --gold: #6b5a3a;
}

[data-palette="oyster"] {
  --bg: #ebe7df;
  --bg-soft: #e2ddd2;
  --fg: #1a1a1a;
  --fg-mute: rgba(26, 26, 26, 0.55);
  --fg-soft: rgba(26, 26, 26, 0.72);
  --fg-faint: rgba(26, 26, 26, 0.25);
  --rule: rgba(26, 26, 26, 0.12);
  --champagne: #7a7568;
  --gold: #5e574a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--fg); }
body {
  font-family: var(--sans);
  font-size: var(--type-body);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  transition: background-color 1.6s cubic-bezier(.22,.61,.36,1), color 1.6s cubic-bezier(.22,.61,.36,1);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
[dir="rtl"] .serif { letter-spacing: 0; font-weight: 500; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.label {
  font-family: var(--sans);
  font-size: var(--type-label);
  font-weight: 500;
  letter-spacing: var(--track-en);
  text-transform: uppercase;
  color: var(--fg-mute);
}
[dir="rtl"] .label { text-transform: none; }

/* ───────── Header ───────── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 40px;
  pointer-events: none;
  mix-blend-mode: normal;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.header--hidden {
  transform: translateY(-100%);
}
/* subtle top gradient — keeps text legible over hero without a solid bar */
.header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 130px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.22) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}
[data-palette="ivory"] .header::before,
[data-palette="oyster"] .header::before {
  background: linear-gradient(to bottom, rgba(255,255,255,0.14) 0%, transparent 100%);
}
.header > * { pointer-events: auto; }

.header__logo {
  display: flex; align-items: center;
}
.header__logo img {
  height: 50px;
  width: auto;
}
.header__logo .logo-light { display: none; }
[data-palette="ivory"] .header__logo .logo-dark,
[data-palette="oyster"] .header__logo .logo-dark { display: none; }
[data-palette="ivory"] .header__logo .logo-light,
[data-palette="oyster"] .header__logo .logo-light { display: block; }

.header__nav {
  display: flex; gap: 28px;
  justify-self: center;
  font-size: var(--type-label);
  letter-spacing: var(--track-en);
  text-transform: uppercase;
}
[dir="rtl"] .header__nav { text-transform: none; }
.header__nav a {
  color: var(--fg-soft);
  position: relative;
  padding: 6px 0;
  transition: color .35s ease;
}
.header__nav a:hover, .header__nav a.is-active { color: var(--fg); }
.header__nav a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--champagne);
}

.header__meta {
  justify-self: end;
  display: flex; gap: 18px; align-items: center;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.header__meta .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--champagne);
  box-shadow: 0 0 8px var(--champagne);
}

.header__theme {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Header controls — float over the dark hero regardless of palette.
   Frosted dark pill provides legibility on any background. */
.lang-switch {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--track-en);
  text-transform: uppercase;
  color: #f3ece0;
  padding: 5px 9px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background .3s ease;
}
.lang-switch:hover {
  background: rgba(0, 0, 0, 0.60);
}
.theme-toggle {
  border: 1px solid rgba(243, 236, 224, 0.42);
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #f3ece0;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--track-en);
  text-transform: uppercase;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: border-color .3s ease, background .3s ease, transform .3s ease;
}
.theme-toggle:hover {
  border-color: var(--champagne);
  background: color-mix(in srgb, var(--champagne) 14%, rgba(0,0,0,0.50));
  transform: translateY(-1px);
}
.theme-toggle__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--champagne);
  box-shadow: 0 0 10px var(--champagne);
}

/* Light palettes: nav and toggle at full opacity — var(--fg-mute) at 55% is
   too low-contrast against the ivory/oyster hero and body backgrounds. */
[data-palette="ivory"] .header__nav a,
[data-palette="oyster"] .header__nav a {
  color: var(--fg);
}
[data-palette="ivory"] .header__nav a:hover,
[data-palette="oyster"] .header__nav a:hover {
  color: var(--champagne);
}
/* ───────── Footer ───────── */
.footer {
  border-top: 1px solid var(--rule);
  padding: 80px 40px 40px;
  display: grid;
  grid-template-columns: minmax(280px, 1.6fr) minmax(140px, .6fr) minmax(240px, .9fr);
  gap: 40px;
}
.footer__col h4 {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 18px;
  color: var(--fg-mute);
  letter-spacing: 0.02em;
}
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.footer__col ul a { color: var(--fg); opacity: .8; transition: opacity .25s ease; }
.footer__col ul a:hover { opacity: 1; }
.footer__brand .serif {
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.footer__brand p { color: var(--fg-mute); max-width: 36ch; font-size: 13px; }
.footer__base {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  font-size: var(--type-label);
  letter-spacing: var(--track-en);
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* ───────── Cinema-style placeholder ───────── */
.plate {
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
  isolation: isolate;
}
.plate::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 6px,
      rgba(217, 201, 168, 0.06) 6px 7px
    ),
    radial-gradient(ellipse at var(--lx, 70%) var(--ly, 35%),
      rgba(217, 201, 168, 0.28) 0%,
      rgba(217, 201, 168, 0.08) 30%,
      transparent 65%);
  z-index: 0;
}
[data-palette="ivory"] .plate::before,
[data-palette="oyster"] .plate::before {
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 6px,
      rgba(28, 24, 20, 0.04) 6px 7px
    ),
    radial-gradient(ellipse at var(--lx, 70%) var(--ly, 35%),
      rgba(184, 162, 116, 0.32) 0%,
      rgba(184, 162, 116, 0.10) 32%,
      transparent 70%);
}
.plate__caption {
  position: absolute;
  left: 14px; bottom: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
  z-index: 2;
  display: flex;
  gap: 10px;
  align-items: center;
}
.plate__caption .tick {
  width: 6px; height: 6px; border: 1px solid var(--fg-mute);
}
.plate__corner {
  position: absolute;
  top: 12px; right: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
  z-index: 2;
}

/* page transition */
.page-enter {
  animation: pageIn .9s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* utility */
.container { padding: 0 40px; }
.rule { height: 1px; background: var(--rule); }
button { font-family: inherit; }


/* JSON project images */
.plate__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: none;
  opacity: 1;
}


.plate--image::before {
  z-index: 1;
  opacity: .18;
  mix-blend-mode: soft-light;
}

.plate--image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(0,0,0,.02), rgba(0,0,0,.08));
  pointer-events: none;
}


[data-palette="ivory"] .plate--image::after,
[data-palette="oyster"] .plate--image::after {
  background: linear-gradient(to bottom, rgba(255,255,255,.06), rgba(0,0,0,.18));
}
.data-loading {
  min-height: 60vh;
  display: grid;
  place-items: center;
  padding-top: 140px;
  color: var(--fg-mute);
}

/* Public mobile menu — replaces the theme toggle in production */
.mobile-burger{
  justify-self:end;
  width:44px;
  height:44px;
  border:1px solid var(--rule);
  background:color-mix(in srgb, var(--bg) 76%, transparent);
  color:var(--fg);
  display:none;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:6px;
  cursor:pointer;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  transition:border-color .35s ease, background-color .35s ease, transform .35s ease;
}
.mobile-burger:hover{
  border-color:var(--champagne);
  background:color-mix(in srgb, var(--champagne) 10%, transparent);
}
.mobile-burger span{
  width:17px;
  height:1px;
  background:currentColor;
  display:block;
  transform-origin:center;
  transition:transform .35s ease, opacity .35s ease;
}
.mobile-burger[aria-expanded="true"] span:first-child{transform:translateY(3.5px) rotate(38deg);}
.mobile-burger[aria-expanded="true"] span:last-child{transform:translateY(-3.5px) rotate(-38deg);}
.mobile-menu{
  position:fixed;
  top:72px;
  left:18px;
  right:18px;
  z-index:49;
  display:none;
  flex-direction:column;
  align-items:flex-end;
  gap:18px;
  padding:20px 0;
  border-top:1px solid var(--rule);
  border-bottom:1px solid var(--rule);
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}
.mobile-menu.is-open{display:flex;}
.mobile-menu a{
  font-family:var(--mono);
  font-size:11px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--fg-mute);
}
.mobile-menu a:hover,.mobile-menu a.is-active{color:var(--fg);}
@media (min-width:901px){
  .mobile-burger,.mobile-menu{display:none!important;}
}

/* ── Mobile header: logo + controls only, no nav ────────────────────── */
@media (max-width:900px){
  .mobile-burger,.mobile-menu{display:none!important;}
  .header{display:flex;align-items:center;height:58px;padding:0 20px;}
  .header__logo{white-space:nowrap;flex-shrink:0;}
  .header__logo img{height:32px;}
  .header__nav{position:static;transform:none;display:flex;gap:14px;font-size:11px;letter-spacing:0.06em;margin-left:16px;white-space:nowrap;}
  .header__nav a{padding:2px 0;}
  .header__theme{display:flex!important;align-items:center;gap:7px;margin-left:auto;flex-shrink:0;}
  .lang-switch{font-size:11.5px;padding:4px 7px;letter-spacing:0.09em;}
  .theme-toggle{font-size:11.5px;padding:4px 8px;letter-spacing:0.09em;gap:5px;}
  .theme-toggle__dot{width:5px;height:5px;}
}
@media (max-width:900px){
  /* RTL mobile: center nav absolutely so logo+controls don't compete with it for space */
  [dir="rtl"] .header__nav{display:flex;position:absolute;left:auto;right:50%;transform:translateX(50%);margin-left:0;font-size:14px;gap:18px;}
  [dir="rtl"] .header__theme{margin-left:0;margin-right:auto;}
}

.footer__he{margin-top:12px;color:var(--muted);font-size:13px;line-height:1.7;}

/* Footer body text */
.footer__col ul,
.footer__brand p,
.footer__he { font-size: 14px; line-height: 1.68; }
.footer__col h4 { font-size: var(--type-body); font-weight: 400; }

/* ─────────────────────────────────────────────
   RTL overrides — applied when html[dir="rtl"]
   Most grid / flex layouts reverse automatically;
   these handle hardcoded physical margin/padding.
───────────────────────────────────────────── */
[dir="rtl"] .hero__content {
  padding-left: 0;
  padding-right: 24px;
}
[dir="rtl"] .archive__arrow {
  display: inline-block;
  transform: scaleX(-1);
}
[dir="rtl"] .archive__row:hover .archive__arrow {
  transform: scaleX(-1) translateX(4px);
}
[dir="rtl"] .archive__card-overlay {
  padding-left: 20px;
  padding-right: 20px;
}
[dir="rtl"] .contact-left {
  border-right: none;
  border-left: 1px solid var(--rule);
}
[dir="rtl"] .detail__nav { direction: rtl; }
[dir="rtl"] .field__arrow {
  display: inline-block;
  transform: scaleX(-1);
}
[dir="rtl"] .exrow__arrow {
  display: inline-block;
  transform: scaleX(-1);
}
/* Footer: keep brand paragraph readable in RTL */
[dir="rtl"] .footer__brand p { max-width: 40ch; }
/* Hebrew: suppress uppercase tracking and case-transform on UI chrome */
[dir="rtl"] .header__meta,
[dir="rtl"] .theme-toggle,
[dir="rtl"] .lang-switch,
[dir="rtl"] .footer__base,
[dir="rtl"] .selected__all,
[dir="rtl"] .manifesto__meta,
[dir="rtl"] .cta { letter-spacing: 0; text-transform: none; }
/* Hebrew headings: remove negative letter-spacing (Latin optical fix, meaningless in Hebrew) */
[dir="rtl"] .hero__title,
[dir="rtl"] .fields__title,
[dir="rtl"] .archive__title,
[dir="rtl"] .detail__title,
[dir="rtl"] .detail__nav-name,
[dir="rtl"] .section-title,
[dir="rtl"] .exrow__name,
[dir="rtl"] .field__name,
[dir="rtl"] .proj-row__name,
[dir="rtl"] .archive__name,
[dir="rtl"] .archive__preview-name,
[dir="rtl"] .manifesto__quote,
[dir="rtl"] .detail__lede,
[dir="rtl"] .expertise__title { letter-spacing: 0; }
