/* מפתח אקספרס — phone-first.
   one cinematic hero, two real CTAs, one info strip. nothing else.
   the page is a shop sign, not a brochure. */

:root {
  --paper:    #f1e7cf;
  --paper-2:  #e6dab8;
  --rule:     #a8302c;
  --ink:      #0d1018;     /* photo-deep ink for the hero band */
  --ink-2:    #1d2a3d;
  --ink-3:    #6a7382;
  --chalk:    #f5efdc;
  --whatsapp: #25d366;

  --hair:   rgba(13, 16, 24, 0.16);
  --hair-2: rgba(13, 16, 24, 0.34);
  --hair-paper: rgba(245, 239, 220, 0.18);

  --display:   "Karantina", "Frank Ruhl Libre", Georgia, serif;
  --display-2: "Frank Ruhl Libre", Georgia, serif;
  --body:      "Heebo", system-ui, sans-serif;
  --mono:      "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }

html, body { background: var(--ink); }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--chalk);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--rule); color: var(--chalk); }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; background: transparent; border: 0; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--rule);
  outline-offset: 3px;
}

/* --- top bar --- */

.bar {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px 28px;
  flex-wrap: wrap;
  padding: 14px 28px;
  background: var(--ink);
  border-bottom: 1px solid var(--hair-paper);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(245, 239, 220, 0.7);
  text-transform: uppercase;
}
.bar .cipher { margin: 0; color: var(--rule); font-weight: 700; }
.bar-folio { margin: 0; }
.bar-call {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--chalk);
  font-weight: 700;
}
.bar-call:hover { color: var(--rule); }
.bar-call .dot {
  width: 8px; height: 8px;
  background: var(--rule);
  border-radius: 50%;
  animation: livePulse 2.8s cubic-bezier(0.65,0,0.35,1) infinite;
}

/* --- HERO — full-bleed, single screen on desktop --- */

.hero {
  position: relative;
  min-height: clamp(620px, 92svh, 980px);
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--ink);
}

.hero-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("illustrations/hero-key-photo.webp");
  background-size: cover;
  /* image is wide and centered on the key+lock; on mobile we want the key
     pulled slightly to the right (RTL-end) so it sits behind the headline */
  background-position: 60% 50%;
  background-repeat: no-repeat;
  background-color: #0d1018;
  /* a slow living-still: 14s loop, 1% scale + 1% pan. quiet, not jiggly. */
  animation: heroBreathe 22s ease-in-out infinite;
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  /* one directional gradient — RTL: ink on the right (where the text sits),
     transparent on the left (where the photo's lock sits) */
  background:
    linear-gradient(270deg, rgba(13,16,24,0.92) 0%, rgba(13,16,24,0.72) 32%, rgba(13,16,24,0.18) 62%, rgba(13,16,24,0) 100%),
    linear-gradient(180deg, rgba(13,16,24,0.4) 0%, transparent 30%, transparent 70%, rgba(13,16,24,0.55) 100%);
}

.hero-inner {
  position: relative;
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(56px, 8vw, 100px) 0 clamp(56px, 8vw, 100px);
  display: grid;
  gap: 18px;
  /* the brand mark needs room — let the column flex to the container */
  grid-template-columns: minmax(0, 1fr);
}

.hero-tag {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--chalk);
  text-transform: uppercase;
  background: rgba(168, 48, 44, 0.92);
  width: fit-content;
}

/* ---- BRAND MARK — kinetic display typography for "הגלריה".
   Each letter sits in an overflow-hidden frame; the inner span
   slides up from translateY(110%) on load with a staggered delay.
   After the mark resolves, a red hairline draws underneath and a
   small accent dot rides it continuously, like a pickpoint scanning. ---- */

.brand {
  margin: 0;
  display: block;
  /* container for mark + rule */
  --brand-rise: 800ms;
  --brand-stagger: 80ms;
  --brand-rule-delay: 700ms;
}

.brand-mark {
  display: inline-flex;
  /* native RTL flow — letters appear right-to-left to the reader */
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(5.6rem, 17vw, 13.5rem);
  line-height: 0.86;
  letter-spacing: -0.012em;
  color: var(--chalk);
}
.brand-letter {
  display: inline-block;
  overflow: hidden;
  /* a small horizontal nudge for kerning; Karantina runs tight already */
  padding: 0 0.005em;
}
.brand-letter > span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  animation: brandRise var(--brand-rise) cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.brand-letter:nth-child(1) > span { animation-delay: calc(var(--brand-stagger) * 0); }
.brand-letter:nth-child(2) > span { animation-delay: calc(var(--brand-stagger) * 1); }
.brand-letter:nth-child(3) > span { animation-delay: calc(var(--brand-stagger) * 2); }
.brand-letter:nth-child(4) > span { animation-delay: calc(var(--brand-stagger) * 3); }
.brand-letter:nth-child(5) > span { animation-delay: calc(var(--brand-stagger) * 4); }
.brand-letter:nth-child(6) > span { animation-delay: calc(var(--brand-stagger) * 5); }
@keyframes brandRise {
  0%   { transform: translateY(110%); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: translateY(0);    opacity: 1; }
}

/* a hairline rule that draws under the mark, with a single
   slow-traveling dot riding along it (RTL: right → left) */
.brand-rule {
  display: block;
  position: relative;
  margin-top: 18px;
  height: 1px;
  width: 0;
  background: var(--rule);
  animation: brandRule 1100ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: var(--brand-rule-delay);
  max-width: 540px;
}
@keyframes brandRule {
  to { width: clamp(280px, 38vw, 540px); }
}
.brand-rule-dot {
  position: absolute;
  top: -2px;
  inset-inline-start: 0;
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rule);
  box-shadow: 0 0 10px rgba(168, 48, 44, 0.85);
  opacity: 0;
  animation: brandDot 6.4s cubic-bezier(0.6, 0, 0.4, 1) infinite;
  /* kicks in after the rule has finished drawing */
  animation-delay: calc(var(--brand-rule-delay) + 1100ms);
}
@keyframes brandDot {
  0%   { inset-inline-start: 0;    opacity: 0; }
  6%   { opacity: 1; }
  94%  { opacity: 1; }
  100% { inset-inline-start: 100%; opacity: 0; }
}

/* the small mono tagline that sits between brand and body copy */
.brand-tagline {
  margin: 22px 0 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(245, 239, 220, 0.62);
  text-transform: uppercase;
  opacity: 0;
  animation: brandFade 720ms ease forwards;
  animation-delay: calc(var(--brand-rule-delay) + 280ms);
}
.brand-tagline-num {
  font-weight: 700;
  color: var(--rule);
}
@keyframes brandFade { to { opacity: 1; } }

.hero-sub {
  margin: 18px 0 0;
  font-family: var(--display-2);
  font-weight: 500;
  font-size: clamp(1.18rem, 2vw, 1.6rem);
  line-height: 1.32;
  color: rgba(245, 239, 220, 0.82);
  max-width: 42ch;
  text-wrap: balance;
  opacity: 0;
  animation: brandFade 720ms ease forwards;
  animation-delay: calc(var(--brand-rule-delay) + 380ms);
}
.hero-sub em {
  font-style: normal;
  color: var(--rule);
  font-weight: 700;
}

/* ---- CYL-STAGE — the editorial cylinder section, after the canvas reveal ---- */
.cyl-stage {
  position: relative;
  background: var(--ink);
  padding: clamp(64px, 9vw, 120px) 28px clamp(72px, 10vw, 140px);
  border-top: 1px solid var(--hair-paper);
}
.cyl-figure {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 24px;
}
.cyl-cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(245, 239, 220, 0.55);
  text-transform: uppercase;
  border-bottom: 1px solid var(--hair-paper);
  padding-bottom: 14px;
}
.cyl-cap-mute { color: var(--rule); font-weight: 700; }
.cyl-stage .cyl-svg {
  width: 100%;
  height: auto;
  max-height: 400px;
}

/* --- side cross-section cylinder. key slides horizontally only.
   drivers lift in sequence as the blade reaches each chamber.
   shear-line "clicks" at the moment of full alignment. no diagonal tilt. --- */

.cyl-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  overflow: visible;
}

/* Master clock for the cylinder choreography. Every animation is a phase of this loop:
   0–14%   rest, status dim
   14–22%  blade slides in
   17–28%  driver pins lift in sequence (dp1→dp5), status dots fill
   28–32%  click — shear flashes hard, body shudders
   32–48%  plug rotates clockwise to +14°  (key bow swings up)
   48–62%  hold rotated  (lock open)
   62–76%  plug rotates back to 0
   76–82%  pins drop, status dots empty
   82–92%  blade retracts
   92–100% rest                                                                       */
:root { --kc: 13s; }

/* The whole cylinder gets a tiny "torque shudder" on the click moment (28–32%) */
.cyl-svg .cyl {
  transform-box: view-box;
  transform-origin: 350px 130px;
  animation: cylShudder var(--kc) linear infinite;
}
@keyframes cylShudder {
  0%, 27%, 33%, 100% { transform: translate(0, 0); }
  28%   { transform: translate(0.6px, -0.4px); }
  29%   { transform: translate(-0.5px, 0.5px); }
  30%   { transform: translate(0.4px, 0.3px); }
  31%   { transform: translate(-0.3px, -0.3px); }
}

/* PLUG ROTOR — rotates around the cylinder's axis at (350,151).
   This is the central new element: the key+key-pins+keyway turn together,
   the body and plug-shell stay fixed. Rotation reads as "the lock just turned." */
.cyl-svg .plug-rotor {
  transform-box: view-box;
  transform-origin: 350px 151px;
  animation: plugRotate var(--kc) cubic-bezier(0.7, 0, 0.3, 1) infinite;
}
@keyframes plugRotate {
  0%, 32%       { transform: rotate(0deg); }
  48%, 62%      { transform: rotate(14deg); }
  76%, 100%     { transform: rotate(0deg); }
}

/* FACE TICK — the small red notch on the cylinder face. rotates around (240,130)
   in lock-step with the plug, so the rotation is visible from outside too. */
.cyl-svg .face-tick {
  transform-box: view-box;
  transform-origin: 240px 130px;
  animation: faceTickRotate var(--kc) cubic-bezier(0.7, 0, 0.3, 1) infinite;
}
@keyframes faceTickRotate {
  0%, 32%   { transform: rotate(0deg); }
  48%, 62%  { transform: rotate(14deg); }
  76%, 100% { transform: rotate(0deg); }
}

/* KEY: slides horizontally only. inserted at translateX(154) — blade tip lands
   just past the last chamber. withdrawn at translateX(-180) — bow off-screen left.
   Note: the .key is INSIDE .plug-rotor, so its translateX compounds with the rotor's
   rotation. After insertion (22%) the key is held at 154 through the rotation phase. */
.cyl-svg .key {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: keySlide var(--kc) cubic-bezier(0.55, 0, 0.45, 1) infinite;
}
@keyframes keySlide {
  0%,  10%   { transform: translateX(-180px); }
  22%        { transform: translateX(154px); }
  82%        { transform: translateX(154px); }
  92%, 100%  { transform: translateX(-180px); }
}

/* DRIVER PINS: each lifts in sequence as the blade reaches it.
   chamber 1 first (closest to face), chamber 5 last. */
.cyl-svg .dp { transform-box: fill-box; transform-origin: 50% 0; }
.cyl-svg .dp-1 { animation: dp1 var(--kc) cubic-bezier(0.5,0,0.3,1) infinite; }
.cyl-svg .dp-2 { animation: dp2 var(--kc) cubic-bezier(0.5,0,0.3,1) infinite; }
.cyl-svg .dp-3 { animation: dp3 var(--kc) cubic-bezier(0.5,0,0.3,1) infinite; }
.cyl-svg .dp-4 { animation: dp4 var(--kc) cubic-bezier(0.5,0,0.3,1) infinite; }
.cyl-svg .dp-5 { animation: dp5 var(--kc) cubic-bezier(0.5,0,0.3,1) infinite; }

/* lift amounts (the "bitting code"): 5 / 8 / 3 / 7 / 6 px. Pins stay seated
   from ~22% through ~76%, fall together as the rotor returns to 0. */
@keyframes dp1 { 0%, 16% { transform: translateY(0); } 19%, 76% { transform: translateY(-5px); } 80%, 100% { transform: translateY(0); } }
@keyframes dp2 { 0%, 17% { transform: translateY(0); } 20%, 76% { transform: translateY(-8px); } 80%, 100% { transform: translateY(0); } }
@keyframes dp3 { 0%, 18% { transform: translateY(0); } 21%, 76% { transform: translateY(-3px); } 80%, 100% { transform: translateY(0); } }
@keyframes dp4 { 0%, 19% { transform: translateY(0); } 22%, 76% { transform: translateY(-7px); } 80%, 100% { transform: translateY(0); } }
@keyframes dp5 { 0%, 20% { transform: translateY(0); } 23%, 76% { transform: translateY(-6px); } 80%, 100% { transform: translateY(0); } }

/* STATUS DOTS: each dot fills brass when its driver pin seats,
   stays filled through the rotation phase, drains as the pins drop.
   Mirrors the dp1–dp5 timing exactly so the dot-row reads as a live counter. */
.cyl-svg .sd-1 { animation: sd1 var(--kc) cubic-bezier(0.5,0,0.3,1) infinite; }
.cyl-svg .sd-2 { animation: sd2 var(--kc) cubic-bezier(0.5,0,0.3,1) infinite; }
.cyl-svg .sd-3 { animation: sd3 var(--kc) cubic-bezier(0.5,0,0.3,1) infinite; }
.cyl-svg .sd-4 { animation: sd4 var(--kc) cubic-bezier(0.5,0,0.3,1) infinite; }
.cyl-svg .sd-5 { animation: sd5 var(--kc) cubic-bezier(0.5,0,0.3,1) infinite; }
@keyframes sd1 { 0%, 17% { fill: transparent; stroke: #6a7382; } 20%, 77% { fill: #e6c66e; stroke: #e6c66e; } 81%, 100% { fill: transparent; stroke: #6a7382; } }
@keyframes sd2 { 0%, 18% { fill: transparent; stroke: #6a7382; } 21%, 77% { fill: #e6c66e; stroke: #e6c66e; } 81%, 100% { fill: transparent; stroke: #6a7382; } }
@keyframes sd3 { 0%, 19% { fill: transparent; stroke: #6a7382; } 22%, 77% { fill: #e6c66e; stroke: #e6c66e; } 81%, 100% { fill: transparent; stroke: #6a7382; } }
@keyframes sd4 { 0%, 20% { fill: transparent; stroke: #6a7382; } 23%, 77% { fill: #e6c66e; stroke: #e6c66e; } 81%, 100% { fill: transparent; stroke: #6a7382; } }
@keyframes sd5 { 0%, 21% { fill: transparent; stroke: #6a7382; } 24%, 77% { fill: #e6c66e; stroke: #e6c66e; } 81%, 100% { fill: transparent; stroke: #6a7382; } }

/* SHEAR LINE: a hard flash at the click moment, then a sustained low glow
   throughout the rotation phase (the lock is "live"). */
.cyl-svg .shear { animation: shearClick var(--kc) cubic-bezier(0.4,0,0.2,1) infinite; }
@keyframes shearClick {
  0%, 26%, 78%, 100% { opacity: 0.42; stroke-width: 0.8; }
  30%                { opacity: 1;    stroke-width: 1.8; }
  34%, 70%           { opacity: 0.78; stroke-width: 1.3; }
  74%                { opacity: 0.5;  stroke-width: 1; }
}

/* KEYWAY SLOT: amber glow when the key seats. */
.cyl-svg .keyway-slot { animation: keywayGlow var(--kc) cubic-bezier(0.4,0,0.2,1) infinite; }
@keyframes keywayGlow {
  0%, 22%, 78%, 100% { fill: #06080c; }
  30%, 70%           { fill: #2a1f0e; }
}

/* --- CTAs — the actual purpose of the page --- */

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 4px;
}

.cta {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 24px;
  border: 1.4px solid var(--chalk);
  font-family: var(--display-2);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
  min-width: 260px;
}
.cta-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 239, 220, 0.65);
}
.cta-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: 0.01em;
  font-feature-settings: "tnum" 1;
}

.cta-call {
  background: var(--chalk);
  border-color: var(--chalk);
  color: var(--ink);
}
.cta-call .cta-tag { color: rgba(13,16,24,0.55); }
.cta-call:hover { background: var(--rule); border-color: var(--rule); color: var(--chalk); }
.cta-call:hover .cta-tag { color: rgba(245,239,220,0.7); }

.cta-wa {
  background: transparent;
  color: var(--chalk);
  border-color: var(--chalk);
}
.cta-wa:hover { background: var(--whatsapp); border-color: var(--whatsapp); color: #0a3d22; }
.cta-wa:hover .cta-tag { color: rgba(10, 61, 34, 0.7); }

.hero-foot {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: rgba(245, 239, 220, 0.55);
  text-transform: uppercase;
}

/* --- INFO STRIP --- */

.strip {
  background: var(--paper);
  color: var(--ink-2);
  padding: 28px 28px;
  border-top: 1px solid rgba(168,48,44,0.18);
}
.strip-grid {
  width: min(1200px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}
.strip-grid div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 24px;
  border-inline-start: 1px dotted var(--hair-2);
}
.strip-grid div:first-child { border-inline-start: 0; padding-inline-start: 0; }
.strip-grid dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.strip-grid dd {
  margin: 0;
  font-family: var(--display-2);
  font-weight: 500;
  font-size: 1.08rem;
  color: var(--ink-2);
}
.strip-grid dd a { border-bottom: 1px solid var(--hair-2); padding-bottom: 1px; }
.strip-grid dd a:hover { color: var(--rule); border-bottom-color: var(--rule); }

/* --- footer --- */

.bottom {
  background: var(--ink);
  padding: 18px 28px 22px;
  text-align: center;
}
.bottom p {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(245, 239, 220, 0.4);
  text-transform: uppercase;
}

/* --- motion --- */

@keyframes livePulse {
  0%, 100% { transform: scale(0.9); opacity: 0.85; }
  50%      { transform: scale(1.18); opacity: 1; }
}
@keyframes heroBreathe {
  0%, 100% { transform: scale(1.02) translate(0, 0); }
  50%      { transform: scale(1.04) translate(-0.6%, -0.4%); }
}

/* --- responsive --- */

@media (max-width: 980px) {
  .bar { padding: 10px 18px; }
  .bar-folio { display: none; }
  .hero-inner {
    width: min(100% - 36px, 1200px);
  }
  .brand-mark { font-size: clamp(5rem, 20vw, 9.5rem); }
  .brand-rule { max-width: 100%; }
  .hero-photo { background-position: 70% 50%; }
  .hero-shade {
    background:
      linear-gradient(180deg, rgba(13,16,24,0.45) 0%, rgba(13,16,24,0.78) 60%, rgba(13,16,24,0.94) 100%);
  }
  .strip-grid { grid-template-columns: repeat(2, 1fr); gap: 14px 0; }
  .strip-grid div { padding: 8px 16px; }
  .strip-grid div:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { min-height: clamp(540px, 92svh, 760px); }
  .brand-mark { font-size: clamp(4.2rem, 22vw, 7rem); }
  .brand-tagline { font-size: 11px; gap: 8px; }
  .hero-sub { font-size: clamp(1.05rem, 4.6vw, 1.32rem); }
  .cta { width: 100%; min-width: 0; }
  .cta-num { font-size: 1.8rem; }
  .strip-grid { grid-template-columns: 1fr; }
  .strip-grid div { border-inline-start: 0; padding-inline-start: 0; }
}

/* ===========================================================
   SCROLL STAGE — pure image-sequence scrub on canvas.
   No text. No rotation. Tall runway → frames advance slowly.
   tall runway + sticky pin + rAF render loop (script in scroll-key.js)
   =========================================================== */

.kx-stage {
  position: relative;
  background: var(--ink);
  /* runway = total scroll distance over which the 150 frames map.
     ~5x viewport gives ~30 frames per screen — slow, controlled, premium. */
  --kx-runway: 750vh;
}

.kx-runway {
  position: relative;
  height: var(--kx-runway);
}

.kx-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  /* a single soft overhead light against deep ink — studio mood */
  background:
    radial-gradient(ellipse 62% 56% at 50% 48%, rgba(245,239,220,0.05) 0%, rgba(245,239,220,0) 70%),
    var(--ink);
}

.kx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* soft-edged radial mask — the key floats out of the dark, no hard rectangle */
  -webkit-mask-image: radial-gradient(ellipse 64% 60% at 50% 50%, #000 40%, transparent 80%);
          mask-image: radial-gradient(ellipse 64% 60% at 50% 50%, #000 40%, transparent 80%);
}

/* ---- minimal local loader — single hairline progress, no copy ---- */
.kx-loader {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 6;
  height: 1px;
  background: rgba(245, 239, 220, 0.10);
  pointer-events: none;
}
.kx-loader[hidden] { display: none; }
.kx-loader.is-leaving { opacity: 0; transition: opacity 480ms ease 60ms; }
.kx-loader-bar {
  position: absolute; inset: 0;
}
.kx-loader-fill {
  position: absolute;
  inset-inline-start: 0;
  top: 0; bottom: 0;
  width: 0%;
  background: var(--rule);
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- responsive ---- */
@media (max-width: 980px) {
  .kx-stage { --kx-runway: 600vh; }
}
@media (max-width: 640px) {
  .kx-stage { --kx-runway: 500vh; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media print {
  html, body { background: #fff; color: #000; }
  .hero-photo, .hero-shade { display: none; }
}

/* --- page switcher (variants 1–4) --- */

.page-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 12px 16px;
  background: rgba(13, 16, 24, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hair-paper);
}
.page-nav a {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(245, 239, 220, 0.04);
  border: 1px solid var(--hair-paper);
  color: rgba(245, 239, 220, 0.78);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 220ms ease;
}
.page-nav a:hover {
  background: rgba(245, 239, 220, 0.08);
  color: var(--chalk);
  border-color: rgba(245, 239, 220, 0.3);
}
.page-nav a.is-active {
  background: var(--rule);
  border-color: var(--rule);
  color: var(--chalk);
  box-shadow: 0 0 0 4px rgba(168, 48, 44, 0.22);
}
.page-nav-label {
  align-self: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 239, 220, 0.5);
  margin-inline-end: 6px;
}
@media (max-width: 520px) {
  .page-nav-label { display: none; }
  .page-nav a { width: 42px; height: 42px; font-size: 15px; }
}

/* --- 3D key stage (used by page3 / page4) --- */

.three-stage {
  position: relative;
  width: min(100%, 1320px);
  margin: 60px auto 80px;
  aspect-ratio: 16 / 9;
  border-radius: clamp(18px, 2vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  background:
    radial-gradient(circle at 50% 42%, rgba(24,31,44,0.9), rgba(9,11,16,1) 62%),
    #0a0c12;
  box-shadow:
    0 40px 100px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.35);
}
.three-stage canvas { width: 100%; height: 100%; display: block; }
.three-stage .badge {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(12px);
  color: rgba(219,226,238,0.84);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
  font-family: var(--mono);
}
.three-stage .badge .bdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5a5a;
  box-shadow: 0 0 10px rgba(255,90,90,0.75);
  transition: background 180ms ease, box-shadow 180ms ease;
}
@media (max-width: 860px) {
  .three-stage { aspect-ratio: 4 / 5; margin: 40px auto 60px; }
}
@media (max-width: 560px) {
  .three-stage { aspect-ratio: 3 / 4; margin: 28px 12px 48px; }
  .three-stage .badge { top: 12px; inset-inline-end: 12px; font-size: 10px; padding: 8px 12px; }
}
