/* MERIZKOU v3 — warm clay & arches. El Messiri + Rubik. Unusual: spinning seal, sticky card stack, snap carousel. */
:root {
  --sand: #f4e8d7;
  --sand-deep: #eadbc3;
  --clay: #a8502a;
  --clay-deep: #7e3a1c;
  --cocoa: #2f2016;
  --cocoa-soft: #6b573f;
  --gold: #c19a5b;
  --line: rgba(47, 32, 22, .16);
  --arch: 999px 999px 26px 26px;
  --head: "El Messiri", system-ui, sans-serif;
  --body: "Rubik", system-ui, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
section { scroll-margin-top: 76px; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(168, 80, 42, .18); }
body {
  background: var(--sand);
  color: var(--cocoa);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.7;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 clamp(18px, 3.5vw, 44px); }

/* subtle eastern lattice on body */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .05; z-index: 0;
  background-image: repeating-linear-gradient(45deg, var(--cocoa) 0 1px, transparent 1px 26px),
                    repeating-linear-gradient(-45deg, var(--cocoa) 0 1px, transparent 1px 26px);
}
main, nav.top, footer { position: relative; z-index: 1; }

/* ─── Nav ─── */
nav.top { position: sticky; top: 0; z-index: 60; background: rgba(244, 232, 215, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
nav.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 12px; padding-bottom: 12px; }
.logo { font-family: var(--head); font-weight: 700; font-size: 22px; letter-spacing: .02em; }
.logo span { color: var(--clay); }
nav.top ul { list-style: none; display: flex; gap: clamp(14px, 2.4vw, 30px); }
nav.top ul a { font-size: 14px; color: var(--cocoa-soft); transition: color .2s; }
nav.top ul a:hover { color: var(--clay); }
.btn { display: inline-block; border-radius: 14px; padding: 13px 28px; font-weight: 600; font-size: 14.5px; transition: all .25s; }
.btn-clay { background: var(--clay); color: var(--sand); box-shadow: 0 10px 26px rgba(168, 80, 42, .28); }
.btn-clay:hover { background: var(--clay-deep); transform: translateY(-2px); }
.btn-line { border: 1.5px solid var(--cocoa); color: var(--cocoa); }
.btn-line:hover { background: var(--cocoa); color: var(--sand); }
nav.top .btn { padding: 10px 20px; border-radius: 12px; }

/* ─── Hero: centered arch + spinning seal ─── */
.hero { padding: clamp(44px, 6vw, 80px) 0 clamp(48px, 6vw, 84px); text-align: center; position: relative; overflow: clip; }
.hero .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; z-index: 0; }
.hero .blob.b1 { width: 420px; height: 420px; background: #e3b28c; top: -80px; left: -120px; }
.hero .blob.b2 { width: 380px; height: 380px; background: #d9a487; bottom: -100px; right: -110px; }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { font-family: var(--head); font-weight: 700; font-size: clamp(30px, 5vw, 56px); line-height: 1.18; max-width: 21ch; margin: 0 auto; }
.hero h1 em { font-style: normal; color: var(--clay); }
.hero .sub { margin: 18px auto 0; max-width: 58ch; color: var(--cocoa-soft); }
.arch-stage { position: relative; width: min(420px, 78vw); margin: clamp(30px, 4vw, 46px) auto 0; }
.arch-stage .photo { border-radius: var(--arch); overflow: hidden; box-shadow: 0 30px 60px rgba(47, 32, 22, .22); }
.arch-stage .photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.seal { position: absolute; top: -46px; right: -46px; width: 132px; height: 132px; z-index: 2; }
.seal svg { width: 100%; height: 100%; animation: spin 18s linear infinite; }
.seal .star { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; color: var(--clay); }
@keyframes spin { to { transform: rotate(360deg); } }
.hero .chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.chip { border: 1px solid var(--line); background: rgba(255, 252, 246, .6); border-radius: 999px; padding: 8px 18px; font-size: 13px; color: var(--cocoa-soft); }
.chip.hot { background: var(--clay); border-color: var(--clay); color: var(--sand); }
.hero .cta-row { margin-top: 30px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ─── Tilted marquee ─── */
.marquee { background: var(--cocoa); color: var(--sand); transform: rotate(-1.6deg); margin: 10px -30px; overflow: hidden; padding: 13px 0; }
.marquee .track { display: flex; width: max-content; animation: mq 30s linear infinite; }
.marquee span { font-family: var(--head); font-size: 15px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.marquee i { color: var(--gold); font-style: normal; margin: 0 22px; }
@keyframes mq { to { transform: translateX(-50%); } }

/* ─── Section furniture ─── */
section { padding: clamp(60px, 8vw, 110px) 0; }
.eyebrow { display: block; font-size: 13px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--clay); margin-bottom: 14px; }
.eyebrow::before { content: "✦ "; color: var(--gold); }
h2 { font-family: var(--head); font-weight: 700; font-size: clamp(26px, 3.8vw, 42px); line-height: 1.22; margin-bottom: 18px; max-width: 20em; }
.lede { color: var(--cocoa-soft); max-width: 62ch; }

/* ─── Sticky stack of service cards ─── */
.stack { margin-top: clamp(26px, 4vw, 44px); }
.stack .s-card {
  position: sticky; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(22px, 4vw, 56px);
  align-items: center; border-radius: 30px; padding: clamp(26px, 4.5vw, 56px);
  margin-bottom: 22px; min-height: 320px; box-shadow: 0 -12px 40px rgba(47, 32, 22, .14);
}
.stack .s-card:nth-child(1) { top: 86px; background: #ffffff; }
.stack .s-card:nth-child(2) { top: 108px; background: var(--sand-deep); }
.stack .s-card:nth-child(3) { top: 130px; background: var(--clay); color: var(--sand); }
.stack .s-card:nth-child(4) { top: 152px; background: var(--cocoa); color: var(--sand); }
.s-card .k { font-family: var(--head); font-size: 15px; color: var(--gold); display: block; margin-bottom: 10px; }
.s-card h3 { font-family: var(--head); font-weight: 700; font-size: clamp(22px, 2.8vw, 32px); line-height: 1.25; margin-bottom: 12px; }
.s-card p { opacity: .82; max-width: 48ch; }
.s-card figure { border-radius: var(--arch); overflow: hidden; }
.s-card figure img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.stack .s-card:nth-child(3) .k, .stack .s-card:nth-child(4) .k { color: #e9c896; }

/* ─── Case band ─── */
.case-band { background: var(--clay); color: var(--sand); border-radius: 34px; padding: clamp(28px, 5vw, 64px); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(26px, 4.5vw, 58px); align-items: center; }
.case-band .eyebrow { color: var(--sand); }
.case-band h2 { color: var(--sand); }
.case-band p { color: rgba(244, 232, 215, .82); }
.case-band ul { list-style: none; margin-top: 20px; }
.case-band li { padding: 11px 0; border-top: 1px solid rgba(244, 232, 215, .28); display: flex; gap: 12px; font-size: 15px; }
.case-band li::before { content: "✦"; color: var(--gold); }
.phones { display: flex; gap: clamp(10px, 1.6vw, 16px); justify-content: center; align-items: center; }
.phone { border-radius: 18px; overflow: hidden; box-shadow: 0 20px 44px rgba(47, 22, 8, .35); flex: 0 1 205px; background: #fff; border: 3px solid #fff; }
.phone img { width: 100%; display: block; }
.phone:nth-child(2) { margin-top: -22px; }
/* solo mode — BAKAI 3→1 (Boss 2026-07-22): one phone, big */
.phones.phones-solo { width: 100%; }
.phones.phones-solo .phone { flex: 0 0 auto; width: min(500px, 100%); }
.phones.phones-solo .phone:nth-child(2) { margin-top: 0; }

/* ─── Snap carousel portfolio ─── */
.rail-wrap { position: relative; }
.rail {
  display: flex; gap: clamp(14px, 2vw, 24px); overflow-x: auto; padding: clamp(24px, 3vw, 40px) clamp(18px, 3.5vw, 44px);
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail figure { flex: 0 0 clamp(240px, 30vw, 340px); scroll-snap-align: center; position: relative; }
.rail figure:nth-child(odd) img { border-radius: var(--arch); }
.rail figure:nth-child(even) img { border-radius: 26px; }
.rail img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; box-shadow: 0 18px 40px rgba(47, 32, 22, .18); }
.rail figcaption { position: absolute; left: 12px; bottom: 12px; background: rgba(244, 232, 215, .9); border-radius: 999px; padding: 6px 15px; font-size: 12.5px; font-weight: 600; color: var(--cocoa); }
.rail-hint { text-align: center; font-size: 13px; color: var(--cocoa-soft); letter-spacing: .18em; text-transform: uppercase; }

/* ─── Quote ─── */
.quote { text-align: center; }
.quote .star { font-size: 44px; color: var(--gold); display: block; margin-bottom: 18px; }
.quote blockquote { font-family: var(--head); font-weight: 600; font-size: clamp(22px, 3.4vw, 36px); line-height: 1.4; max-width: 24ch; margin: 0 auto; }
.quote blockquote em { font-style: normal; color: var(--clay); }
.quote .a { margin-top: 16px; font-size: 13px; letter-spacing: .26em; text-transform: uppercase; color: var(--cocoa-soft); }

/* ─── About ─── */
.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(28px, 4.5vw, 64px); align-items: center; }
.about-grid > figure { border-radius: var(--arch); overflow: hidden; box-shadow: 0 24px 50px rgba(47, 32, 22, .2); }
.about-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.about-grid .facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.quote-line { border-left: 3px solid var(--clay); padding-left: 20px; margin-top: 22px; font-size: 17px; }

/* ─── CTA ─── */
.cta-card { background: var(--cocoa); color: var(--sand); border-radius: 34px; padding: clamp(36px, 6vw, 72px); text-align: center; position: relative; overflow: hidden; }
.cta-card::before { content: "✦"; position: absolute; font-size: 220px; color: rgba(193, 154, 91, .14); top: -60px; right: -30px; font-family: serif; }
.cta-card h2 { color: var(--sand); margin-inline: auto; }
.cta-card p { color: rgba(244, 232, 215, .75); max-width: 54ch; margin: 0 auto; }
.cta-card .cta-row { margin-top: 30px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.cta-card .btn-line { border-color: rgba(244, 232, 215, .6); color: var(--sand); }
.cta-card .btn-line:hover { background: var(--sand); color: var(--cocoa); }
.cta-card .links { margin-top: 26px; display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; font-size: 13px; color: rgba(244, 232, 215, .65); }
.cta-card .links a:hover { color: var(--gold); }

/* ─── Footer ─── */
footer { padding: 36px 0 44px; text-align: center; }
footer .logo { font-size: 20px; }
footer small { display: block; margin-top: 8px; color: var(--cocoa-soft); font-size: 12.5px; }

/* ─── Lang switcher ─── */
.lang-sw { display: flex; gap: 13px; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.lang-sw a { opacity: .55; transition: .2s; padding-bottom: 2px; border-bottom: 1.5px solid transparent; }
.lang-sw a:hover { opacity: 1; }
.lang-sw a.act { opacity: 1; color: var(--clay); border-bottom-color: var(--gold); }

/* ─── Roles (4 направления) ─── */
.roles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 2vw, 22px); margin-top: clamp(26px, 4vw, 44px); }
.role-card {
  display: block; background: #fff; border: 1px solid rgba(47, 32, 22, .1); border-radius: var(--arch);
  padding: clamp(22px, 2.6vw, 32px) clamp(18px, 2vw, 26px); text-align: center;
  transition: transform .3s, box-shadow .3s; position: relative;
}
.role-card:hover { transform: translateY(-6px); box-shadow: 0 22px 48px rgba(47, 32, 22, .16); }
.role-card .rn { font-family: var(--head); color: var(--gold); font-size: 14px; display: block; margin-bottom: 32px; }
.role-card h3 { font-family: var(--head); font-weight: 700; font-size: clamp(18px, 1.9vw, 22px); line-height: 1.3; margin-bottom: 10px; }
.role-card p { font-size: 13.5px; color: var(--cocoa-soft); margin-bottom: 20px; }
.role-card .go { font-weight: 600; font-size: 13.5px; color: var(--clay); }
.role-card:hover .go { text-decoration: underline; }

/* ─── Role pages ─── */
.role-hero { padding: clamp(40px, 6vw, 72px) 0 clamp(36px, 5vw, 60px); text-align: center; position: relative; overflow: clip; }
.role-hero .back { display: inline-block; margin-bottom: 22px; font-size: 13.5px; font-weight: 600; color: var(--cocoa-soft); }
.role-hero .back:hover { color: var(--clay); }
.role-hero .rn { font-family: var(--head); color: var(--gold); font-size: 15px; display: block; margin-bottom: 10px; }
.role-hero h1 { font-family: var(--head); font-weight: 700; font-size: clamp(32px, 5vw, 54px); line-height: 1.15; }
.role-hero .sub { margin: 16px auto 0; max-width: 56ch; color: var(--cocoa-soft); }
.soon {
  border: 2px dashed rgba(168, 80, 42, .4); border-radius: 22px; padding: clamp(22px, 3vw, 34px);
  text-align: center; color: var(--cocoa-soft); font-size: 15px; margin-top: clamp(22px, 3vw, 36px);
}
.soon b { color: var(--clay); display: block; font-family: var(--head); margin-bottom: 6px; font-size: 17px; }

/* ─── Reveal + fly-ins ─── */
html.js .reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.16, .84, .28, 1) var(--d, 0s), transform .9s cubic-bezier(.16, .84, .28, 1) var(--d, 0s);
}
html.js .reveal.fx-l { transform: translate(-48px, 24px) scale(.97); }
html.js .reveal.fx-r { transform: translate(48px, 24px) scale(.97); }
html.js .reveal.fx-z { transform: translateY(32px) scale(.93); }
html.js .reveal.in { opacity: 1; transform: translateY(var(--plx, 0px)); }
.plx { will-change: transform; }
html.js .plx.in { transition: opacity .9s cubic-bezier(.16, .84, .28, 1) var(--d, 0s), transform .3s cubic-bezier(.2, .6, .3, 1); }

/* ─── Responsive ─── */
@media (max-width: 920px) {
  nav.top ul { display: none; }
  .stack .s-card, .case-band, .about-grid { grid-template-columns: 1fr; }
  .s-card figure { max-width: 380px; }
  .about-grid > figure { max-width: 420px; }
  .roles-grid { grid-template-columns: 1fr 1fr; }
  nav.top .btn { display: none; }
}
@media (max-width: 560px) { .roles-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  section { padding: 52px 0; }
  .seal { width: 96px; height: 96px; top: -30px; right: -18px; }
  .seal .star { font-size: 22px; }
  /* sticky stack stays ON for phones — compact cards so each fits the viewport */
  .stack .s-card { min-height: 0; padding: 22px; gap: 16px; margin-bottom: 16px; }
  .stack .s-card:nth-child(1) { top: 64px; }
  .stack .s-card:nth-child(2) { top: 80px; }
  .stack .s-card:nth-child(3) { top: 96px; }
  .stack .s-card:nth-child(4) { top: 112px; }
  .s-card figure { max-width: none; }
  .s-card figure img { aspect-ratio: 16 / 10; }
  .s-card h3 { font-size: 20px; }
  .s-card p { font-size: 14px; }
  .hero .cta-row .btn, .cta-card .cta-row .btn { display: block; text-align: center; }
  .phones { flex-wrap: wrap; }
  .phone:nth-child(2) { margin-top: 0; }
  .rail figure { flex-basis: 78vw; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .marquee .track, .seal svg { animation: none; }
}

/* BAKAI case — single photo, no phone chrome (Boss 2026-07-22) */
.case-photo { border-radius: 26px; overflow: hidden; box-shadow: 0 24px 50px rgba(47, 22, 8, .35); max-width: 460px; margin: 0 auto; }
.case-photo img { width: 100%; display: block; }
