/* ============================================================
   ХИРО „Покривът се отваря“ — финална версия
   Светла хартия → златният покрив от логото се изрисува → звездата
   проблясва → покривът става прозорец към слънчевата стая.
   Разделение: CSS носи текста, знака и аварийния изход (котвата им
   е в инлайн скрипта след секцията); home.js (GSAP) носи само
   „светлината“: прозореца, растежа, полета на звездата и циклите.
   Крайното състояние е по подразбиране (без JS / без движение).
   Зарежда се САМО на началната страница (@push('head') в трите home изгледа);
   общите поправки (SITE FIXES 14–16) са в края на style.css.

   ФИЛМЪТ ПО СКРОЛ (.rhero--film, 21.10.2026): покривът се отваря към първия
   кадър на филма (светлата стая преди ремонта); после хирото се пинира и
   скролът „пуска“ филма до завършената стая — <canvas> с кадри (десктоп) /
   <video> (телефон). Хореографията на текста е в home.js; тук са слоевете,
   статичните състояния (без движение / без JS = завършеният кадър) и
   честният надпис .rhero__note. Отдолу: мостът с истинската кухня и
   секцията „Реални обекти“ (.realwork).
   ============================================================ */

.rhero {
  --pad: clamp(20px, 4vw, 48px);
  --mark: clamp(108px, 10.4vw, 150px);   /* знакът (кутия 100×100 от логото) */
  --mark-x: 56%;                          /* десктоп: вдясно от текста, над прозореца в снимката */
  --mark-y: .45;                          /* център на знака като дял от първия екран */
  --gh: clamp(120px, 11vw, 190px);        /* височина на прага-покрив под първия екран */
  --gold-ink: #8a6418;                    /* злато за дребен текст върху хартия (4.8:1) */
  --nav-ink: #4a4236;                     /* текст на навигацията върху снимката (≥ 6.9:1) */
  --shine-base: #2b5d6c;                  /* „блестим.“ — 6.5:1 върху хартия */
  --shine-edge: #173e4a;                  /* тъмният ръб пред отблясъка (≈ 10:1) */
  --shine-hi: #387387;                    /* светлата ивица — пак ≥ 4.6:1 върху реалния фон (#f3f0e8) */
  --film-x: 50%;                          /* хоризонталната котва на кадъра (постерът и канвасът — home.js я чете) */
  position: relative; z-index: 0; isolation: isolate;
  background: var(--paper);
  color: var(--text-on-light);
}

/* първият екран + прагът-покрив (в същата сцена: снимката продължава зад стрехите) */
.rhero__stage {
  position: relative;
  height: calc(100vh + var(--gh)); height: calc(100svh + var(--gh));
  min-height: calc(640px + var(--gh));
  padding-bottom: var(--gh);
  overflow: hidden;
  display: grid; align-items: center; grid-template-columns: minmax(0, 1fr);
}

/* ---------- снимката (обвивка за паралакс → маска → картина) ---------- */
.rhero__media, .rhero__photo { position: absolute; inset: 0; }
.rhero__media { z-index: 1; }
.rhero picture { display: contents; }
.rhero__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: var(--film-x) 50%;
  max-width: none;
}
/* докато покривът расте: долният ръб на прозореца е мек (--rh-base / --rh-fe ги дава home.js),
   за да не реже твърда хоризонтална линия през текста и вратите */
html.rh-run .rhero__photo {
  -webkit-mask-image: linear-gradient(180deg, #000 calc(var(--rh-base, 100%) - var(--rh-fe, 0px)), transparent var(--rh-base, 100%));
          mask-image: linear-gradient(180deg, #000 calc(var(--rh-base, 100%) - var(--rh-fe, 0px)), transparent var(--rh-base, 100%));
}
.rhero.rh-done .rhero__photo { -webkit-mask-image: none; mask-image: none; }

/* ---------- филмът: постер (img) → canvas (десктоп) / video (телефон) отгоре, в същото „cover“ кадриране ---------- */
.rhero__film { position: absolute; inset: 0; }
.rhero__canvas, .rhero__video, .rhero__after {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; pointer-events: none;
}
.rhero__video, .rhero__after { object-fit: cover; object-position: var(--film-x) 50%; }
.rhero__canvas, .rhero__video { display: none; }
@media (min-width: 900px) { .rhero__canvas { display: block; } }
/* телефон: видеото остава display:none, докато филмът не тръгне (home.js слага .is-on) — Chrome отчита
   първия кадър на заредено видео като LCP дори при opacity:0 / visibility:hidden; постерът (img) е същият кадър */
@media (max-width: 899px) { .rhero__video.is-on { display: block; } }
.rhero__canvas.is-on, .rhero__video.is-on { opacity: 1; }
/* десктоп с филма: постерът е вписан в ПЪРВИЯ екран (както кадрите в канваса), не в целия stage + прага —
   иначе кадърът е увеличен с ~18 % и по-мек. Под стрехите канвасът рисува огледалния под (home.js). */
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  html.js .rhero--film .rhero__img { height: calc(100% - var(--gh)); }
}
/* без JS (или паднал CDN — site.js маха .js): статичният завършен кадър, не стаята преди ремонта */
html:not(.js) .rhero__film { background: url("../assets/intro/film/after-d-1600.webp") 50% 50% / cover no-repeat; }
html:not(.js) .rhero__img { visibility: hidden; }
@media (max-width: 899px) { html:not(.js) .rhero__film { background-image: url("../assets/intro/film/after-m-720.webp"); } }

/* зърното на началната страница е фино (.02 — като светлите страници): светлото хиро и филмът са
   одобрени така; досега го слагаше страничен ефект в home.js, сега е тук */
body.page-home .grain { opacity: .02; }

/* обвивката на пина (собствен pin-spacer на ScrollTrigger: сцената никога не се мести в DOM) */
.rhero__pin { position: relative; }

/* ---------- честният надпис: анимация по реални снимки → преди/след в проектите ---------- */
.rhero__note {
  position: absolute; z-index: 5;
  right: var(--pad); bottom: calc(var(--gh) + 22px);
  display: inline-flex; align-items: center; gap: 9px;
  max-width: min(520px, calc(100% - 2 * var(--pad)));
  padding: 9px 15px 9px 13px; border-radius: 99px;
  background: rgba(246,242,234,.92); color: var(--text-on-light);
  box-shadow: 0 10px 28px -16px rgba(36,31,24,.5), inset 0 0 0 1px rgba(36,31,24,.08);
  font-size: 12.5px; font-weight: 600; line-height: 1.35;
}
.rhero__note i {
  flex: none; width: 7px; height: 7px; border-radius: 50%;
  background: var(--aqua-deep); box-shadow: 0 0 0 3px rgba(63,115,131,.18);
}
.rhero__note b { flex: none; font-weight: 700; color: var(--gold-ink); transition: transform .3s; }
.rhero__note:hover b, .rhero__note:focus-visible b { transform: translateX(3px); }
.rhero__note:hover { color: var(--ink); }
.rhero__note-still { display: none; }
/* статичен кадър (без движение, без JS, бавна мрежа) → „визуализация по реална снимка“ */
html:not(.js) .rhero__note-film, .rhero--static .rhero__note-film { display: none; }
html:not(.js) .rhero__note-still, .rhero--static .rhero__note-still { display: inline; }
@media (prefers-reduced-motion: reduce) {
  .rhero__note-film { display: none; }
  .rhero__note-still { display: inline; }
}
/* дългият текст е за десктоп; на телефон — кратък, на един ред (.rhero__note--s) */
@media (min-width: 900px) { .rhero__note .rhero__note--s { display: none !important; } }
@media (max-width: 899px) { .rhero__note > span:not(.rhero__note--s) { display: none !important; } }

/* топъл слънчев лъч, минава веднъж при отварянето */
.rhero__sun {
  position: absolute; inset: 0;
  background: linear-gradient(102deg, rgba(255,232,190,0) 42%, rgba(255,226,170,.5) 48.5%, rgba(255,244,222,.62) 50%, rgba(255,226,170,.45) 51.5%, rgba(255,232,190,0) 58%);
  background-size: 300% 100%; background-position: 100% 0; background-repeat: no-repeat;
  mix-blend-mode: soft-light;
  opacity: 0; pointer-events: none;
}

/* хартиен воал: текстът стои върху хартия, не върху снимка (само в първия екран) */
.rhero__wash {
  position: absolute; z-index: 2; pointer-events: none;
  inset: 0;                      /* цялата сцена: воалът продължава под сгъвката и изтънява до НУЛА → без шев */
  background:
    radial-gradient(34% 26% at 24% 32%, rgba(246,242,234,.72), rgba(246,242,234,0)),  /* ореол зад заглавието: телевизорът в стаята не стои като кутия зад „блестим.“ */
    linear-gradient(180deg, rgba(246,242,234,.84) 0, rgba(246,242,234,.6) 64px, rgba(246,242,234,0) 150px),
    linear-gradient(90deg, rgba(246,242,234,.97) 0, rgba(246,242,234,.93) 28%, rgba(246,242,234,.84) 40%, rgba(246,242,234,.5) 50%, rgba(246,242,234,0) 62%);
  /* към сгъвката воалът изтънява и свършва напълно прозрачен в зоната на стрехите
     (стрехите стоят над него) → подът под текста се „разлива“ меко, без права линия */
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - var(--gh) - 130px), rgba(0,0,0,.25) calc(100% - var(--gh)), transparent calc(100% - var(--gh) * .3));
          mask-image: linear-gradient(180deg, #000 calc(100% - var(--gh) - 130px), rgba(0,0,0,.25) calc(100% - var(--gh)), transparent calc(100% - var(--gh) * .3));
}
/* десктоп: под колоната с текста воалът стига до долу (иначе размитият стол на преден план в завършения
   кадър стои като сив „призрак“ под числата); вдясно подът пак се разлива свободно */
@media (min-width: 900px) {
  .rhero__wash {
    -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - var(--gh) - 130px), rgba(0,0,0,.25) calc(100% - var(--gh)), transparent calc(100% - var(--gh) * .3)),
                        linear-gradient(90deg, #000 0, #000 20%, transparent 36%);
    -webkit-mask-composite: source-over;
            mask-image: linear-gradient(180deg, #000 calc(100% - var(--gh) - 130px), rgba(0,0,0,.25) calc(100% - var(--gh)), transparent calc(100% - var(--gh) * .3)),
                        linear-gradient(90deg, #000 0, #000 20%, transparent 36%);
            mask-composite: add;
  }
}

/* ---------- знакът: покрив + звезда + словесна марка ---------- */
.rhero__mark {
  position: absolute; z-index: 3;
  width: var(--mark); height: var(--mark);
  left: calc(var(--mark-x) - var(--mark) / 2);
  top: calc((100% - var(--gh)) * var(--mark-y) - var(--mark) / 2);
  pointer-events: none;
  opacity: 0;                    /* крайно състояние: скрит */
}
/* покривът на логото (M14,74 L50,26 L86,74; дебелина 8.5; кръгли краища и чупка), разглобен на части
   с точната геометрия на логото (SVG в една и съща кутия 100×100): точка на билото + за всеки крак
   „прът“ (права линия, скъсен по крака с scaleX от билото) и кръгъл „връх“ (плъзга се по крака).
   Изрисуването е само transform върху HTML обвивките → върви в компоузитора и на зает телефон
   (stroke-dasharray стоеше на точката и после „изскачаше“ цял). Накрая частите = пътя от логото. */
.rhero__logo, .rhero__rod, .rhero__tip { position: absolute; inset: 0; }
.rhero__logo svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: var(--gold); }
.rhero__rod { transform-origin: 50% 26%; }                       /* билото */
.rhero__rod path { fill: none; stroke: var(--gold); stroke-width: 8.5; stroke-linecap: butt; }
.rhero__frame path {
  fill: none; stroke: var(--gold); stroke-width: 8.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.rhero__star {
  position: absolute; z-index: 6;
  left: 38%; top: 48%; width: 24%; height: 24%;
}
.rhero__star svg, .rhero__spark svg, .rhero__gable-star svg {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  fill: var(--gold);
}
.rhero__glow {
  position: absolute; inset: -110%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,240,205,.95) 0, rgba(232,192,122,.55) 22%, rgba(232,192,122,0) 62%);
  opacity: 0; pointer-events: none;
}
.rhero__wordmark {
  position: absolute; z-index: 0;
  top: 86%; left: 50%; transform: translateX(-50%);
  display: grid; justify-items: center; gap: .55em;
  white-space: nowrap; text-align: center;
}
.rhero__wm-name {
  display: flex; overflow: hidden; padding: .06em 0 .06em .17em;
  font-family: var(--font-display); font-weight: 800;
  font-size: calc(var(--mark) * .25); letter-spacing: .17em; line-height: 1.05;
  color: var(--ink);
}
.rhero__wm-name i { display: inline-block; font-style: normal; }
.rhero__wm-sub {
  font-family: var(--font-display); font-weight: 700;
  font-size: max(9px, calc(var(--mark) * .072)); letter-spacing: .44em; padding-left: .44em;
  text-transform: uppercase; color: var(--gold-ink);
}

/* тесен десктоп (900–1199, напр. iPad landscape): текстът стига до знака → само покривът и звездата
   (името е в навигацията), а знакът отстъпва надясно, за да не стъпва върху подзаглавието */
/* 900–1279: текстът заема повече от ширината → кадърът се плъзга надясно (--film-x), така че диванът и масата
   в завършената стая не стоят под вратите и числата (постерът, канвасът и „светлината“ в интрото четат същото) */
@media (min-width: 900px) and (max-width: 1279px) {
  .rhero { --film-x: 30%; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .rhero { --mark-x: 66%; }
  .rhero__wordmark { display: none; }
  /* тук бутонът + вратите стигат до ~70 % от ширината → воалът стига по-надясно (дребният текст ≥ 4.5:1) */
  .rhero__wash {
    background:
      radial-gradient(40% 26% at 30% 32%, rgba(246,242,234,.72), rgba(246,242,234,0)),
      linear-gradient(180deg, rgba(246,242,234,.84) 0, rgba(246,242,234,.6) 64px, rgba(246,242,234,0) 150px),
      linear-gradient(90deg, rgba(246,242,234,.97) 0, rgba(246,242,234,.93) 34%, rgba(246,242,234,.86) 50%, rgba(246,242,234,.62) 62%, rgba(246,242,234,0) 76%);
  }
}

/* рамката на покрива при растежа (геометрията я смята home.js).
   Маска: изчезва под навигацията (горе) и — на десктоп — над колоната с текста (вляво),
   така че растящият покрив никога не „зачерква“ заглавието, бутона или вратите;
   при предаването от логото (вдясно, ≥ 52 %) е напълно плътна → без скок. */
.rhero__frame {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3;
  overflow: visible; pointer-events: none;
  display: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 56px, #000 170px);
          mask-image: linear-gradient(180deg, transparent 56px, #000 170px);
}
@media (min-width: 900px) {
  .rhero__frame {
    -webkit-mask-image: linear-gradient(90deg, transparent 34%, #000 51%), linear-gradient(180deg, transparent 56px, #000 170px);
    -webkit-mask-composite: source-in;
            mask-image: linear-gradient(90deg, transparent 34%, #000 51%), linear-gradient(180deg, transparent 56px, #000 170px);
            mask-composite: intersect;
  }
}
html.rh-run .rhero__frame { display: block; }

/* ---------- текстът ---------- */
.rhero__copy {
  position: relative; z-index: 4;
  padding: 104px var(--pad) 60px;
  max-width: calc(780px + var(--pad));   /* бутонът + двете врати на един ред и на руски */
}
.rhero__eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  letter-spacing: .3em; text-transform: uppercase; color: var(--gold-ink);
  margin-bottom: 26px;
}
.rhero__eyebrow::before { content: ""; width: 36px; height: 1.5px; background: currentColor; flex: none; }
.rhero__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(44px, 4.7vw, 76px); line-height: 1.06; letter-spacing: -.012em;
  color: var(--ink);
}
/* маска на реда: подложката дава място на наклона и искрата; маржът я връща */
.rhero__line {
  display: block; overflow: hidden;
  padding: .04em .6em .14em 0; margin: -.04em -.6em -.14em 0;
}
.rh-done .rhero__line { overflow: visible; }
.rhero__w { display: inline-block; transform-origin: 0 100%; }
.rhero__w--shine { position: relative; }
.rhero__w--shine em {
  font-family: var(--font-story); font-style: italic; font-weight: 600;
  font-size: 1.13em; letter-spacing: -.005em; line-height: 0;
  color: var(--shine-base);
  /* подложка, за да не се реже наклоненият курсив при background-clip:text */
  padding: 0 .14em 0 .04em; margin: 0 -.14em 0 -.04em;
}
/* „блестим.“ — светла ивица минава периодично през цялата дума (позиция на градиент, без разбиване на букви);
   движи я home.js (един цикъл с проблясването на звездата). Тъмният ръб пред светлото дава „гланц“,
   без светлото да пада под 4.5:1. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  html.js .rhero__w--shine em {
    background-image: linear-gradient(100deg,
      var(--shine-base) 0%, var(--shine-base) 40%, var(--shine-edge) 45.5%,
      var(--shine-hi) 50%, var(--shine-hi) 51.5%,
      var(--shine-base) 57%, var(--shine-base) 100%);
    background-size: 400% 100%; background-position: 100% 0; background-repeat: no-repeat;
    -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
  }
}
.rhero__spark {
  position: absolute; right: -.33em; top: .02em;
  width: .38em; height: .38em;
}
.rhero__sub {
  margin-top: 26px; max-width: 34em;
  font-size: clamp(16px, 1.22vw, 18.5px); line-height: 1.65;
  color: #463f34;
}

/* бутонът + двете „врати“ (строителство / почистване) */
.rhero__cta { margin-top: 34px; display: flex; align-items: center; flex-wrap: wrap; gap: 16px clamp(24px, 2.6vw, 40px); }
.rhero__cta .btn { text-align: center; }
.rhero .btn--gold { box-shadow: 0 10px 30px -12px rgba(168,122,36,.55); }
.rhero__doors { list-style: none; display: flex; flex-wrap: wrap; gap: 8px clamp(22px, 2.4vw, 34px); }
.rhero__door {
  position: relative;
  display: inline-flex; align-items: center; gap: 11px;
  min-height: 48px; padding: 6px 2px 8px 0;
  color: var(--text-on-light);
}
.rhero__door::after, .rhero__door::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
}
.rhero__door::after { background: rgba(36,31,24,.18); }
.rhero__door::before { z-index: 1; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.rhero__door svg { width: 24px; height: 24px; flex: none; overflow: visible; }
.rhero__door--build svg { width: 26px; height: 26px; }
.rhero__door--build svg path { fill: none; stroke: var(--gold-deep); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.rhero__door--clean svg path { fill: var(--aqua-deep); }
.rhero__door-txt { display: grid; gap: 4px; }
.rhero__door-name { display: inline-flex; align-items: baseline; gap: 8px; font-weight: 700; font-size: 15.5px; line-height: 1.2; white-space: nowrap; }
.rhero__door-name b { font-weight: 600; color: var(--muted-on-light); transition: transform .3s, color .3s; }
.rhero__door small {
  font-family: var(--font-display); font-weight: 600; font-size: 10px; line-height: 1.2;
  letter-spacing: .13em; text-transform: uppercase; white-space: nowrap;
  color: #5d5649;                                   /* 6.4:1 — дребен текст и върху снимката */
}
.rhero__door:hover::before, .rhero__door:focus-visible::before { transform: scaleX(1); }
.rhero__door:hover .rhero__door-name b, .rhero__door:focus-visible .rhero__door-name b { transform: translateX(4px); color: currentColor; }
.rhero__door--build:hover { color: var(--gold-ink); }
.rhero__door--clean:hover { color: var(--aqua-deep); }
.rhero a:focus-visible { outline-color: var(--gold-deep); }

.rhero__facts {
  list-style: none; margin-top: 40px; padding-top: 20px;
  display: flex; gap: clamp(22px, 2.6vw, 40px);
  border-top: 1px solid rgba(36,31,24,.14);
  max-width: 560px;
}
.rhero__facts li { display: grid; gap: 4px; font-size: 13px; line-height: 1.35; color: #5d5649; }
.rhero__facts b {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  letter-spacing: -.01em; color: var(--text-on-light);
}

/* подсказка за скрол (десктоп): тънка златна линия, по която „тече“ светлина */
.rhero__cue {
  position: absolute; z-index: 4; left: 50%; bottom: calc(var(--gh) + 24px);
  width: 1px; height: 46px; margin-left: -.5px; overflow: hidden;
  background: rgba(168,122,36,.25);
  display: none;
}
.rhero__cue::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  background: linear-gradient(to bottom, transparent, var(--gold-deep));
  transform: translateY(-100%);
}
@media (min-width: 900px) and (min-height: 700px) { .rhero__cue { display: block; } }

/* ---------- прагът към тъмната глава: покривът на логото в мащаб ---------- */
.rhero__gable {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  height: var(--gh);
  pointer-events: none;
}
.rhero__gable-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.rhero__gable-fill { fill: var(--ink); }
.rhero__gable-edge {
  fill: none; stroke: var(--gold); stroke-width: 2.5;
  vector-effect: non-scaling-stroke; stroke-linecap: round;
}
.rhero__gable-star {
  --gs: clamp(24px, 2.3vw, 36px);
  position: absolute; left: calc(50% - var(--gs) / 2); top: calc(42% - var(--gs) / 2);
  width: var(--gs); height: var(--gs);
}
.rhero__gable-ask {
  position: absolute; left: 0; right: 0; top: 66%;
  text-align: center; white-space: nowrap;
  font-family: var(--font-story); font-style: italic; font-weight: 500;
  font-size: clamp(16px, 1.4vw, 22px); line-height: 1.3; letter-spacing: .01em;
  color: var(--gold-soft);
}
.rhero__marquee { border-top: 0; margin-top: -1px; position: relative; z-index: 1; }

/* ---------- навигацията над светлото хиро (body.hero-light идва от сървъра; JS я гаси при покрива) ---------- */
/* първият кадър: браузърът може да изрисува частично парснатия документ (само навигацията) преди хирото —
   при бавна мрежа/телефон, при поточен HTML или докато вграден скрипт чака стиловете. Тогава тялото
   трябва да е хартия, не мастило (иначе първият кадър е точно тъмното начало, което собственичката отхвърли).
   Само с .js: без JS / паднал CDN (site.js маха .js) тялото си остава мастилено за прозрачните секции.
   Мостът пише фона на тялото инлайн, а hero-light се гаси при покрива → по-надолу нищо не се променя. */
html.js body.hero-light { background-color: var(--paper); }
body.hero-light .nav { color: var(--text-on-light); }
body.hero-light .nav.is-scrolled { background: color-mix(in srgb, var(--paper) 88%, transparent); box-shadow: 0 1px 0 rgba(36,31,24,.07); }
body.hero-light .nav__logo-stack i { color: var(--gold-ink, #8a6418); opacity: 1; }
body.hero-light .nav__links { color: #4a4236; }
body.hero-light .nav__links a:hover,
body.hero-light .nav__links a[aria-current="page"] { color: #8a6418; }
body.hero-light .nav .langsw a { color: #4a4236; }
body.hero-light .nav .langsw a:hover, body.hero-light .nav .langsw a.is-active { color: #8a6418; }
body.hero-light .nav__phone { border-color: rgba(36,31,24,.34); }
body.hero-light .nav__phone:hover { color: var(--ink); }
body.hero-light .nav a:focus-visible, body.hero-light .nav button:focus-visible { outline-color: var(--gold-deep); }
/* мастиленият покрив минава под навигацията (от билото до стрехите; home.js слага body.nav-gable):
   плътна мастилена лента — продължение на покрива, без полупрозрачно стъкло и размазване над светлата снимка */
body.nav-gable .nav {
  color: var(--text-on-dark);
  background: var(--ink);
  -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
}
/* смяната светла ↔ мастилена е рязка (в мига на допира), без сиви междинни кадри от прехода на .nav */
.nav.nav--snap, .nav.nav--snap * { transition: none !important; }
/* без JS (или паднал CDN — site.js маха .js) никой не гаси hero-light → навигацията носи своя хартиен фон */
html:not(.js) body.hero-light .nav { background: color-mix(in srgb, var(--paper) 92%, transparent); box-shadow: 0 1px 0 rgba(36,31,24,.08); }

/* ============================================================
   ДВИЖЕНИЕ — само при разрешено движение и работещ JS.
   Времената са от котвата S (първото изрисуване, но ≤ 0,38 s след навигацията).
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {

  /* --- първо посещение в сесията: знакът се изрисува, текстът изгрява --- */
  html.js:not(.rh-seen) .rhero__mark { opacity: 1; }
  html.js:not(.rh-seen) .rhero__rod--l { animation: rh-rod-l .4s cubic-bezier(.45,0,.25,1) .04s backwards; }
  html.js:not(.rh-seen) .rhero__rod--r { animation: rh-rod-r .4s cubic-bezier(.45,0,.25,1) .04s backwards; }
  html.js:not(.rh-seen) .rhero__tip--l { animation: rh-tip-l .4s cubic-bezier(.45,0,.25,1) .04s backwards; }
  html.js:not(.rh-seen) .rhero__tip--r { animation: rh-tip-r .4s cubic-bezier(.45,0,.25,1) .04s backwards; }
  html.js:not(.rh-seen) .rhero__star svg { animation: rh-pop .44s cubic-bezier(.34,1.7,.64,1) .2s backwards; }
  html.js:not(.rh-seen) .rhero__wm-name i { animation: rh-letter .46s cubic-bezier(.22,1,.36,1) backwards; }
  html.js:not(.rh-seen) .rhero__wm-name i:nth-child(1) { animation-delay: .12s; }
  html.js:not(.rh-seen) .rhero__wm-name i:nth-child(2) { animation-delay: .145s; }
  html.js:not(.rh-seen) .rhero__wm-name i:nth-child(3) { animation-delay: .17s; }
  html.js:not(.rh-seen) .rhero__wm-name i:nth-child(4) { animation-delay: .195s; }
  html.js:not(.rh-seen) .rhero__wm-name i:nth-child(5) { animation-delay: .22s; }
  html.js:not(.rh-seen) .rhero__wm-name i:nth-child(6) { animation-delay: .245s; }
  html.js:not(.rh-seen) .rhero__wm-name i:nth-child(7) { animation-delay: .27s; }
  html.js:not(.rh-seen) .rhero__wm-sub { animation: rh-fade-up .36s ease-out .3s backwards; }

  html.js:not(.rh-seen) .rhero__eyebrow { animation: rh-fade-up .5s cubic-bezier(.22,1,.36,1) .16s backwards; }
  html.js:not(.rh-seen) .rhero__w { animation: rh-word .9s cubic-bezier(.16,1,.3,1) backwards; }
  html.js:not(.rh-seen) .rhero__line--1 .rhero__w:nth-child(1) { animation-delay: .2s; }
  html.js:not(.rh-seen) .rhero__line--1 .rhero__w:nth-child(2) { animation-delay: .26s; }
  html.js:not(.rh-seen) .rhero__line--2 .rhero__w:nth-child(1) { animation-delay: .32s; }
  html.js:not(.rh-seen) .rhero__line--2 .rhero__w:nth-child(2) { animation-delay: .38s; }
  html.js:not(.rh-seen) .rhero__sub { animation: rh-fade-up .52s cubic-bezier(.22,1,.36,1) .4s backwards; }
  html.js:not(.rh-seen) .rhero__cta .btn { animation: rh-fade-up .44s cubic-bezier(.22,1,.36,1) .44s backwards; }
  html.js:not(.rh-seen) .rhero__doors li { animation: rh-fade-up .48s cubic-bezier(.22,1,.36,1) .52s backwards; }
  html.js:not(.rh-seen) .rhero__doors li + li { animation-delay: .58s; }
  html.js:not(.rh-seen) .rhero__facts { animation: rh-fade-up .5s cubic-bezier(.22,1,.36,1) .66s backwards; }
  html.js:not(.rh-seen) .rhero__note { animation: rh-fade-up .5s cubic-bezier(.22,1,.36,1) 1.1s backwards; }
  html.js.rh-seen .rhero__note { animation: rh-fade-up .4s cubic-bezier(.22,1,.36,1) .2s backwards; }

  /* преди home.js: снимката и искрата чакат „светлината“; авариен изход в 1,7 s от котвата */
  html.js:not(.rh-seen):not(.rh-run) .rhero__photo { animation: rh-in .5s ease-out 1.7s backwards; }
  html.js:not(.rh-seen):not(.rh-run) .rhero__mark { animation: rh-out .35s ease-in 1.7s forwards; }
  html.js:not(.rh-seen):not(.rh-run) .rhero__spark { animation: rh-spark-in .6s cubic-bezier(.34,1.7,.64,1) 1.9s backwards; }

  /* --- повторно посещение в сесията: само кратко „настаняване“ (≤ 0,6 s) --- */
  html.js.rh-seen .rhero__copy > * { animation: rh-fade-up .4s cubic-bezier(.22,1,.36,1) backwards; }
  html.js.rh-seen .rhero__copy > :nth-child(2) { animation-delay: .04s; }
  html.js.rh-seen .rhero__copy > :nth-child(3) { animation-delay: .1s; }
  html.js.rh-seen .rhero__copy > :nth-child(4) { animation-delay: .14s; }
  html.js.rh-seen .rhero__copy > :nth-child(5) { animation-delay: .18s; }
  html.js.rh-seen .rhero__photo { animation: rh-in .35s ease-out backwards; }

  /* --- безкрайният CSS цикъл (подсказката; паузира се извън екрана: .is-idle).
         Блясъкът на „блестим.“ и звездата са един GSAP цикъл в home.js. --- */
  html.js .rhero__cue::after { animation: rh-cue 2.4s cubic-bezier(.65,0,.35,1) 2.2s infinite; }
  .rhero.is-idle .rhero__cue::after { animation-play-state: paused; }
}

/* пръчката се скъсява само по посоката на крака (завърти → мащаб по x → завърти обратно); краят = без transform */
@keyframes rh-rod-l { from { transform: rotate(126.87deg) scaleX(.001) rotate(-126.87deg); } to { transform: rotate(126.87deg) scaleX(1) rotate(-126.87deg); } }
@keyframes rh-rod-r { from { transform: rotate(53.13deg) scaleX(.001) rotate(-53.13deg); } to { transform: rotate(53.13deg) scaleX(1) rotate(-53.13deg); } }
@keyframes rh-tip-l { from { transform: translate(36%, -48%); } }    /* от билото (50,26) до (14,74) */
@keyframes rh-tip-r { from { transform: translate(-36%, -48%); } }   /* от билото (50,26) до (86,74) */
@keyframes rh-pop { from { transform: scale(0) rotate(-135deg); } }
@keyframes rh-letter { from { transform: translateY(110%); } }
@keyframes rh-word { from { transform: translateY(118%) rotate(5deg); } }
@keyframes rh-fade-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes rh-in { from { opacity: 0; } }
@keyframes rh-out { to { opacity: 0; } }
@keyframes rh-spark-in { from { opacity: 0; transform: scale(1.6) rotate(-45deg); } }
@keyframes rh-cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

.rhero.rh-done .rhero__mark, .rhero.rh-done .rhero__frame { display: none; }

/* ============================================================
   Телефон / таблет: снимката горе, текстът на хартия отдолу
   ============================================================ */
@media (max-width: 899px) {
  .rhero { --mark: clamp(96px, 27vw, 128px); --mark-x: 50%; --mark-y: .3; --gh: clamp(108px, 30vw, 150px); }
  .rhero__stage { align-items: end; min-height: calc(600px + var(--gh)); }
  /* филмът е на целия първи екран (под хартията на текста); в началото е вдигнат с 13 %, за да се вижда
     стаята (прозорецът и столовете) над текста; home.js го сваля, докато хартията се отдръпва */
  .rhero__media { bottom: auto; height: calc(100% - var(--gh)); }
  .rhero__film { transform: translateY(-13%); }
  /* долният ръб на филма е мек (докато хартията се отдръпва/връща, не се вижда права линия под пода) */
  .rhero__film::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 14%; z-index: 1; pointer-events: none;
    background: linear-gradient(180deg, rgba(246,242,234,0), rgba(246,242,234,.85) 70%, var(--paper));
  }
  .rhero__wash {
    inset: 0 0 auto 0; height: 160px; -webkit-mask-image: none; mask-image: none;
    background: linear-gradient(180deg, rgba(246,242,234,.78) 0, rgba(246,242,234,.5) 56px, rgba(246,242,234,0) 130px);
  }
  /* текстът носи своя хартия с мек преход отгоре (::before, --panel) → без твърд ръб, колкото и да е висок.
     Докато филмът тече, хартията изчезва и остава само мек долен воал (::after, --scrim) зад заглавието */
  .rhero__copy {
    padding: 58px 24px calc(22px + env(safe-area-inset-bottom)); max-width: none;
  }
  .rhero__copy::before, .rhero__copy::after { content: ""; position: absolute; z-index: -1; left: 0; right: 0; pointer-events: none; }
  .rhero__copy::before {
    top: 0; bottom: 0; opacity: var(--panel, 1);
    background: linear-gradient(180deg, rgba(246,242,234,0) 0, rgba(246,242,234,.9) 34px, var(--paper) 58px);
  }
  .rhero__copy::after {
    bottom: 0; height: 64%; opacity: var(--scrim, 0);
    background: linear-gradient(180deg, rgba(246,242,234,0) 0, rgba(246,242,234,.82) 46%, rgba(246,242,234,.94) 100%);
  }
  .rhero__note {
    right: 16px; bottom: auto; top: calc(78px + env(safe-area-inset-top));
    max-width: calc(100% - 32px); padding: 7px 12px 7px 11px; gap: 8px;
    font-size: 11.5px; white-space: nowrap;
  }
  /* без движение / без JS: завършеният кадър е вдигнат като в края на филма — диванът, масата и килимът
     стоят над хартията с текста (не пердетата и телевизорът) */
  html:not(.js) .rhero { --film-x: 78%; }
  html:not(.js) .rhero__film { transform: translateY(-27%); }
  .rhero__eyebrow { font-size: 10px; letter-spacing: .15em; margin-bottom: 14px; white-space: nowrap; }
  .rhero__eyebrow::before { display: none; }
  .rhero__title { font-size: clamp(30px, 10.2vw, 52px); line-height: 1.06; }
  .rhero__sub { margin-top: 14px; font-size: 15.5px; line-height: 1.58; }
  .rhero__cta { margin-top: 20px; display: grid; gap: 10px; }
  .rhero__cta .btn { width: 100%; padding: 15px 22px; }
  .rhero__doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .rhero__door { width: 100%; gap: 8px; min-height: 50px; }
  .rhero__door-name { font-size: 14.5px; gap: 6px; }
  .rhero__door svg { width: 21px; height: 21px; }
  .rhero__door--build svg { width: 23px; height: 23px; }
  /* телефон: широките главни букви на Unbounded не се побират в полуколона в четим размер →
     същото име, четимо: Manrope, нормален регистър, 11 px */
  .rhero__door small { font-family: var(--font-body); font-weight: 600; font-size: 11px; letter-spacing: .01em; text-transform: none; }
  .rhero__facts { margin-top: 18px; padding-top: 14px; gap: 18px; max-width: none; }
  .rhero__facts li { font-size: 11.5px; }
  .rhero__facts b { font-size: 17px; }
  .rhero__gable-star { --gs: 24px; top: calc(40% - var(--gs) / 2); }
  .rhero__gable-ask { top: 64%; font-size: 16px; }
}
/* много тесен телефон */
@media (max-width: 379px) {
  /* надписът остава на един ред (без „висяща“ точка): по-плътна разредка, размерът следва ширината */
  .rhero__eyebrow { font-size: min(10px, 2.62vw); letter-spacing: .1em; }
  .rhero__facts { gap: 12px; }
  .rhero__doors { gap: 14px; }
  .rhero__door { gap: 7px; }
  .rhero__door svg { width: 18px; height: 18px; }
  .rhero__door--build svg { width: 20px; height: 20px; }
  .rhero__door-name { font-size: 13.5px; gap: 5px; }
  .rhero__door small { font-size: 10.5px; letter-spacing: 0; }
}
/* таблет: бутонът и вратите в един ред */
@media (min-width: 600px) and (max-width: 899px) {
  .rhero__cta { display: flex; }
  .rhero__cta .btn { width: auto; }
  .rhero__doors { display: flex; }
  .rhero__door { width: auto; }
}
/* нисък телефон: числата отстъпват на бутона и вратите */
@media (max-width: 899px) and (max-height: 760px) {
  .rhero__facts { display: none; }
  .rhero { --mark-y: .28; }
}
/* нисък десктоп */
@media (min-width: 900px) and (max-height: 760px) {
  .rhero__facts { display: none; }
  .rhero__copy { padding-top: 96px; padding-bottom: 40px; }
  .rhero__title { font-size: clamp(42px, 5vw, 70px); }
}

/* ---------- без движение: всичко статично и видимо ---------- */
@media (prefers-reduced-motion: reduce) {
  .rhero__mark, .rhero__frame, .rhero__sun { display: none !important; }
  .rhero__line { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 899px) {
  .rhero { --film-x: 78%; }
  .rhero__film { transform: translateY(-27%); }
}

@media (forced-colors: active) {
  .rhero__w--shine em { background: none !important; color: CanvasText !important; -webkit-text-fill-color: CanvasText !important; }
}

@media print {
  .rhero__mark, .rhero__frame, .rhero__wash, .rhero__sun, .rhero__gable, .rhero__marquee, .rhero__cue,
  .rhero__canvas, .rhero__video, .rhero__note { display: none !important; }
  .rhero__stage { height: auto; min-height: 0; padding-bottom: 0; }
  .rhero__media { position: relative; height: 320px; }
}

/* ============================================================
   МОСТЪТ — истинската кухня (обект „apartament“), снимките са
   изравнени пиксел в пиксел, портрет 3:4. Тялото на .ba / плъзгача
   е в style.css; тук само рамката, надписът и подредбата.
   ============================================================ */
.bridge__real { margin: 0; width: 100%; display: grid; justify-items: center; gap: 14px; }
.ba.ba--real {
  height: auto; aspect-ratio: 4 / 5;
  width: clamp(220px, calc((100svh - 470px) * .8), 440px);
  border-radius: 22px;
}
.ba--real .ba__img { object-position: 50% 52%; }
.bridge__cap {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px;
  font-size: 13.5px; line-height: 1.5; text-align: center;
  color: var(--muted-on-dark); transition: color .4s;
}
.bridge__cap a { font-weight: 700; color: var(--gold); white-space: nowrap; transition: color .4s; }
.bridge__cap a b { display: inline-block; margin-left: .3em; font-weight: 700; transition: transform .3s; }
.bridge__cap a:hover b, .bridge__cap a:focus-visible b { transform: translateX(4px); }
body.is-light .bridge__cap { color: var(--muted-on-light); }
body.is-light .bridge__cap a { color: var(--gold-deep); }
@media (max-width: 899px) {
  .page-home .bridge__stage { padding-top: 84px; padding-bottom: 40px; gap: clamp(18px, 3vh, 34px); }
}
/* десктоп: цитатът и бележката вляво, кухнята (3:4) вдясно — пинираният екран побира всичко */
@media (min-width: 900px) {
  .page-home .bridge__stage {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "quote real" "note real";
    align-content: center; column-gap: clamp(48px, 7vw, 120px); row-gap: 28px;
    max-width: 1180px; padding: 96px clamp(32px, 5vw, 64px) 40px;
  }
  .page-home .bridge__quote { grid-area: quote; align-self: end; text-align: left; font-size: clamp(26px, 2.9vw, 42px); }
  .page-home .bridge__real { grid-area: real; }
  .page-home .bridge__note { grid-area: note; align-self: start; text-align: left; max-width: 440px; }
  .ba.ba--real { aspect-ratio: 3 / 4; width: auto; height: min(calc(100svh - 210px), 700px); }
  .bridge__cap { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .bridge__cap { color: var(--muted-on-light); }
  .bridge__cap a { color: var(--gold-deep); }
}

/* ============================================================
   РЕАЛНИ ОБЕКТИ — 4 истински снимки → /proekti#<проект>
   Маркъпът се генерира от home-gen/realwork.mjs (Projects/Valerie).
   Мозайка 12 колони (десктоп) · 2 колони (таблет) · хоризонтален
   плъзгач със snap (телефон, без хоризонтален скрол на страницата).
   ============================================================ */
.realwork {
  position: relative; background: var(--paper); color: var(--text-on-light);
  padding: clamp(64px, 8vw, 120px) 0 clamp(80px, 9vw, 130px);
}
.realwork .section-head { max-width: 1240px; padding-inline: clamp(20px, 4vw, 48px); }
.realwork__grid {
  list-style: none; max-width: 1240px; margin: clamp(36px, 5vw, 60px) auto 0;
  padding: 0 clamp(20px, 4vw, 48px);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: clamp(340px, 38vw, 540px); gap: clamp(14px, 1.6vw, 20px);
}
.realwork__item--a { grid-column: 1 / span 7; }
.realwork__item--b { grid-column: 8 / span 5; }
.realwork__item--c { grid-column: 1 / span 5; }
.realwork__item--d { grid-column: 6 / span 7; }
.realwork__card {
  position: relative; display: block; height: 100%;
  border-radius: 22px; overflow: hidden; isolation: isolate;
  background: #d9d2c4; color: #fff;
  box-shadow: 0 30px 60px -40px rgba(36,31,24,.6);
}
.realwork__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1);
}
.realwork__item--a .realwork__img { object-position: 36% 74%; }
.realwork__item--d .realwork__img { object-position: 64% 50%; }
.realwork__card::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(14,11,8,0) 42%, rgba(14,11,8,.42) 64%, rgba(14,11,8,.86) 100%);
}
.realwork__cap {
  position: absolute; z-index: 2;
  left: clamp(18px, 2.2vw, 30px); right: 84px; bottom: clamp(18px, 2.2vw, 28px);
  display: grid; gap: 7px;
}
.realwork__cap small {
  font-size: 11.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-soft);
}
.realwork__cap strong {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(17px, 1.65vw, 23px); line-height: 1.25; color: #fff;
}
.realwork__go {
  position: absolute; z-index: 2;
  right: clamp(16px, 2vw, 26px); bottom: clamp(16px, 2vw, 26px);
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(246,242,234,.94); color: var(--ink); font-weight: 700; font-size: 18px;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), background .35s;
}
.realwork__card:hover .realwork__img, .realwork__card:focus-visible .realwork__img { transform: scale(1.045); }
.realwork__card:hover .realwork__go, .realwork__card:focus-visible .realwork__go { background: var(--gold); transform: translateX(4px); }
.realwork__card:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 4px; }
.realwork__more { max-width: 1240px; margin: clamp(30px, 4vw, 48px) auto 0; padding: 0 clamp(20px, 4vw, 48px); text-align: center; }
.realwork__all b { display: inline-block; margin-left: .35em; transition: transform .3s; }
.realwork__all:hover b, .realwork__all:focus-visible b { transform: translateX(4px); }

/* таблет: две колони, еднакви карти 4:5 */
@media (max-width: 899px) {
  .realwork__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .realwork__item { grid-column: auto !important; aspect-ratio: 4 / 5; }
  .realwork__cap { right: 70px; }
  .realwork__go { width: 40px; height: 40px; font-size: 16px; }
}
/* телефон: хоризонтален плъзгач със snap; следващата карта наднича (подсказка за плъзгане) */
@media (max-width: 599px) {
  .realwork__grid {
    display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: 20px;
    padding: 0 20px 6px; scrollbar-width: none;
  }
  .realwork__grid::-webkit-scrollbar { display: none; }
  .realwork__item { flex: 0 0 80%; scroll-snap-align: start; }
  .realwork__card { border-radius: 18px; }
  .realwork__cap strong { font-size: 17px; }
  .realwork__all { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .realwork__img, .realwork__go { transition: none; }
}
@media print {
  .realwork__grid { display: block; }
  .realwork__item { break-inside: avoid; height: 320px; margin-bottom: 12px; }
}
