/* ================================================================
   ART PRO DESIGN — MOBILE EDITION
   Same identity as style.css (dark · chartreuse · violet ·
   Space Grotesk caps), re-set for reading on a phone:
   · body 16.5px / 1.65, Inter 400 (300 is too thin on OLED)
   · copy at 74% white instead of 60% — contrast for small type
   · 20px gutters, one column, ~34–38 characters per line
   · media full-bleed; dense artwork opens in a zoomable lightbox
   ================================================================ */

:root {
  --bg: #07070b;
  --bg-2: #0e0e17;
  --card: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --accent: #c5ff3d;
  --accent-soft: rgba(197, 255, 61, 0.12);
  --violet: #a07cff;     /* lifted from #8b5cf6 — the original fails contrast at 12px on black */
  --violet-deep: #8b5cf6;
  --text: #ececf2;
  --text-2: rgba(236, 236, 242, 0.74);
  --text-3: rgba(236, 236, 242, 0.48);

  --g: 20px;
  --r: 14px;
  --top-h: 56px;
  --bar-h: 76px;

  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 8px); }
body {
  background: var(--bg);
  background-image:
    radial-gradient(120% 50% at 0% 0%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(80% 30% at 100% 6%, rgba(197, 255, 61, 0.05), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--body);
  font-size: 16.5px; line-height: 1.65; font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
}
body.menu-open, body.lb-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
strong { color: var(--text); font-weight: 600; }
em { font-style: normal; }
::selection { background: rgba(197, 255, 61, 0.6); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

#m-app, .m-top-in, .m-bar-in, .m-menu-nav, .m-menu-foot { max-width: 560px; margin-left: auto; margin-right: auto; }

/* ---------- type primitives ---------- */
.m-label, .m-sub {
  display: block;
  font-family: var(--display); font-weight: 600;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--violet); line-height: 1.5;
}
.m-h2, .m-display, .m-case-title, .m-contact-title {
  font-family: var(--display); font-weight: 700;
  text-transform: uppercase; letter-spacing: -0.01em;
  color: var(--text);
}
.m-h2 { font-size: clamp(30px, 9vw, 40px); line-height: 1.02; margin-top: 10px; }
.m-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-family: var(--display); font-weight: 600; font-size: 13px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
.m-hint { font-size: 13px; color: var(--text-3); text-align: center; margin: 10px var(--g) 0; }

/* ---------- buttons ---------- */
.m-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 22px; width: 100%;
  border-radius: 999px;
  font-family: var(--display); font-weight: 600; font-size: 14px;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: transform .15s ease;
}
.m-btn:active { transform: scale(0.98); }
.m-btn-primary { background: var(--accent); color: var(--bg); box-shadow: 0 10px 30px -12px rgba(197, 255, 61, 0.55); }
.m-btn-ghost { border: 1px solid var(--line-2); color: var(--text); background: rgba(255,255,255,0.02); }
.m-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- top bar ---------- */
.m-top {
  position: sticky; top: 0; z-index: 40;
  padding-top: env(safe-area-inset-top);
  background: rgba(7, 7, 11, 0.82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .25s ease;
}
.m-top.scrolled { border-bottom-color: var(--line); }
.m-top-in { height: var(--top-h); padding: 0 var(--g); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.m-brand { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.02em; white-space: nowrap; }
.m-brand em { color: var(--accent); }
.m-back {
  font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text); min-height: 44px; display: inline-flex; align-items: center;
}
.m-back[hidden], .m-brand[hidden] { display: none; }
.m-top-actions { display: flex; align-items: center; gap: 6px; margin-right: -10px; }
.m-lang {
  min-width: 44px; height: 36px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2);
  font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.12em;
}
.m-menu-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.m-burger { width: 20px; height: 12px; position: relative; }
.m-burger::before, .m-burger::after { content: ''; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: var(--text); transition: transform .3s ease, top .3s ease, bottom .3s ease; }
.m-burger::before { top: 0; } .m-burger::after { bottom: 0; }
.menu-open .m-burger::before { top: 5px; transform: rotate(45deg); }
.menu-open .m-burger::after { bottom: 5px; transform: rotate(-45deg); }

/* ---------- menu ---------- */
.m-menu {
  position: fixed; inset: 0; z-index: 35;
  padding: calc(var(--top-h) + env(safe-area-inset-top) + 24px) var(--g) calc(28px + env(safe-area-inset-bottom));
  background: var(--bg);
  background-image: radial-gradient(90% 50% at 100% 100%, rgba(139, 92, 246, 0.22), transparent 70%);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s;
}
.menu-open .m-menu { opacity: 1; visibility: visible; transition-delay: 0s; }
.m-menu-nav { width: 100%; display: flex; flex-direction: column; }
.m-menu-nav a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font-family: var(--display); font-weight: 700; font-size: 34px; text-transform: uppercase; letter-spacing: -0.01em;
}
.m-menu-nav a span { font-size: 12px; color: var(--accent); letter-spacing: 0.1em; font-weight: 600; }
.m-menu-foot { width: 100%; margin-top: auto; padding-top: 24px; display: grid; gap: 12px; }

/* ---------- sections ---------- */
.m-sec { padding: 72px var(--g) 0; }
.m-head { margin-bottom: 28px; }
.m-lede { font-size: 18px; line-height: 1.55; color: var(--text); margin-bottom: 32px; }

/* hero */
.m-hero { padding: 40px var(--g) 8px; }
.m-name {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(46px, 15vw, 66px); line-height: 0.92; letter-spacing: -0.03em;
  display: flex; flex-direction: column;
}
.m-name em { color: var(--accent); }
.m-role { margin-top: 20px; font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--violet); }
.m-hero-desc { margin-top: 18px; font-size: 18px; line-height: 1.55; color: var(--text-2); }
.m-avail { display: flex; align-items: center; gap: 10px; margin-top: 22px; font-size: 14px; color: var(--text-2); }
.m-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(197,255,61,.6); animation: mpulse 2.2s ease-out infinite; flex-shrink: 0; }
@keyframes mpulse { 0% { box-shadow: 0 0 0 0 rgba(197,255,61,.55); } 70%,100% { box-shadow: 0 0 0 10px rgba(197,255,61,0); } }
.m-hero-actions { display: grid; gap: 10px; margin-top: 32px; }

/* work */
.m-works { display: grid; gap: 40px; }
.m-work { display: block; }
.m-work-img { position: relative; margin: 0 calc(var(--g) * -1); aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); }
.m-work-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.m-work:active .m-work-img img { transform: scale(1.02); }
.m-work-no {
  position: absolute; left: var(--g); top: 14px;
  font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.12em;
  color: var(--bg); background: var(--accent); padding: 4px 9px; border-radius: 999px;
}
.m-work-body { padding-top: 18px; }
.m-work-meta { display: block; font-size: 13px; color: var(--text-3); letter-spacing: 0.04em; margin-bottom: 6px; }
.m-work-title { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.08; text-transform: uppercase; letter-spacing: -0.01em; }
.m-work-kind { margin-top: 8px; font-size: 16px; line-height: 1.45; color: var(--text-2); }
.m-work .m-link { margin-top: 6px; }

/* services */
.m-svcs { list-style: none; border-top: 1px solid var(--line); }
.m-svc { padding: 24px 0 26px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 38px 1fr; column-gap: 8px; }
.m-svc-num { font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--accent); padding-top: 5px; }
.m-svc h3 { font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.15; text-transform: uppercase; }
.m-svc p { grid-column: 2; margin-top: 8px; font-size: 16px; color: var(--text-2); }

/* rail */
.m-rail-wrap { margin: 0 calc(var(--g) * -1); }
.m-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 86%;
  column-gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 0 var(--g);
  padding: 2px var(--g) 4px; scrollbar-width: none;
}
.m-rail::-webkit-scrollbar { display: none; }
.m-rail > * { scroll-snap-align: start; }
.m-rail-meta { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--g) 0; }
.m-dots { display: flex; gap: 6px; flex-wrap: wrap; max-width: 70%; }
.m-dots i { width: 6px; height: 6px; border-radius: 6px; background: var(--line-2); transition: width .3s ease, background .3s ease; }
.m-dots i.on { width: 20px; background: var(--accent); }
.m-count { font-family: var(--display); font-size: 12px; letter-spacing: 0.1em; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* testimonials */
.m-quote { padding: 24px 20px 20px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; }
.m-quote blockquote { flex: 1; font-size: 17px; line-height: 1.55; color: var(--text); position: relative; padding-top: 26px; }
.m-quote blockquote::before { content: '“'; position: absolute; top: -8px; left: -2px; font-family: var(--display); font-size: 54px; line-height: 1; color: var(--accent); }
.m-quote figcaption { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.m-quote figcaption img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.m-quote strong { display: block; font-size: 15px; line-height: 1.3; }
.m-quote small { display: block; font-size: 13px; line-height: 1.35; color: var(--text-3); margin-top: 2px; }

/* contact */
.m-contact { padding-top: 88px; }
.m-contact-title { font-size: clamp(38px, 12vw, 54px); line-height: 0.98; margin-top: 12px; }
.m-contact-title em { color: var(--accent); display: block; }
.m-contact-desc { margin-top: 20px; font-size: 17px; color: var(--text-2); }
.m-contact-desc strong { color: var(--accent); font-weight: 500; }
.m-mail { margin-top: 30px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.m-mail .m-btn { text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 600; font-size: 15px; }
.m-copy { min-height: 54px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.m-copy.done { color: var(--accent); border-color: var(--accent); }
.m-socials { margin-top: 28px; border-top: 1px solid var(--line); }
.m-social { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; min-height: 58px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 500; }
.m-social svg { color: var(--text-2); }
.m-social i { font-style: normal; color: var(--accent); }

.m-foot { padding: 48px var(--g) 28px; margin-top: 56px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; color: var(--text-3); }
.m-desktop-link { margin-top: 10px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; justify-self: start; min-height: 32px; display: inline-flex; align-items: center; }

/* ================================================================
   CASE STUDY
   ================================================================ */
.m-case-head { padding: 28px var(--g) 28px; }
.m-client { height: 30px; width: auto; margin-bottom: 18px; opacity: .9; }
.m-case-title { font-size: clamp(30px, 9.4vw, 42px); line-height: 1.02; }
.m-case-head .m-sub { margin-top: 12px; }
.m-facts { margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.m-fact { padding: 14px 0; border-bottom: 1px solid var(--line); }
.m-fact:nth-child(odd) { padding-right: 12px; }
.m-fact.is-scope, .m-fact.is-role { grid-column: 1 / -1; padding-right: 0; }
.m-fact dt { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); font-family: var(--display); font-weight: 600; }
.m-fact dd { margin-top: 4px; font-size: 16px; line-height: 1.35; color: var(--text); }
.m-fact.is-company dd { color: var(--accent); }
.m-fact.is-role dd { color: var(--violet); }

/* media */
.m-media { margin: 28px 0; }
.m-media.is-hero { margin-top: 0; }
.m-media.is-framed { padding: 0 var(--g); }
.m-media.is-framed .m-fig { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.m-media[style*="--band"] { background: var(--band); padding: 18px 0; }
.m-fig { position: relative; background: var(--bg-2); cursor: zoom-in; }
.m-fig img { width: 100%; height: 100%; object-fit: cover; }
.m-zoom-ico {
  position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(7, 7, 11, 0.72); border: 1px solid var(--line-2);
}
.m-zoom-ico::before, .m-zoom-ico::after { content: ''; position: absolute; background: var(--text); border-radius: 2px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.m-zoom-ico::before { width: 12px; height: 1.6px; } .m-zoom-ico::after { width: 1.6px; height: 12px; }
/* very tall sheets (old long-scroll case images) are capped and opened in the lightbox */
.m-media.is-tall .m-fig { aspect-ratio: auto !important; max-height: 120vh; overflow: hidden; }
.m-media.is-tall .m-fig::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.m-media.is-tall .m-fig img { height: auto; object-fit: initial; }
.m-cap { padding: 12px var(--g) 0; font-size: 14px; line-height: 1.5; color: var(--text-3); }
.m-cap b { color: var(--text-2); font-weight: 600; }

.m-rail-shots { grid-auto-columns: 88%; }
.m-rail-fig { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.m-case-body > .m-rail-wrap, .m-case-body > .m-cards-block, .is-case > .m-rail-wrap { margin-top: 28px; margin-bottom: 28px; }
.is-case > .m-rail-wrap, .m-case-body .m-rail-wrap { margin-left: 0; margin-right: 0; }

/* text */
.m-case-sec { padding: 8px var(--g); display: grid; gap: 12px; }
.m-case-lede { font-size: 19px; line-height: 1.5; color: var(--text); margin: 8px 0 12px; }
.m-brief { padding: 22px 20px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.m-num { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--accent); letter-spacing: 0.08em; }
.m-brief h3 { margin-top: 8px; font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.2; text-transform: uppercase; }
.m-brief h4 { margin-top: 18px; font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--violet); }
.m-brief p { margin-top: 10px; font-size: 16px; color: var(--text-2); }
.m-brief .m-list { margin-top: 10px; }
.m-intro-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.m-intro-head img { width: 24px; height: 24px; border-radius: 50%; }
.m-intro-head h3 { margin-right: 4px; }

.m-text { padding: 0 var(--g); margin: 28px 0; }
.m-text.is-chapter { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }
.m-text.is-label { margin-bottom: 14px; }
.m-chapter { display: block; font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--accent); letter-spacing: 0.1em; margin-bottom: 10px; }
.m-display { font-size: clamp(28px, 8.6vw, 38px); line-height: 1.04; }
.m-display.is-violet { color: var(--violet); }
.m-case-h2 { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.2; text-transform: uppercase; }
.m-case-h2 .sep { color: var(--text-3); }
.m-case-h2 em { color: var(--violet); }
.m-text .m-sub { margin-top: 10px; }
.m-text > .m-sub:first-child { margin-top: 0; }
.m-body { margin-top: 14px; font-size: 16.5px; color: var(--text-2); }
.m-body + .m-body { margin-top: 12px; }
.m-body strong, .m-list strong { color: var(--accent); font-weight: 500; }
.m-text.is-small .m-body { font-size: 15.5px; }
.m-list { list-style: none; margin-top: 14px; display: grid; gap: 10px; }
.m-list li { position: relative; padding-left: 20px; font-size: 16px; color: var(--text-2); }
.m-list li::before { content: ''; position: absolute; left: 0; top: 11px; width: 9px; height: 2px; border-radius: 2px; background: var(--accent); }
.m-note { margin-top: 14px; font-size: 14px; color: var(--text-3); }
.m-aside { margin-top: 8px; font-size: 15px !important; }

/* grid of small artwork */
.m-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 10px; padding: 0 var(--g); margin: 24px 0; }
.m-grid figure { border-radius: 10px; overflow: hidden; background: var(--bg-2); }
.m-grid img { width: 100%; height: 100%; object-fit: contain; }

/* flip cards */
.m-rail-cards { grid-auto-columns: 62%; align-items: start; }
.m-flip { display: block; width: 100%; perspective: 1200px; text-align: left; }
.m-flip-in { display: grid; transition: transform .6s var(--ease); transform-style: preserve-3d; }
.m-flip.is-flipped .m-flip-in { transform: rotateY(180deg); }
.m-flip-face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 12px; overflow: hidden; }
.m-flip-front img { width: 100%; height: 100%; object-fit: contain; }
.m-flip-back {
  transform: rotateY(180deg); padding: 18px 16px; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(160deg, #1a1530, #0e0e17); border: 1px solid rgba(160, 124, 255, 0.35);
}
.m-flip-name { font-family: var(--display); font-weight: 700; font-size: 18px; text-transform: uppercase; line-height: 1.1; }
.m-flip-rank { align-self: flex-start; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bg); background: var(--accent); padding: 3px 8px; border-radius: 999px; font-weight: 600; }
.m-flip-back p { font-size: 14px; line-height: 1.5; color: var(--text-2); }
.m-flip-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--violet); }
.m-flip-foot img { width: 26px; height: 26px; }

/* brand sheet */
.m-brandsheet { padding: 0 var(--g); margin: 28px 0; }
.m-brand-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-brand-panel { border-radius: 12px; border: 1px solid var(--line); background: var(--bg); overflow: hidden; }
.m-brand-panel:first-child { background: #ececf2; }
.m-brand-panel img { padding: 12px; }
.m-brand-panel figcaption { padding: 8px 12px; font-size: 12px; color: var(--text-3); background: var(--bg); border-top: 1px solid var(--line); }
.m-brandsheet .m-media { margin: 14px calc(var(--g) * -1); }
.m-brandsheet > .m-sub { margin-top: 22px; }
.m-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.m-swatch span { display: block; aspect-ratio: 1.6; border-radius: 10px; border: 1px solid var(--line); }
.m-swatch small { display: block; margin-top: 6px; font-size: 12px; color: var(--text-3); line-height: 1.3; }

/* compare */
.m-compare { position: relative; margin: 28px 0; overflow: hidden; touch-action: pan-y; }
.m-compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.m-cmp-before { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.m-cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; background: var(--accent); transform: translateX(-1px); pointer-events: none; }
.m-cmp-handle::after { content: '‹ ›'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--bg); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 16px; letter-spacing: 2px; }
.m-cmp-l { position: absolute; top: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(7,7,11,.75); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; pointer-events: none; }
.m-cmp-l.is-before { left: 12px; } .m-cmp-l.is-after { right: 12px; }
.m-compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: ew-resize; }

/* impact */
.m-impact { padding: 0 var(--g); margin: 28px 0; display: grid; gap: 10px; }
.m-impact-lead { padding: 26px 20px; border-radius: var(--r); background: linear-gradient(150deg, rgba(197,255,61,.12), rgba(139,92,246,.12)); border: 1px solid rgba(197,255,61,.3); }
.m-impact-fig { margin-top: 10px; font-family: var(--display); }
.m-impact-fig b { display: block; font-size: 72px; line-height: 1; font-weight: 700; color: var(--accent); letter-spacing: -0.03em; }
.m-was { display: block; font-size: 15px; color: var(--text-3); margin-bottom: 6px; }
.m-was s, .m-fig-line s { text-decoration-thickness: 1.5px; text-decoration-color: rgba(236,236,242,.4); }
.m-impact-note { margin-top: 12px; font-size: 15px; color: var(--text-2); }
.m-impact-mini { padding: 18px 20px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.m-fig-line { display: flex; align-items: baseline; gap: 10px; font-family: var(--display); }
.m-fig-line s { font-size: 20px; color: var(--text-3); }
.m-fig-line span { font-size: 13px; color: var(--text-3); }
.m-fig-line b { font-size: 34px; color: var(--accent); font-weight: 700; letter-spacing: -0.02em; }
.m-impact-label { margin-top: 4px; font-size: 15px; color: var(--text-2); }

/* diagram: drawn at a readable width, panned sideways */
.m-diagram { margin: 28px 0; }
.m-diagram-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding: 0 var(--g); scrollbar-width: none; }
.m-diagram-scroll::-webkit-scrollbar { display: none; }
.m-diagram-scroll svg { width: 940px; height: auto; display: block; }
.m-legends { display: grid; gap: 8px; padding: 16px var(--g) 0; }
.m-legend { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.m-legend::before { content: ''; width: 22px; height: 0; border-top: 3px solid var(--c); flex-shrink: 0; }
.m-legend.is-dashed::before { border-top-style: dashed; }

/* palette */
.m-pal-chips { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.m-pal-chips span { display: block; aspect-ratio: 1; border-radius: 10px; }
.m-pal-chips small { display: block; margin-top: 5px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* embed */
.m-embed { margin: 28px 0; }
.m-embed-box { margin: 0 var(--g); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.m-embed-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.m-embed .m-link { margin: 6px var(--g) 0; }

/* outro */
.m-outro { margin: 72px var(--g) 0; padding-top: 40px; border-top: 1px solid var(--line); text-align: center; }
.m-outro img { height: 44px; width: auto; margin: 0 auto 22px; }
.m-outro p { font-size: 16.5px; color: var(--text-2); margin-top: 12px; }
.m-outro p.is-sign strong { color: var(--violet); font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; }
.m-outro-note { font-size: 12px !important; color: var(--text-3) !important; margin-top: 22px !important; }

/* next project */
.m-next { display: block; margin: 72px var(--g) 0; }
.m-next figure { margin: 14px 0 0; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.m-next img { width: 100%; height: 100%; object-fit: cover; }
.m-next-title { display: block; margin-top: 14px; font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.2; text-transform: uppercase; }
.m-next-title em { color: var(--violet); }
.m-next-title .sep { color: var(--text-3); }

/* ---------- bottom thumb bar ---------- */
.m-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px var(--g) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(7,7,11,0), rgba(7,7,11,.94) 32%);
  transform: translateY(110%); transition: transform .35s var(--ease);
}
.m-bar.show { transform: none; }
.m-bar-in { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.m-bar-icon { min-width: 72px; height: 54px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(14,14,23,.95); display: flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .1em; }

/* ---------- lightbox ---------- */
.m-lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(4,4,8,.97); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s; }
.lb-open .m-lightbox { opacity: 1; visibility: visible; transition-delay: 0s; }
.m-lb-scroll { position: absolute; inset: 0; overflow: auto; display: flex; align-items: center; justify-content: flex-start; overscroll-behavior: contain; }
.m-lb-scroll img { width: 100%; max-width: none; margin: auto; }
.m-lightbox.zoomed .m-lb-scroll { align-items: flex-start; }
.m-lightbox.zoomed .m-lb-scroll img { width: 260%; }
.m-lb-ui { position: absolute; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top)) var(--g) 10px; display: flex; justify-content: space-between; align-items: center; background: linear-gradient(rgba(4,4,8,.9), transparent); pointer-events: none; }
.m-lb-hint { font-size: 13px; color: var(--text-3); }
.m-lb-close { pointer-events: auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; margin-right: -6px; }

/* ---------- reveal ---------- */
.has-reveal .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.has-reveal .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .has-reveal .reveal { opacity: 1; transform: none; }
}

/* small phones */
@media (max-width: 359px) {
  :root { --g: 16px; }
  body { font-size: 16px; }
  .m-brand { font-size: 13px; }
  .m-impact-fig b { font-size: 60px; }
}
/* opened on a wide screen: keep the phone column, centred */
@media (min-width: 600px) {
  .m-work-img, .m-rail-wrap { margin-left: 0; margin-right: 0; }
  .m-work-img { border-radius: var(--r); }
}

/* long Russian words in caps headings must never widen the page */
html, body { overflow-x: clip; }
.m-h2, .m-display, .m-case-title, .m-contact-title, .m-case-h2, .m-work-title,
.m-svc h3, .m-brief h3, .m-menu-nav a, .m-next-title, .m-name {
  overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto;
}
html[lang="ru"] .m-display, html[lang="ru"] .m-case-title { font-size: clamp(26px, 7.6vw, 36px); }
html[lang="ru"] .m-h2 { font-size: clamp(28px, 8.2vw, 38px); }
html[lang="ru"] .m-name { font-size: clamp(42px, 12.4vw, 60px); }
.m-menu-foot .m-btn-primary, .m-mail .m-btn { text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 600; font-size: 15px; }

.m-mail { grid-template-columns: minmax(0, 1fr) 54px; }
.m-copy { width: 54px; padding: 0; display: flex; align-items: center; justify-content: center; position: relative; }
.m-copy.done::after { content: attr(aria-label); position: absolute; bottom: calc(100% + 8px); right: 0; white-space: nowrap; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--bg); letter-spacing: .06em; }

/* live prototype tile on the home card: inert, the whole card stays one link */
.m-work-live { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; background: transparent; }
.m-work-img .m-work-no { z-index: 2; }

/* ---------- Winners Cup player ---------- */
.m-proto { margin: 28px var(--g); }
.m-proto-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.m-proto-step { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 11px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); transition: border-color .25s ease, background .25s ease; }
.m-proto-step b { display: block; font-family: var(--display); font-weight: 700; font-size: 12.5px; line-height: 1.15; text-transform: uppercase; letter-spacing: .02em; color: var(--text-2); }
.m-proto-step small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.3; color: var(--text-3); }
.m-proto-dot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 11px; color: var(--text-3); }
.m-proto-step.on { border-color: var(--accent); background: var(--accent-soft); }
.m-proto-step.on b { color: var(--text); }
.m-proto-step.on .m-proto-dot { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.m-proto[data-state="ready"] .m-proto-step.on, .m-proto[data-state="claim"] .m-proto-step.on { border-color: var(--violet); background: rgba(160,124,255,.12); }
.m-proto[data-state="ready"] .m-proto-step.on .m-proto-dot, .m-proto[data-state="claim"] .m-proto-step.on .m-proto-dot { background: var(--violet); border-color: var(--violet); }
.m-proto-stage { aspect-ratio: 1 / 1; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.m-proto-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.m-proto-meter { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.m-proto-bar { flex: 1; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.m-proto-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .15s linear; }
.m-proto[data-state="ready"] .m-proto-bar i { background: var(--violet); }
.m-proto-pct { font-size: 13px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-proto-pct b { color: var(--text); font-family: var(--display); font-size: 15px; }
.m-proto-ctl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.m-proto-ctl button { min-height: 46px; border-radius: 999px; border: 1px solid var(--line-2); font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.m-proto-ctl button:active { transform: scale(.97); }
.m-proto-ctl .is-main { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.m-proto-auto { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; }
.m-proto-auto span { width: 34px; height: 20px; border-radius: 20px; background: var(--line-2); position: relative; transition: background .2s ease; }
.m-proto-auto span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: transform .2s ease; }
.m-proto-auto[aria-pressed="true"] span { background: var(--accent); }
.m-proto-auto[aria-pressed="true"] span::after { transform: translateX(14px); background: var(--bg); }
.m-proto .m-cap { padding: 14px 0 0; }
.m-proto .m-link { margin-top: 4px; }

.m-case-body.is-proto-first .m-proto { margin-top: 4px; }

/* Omni Squads: no zoom badge on the artwork (tap still opens the lightbox) */
body[data-case="omni2"] .m-zoom-ico, body[data-case="fishdom2"] .m-zoom-ico { display: none; }

/* screens in swipe rails carry their own device frame — no extra border or plate */
.m-rail-fig { border: 0; border-radius: 0; background: transparent; }
.m-rail-fig img { object-fit: contain; }

/* ---------- endless card rail: one card always centred ---------- */
.m-rail-loop {
  position: relative;
  grid-auto-columns: 62%; column-gap: 0;
  padding: 6px 19% 8px; scroll-padding: 0;
  align-items: center;
}
.m-rail-loop > .m-loop-item {
  scroll-snap-align: center; scroll-snap-stop: always;
  padding: 0 6px;
  transform: scale(.84); opacity: .45;
  transition: transform .35s var(--ease), opacity .35s var(--ease);
}
.m-rail-loop > .m-loop-item.is-center { transform: none; opacity: 1; }
.m-rail-loop .m-flip { pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .m-rail-loop > .m-loop-item { transition: none; } }
/* each slot is exactly the centre window (62% of the rail); the side padding
   lets the first and last copies reach the centre */
.m-rail-loop { grid-auto-columns: 100%; }
/* the back takes the size of the front, so long notes never stretch the row */
.m-rail-loop .m-flip-in { position: relative; }
.m-rail-loop .m-flip-back {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 14px; gap: 6px;
}
.m-rail-loop .m-flip-name { font-size: 16px; }
.m-rail-loop .m-flip-back p { font-size: 13px; line-height: 1.45; }

/* scale and opacity are now driven per frame from the scroll position */
.m-rail-loop > .m-loop-item, .m-rail-loop > .m-loop-item.is-center { transition: none; will-change: transform, opacity; }

/* ---------- heroes: 3-up grid ---------- */
.m-hero-grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 10px 8px; padding: 0 var(--g); margin-top: 24px; align-items: center; }
.m-hero { display: block; width: 100%; border-radius: 10px; transition: transform .15s ease; }
.m-hero:active { transform: scale(.96); }
.m-hero img { width: 100%; height: auto; }
.m-hero.is-empty { visibility: hidden; }

/* ---------- card sheet ---------- */
body.sheet-open { overflow: hidden; }
.m-sheet { position: fixed; inset: 0; z-index: 55; visibility: hidden; transition: visibility 0s linear .3s; }
.sheet-open .m-sheet { visibility: visible; transition-delay: 0s; }
.m-sheet-back { position: absolute; inset: 0; background: rgba(4,4,8,.7); opacity: 0; transition: opacity .3s ease; }
.sheet-open .m-sheet-back { opacity: 1; }
.m-sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
  max-width: 560px; margin: 0 auto;
  padding: 18px var(--g) calc(26px + env(safe-area-inset-bottom));
  background: linear-gradient(170deg, #1a1530, #0e0e17 60%); border: 1px solid rgba(160,124,255,.3); border-bottom: 0;
  border-radius: 22px 22px 0 0;
  transform: translateY(100%); transition: transform .38s var(--ease);
}
.sheet-open .m-sheet-card { transform: none; }
.m-sheet-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; }
.m-sheet-art { width: 56%; margin: 6px auto 16px; }
.m-sheet-body h3 { font-family: var(--display); font-weight: 700; font-size: 24px; text-transform: uppercase; line-height: 1.1; margin-bottom: 10px; }
.m-sheet-body p { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--text-2); }
.m-sheet-body .m-flip-foot { margin-top: 16px; }

/* card backs in the centred rails: everything on one axis, smaller tag,
   more air between the tag and the note */
.m-rail-loop .m-flip-back { align-items: center; text-align: center; justify-content: flex-start; }
.m-rail-loop .m-flip-rank { align-self: center; font-size: 8px; padding: 2px 6px; letter-spacing: .14em; }
.m-rail-loop .m-flip-back p { margin-top: 12px; }
.m-rail-loop .m-flip-foot { justify-content: center; align-self: stretch; }

/* heroes 30% larger, packed closer: the artwork carries transparent margins,
   so each image is drawn 130% wide and the margin is pulled back */
.m-hero-grid { gap: 0; padding: 0 calc(var(--g) - 6px); }
.m-hero { overflow: visible; }
.m-hero img { width: 130%; max-width: none; margin: -12% -15%; }
/* the icon sheet reads larger than the hero cards around it */
.m-hero:has(img[src*="omni2_icons"]) img { transform: scale(.85); }
/* same correction inside the card sheet: icon set 10% smaller */
.m-sheet-art:has(img[src*="omni2_icons"]) { width: 50.4%; }

/* credits line under the card group */
.m-credits { margin: 22px var(--g) 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.m-credits div { display: grid; gap: 2px; }
.m-credits dt { font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.m-credits dd { font-size: 15px; color: var(--text); }

/* logo variants: no frames or plates — the artwork already sits on its own background */
.m-brand-panel, .m-brand-panel:first-child { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.m-brand-panel img { padding: 0; }
.m-brand-panel figcaption { background: transparent; border-top: 0; padding: 8px 0 0; }

.m-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m-hero { padding-top: 32px; }
.m-hero .m-role { margin-top: 0; }

/* gallery lightbox: the image follows the finger; nothing selects or drags natively */
.m-lb-scroll { touch-action: pan-y pinch-zoom; }
.m-lightbox.zoomed .m-lb-scroll { touch-action: auto; }
.m-lb-scroll img { will-change: transform; -webkit-user-drag: none; user-select: none; }
.m-lb-hint { font-variant-numeric: tabular-nums; }
/* fully opaque backdrop — the 97% one let bright page images show through */
.m-lightbox { background: #050508; }

/* ---------- carousel lightbox ---------- */
.m-lb-scroll { overflow: hidden; display: block; }
.m-lb-track { position: absolute; top: 0; bottom: 0; left: 0; display: flex; gap: 24px; width: calc(300% + 48px); will-change: transform; }
.m-lb-slide { flex: 0 0 calc((100% - 48px) / 3); height: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; overscroll-behavior: contain; }
.m-lb-slide img { width: 100%; max-width: none; height: auto; max-height: 100%; object-fit: contain; margin: auto; transform: none !important; -webkit-user-drag: none; user-select: none; }
.m-lb-slide.is-empty { visibility: hidden; }
.m-lightbox.zoomed .m-lb-slide:nth-child(2) { overflow: auto; align-items: flex-start; justify-content: flex-start; touch-action: auto; }
.m-lightbox.zoomed .m-lb-slide:nth-child(2) img { width: 260%; max-height: none; margin: 0; }
@media (prefers-reduced-motion: reduce) { .m-lb-track { transition: none !important; } }
