/* ==========================================================================
   Anastasia Lastovskaya — Portfolio
   Dark / glass design system
   ========================================================================== */

/* Onest (variable 300–700) — self-hosted, subsets cyrillic / cyrillic-ext / latin.
   Source: Google Fonts (OFL). No external font requests. */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/onest-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/onest-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/onest-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #08080a;
  --bg-raised: #0e0e11;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.06);

  --text: #f4f3f1;
  --text-soft: rgba(244, 243, 241, 0.64);
  --text-faint: rgba(244, 243, 241, 0.38);

  --violet: #9b8bff;
  --blue: #5fa8ff;
  --glow-a: #7c6cf6;
  --glow-b: #4d7fff;

  /* Light / shadow accent language: warm = light source, cool = shadow */
  --glow-warm-core: #fff2dc;
  --glow-warm: #ff9d4d;
  --glow-warm-deep: #ff5a36;
  --glow-cool: #3d5fc4;
  --glow-cool-bright: #5fa8ff;
  --glow-haze: #6f7ab0;

  --font-body: 'Onest', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Onest', -apple-system, BlinkMacSystemFont, sans-serif;

  --sidebar-w: 300px;
  --gutter: clamp(20px, 4vw, 56px);
  --radius: 18px;
  --radius-sm: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* -------------------- Ambient background glow -------------------- */
/* Scoped to the hero only — the "first impression" of light/shadow.
   Scrolls away with the page so it never sits behind the case grid
   and never competes with reading the cases. Decorative + pointer-events:none. */

/* Sitewide grain — very low opacity, purely textural, never affects contrast */
.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* -------------------- Layout shell -------------------- */

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 0 var(--gutter);
}

@media (max-width: 900px) {
  .shell { display: block; }
  .main { margin-left: 0; }
}

/* -------------------- Sidebar -------------------- */

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--border-soft);
  z-index: 20;
}

.sidebar-identity {
  display: block;
  text-decoration: none;
  color: inherit;
}

.sidebar-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, var(--glow-a), var(--glow-b));
  margin-bottom: 20px;
}
.sidebar-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sidebar-role {
  font-size: 14px;
  color: var(--text-soft);
  margin-top: 4px;
}

.nav-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.sidebar-nav-group { margin-top: 40px; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav a {
  text-decoration: none;
  font-size: 14px;
  color: var(--text-soft);
  padding: 9px 10px;
  margin: 0 -10px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  color: var(--text);
  background: var(--glass);
}
.sidebar-nav a .n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.sidebar-contact-group {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}

.sidebar-contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contact-btn {
  text-decoration: none;
  font-size: 13px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
  width: calc(100% + 20px);
  background: none;
  border: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.contact-btn.copied { color: var(--violet); }
.contact-btn:hover { color: var(--text); background: var(--glass); }
.contact-btn .ic { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.8; }
/* let the phone/email text be selected with the cursor (buttons and links
   suppress this by default; also kill the link ghost-drag) */
.contact-btn { -webkit-user-drag: none; }
.contact-btn span,
.contact-btn .copy-label {
  flex: 1;
  -webkit-user-select: text;
  user-select: text;
}
.contact-btn .arrow { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.55; }

.sidebar-copyright {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 18px;
}

/* Mobile: sidebar collapses into a top bar + hamburger */

.sidebar-mobile-bar { display: none; }

@media (max-width: 900px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 16px var(--gutter);
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(12px);
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
  }
  .sidebar-identity { display: flex; align-items: center; }
  .sidebar-avatar { width: 36px; height: 36px; font-size: 14px; margin-bottom: 0; margin-right: 12px; }
  .sidebar-name { font-size: 15px; }
  .sidebar-role { display: none; }
  .sidebar-nav-group, .sidebar-contact-group { display: none; }
  .sidebar.open {
    position: fixed;
    left: 0; right: 0; top: 0;
    max-height: 100dvh;
    overflow-y: auto;
    background: var(--bg);
    z-index: 50;
  }
  .sidebar.open .sidebar-nav-group,
  .sidebar.open .sidebar-contact-group {
    display: block;
    flex-basis: 100%;
    width: 100%;
    margin: 0;
    padding: 14px 0 2px;
    border-top: 1px solid var(--border-soft);
  }
  .sidebar.open .sidebar-nav-group { margin-top: 8px; }
  .sidebar.open .sidebar-contact-group { padding-bottom: 24px; }
  .sidebar-mobile-bar {
    display: flex;
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 36px; height: 36px;
    align-items: center;
    justify-content: center;
    color: var(--text);
    cursor: pointer;
  }
}

/* -------------------- Type -------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: block;
  margin-bottom: 14px;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: 18px;
  color: var(--text-soft);
  max-width: 85ch;
}

.gradient-text {
  background: linear-gradient(100deg, var(--glow-warm-core), var(--glow-warm) 55%, var(--glow-warm-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 157, 77, 0.3));
}

/* -------------------- Hero (home) -------------------- */

.home-hero {
  position: relative;
  padding: 72px 0 40px;
  max-width: 920px;
}

/* Mesh gradient: 2-3 large soft color fields drifting slowly behind
   everything, fixed to the viewport so cards drift over them while
   scrolling. Warm/cool palette, low opacity, screen blend so overlaps
   mix rather than muddy. This is the site's one background motion. */
.mesh-blob {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(100px);
  mix-blend-mode: screen;
  pointer-events: none;
}
.mesh-1 {
  width: 700px;
  height: 700px;
  top: -300px;
  right: -260px;
  background: radial-gradient(circle, var(--glow-warm) 0%, var(--glow-warm-deep) 40%, transparent 70%);
  opacity: 0.22;
  animation: drift-1 20s ease-in-out infinite alternate;
}
.mesh-2 {
  width: 800px;
  height: 800px;
  bottom: -220px;
  left: -160px;
  background: radial-gradient(circle, var(--glow-cool-bright) 0%, var(--glow-cool) 45%, transparent 70%);
  opacity: 0.32;
  animation: drift-2 26s ease-in-out infinite alternate;
}
.mesh-3 {
  width: 520px;
  height: 520px;
  top: 32%;
  left: 42%;
  background: radial-gradient(circle, var(--glow-haze) 0%, transparent 65%);
  opacity: 0.28;
  animation: drift-3 16s ease-in-out infinite alternate;
}
@keyframes drift-1 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-150px, 110px) scale(1.18); }
  100% { transform: translate(70px, -70px) scale(0.88); }
}
@keyframes drift-2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(130px, -130px) scale(1.22); }
  100% { transform: translate(-90px, 60px) scale(0.85); }
}
@keyframes drift-3 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-90px, -110px) scale(1.3); }
  100% { transform: translate(100px, 80px) scale(0.8); }
}
@media (prefers-reduced-motion: reduce) {
  .mesh-blob { animation: none; }
}

.home-hero h1 {
  font-size: clamp(30px, 4vw, 44px);
}

.logo-row {
  margin-top: 44px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.logo-row .label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.logo-row .marks {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.logo-row .marks > span {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-soft);
  letter-spacing: -0.01em;
}

.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  padding: 6px;
  position: relative;
  transform: rotate(var(--r, 0deg)) translateY(var(--y, 0));
  animation: badge-spin-in 0.7s cubic-bezier(.34, 1.2, .3, 1) both;
}
.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.location-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-faint);
}
.location-pill svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.8;
}
.marks .brand-badge:nth-child(1) { animation-delay: 0.9s; }
.marks .brand-badge:nth-child(2) { animation-delay: 1.25s; }
.marks .brand-badge:nth-child(3) { animation-delay: 1.6s; }

@keyframes badge-spin-in {
  from { transform: rotate(0deg); }
  to { transform: rotate(calc(var(--r, 0deg) + 360deg)) translateY(var(--y, 0)); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-badge { animation: none; }
}

/* -------------------- Case grid (bento) -------------------- */

.case-grid {
  padding: 40px 0 100px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 700px) {
  .case-grid { grid-template-columns: 1fr; }
}

.case-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 0 1px rgba(255, 157, 77, 0.03), 0 20px 40px -20px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.3s ease;
}
.case-card::before {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  width: 260px; height: 260px;
  background: radial-gradient(circle, var(--glow-warm), transparent 70%);
  opacity: 0.05;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.case-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--glass-strong);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(255, 157, 77, 0.12), 0 24px 48px -20px rgba(0, 0, 0, 0.55);
}
.case-card:hover::before { opacity: 0.3; }

.case-card .thumb {
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  padding: 12px;
  position: relative;
  z-index: 1;
}

.case-card .top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.case-card .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.case-card h3 {
  font-size: 21px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.case-card .desc {
  color: var(--text-soft);
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.case-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-soft);
}

/* -------------------- Case page -------------------- */

.back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  text-decoration: none;
  max-width: 900px;
  margin: 40px auto 0;
  transition: color 0.15s ease;
}
.back-link:hover { color: var(--text); }
.back-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.case-hero {
  position: relative;
  padding: 32px 0 40px;
  max-width: 900px;
  margin: 0 auto;
}
.case-hero h1 {
  display: inline-block;
  background: linear-gradient(100deg, var(--glow-warm-core), var(--glow-warm) 55%, var(--glow-warm-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 157, 77, 0.3));
}

.case-meta-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}
.case-meta-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) {
  .case-meta-row { grid-template-columns: repeat(2, 1fr); }
}
.case-meta-row .k {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}
.case-meta-row .k svg {
  width: 15px;
  height: 15px;
  color: var(--text-faint);
  flex-shrink: 0;
}
.case-meta-row .v {
  font-size: 13.5px;
  color: var(--text-soft);
  line-height: 1.7;
}

.case-kpi {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 0 auto 64px;
}
.case-kpi.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) {
  .case-kpi { grid-template-columns: 1fr; }
  .case-kpi.cols-4 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) and (min-width: 701px) {
  .case-kpi.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
.kpi-tile {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px;
  backdrop-filter: blur(20px);
}
.kpi-tile .num {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ff7d47;
}
.kpi-tile .label {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 6px;
}
.kpi-tile.qualitative .num {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.case-block {
  max-width: 900px;
  margin: 0 auto 64px;
}
.case-block h2 {
  font-size: 24px;
  margin-bottom: 18px;
}
.case-block p {
  color: var(--text-soft);
  font-size: 17px;
}
.case-block ul {
  color: var(--text-soft);
  font-size: 17px;
  padding-left: 20px;
  margin: 0;
}
.case-block li { margin-bottom: 10px; }
.case-block li:last-child { margin-bottom: 0; }

.draft-flag {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 0 auto 56px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-soft);
  max-width: 900px;
}
.draft-flag strong { color: var(--text); }

.placeholder-img {
  aspect-ratio: 16/10;
  background: var(--bg-raised);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  padding: 20px;
  margin-top: 16px;
}
.case-cover {
  aspect-ratio: 16/9;
  margin-top: 32px;
}

/* ---- Hero cover: static centered phone with a screen-recording inside ---- */
.cover-hero {
  aspect-ratio: 16 / 11;
  margin-top: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(78% 60% at 16% 8%, rgba(255, 137, 71, 0.15), transparent 60%),
    radial-gradient(92% 74% at 88% 96%, rgba(124, 108, 246, 0.26), transparent 62%),
    radial-gradient(70% 62% at 62% 46%, rgba(93, 168, 255, 0.10), transparent 72%),
    #0c0c16;
}
.cover-phone {
  position: relative;
  height: 94%;
  width: auto;
  flex: 0 0 auto;
  border-radius: 44px;
  padding: 10px;
  background: linear-gradient(148deg, #43434c, #17171b 46%, #303038);
  box-shadow:
    0 34px 70px -16px rgba(86, 64, 168, 0.45),
    0 14px 30px rgba(0, 0, 0, 0.4),
    inset 0 0 0 2px rgba(255, 255, 255, 0.12),
    inset 0 0 0 6px rgba(0, 0, 0, 0.5);
}
.cover-phone::before {
  content: "";
  position: absolute;
  right: -3px;
  top: 33%;
  width: 3px;
  height: 56px;
  border-radius: 2px;
  background: #2c2c31;
}
.cover-screen {
  position: relative;
  height: 100%;
  width: auto;
  border-radius: 35px;
  overflow: hidden;
  background: #efefef;
  font-size: 0;
}
.cover-screen video {
  display: block;
  height: 100%;
  width: auto;
}
.cover-statusbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 6;
  pointer-events: none;
}
@media (max-width: 700px) {
  .cover-hero { aspect-ratio: 4 / 5; }
}

/* ---- Hero cover: 3 dashboards stacked flat, fanning up-right ---- */
.iso-hero {
  aspect-ratio: 16 / 9;
  margin-top: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  background: linear-gradient(-28deg, #2d2517 0%, #2d2d2f 48%, #111114 100%);
}
.iso-stage {
  position: absolute;
  inset: 0;
}
.iso-screen {
  position: absolute;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 34px 64px -18px rgba(0, 0, 0, 0.78),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: iso-bob 7.5s ease-in-out infinite;
  will-change: transform;
}
.iso-screen img {
  display: block;
  width: 100%;
  height: auto;
}
.iso-s1 { width: 50%; left: 6%;  top: 33%; z-index: 3; }
.iso-s2 { width: 50%; left: 25%; top: 20%; z-index: 2; opacity: 0.98; }
.iso-s3 { width: 50%; left: 44%; top: 6%;  z-index: 1; opacity: 0.94; }
.iso-s1 { animation-delay: 0s; }
.iso-s2 { animation-delay: 2.5s; }
.iso-s3 { animation-delay: 5s; }
@keyframes iso-bob {
  0%   { transform: translateY(0); }
  6%   { transform: translateY(-18px); }
  18%  { transform: translateY(0); }
  100% { transform: translateY(0); }
}
@media (max-width: 700px) {
  .iso-hero { aspect-ratio: 4 / 4.2; }
  .iso-s1 { width: 64%; left: 3%;  top: 42%; }
  .iso-s2 { width: 64%; left: 19%; top: 25%; }
  .iso-s3 { width: 64%; left: 35%; top: 8%; }
}
@media (prefers-reduced-motion: reduce) {
  .iso-screen { animation: none; }
}

/* ---- ШМБ hero cover: bento collage with the AI card pushing forward ---- */
.shmb-cover {
  position: relative;
  aspect-ratio: 1995 / 1245;
  margin-top: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.shmb-cover-base {
  display: block;
  width: 100%;
  height: auto;
}
.shmb-cover-ai {
  position: absolute;
  left: 34.687%;
  top: 29.558%;
  width: 32.481%;
  transform-origin: center center;
  animation: shmb-ai-pop 4.2s ease-in-out infinite;
  will-change: transform;
}
.shmb-cover-ai img { display: block; width: 100%; height: auto; }
@keyframes shmb-ai-pop {
  0%   { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0)); }
  50%  { transform: scale(1.1);  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.55)); }
  100% { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0)); }
}
@media (prefers-reduced-motion: reduce) {
  .shmb-cover-ai { animation: none; }
}
/* Compact variant for the ШМБ case-card thumbnail (same 16:10 collage) */
.shmb-cover.shmb-mini {
  margin-top: 0;
  border: 0;
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  isolation: isolate;
}
.shmb-mini .shmb-cover-base {
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-sm);
}
.shmb-mini .shmb-cover-ai {
  left: 34.687%;
  top: 29.558%;
  width: 32.481%;
}

/* ---- Сертификация hero cover: two separate rounded panels (laptop + phone in
   hand) with a real gap between them; the hand gently turns inside its panel. ---- */
.quals-cover {
  position: relative;
  aspect-ratio: 1995 / 1245;
  margin-top: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #000;
}
.quals-cover-left {
  position: absolute;
  top: 1.85%;
  left: 1.3%;
  width: 58%;
  height: 96.15%;
  border-radius: var(--radius-sm);
  object-fit: cover;
  object-position: left center;
}
.quals-cover-right {
  position: absolute;
  top: 1.85%;
  right: 1.3%;
  width: 38.5%;
  height: 96.15%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  isolation: isolate;
}
.quals-cover-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.quals-cover-hand {
  position: absolute;
  left: -26%;
  top: 2%;
  width: 128%;
  max-width: none;
  height: auto;
  transform-origin: 43% 96%;
  animation: quals-hand-turn 5.5s ease-in-out infinite;
  will-change: transform;
}
@keyframes quals-hand-turn {
  0%, 100% { transform: rotate(-2deg); }
  50%      { transform: rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .quals-cover-hand { animation: none; }
}
/* Compact variant for the certification case-card thumbnail */
.quals-cover.quals-mini {
  margin-top: 0;
  border: 0;
  width: 100%;
  height: 100%;
}

/* Compact iso variant for the Forex case-card thumbnail */
.iso-hero.iso-mini {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
}
.iso-mini .iso-screen {
  border-radius: 7px;
  box-shadow: 0 16px 30px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation-name: iso-bob-mini;
}
.iso-mini .iso-s1 { top: 37%; }
.iso-mini .iso-s2 { top: 23%; }
.iso-mini .iso-s3 { top: 9%; }
@keyframes iso-bob-mini {
  0%   { transform: translateY(0); }
  6%   { transform: translateY(-8px); }
  18%  { transform: translateY(0); }
  100% { transform: translateY(0); }
}

/* Compact variant for the case-card thumbnail on the home page */
.cover-hero.cover-mini {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}
.cover-mini .cover-phone {
  height: 94%;
  border-radius: 21px;
  padding: 5px;
  box-shadow:
    0 16px 34px -10px rgba(86, 64, 168, 0.5),
    0 6px 16px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.12),
    inset 0 0 0 3px rgba(0, 0, 0, 0.5);
}
.cover-mini .cover-phone::before { display: none; }
.cover-mini .cover-screen { border-radius: 17px; }

.case-figure {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 16px;
  cursor: zoom-in;
  transition: border-color 0.15s ease;
}
.case-figure:hover { border-color: rgba(255, 255, 255, 0.22); }
p.figure-caption {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 12px;
}

.compare-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 16px;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
  --pos: 50%;
}
.compare-slider.wide {
  aspect-ratio: 2.32 / 1;
}
.compare-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  pointer-events: none;
}
.compare-slider .compare-before {
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 3px;
  background: #ff7d47;
  box-shadow: 0 0 12px rgba(255, 125, 71, 0.7);
  transform: translateX(-1.5px);
  pointer-events: none;
  z-index: 2;
}
.compare-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ff7d47;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 20px rgba(255, 125, 71, 0.55);
}
.compare-handle::before {
  content: '↔';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}
.compare-label {
  position: absolute;
  top: 12px;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(4, 4, 5, 0.65);
  backdrop-filter: blur(6px);
  color: #fff;
  letter-spacing: 0.02em;
  pointer-events: none;
  z-index: 3;
}
.compare-label.before { left: 12px; }
.compare-label.after { right: 12px; }

.phone-showcase {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-top: 16px;
  padding: 48px;
  background: #0a0a0d;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.phone-frame {
  position: relative;
  width: 220px;
  aspect-ratio: 360 / 760;
  flex-shrink: 0;
  background: #161618;
  border-radius: 36px;
  padding: 10px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}
.phone-notch {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 18px;
  background: #161618;
  border-radius: 12px;
  z-index: 10;
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 26px;
  background: #fff;
}
.phone-scroll-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  display: block;
  animation: phone-scroll 11s linear infinite;
  animation-play-state: paused;
}
@keyframes phone-scroll {
  0% { transform: translateY(0); }
  94% { transform: translateY(calc(-1 * var(--scroll-dist, 0px))); }
  100% { transform: translateY(calc(-1 * var(--scroll-dist, 0px))); }
}
.phone-frame.flow-frame { aspect-ratio: 360 / 700; }
.phone-flow { position: relative; width: 100%; height: 100%; }
.flow-step {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.flow-step.active { opacity: 1; z-index: 2; }
.flow-sub {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
}
.flow-sub.active { opacity: 1; z-index: 2; }
.flow-reveal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 3;
  pointer-events: none;
  clip-path: inset(0 100% 0 0);
}
.flow-cursor {
  position: absolute;
  left: 50%;
  top: 85%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95), rgba(150, 150, 158, 0.8) 65%);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.1), 0 4px 10px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%);
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: left .55s cubic-bezier(.4,0,.2,1), top .55s cubic-bezier(.4,0,.2,1), opacity .25s ease;
}
.flow-cursor.visible { opacity: 1; }
.flow-cursor.tap { animation: flow-tap .3s ease; }
@keyframes flow-tap {
  0% { transform: translate(-50%, -50%) scale(1); }
  40% { transform: translate(-50%, -50%) scale(.7); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.phone-showcase-text h4 {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 12px;
}
.phone-showcase-text p {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.6;
  margin: 0;
}
@media (max-width: 700px) {
  .phone-showcase { flex-direction: column; padding: 16px; text-align: center; }
}
.card-showcase {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-top: 16px;
  padding: 48px;
  background: #0a0a0d;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.card-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
  width: 220px;
}
.card-stack img {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.modal-showcase.card-showcase { padding-left: 20px; }
.modal-showcase-img {
  width: 500px;
  flex-shrink: 0;
  display: block;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
@media (max-width: 700px) {
  .modal-showcase-img { width: 100%; max-width: 500px; }
}
.illustration-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.illustration-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.illustration-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
@media (max-width: 700px) {
  .illustration-grid { grid-template-columns: repeat(2, 1fr); }
  .illustration-cell { padding: 14px; }
}
@media (max-width: 700px) {
  .card-showcase { flex-direction: column; padding: 16px; text-align: center; }
  .card-stack { width: 100%; max-width: 280px; margin: 0 auto; }
}
.phone-screen.static-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: #f4f4f6;
}
.phone-screen.static-card img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.mobile-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 32px;
}
.mobile-row .case-figure {
  margin-top: 0;
  width: 100%;
  height: auto;
}
@media (max-width: 700px) {
  .mobile-row { grid-template-columns: 1fr; }
}

.dual-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 32px;
}
.dual-row .case-figure {
  margin-top: 0;
  width: auto;
  height: 225px;
  object-fit: contain;
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .dual-row { flex-direction: column; }
  .dual-row .case-figure { width: 100%; height: auto; }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 4, 5, 0.92);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 48px;
  cursor: zoom-out;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform-origin: center center;
  transition: transform 0.13s ease-out;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox.zoomed { cursor: grab; }
.lightbox.zoomed img { border-radius: 0; }
.lightbox.panning { cursor: grabbing; }
.lightbox.panning img { transition: none; }
@media (max-width: 700px) {
  .lightbox { padding: 12px; }
}
.lightbox-close {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
}

.ps-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px;
  backdrop-filter: blur(20px);
}
.ps-card + .ps-card { margin-top: 20px; }
.ps-card h4 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 14px;
  color: var(--text-soft);
}
.ps-problem, .ps-solution {
  border-left: 2px solid;
  padding-left: 14px;
  font-size: 16px;
  color: var(--text-soft);
}
.ps-problem { border-color: #ff6b5e; margin-bottom: 12px; }
.ps-problem.hypothesis { border-color: #facc15; }
.ps-solution { border-color: #4ade9a; }
.ps-problem b, .ps-solution b { color: var(--text); font-weight: 500; }
b.stat { color: #ff7d47; font-weight: 700; }

.case-next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(20px);
  transition: border-color 0.2s ease, background 0.2s ease;
  max-width: 900px;
  margin: 40px auto 80px;
}
.case-next:hover { border-color: rgba(255,255,255,0.18); background: var(--glass-strong); }
.case-next .cn-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.case-next .cn-title { font-size: 22px; }
.case-next .cn-arrow { font-size: 22px; color: var(--text-faint); flex-shrink: 0; }

/* Tighter card padding on mobile (kept last so it wins over base rules) */
@media (max-width: 700px) {
  .case-card,
  .kpi-tile,
  .ps-card,
  .case-next { padding: 16px; }
}

/* -------------------- Footer -------------------- */

.site-footer {
  padding: 36px 0 56px;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
}
