/* ═══════════════════════════════════════════════
   KR DESIGN — Global stylesheet
   CSS3 · uses inset + logical properties (RTL-safe)
   Loaded on every page.
   ═══════════════════════════════════════════════ */

:root {
  /* Palette */
  --bone: #ece4d4;
  --bone-2: #e3dac8;
  --bone-deep: #d6cdb9;
  --paper: #f3eee0;
  --ink: #161310;
  --ink-2: #2a2522;
  --muted: #857d6d;
  --line: #c5bba6;
  --accent: #9c4a2a;

  /* Typography */
  --serif: 'Fraunces', serif;
  --hebrew: 'Heebo', sans-serif;
  --hebrew-serif: 'Frank Ruhl Libre', serif;
  --mono: 'JetBrains Mono', monospace;

  /* Motion */
  --ease: cubic-bezier(.23, 1, .32, 1);
  --slow: cubic-bezier(.77, 0, .18, 1);

  /* Spacing scale */
  --pad-page: 40px;
  --pad-section: 140px;
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--hebrew);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-align: start; /* logical: right in RTL, left in LTR */
}
body { overflow-x: hidden; cursor: none; }

/* Paper grain — every page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .06;
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: none; background: none; border: 0; color: inherit; }
::selection { background: var(--ink); color: var(--bone); }

/* Hebrew accent (replaces italic emphasis where italics don't work) */
.ac { color: var(--accent); font-weight: 400; }

/* Custom cursor */
.cursor {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  inline-size: 8px;
  block-size: 8px;
  background: var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: inline-size .35s var(--ease), block-size .35s var(--ease), background .35s var(--ease);
  mix-blend-mode: difference;
}
.cursor.hover { inline-size: 50px; block-size: 50px; background: var(--bone); }
.cursor.text { inline-size: 90px; block-size: 90px; }
.cursor.hide { opacity: 0; }
.cursor-label {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  pointer-events: none;
  z-index: 10001;
  font-family: var(--hebrew);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .05em;
  color: var(--bone);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .25s var(--ease);
  mix-blend-mode: difference;
}
.cursor-label.visible { opacity: 1; }

/* Fixed nav (loaded by header.php) */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 28px;
  padding-inline: var(--pad-page);
  mix-blend-mode: difference;
  color: var(--bone);
}
.nav-mark {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .04em;
  direction: ltr;
}
.nav-mark sup {
  font-size: 9px;
  font-weight: 300;
  letter-spacing: .2em;
  margin-inline-end: 4px;
  opacity: .6;
}
.nav-list {
  display: flex;
  gap: 36px;
  list-style: none;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .04em;
}
.nav-list a { position: relative; padding-block: 4px; }
.nav-list a::after {
  content: '';
  position: absolute;
  inset: auto 0 0 auto;
  inset-inline-end: 0;
  inline-size: 0;
  block-size: 1px;
  background: currentColor;
  transition: inline-size .5s var(--ease);
}
.nav-list a:hover::after { inline-size: 100%; }
.nav-loc {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .18em;
  opacity: .6;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

/* Shared utilities */
.eyebrow {
  font-family: var(--hebrew);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .05em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.eyebrow::before {
  content: '';
  inline-size: 32px;
  block-size: 1px;
  background: currentColor;
}

.section-num {
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .25em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  direction: ltr;
}

.reveal { overflow: hidden; display: inline-block; }
.reveal > * {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s var(--slow);
}
.reveal.in > * { transform: translateY(0); }

.fade { opacity: 0; transition: opacity 1.2s var(--ease); }
.fade.in { opacity: 1; }

.img-mask { overflow: hidden; position: relative; }
.img-mask::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bone);
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform 1.4s var(--slow);
}
[dir="rtl"] .img-mask::after { transform-origin: right center; }
.img-mask.in::after { transform: scaleX(0); }
.img-mask img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  transform: scale(1.15);
  transition: transform 1.6s var(--slow);
}
.img-mask.in img { transform: scale(1); }

/* Section helpers — every section can use these */
.section {
  position: relative;
  padding-block: var(--pad-section);
  padding-inline: var(--pad-page);
}
.section--no-pad-block { padding-block: 0; }
.section--bg-ink { background: var(--ink); color: var(--bone); }
.section--bg-2 { background: var(--bone-2); }

/* Responsive defaults */
@media (max-width: 980px) {
  :root { --pad-page: 24px; --pad-section: 80px; }
  body { cursor: auto; }
  .cursor, .cursor-label { display: none; }
}
