/* =========================================================
   Holcim Egypt — Digital Brochure Suite · core styles
   Concept: "Strata / طبقات" — every brochure is a layer of
   the same structure. Mobile-first, RTL-ready.
   ========================================================= */

:root {
  /* Holcim-inspired palette (to be matched to the official brand book) */
  --navy: #0A1E3F;
  --navy-2: #0E2A55;
  --blue: #1D4F91;
  --sky: #00A3E0;
  --green: #94C12E;
  --sand: #F3EFE8;
  --sand-2: #E7E0D4;
  --concrete: #B8B3AA;
  --ink: #0B1426;
  --ink-soft: #4A5468;
  --white: #FFFFFF;

  --accent: var(--green);
  --accent-ink: #3E5A1F;

  --font-en: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
  --font: var(--font-en);

  --gut: clamp(20px, 5.5vw, 64px);
  --bar-h: 64px;
  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  color-scheme: light;
}
:root[lang="ar"] { --font: var(--font-ar); }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.ico { width: 1.25em; height: 1.25em; flex: none; }

/* ---------------- deck (vertical swipe) ---------------- */
.deck {
  height: 100vh; height: 100dvh;
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  outline: none;
}
.sec {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--bar-h) + 28px) var(--gut) 56px;
  overflow: hidden;
}
.sec__in { position: relative; z-index: 2; width: 100%; max-width: 1180px; margin: 0 auto; }
.sec--dark { background: var(--navy); color: var(--white); }
.sec--light { background: var(--sand); color: var(--ink); }

/* ---------------- typography ---------------- */
.display {
  font-size: clamp(2.6rem, 11.5vw, 6.4rem);
  line-height: .98; letter-spacing: -.035em; font-weight: 800;
  margin: 0 0 .35em; max-width: 13ch; text-wrap: balance;
}
.h2 {
  font-size: clamp(1.9rem, 7.6vw, 3.6rem);
  line-height: 1.04; letter-spacing: -.03em; font-weight: 750;
  margin: 0 0 .6em; max-width: 18ch; text-wrap: balance;
}
.h3 { font-size: clamp(1.35rem, 5vw, 1.9rem); line-height: 1.12; letter-spacing: -.02em; font-weight: 700; margin: 0 0 .5em; }
.lede { font-size: clamp(1.05rem, 4.2vw, 1.35rem); line-height: 1.5; max-width: 34ch; margin: 0; opacity: .88; }
.eyebrow {
  font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  margin: 0 0 1.1em; display: inline-flex; align-items: center; gap: .7em;
  color: var(--accent-ink);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; }
.sec--dark .eyebrow { color: var(--accent); }
.muted { opacity: .7; margin: 0 0 1.2em; line-height: 1.5; }
em { font-style: normal; color: var(--accent-ink); }
.sec--dark em { color: var(--accent); }

:root[lang="ar"] .display,
:root[lang="ar"] .h2,
:root[lang="ar"] .h3 { letter-spacing: 0; line-height: 1.25; }
:root[lang="ar"] .display { font-size: clamp(2.3rem, 10.5vw, 5.6rem); }
:root[lang="ar"] .eyebrow { letter-spacing: .02em; font-size: .88rem; }
:root[lang="ar"] .lede, :root[lang="ar"] p { line-height: 1.75; }

/* ---------------- reveal system ---------------- */
.rv {
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 110ms + 80ms);
}
.is-in .rv { opacity: 1; transform: none; }

/* ---------------- top bar + progress ---------------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  padding: 10px var(--gut) 0;
  color: var(--white);
  transition: color .4s var(--ease);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.bar::before {
  content: ""; position: absolute; inset: 0 0 -24px 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(10,30,63,.55), rgba(10,30,63,0));
  transition: opacity .4s;
}
.bar--light { color: var(--ink); }
.bar--light::before { background: linear-gradient(to bottom, rgba(243,239,232,.92), rgba(243,239,232,0)); }
.bar__row { display: flex; align-items: center; gap: 12px; height: 40px; }
.brand { display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; font-family: var(--font-en); }
.brand__word { font-weight: 800; letter-spacing: .14em; font-size: 1.02rem; }
.brand__sub { font-weight: 500; font-size: .82rem; opacity: .75; font-family: var(--font); }
.bar__count { margin-inline-start: auto; font-size: .78rem; font-variant-numeric: tabular-nums; opacity: .7; font-family: var(--font-en); }
.bar__count b { opacity: 1; font-weight: 700; }
.bar__act { display: flex; gap: 8px; }
.pill {
  height: 34px; padding: 0 14px; border-radius: 99px;
  border: 1px solid currentColor; font-size: .82rem; font-weight: 600;
  opacity: .9; transition: background .25s, color .25s;
}
.pill:hover { background: currentColor; }
.pill:hover { color: var(--navy); background: var(--white); }
.bar--light .pill:hover { color: var(--white); background: var(--ink); }
.ibtn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 99px; }
.ibtn .ico { width: 22px; height: 22px; }

.progress { display: flex; gap: 4px; margin-top: 8px; }
.seg { flex: 1; height: 14px; display: flex; align-items: center; }
.seg i { display: block; width: 100%; height: 3px; border-radius: 3px; background: currentColor; opacity: .22; position: relative; overflow: hidden; }
.seg i::after {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease-out);
}
[dir="rtl"] .seg i::after { transform-origin: right; }
.seg.done i, .seg.now i { opacity: 1; background: color-mix(in srgb, currentColor 22%, transparent); }
.seg.done i::after { transform: scaleX(1); }
.seg.now i::after { transform: scaleX(1); transition-duration: 1.4s; }
.bar--light .seg i::after { background: var(--accent-ink); }

/* ---------------- menu ---------------- */
.menu {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(6, 16, 34, .55); backdrop-filter: blur(6px);
  display: flex; justify-content: flex-end;
}
.menu[hidden] { display: none; }
.menu__panel {
  width: min(420px, 100%); height: 100%; overflow: auto;
  background: var(--navy); color: var(--white);
  padding: 72px var(--gut) 40px; position: relative;
  animation: slideIn .45s var(--ease-out);
}
[dir="rtl"] .menu__panel { animation-name: slideInR; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
@keyframes slideInR { from { transform: translateX(-40px); opacity: 0; } }
.menu__close { position: absolute; top: 18px; inset-inline-end: var(--gut); }
.menu__list { list-style: none; margin: 0 0 36px; padding: 0; }
.menu__list button, .menu__list a {
  display: flex; gap: 14px; align-items: baseline; width: 100%;
  padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: 1.15rem; font-weight: 600; text-align: start; text-decoration: none;
}
.menu__list span { font-size: .75rem; opacity: .55; font-family: var(--font-en); font-variant-numeric: tabular-nums; }
.menu__list--b a span { color: var(--rec); opacity: 1; }
.menu__list--b a.on { color: var(--rec); }

/* ---------------- cover ---------------- */
.sec--cover { justify-content: flex-end; padding-bottom: 112px; }
.strata { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.cover__veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(7,21,46,.85) 0%, rgba(7,21,46,.25) 55%, rgba(7,21,46,.2) 100%);
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .82rem; font-weight: 600; letter-spacing: .04em; margin: 0 0 22px;
  padding: 6px 14px 6px 6px; border-radius: 99px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(8px);
}
[dir="rtl"] .kicker { padding: 6px 6px 6px 14px; }
.kicker__num {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 99px;
  background: var(--accent); color: var(--navy); font-weight: 800; font-size: .75rem; font-family: var(--font-en);
}
.swipe-hint {
  position: absolute; z-index: 3; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; opacity: .8;
}
.swipe-hint .ico { width: 22px; height: 22px; animation: nudge 1.8s var(--ease) infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------------- statement ---------------- */
.statement {
  font-size: clamp(1.7rem, 7.4vw, 3.8rem); line-height: 1.12; letter-spacing: -.025em; font-weight: 700;
  margin: 0; max-width: 22ch;
}
:root[lang="ar"] .statement { letter-spacing: 0; line-height: 1.45; }
.line { display: block; overflow: hidden; padding-bottom: .06em; }
.line__in {
  display: inline-block; transform: translateY(105%);
  transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i) * 120ms + 150ms);
}
.is-in .line__in { transform: none; }
.sign { margin: 1.8em 0 0; font-size: 1rem; color: var(--ink-soft); max-width: 40ch; }
.statement__strata {
  position: absolute; inset: auto 0 0 0; height: 34%; z-index: 1; opacity: .5;
  transform: translateY(40%); transition: transform 1.6s var(--ease-out) .3s;
}
.statement__strata .art { width: 100%; height: 100%; }
.is-in .statement__strata { transform: none; }

/* ---------------- stats ---------------- */
.sec--stats { background: radial-gradient(120% 80% at 100% 0%, var(--navy-2), var(--navy) 60%); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; margin-top: 8px; }
.stat__num {
  margin: 0; font-family: var(--font-en); font-weight: 800; letter-spacing: -.04em;
  font-size: clamp(2.4rem, 11vw, 4.6rem); line-height: 1; font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; direction: ltr;
}
[dir="rtl"] .stat__num { justify-content: flex-end; }
.stat__suf, .stat__pre { font-size: .5em; color: var(--accent); margin-inline-start: 2px; letter-spacing: 0; }
.stat__bar { display: block; height: 3px; background: rgba(255,255,255,.12); border-radius: 3px; margin: 14px 0 12px; overflow: hidden; }
.stat__bar i { display: block; height: 100%; width: var(--w); background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 1.8s var(--ease-out) .4s; }
[dir="rtl"] .stat__bar i { transform-origin: right; margin-inline-start: 0; }
.is-in .stat__bar i { transform: none; }
.stat__label { margin: 0; font-size: .95rem; line-height: 1.4; opacity: .85; }
.foot { margin: 34px 0 0; font-size: .75rem; opacity: .55; max-width: 60ch; }

/* ---------------- cards ---------------- */
.hint { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink-soft); margin: -.4em 0 20px; }
.sec--dark .hint { color: rgba(255,255,255,.65); }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  position: relative; text-align: start; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 16px 18px; min-height: 168px; border-radius: var(--radius);
  background: var(--white); color: var(--ink);
  box-shadow: 0 1px 0 rgba(10,30,63,.06), 0 12px 30px -18px rgba(10,30,63,.35);
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), opacity .9s var(--ease-out);
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease-out);
}
.card:hover::after, .card:focus-visible::after { transform: scaleX(1); }
.card:active { transform: scale(.97); }
.card__ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-ink); margin-bottom: 6px; }
.card__ico .ico { width: 22px; height: 22px; }
.card__tag { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.card__title { font-weight: 750; font-size: 1.08rem; line-height: 1.2; letter-spacing: -.01em; }
.card__sum { font-size: .85rem; line-height: 1.45; color: var(--ink-soft); }
.card__plus {
  position: absolute; top: 14px; inset-inline-end: 14px; width: 28px; height: 28px; border-radius: 99px;
  display: grid; place-items: center; background: var(--sand); transition: transform .4s var(--ease-out), background .3s;
}
.card__plus .ico { width: 16px; height: 16px; }
.card:hover .card__plus { transform: rotate(90deg); background: var(--accent); }
.cards--5 .card:first-child, .cards--3 .card:first-child { grid-column: span 2; min-height: 140px; }

/* ---------------- bottom sheet ---------------- */
.sheet {
  border: 0; padding: 0; margin: 0; max-width: none; max-height: none;
  width: 100%; height: 100%; background: transparent; inset: 0;
}
.sheet::backdrop { background: rgba(6,16,34,.6); backdrop-filter: blur(4px); }
.sheet[open] { display: flex; align-items: flex-end; justify-content: center; }
.sheet__panel {
  position: relative; width: min(680px, 100%); max-height: 88dvh; overflow: auto;
  background: var(--sand); color: var(--ink); border-radius: 26px 26px 0 0;
  padding: 14px var(--gut) 36px;
  animation: sheetUp .5s var(--ease-out);
  transition: transform .2s;
}
.sheet.closing .sheet__panel { animation: sheetDown .22s ease-in forwards; }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetDown { to { transform: translateY(100%); } }
.sheet__grip { display: block; width: 44px; height: 5px; border-radius: 5px; background: rgba(10,30,63,.2); margin: 0 auto 14px; }
.sheet__close { position: absolute; top: 24px; inset-inline-end: calc(var(--gut) + 6px); z-index: 2; background: rgba(255,255,255,.9); color: var(--ink); }
.sheet__media { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; margin-bottom: 22px; background: var(--navy); }
.sheet__media .art, .sheet__media img { width: 100%; height: 100%; object-fit: cover; }
.sheet__text { font-size: 1.02rem; line-height: 1.6; margin: 0 0 18px; }
.ticks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.ticks li { position: relative; padding-inline-start: 30px; line-height: 1.45; }
.ticks li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .2em; width: 18px; height: 18px; border-radius: 99px;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A1E3F' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.sheet__fig { display: flex; align-items: baseline; gap: 12px; padding: 16px 18px; border-radius: 14px; background: var(--white); margin: 0; }
.sheet__fig b { font-family: var(--font-en); font-size: 2rem; letter-spacing: -.03em; color: var(--accent-ink); direction: ltr; }
.sheet__fig span { font-size: .9rem; color: var(--ink-soft); }

/* ---------------- stories ---------------- */
.sec--stories { padding-inline: 0; }
.sec--stories .sec__in > .eyebrow, .sec--stories .sec__in > .h2, .sec--stories .track__ui { margin-inline: var(--gut); }
.sec--stories .sec__in { max-width: none; }
.track {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px var(--gut) 8px; scroll-padding-inline: var(--gut);
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.track::-webkit-scrollbar { display: none; }
.story {
  flex: 0 0 84%; max-width: 440px; scroll-snap-align: start;
  background: var(--navy-2); border-radius: var(--radius); overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.story__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #000; }
.story__media .art, .story__media img, .story__media iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.story__body { padding: 18px 18px 22px; }
.story__tag { margin: 0 0 8px; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.story__title { margin: 0 0 8px; font-size: 1.2rem; line-height: 1.2; letter-spacing: -.01em; }
.story__text { margin: 0; font-size: .92rem; line-height: 1.55; opacity: .8; }
.story__play {
  position: absolute; inset-inline-start: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 8px; border-radius: 99px; background: rgba(255,255,255,.92); color: var(--navy);
  font-size: .8rem; font-weight: 700;
}
[dir="rtl"] .story__play { padding: 8px 8px 8px 14px; }
.story__play .ico { width: 28px; height: 28px; padding: 7px; border-radius: 99px; background: var(--accent); fill: var(--navy); }
.story__play.is-soon { background: rgba(10,30,63,.85); color: var(--white); }
.ph-tag {
  position: absolute; top: 12px; inset-inline-start: 12px; display: inline-flex; align-items: center; gap: 6px;
  font-size: .66rem; letter-spacing: .06em; padding: 5px 10px; border-radius: 99px;
  background: rgba(10,30,63,.6); color: rgba(255,255,255,.85); backdrop-filter: blur(6px);
}
.ph-tag .ico { width: 14px; height: 14px; }
.track__ui { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.track__ui .hint { margin: 0; }
.dots { display: flex; gap: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 6px; background: rgba(255,255,255,.3); transition: width .4s var(--ease-out), background .4s; }
.dots i.on { width: 22px; background: var(--accent); }

/* ---------------- end ---------------- */
.sec--end { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 60%, color-mix(in srgb, var(--accent) 30%, var(--navy)) 140%); padding-bottom: 72px; }
.end__in { display: grid; gap: 40px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 22px; border-radius: 99px;
  font-weight: 700; font-size: .95rem; transition: transform .3s var(--ease-out), background .3s;
}
.btn:active { transform: scale(.96); }
.btn--accent { background: var(--accent); color: var(--navy); }
.btn--ghost { border: 1px solid rgba(255,255,255,.35); }
.btn--ghost:hover { background: rgba(255,255,255,.1); }
.qr { display: flex; align-items: center; gap: 16px; }
.qr__code { width: 96px; height: 96px; padding: 8px; background: var(--white); border-radius: 12px; flex: none; }
.qr__code svg { width: 100%; height: 100%; display: block; }
.qr p { margin: 0; font-size: .85rem; line-height: 1.5; opacity: .8; }
.qr code { font-size: .72rem; opacity: .75; word-break: break-all; }
.rec {
  display: flex; align-items: center; gap: 14px; padding: 14px 0; text-decoration: none;
  border-top: 1px solid rgba(255,255,255,.12);
}
.rec:last-of-type { border-bottom: 1px solid rgba(255,255,255,.12); }
.rec__num {
  flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; font-family: var(--font-en); font-size: .85rem;
  background: color-mix(in srgb, var(--rec) 20%, transparent); color: var(--rec);
}
.rec__txt { display: grid; gap: 2px; flex: 1; }
.rec__txt b { font-size: 1rem; }
.rec__txt small { font-size: .8rem; opacity: .65; line-height: 1.4; }
.rec__arrow { opacity: .6; transition: transform .35s var(--ease-out), opacity .3s; }
[dir="rtl"] .rec__arrow { transform: scaleX(-1); }
.rec:hover .rec__arrow { opacity: 1; transform: translateX(4px); }
[dir="rtl"] .rec:hover .rec__arrow { transform: scaleX(-1) translateX(4px); }
.home-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; font-weight: 700; text-decoration: none; color: var(--accent); }
.proto { position: absolute; bottom: 16px; inset-inline: var(--gut); margin: 0; font-size: .68rem; opacity: .45; text-align: center; z-index: 2; }

/* ---------------- tablet / desktop ---------------- */
@media (min-width: 760px) {
  .stats { grid-template-columns: repeat(4, 1fr); gap: 40px 32px; }
  .cards { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .cards--4 { grid-template-columns: repeat(4, 1fr); }
  .cards--5 .card:first-child, .cards--3 .card:first-child { grid-column: auto; min-height: 168px; }
  .cards--5 .card:first-child { grid-column: span 2; }
  .card { min-height: 230px; padding: 24px 22px; }
  .story { flex-basis: 46%; }
  .end__in { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 72px; }
}
@media (min-width: 1100px) {
  :root { --bar-h: 72px; }
  .story { flex-basis: calc((100% - 2 * var(--gut) - 32px) / 3); }
  .sec--stories .track { max-width: none; }
}
@media (max-height: 700px) and (max-width: 760px) {
  .card { min-height: 0; padding: 14px; }
  .card__sum { display: none; }
  .stats { gap: 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .deck { scroll-behavior: auto; }
}

/* ---------------- print → PDF fallback ---------------- */
@media print {
  @page { size: A4; margin: 0; }
  body { overflow: visible; background: #fff; }
  .bar, .menu, .sheet, .swipe-hint, .story__play, .track__ui, .proto, .actions, .card__plus, .hint { display: none !important; }
  .deck { height: auto; overflow: visible; }
  .sec { min-height: 297mm; break-after: page; padding: 22mm 18mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rv, .line__in, .stat__bar i, .statement__strata { opacity: 1 !important; transform: none !important; transition: none !important; }
  .track { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; padding: 0 18mm; }
  .story { flex: none; max-width: none; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- refinements ---------------- */
.btn { text-decoration: none; }
.bar__count, .qr code, .layer__qr code { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .stat__bar i { margin-inline-start: 0; margin-left: auto; }
.statement { font-size: clamp(1.6rem, 6.8vw, 3.8rem); }

/* Mobile: cards become a compact tappable list so the whole section fits one screen */
@media (max-width: 759px) {
  .cards, .cards--3, .cards--4, .cards--5 { grid-template-columns: 1fr; gap: 8px; }
  .cards--5 .card:first-child, .cards--3 .card:first-child { grid-column: auto; min-height: 0; }
  .card {
    min-height: 0; padding: 12px 52px 12px 12px; display: grid; gap: 0 12px;
    grid-template-columns: 44px 1fr; grid-template-areas: "ico tag" "ico title";
    align-items: center; border-radius: 14px;
  }
  [dir="rtl"] .card { padding: 12px 12px 12px 52px; }
  .card__ico { grid-area: ico; margin: 0; width: 44px; height: 44px; }
  .card__tag { grid-area: tag; font-size: .62rem; align-self: end; }
  .card__title { grid-area: title; font-size: 1rem; align-self: start; }
  .card__sum { display: none; }
  .card__plus { top: 50%; transform: translateY(-50%); }
  .card:hover .card__plus { transform: translateY(-50%) rotate(90deg); }
  .card::after { inset: 0 auto 0 0; width: 4px; height: auto; transform: scaleY(0); transform-origin: top; }
  [dir="rtl"] .card::after { inset: 0 0 0 auto; }
  .card:hover::after, .card:focus-visible::after { transform: scaleY(1); }
}
