/* Melix portfolio — static rebuild */
:root {
  --bg: #040404;
  --surface: #0c0c0c;
  --surface-2: #141414;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --text-2: #b7b7b7;
  --text-3: #7a7a7a;
  --radius-lg: 22px;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 48px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: var(--gutter); }
.center { text-align: center; }
.muted { color: var(--text-2); max-width: 46ch; }
.dim { color: var(--text-3); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; color: #000; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- top tab nav ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; justify-content: center; pointer-events: none; }
.tab {
  pointer-events: auto;
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px 8px;
  background: rgba(4, 4, 4, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 18px 18px;
}
.tab-logo { padding: 4px 14px; }
.tab-logo img { height: 22px; width: auto; }
.nav-link { font-size: 13px; color: var(--text-2); padding: 6px 10px; border-radius: 8px; transition: color .2s; }
.nav-link:hover, .nav-link[aria-current="page"] { color: #fff; }

/* ---------- type ---------- */
.mega {
  font-size: clamp(88px, 17vw, 240px);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 0.88;
  margin-left: -0.04em;
}
.big { font-size: clamp(44px, 7vw, 96px); font-weight: 600; letter-spacing: -0.05em; line-height: 0.95; }
.mid { font-size: clamp(30px, 4vw, 52px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; margin: 72px 0 28px; }
.lead { font-size: clamp(26px, 3.2vw, 44px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  background: #fff; color: #040404;
  font-weight: 600; font-size: 15px;
  padding: 6px 6px 6px 22px; border-radius: 12px;
  transition: transform .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-ico {
  width: 36px; height: 36px; border-radius: 9px; background: #040404; position: relative;
}
.btn-ico::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px;
  border-top: 1.6px solid #fff; border-right: 1.6px solid #fff; transform: translateX(-2px) rotate(45deg);
}
.btn-sm { font-size: 14px; padding-left: 16px; }
.btn-sm .btn-ico { width: 30px; height: 30px; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .95; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4,4,4,0) 55%, var(--bg) 100%); }
.hero-inner { position: relative; z-index: 1; padding-top: 120px; padding-bottom: 72px; }
.hero .mega { animation: rise 1.1s cubic-bezier(.2,.7,.1,1) both; }
.hero-name { font-size: clamp(18px, 2vw, 24px); color: var(--text-2); margin-top: 28px; }
.hero-role { font-size: clamp(20px, 2.2vw, 28px); font-weight: 600; letter-spacing: -0.02em; }
.hero-focus { color: var(--text-2); font-size: 14px; margin: 24px 0 28px; }
@keyframes rise { from { opacity: 0; transform: translateY(40px); letter-spacing: -0.02em; } to { opacity: 1; transform: none; } }

/* ---------- intro ---------- */
.intro { display: grid; grid-template-columns: minmax(200px, 360px) 1fr; gap: clamp(28px, 6vw, 96px); align-items: center; padding-top: 96px; }
.intro-photo { width: 100%; height: auto; border-radius: var(--radius-lg); filter: grayscale(1); }
.intro-text .muted { margin-top: 24px; }
.intro-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 32px; flex-wrap: wrap; }
.sign { width: 150px; height: auto; opacity: .9; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 72px 0 0; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.stat-num { font-size: clamp(48px, 7vw, 104px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-2); font-size: 14px; max-width: 22ch; }

/* ---------- sections ---------- */
.section { padding-top: clamp(96px, 12vw, 160px); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 48px; flex-wrap: wrap; }
.sec-head .muted { font-size: 15px; }

.process { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.process li {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; min-height: 300px;
}
.process li:nth-child(2) { transform: translateY(40px); }
.process li:nth-child(3) { transform: translateY(80px); }
.process h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: auto; }
.process p { color: var(--text-2); font-size: 14px; }
.step { font-size: 12px; color: var(--text-3); }

/* ---------- figma strip ---------- */
.figma .muted { margin: 18px auto 40px; }
.figma-row { display: flex; gap: 16px; overflow-x: auto; padding: 8px var(--gutter) 24px; scroll-snap-type: x mandatory; scrollbar-width: none; justify-content: safe center; }
.figma-row::-webkit-scrollbar { display: none; }
.fig { flex: 0 0 auto; width: 132px; scroll-snap-align: center; text-align: center; font-size: 12px; color: var(--text-2); }
.fig img { width: 132px; height: 132px; object-fit: cover; border-radius: 18px; border: 1px solid var(--line-strong); margin-bottom: 10px; transition: transform .25s ease; }
.fig:hover img { transform: translateY(-6px); }
.fig:hover { color: #fff; }

/* ---------- expertise slider ---------- */
.exp-row { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 8px; }
.exp-row::-webkit-scrollbar { display: none; }
.exp {
  flex: 0 0 min(400px, 84vw); scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; display: flex; flex-direction: column; gap: 16px;
}
.exp img { width: 56px; height: 56px; object-fit: contain; }
.exp h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.exp ul { color: var(--text-2); font-size: 14px; display: grid; gap: 6px; }
.exp li::before { content: "•"; margin-right: 8px; color: var(--text-3); }
.exp-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.exp-foot span:first-child { color: #fff; font-weight: 600; }
.slider-ctrl { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.slider-ctrl button {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: transparent; color: #fff; font-size: 22px; cursor: pointer;
}
.slider-ctrl button:hover { background: var(--surface-2); }

/* ---------- project cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-apps { grid-template-columns: repeat(4, 1fr); }
.grid-brand { grid-template-columns: repeat(4, 1fr); }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; transition: border-color .25s ease;
}
.card:hover { border-color: var(--line-strong); }
.card-media { aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; position: relative; }
.card-media::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.05) 50%, transparent 70%); background-size: 220% 100%; animation: shimmer 1.6s linear infinite; pointer-events: none; }
.card-media.loaded::before { display: none; }
.card-media video { position: relative; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.card-app .card-media { aspect-ratio: 9 / 19; background: #000; }
.card-app .card-media video { object-fit: contain; }
.card-app:hover .card-media video { transform: none; }
.card-brand .card-media { aspect-ratio: 1; }
.card-media video, .card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.1,1); }
.card:hover .card-media video, .card:hover .card-media img { transform: scale(1.03); }
.card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 12px; }
.card-body h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.card-body p { color: var(--text-2); font-size: 14px; max-width: 60ch; }
.card-brand .card-body p { font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12px; color: var(--text-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 10px; }

.app-row { display: grid; grid-auto-flow: column; grid-auto-columns: min(280px, 64vw); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 8px; margin-bottom: 56px; }
.app-row::-webkit-scrollbar { display: none; }
.app-row .card { scroll-snap-align: start; }

/* ---------- companies ---------- */
.co-list { border-top: 1px solid var(--line); margin-top: 40px; }
.mid + .co-list { margin-top: 0; }
.co {
  display: grid; grid-template-columns: 1.1fr 160px 2fr 32px; align-items: center; gap: 24px;
  padding: 26px 4px; border-bottom: 1px solid var(--line); transition: background .2s;
}
.co:hover { background: var(--surface); }
.co-name { font-size: clamp(22px, 2.4vw, 32px); font-weight: 600; letter-spacing: -0.03em; }
.co-name small { display: block; font-size: 13px; font-weight: 400; color: var(--text-3); letter-spacing: 0; margin-top: 4px; }
.co-logo img { max-height: 34px; width: auto; object-fit: contain; opacity: .85; }
.co-desc { color: var(--text-2); font-size: 14px; }
.co-go { font-size: 20px; color: var(--text-3); text-align: right; }
.co:hover .co-go { color: #fff; }

/* ---------- inner page hero ---------- */
.page-hero { padding-top: 140px; }
.page-hero-sub { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.page-hero-sub.split { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap; }
.page-hero-sub .hero-role { max-width: 18ch; }

/* ---------- about ---------- */
.statement { font-size: clamp(26px, 3.6vw, 48px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; max-width: 24ch; margin-top: 96px; }
.faq { border-top: 1px solid var(--line); max-width: 920px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 26px 48px 26px 0; position: relative;
  font-size: clamp(19px, 2vw, 26px); font-weight: 600; letter-spacing: -0.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-weight: 400; color: var(--text-2); transition: transform .25s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq p { color: var(--text-2); max-width: 68ch; padding-bottom: 18px; }
.faq p:last-child { padding-bottom: 28px; }
.do-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.do { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.do img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.do h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; padding: 22px 24px 8px; }
.do p { color: var(--text-2); font-size: 14px; padding: 0 24px 26px; max-width: 52ch; }

/* ---------- case page ---------- */
.case-head { padding-top: 130px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.back { font-size: 14px; color: var(--text-2); }
.back:hover { color: #fff; }
.case-title { font-size: clamp(44px, 8vw, 120px); font-weight: 600; letter-spacing: -0.055em; line-height: 0.92; max-width: 14ch; }
.case-lead { font-size: clamp(18px, 1.8vw, 22px); color: var(--text-2); max-width: 52ch; }
.case-meta { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 24px; width: 100%; border-top: 1px solid var(--line); padding-top: 20px; }
.case-meta dt { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.case-meta dd { font-size: 15px; }
.case-meta dd:empty::before { content: "—"; color: var(--text-3); }
.case-frame-app { display: flex; justify-content: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(16px, 4vw, 56px); }
.case-frame-app .case-video { width: auto; max-width: 100%; max-height: 82vh; border: 0; border-radius: 18px; background: #000; }
.case-video { width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); }
.case-body { padding-top: 96px; display: grid; gap: 56px; }
.case-block { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
.case-block h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.case-block > div { color: var(--text-2); font-size: 17px; max-width: 64ch; display: grid; gap: 14px; }
.gallery { padding-top: 96px; display: grid; gap: 24px; }
.gallery figure { border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.gallery img { width: 100%; height: auto; }
.gallery figcaption { color: var(--text-2); font-size: 14px; padding: 14px 4px 0; }
.gallery figcaption:empty { display: none; }
.next { padding-top: 120px; display: flex; flex-direction: column; gap: 8px; }
.next a { font-size: clamp(36px, 6vw, 84px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.next a:hover { color: var(--text-2); }

/* empty slots: hidden on live site, shown as hints in draft mode */
[data-slot]:empty { display: none; }
.case-block:has(> div[data-slot]:empty) { display: none; }
.draft [data-slot]:empty, .draft .case-block:has(> div[data-slot]:empty) { display: grid; }
.draft [data-slot]:empty::before {
  content: attr(data-slot); display: block; padding: 14px 16px; border: 1px dashed var(--line-strong);
  border-radius: 10px; color: var(--text-3); font-size: 14px;
}
.draft .case-meta dd[data-slot]:empty { display: block; }
.draft .case-meta dd[data-slot]:empty::before { padding: 4px 8px; font-size: 12px; }
.gallery figure.missing { display: none; }
.draft .gallery figure.missing {
  display: flex; align-items: center; justify-content: center; min-height: 220px;
  border: 1px dashed var(--line-strong); color: var(--text-3); font-size: 14px; text-align: center; padding: 24px;
}
.draft .gallery figure.missing::before { content: "Положи файл: " attr(data-file); }

/* ---------- footer ---------- */
.footer { position: relative; margin-top: clamp(120px, 14vw, 200px); overflow: hidden; border-top: 1px solid var(--line); }
.footer-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.footer-inner { position: relative; padding-top: 96px; padding-bottom: 40px; }
.footer-cta { font-size: clamp(36px, 6vw, 80px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; max-width: 14ch; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 72px; }
.footer h3 { font-size: 13px; font-weight: 500; color: var(--text-3); margin-bottom: 10px; }
.footer-grid p { line-height: 1.8; overflow-wrap: anywhere; }
.footer-grid a:hover { color: var(--text-2); }
.footer-sign { width: 180px; height: auto; margin-top: 72px; opacity: .9; }
.copy { color: var(--text-3); font-size: 13px; margin-top: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .grid-apps { grid-template-columns: repeat(2, 1fr); }
  .grid-brand { grid-template-columns: repeat(2, 1fr); }
  .co { grid-template-columns: 1fr 120px 24px; }
  .co-desc { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
  .nav-link { padding: 6px 7px; font-size: 12px; }
  .tab-logo { padding: 4px 6px; }
  .intro { grid-template-columns: 1fr; padding-top: 64px; }
  .intro-photo { max-width: 280px; }
  .stats, .stats-3 { grid-template-columns: repeat(2, 1fr); }
  .process, .grid, .do-grid { grid-template-columns: 1fr; }
  .grid-apps { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-app .card-body { padding: 16px; }
  .card-app .card-body p { display: none; }
  .process li { min-height: 0; transform: none !important; }
  .process h3 { margin-top: 24px; }
  .co { grid-template-columns: 1fr 24px; }
  .co-logo { display: none; }
  .case-meta { grid-template-columns: repeat(2, 1fr); }
  .case-block { grid-template-columns: 1fr; gap: 12px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .figma-row { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- scroll reveal & entrance ---------- */
.js-anim .will-reveal { opacity: 0; transform: translateY(28px); }
.js-anim .revealed { opacity: 1; transform: none; transition: opacity .8s cubic-bezier(.2,.7,.1,1), transform .8s cubic-bezier(.2,.7,.1,1); transition-delay: var(--d, 0s); }
.hero-name, .hero-role, .hero-focus, .hero .btn { animation: fadeUp .9s cubic-bezier(.2,.7,.1,1) both; }
.hero-name { animation-delay: .25s; }
.hero-role { animation-delay: .35s; }
.hero-focus { animation-delay: .45s; }
.hero .btn { animation-delay: .55s; }
.hero-bg { animation: heroZoom 2.4s cubic-bezier(.2,.7,.1,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes heroZoom { from { transform: scale(1.08); opacity: 0; } to { transform: none; opacity: .95; } }
.page-hero .mega, .case-title { animation: rise 1s cubic-bezier(.2,.7,.1,1) both; }

/* ---------- featured case card ---------- */
.card-feature { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); margin-bottom: 20px; }
.card-feature .card-media { aspect-ratio: 16 / 9; height: 100%; }
.card-feature .card-body { padding: clamp(24px, 3vw, 44px); justify-content: center; gap: 14px; }
.card-feature h3 { font-size: clamp(30px, 3.4vw, 52px); letter-spacing: -0.04em; line-height: 1; }
.card-feature .feature-sub { color: #fff; font-weight: 600; font-size: 15px; }
.card-feature p { font-size: 15px; }
.feature-cta { display: inline-flex; align-items: center; gap: 12px; margin-top: 10px; font-weight: 600; font-size: 15px; }
.feature-cta .btn-ico { background: #fff; width: 32px; height: 32px; }
.feature-cta .btn-ico::after { border-color: #040404; }
.card-feature:hover .feature-cta .btn-ico { transform: translateX(3px); transition: transform .2s; }

/* ---------- comic reader ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.comic { padding-top: clamp(96px, 12vw, 160px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 820px) minmax(0, 1fr); column-gap: 40px; }
.comic-intro, .comic-toc { grid-column: 2; }
.comic-intro .muted { margin-top: 20px; font-size: 17px; max-width: 56ch; }
.comic-actions { display: flex; align-items: center; gap: 24px; margin-top: 28px; flex-wrap: wrap; }
.link-plain { color: var(--text-2); font-size: 14px; border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; }
.link-plain:hover { color: #fff; }
.comic-toc { margin: 56px 0 48px; border-top: 1px solid var(--line); padding-top: 22px; }
.comic-toc h3 { font-size: 13px; font-weight: 500; color: var(--text-3); margin-bottom: 14px; }
.comic-toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 28px; }
.comic-toc a { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--text-2); transition: color .2s; }
.comic-toc a:hover { color: #fff; }
.ch-n { color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 22px; }
.comic-pages { grid-column: 2; display: grid; gap: 20px; }
.comic-page { scroll-margin-top: 72px; }
.comic-open { display: block; width: 100%; padding: 0; border: 0; background: #000; cursor: zoom-in; border-radius: 14px; overflow: hidden; }
.comic-open img { width: 100%; height: auto; aspect-ratio: 780 / 1200; }
.comic-progress {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  background: rgba(4,4,4,.85); backdrop-filter: blur(10px); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums;
  opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; pointer-events: none;
}
.comic-progress.on { opacity: 1; transform: none; }
.comic-progress [data-cur] { color: #fff; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.94); display: flex; align-items: center; justify-content: center; }
.lb-scroll { max-width: min(1100px, 100vw); max-height: 100vh; overflow: auto; }
.lb-scroll img { display: block; width: min(1100px, 100vw); height: auto; }
.lightbox button { position: fixed; background: rgba(20,20,20,.85); color: #fff; border: 1px solid var(--line-strong); border-radius: 12px; width: 48px; height: 48px; font-size: 26px; cursor: pointer; z-index: 2; }
.lb-close { top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); font-size: 13px; color: var(--text-2); background: rgba(20,20,20,.85); padding: 4px 12px; border-radius: 999px; }
@media (max-width: 1024px) {
  .card-feature { grid-template-columns: 1fr; }
  .card-feature .card-media { height: auto; }
}
@media (max-width: 760px) {
  .comic { display: block; }
  .comic-toc ol { grid-template-columns: 1fr; }
  .comic-pages { gap: 12px; margin-inline: calc(-1 * var(--gutter) + 8px); }
  .comic-open { border-radius: 8px; }
  .lightbox button.lb-prev, .lightbox button.lb-next { display: none; }
}

/* process icons */
.proc-icon { width: 40px; height: 40px; color: #fff; }
.step { display: inline-flex; align-items: center; gap: 10px; }
.step-icon { color: var(--text-2); flex: none; }
.step-sep { width: 1px; height: 16px; background: var(--line-strong); }

/* ---------- signature logo (SVG, black removed by filter) ---------- */
.logo-svg { display: block; height: 24px; width: auto; aspect-ratio: 407 / 143; }
.sign { display: block; width: 150px; height: auto; aspect-ratio: 407 / 143; }
.footer-sign { display: block; width: 180px; height: auto; aspect-ratio: 407 / 143; margin-top: 72px; }

/* ---------- hero: 3D wall of separate phone screens ---------- */
.hero { background: radial-gradient(120% 90% at 75% 30%, #0c1630 0%, #060912 55%, var(--bg) 100%); }
.hero-stage { position: absolute; inset: 0; overflow: hidden; perspective: 1800px; perspective-origin: 70% 40%; }
.hero-wall {
  position: absolute; top: -30%; bottom: -30%; left: 30%; right: -22%;
  display: flex; gap: 22px; transform-style: preserve-3d;
  transform: rotateX(calc(28deg + var(--ry, 0deg))) rotateY(calc(-12deg + var(--rx, 0deg))) rotateZ(-14deg);
  transition: transform .8s cubic-bezier(.2,.7,.1,1);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 100%);
}
.wall-col { flex: 1 1 0; min-width: 0; overflow: visible; }
.wall-track { display: flex; flex-direction: column; gap: 22px; animation: wallUp 60s linear infinite; will-change: transform; }
.wall-col:nth-child(even) .wall-track { animation-name: wallDown; animation-duration: 70s; }
.wall-col-3 .wall-track { animation-duration: 52s; }
.wall-col-5 .wall-track { animation-duration: 78s; }
.phone {
  position: relative; border-radius: 26px; padding: 5px; background: linear-gradient(160deg, #3a3d46, #0f1014 40%, #1d1f26);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.08), inset 0 1px 0 rgba(255,255,255,.18);
  transform: translateZ(0); transition: transform .5s cubic-bezier(.2,.7,.1,1), box-shadow .5s;
  animation: phoneIn 1.1s cubic-bezier(.2,.7,.1,1) both;
}
.phone img { display: block; width: 100%; height: auto; border-radius: 21px; }
.phone::after { /* glass reflection */
  content: ""; position: absolute; inset: 5px; border-radius: 21px; pointer-events: none;
  background: linear-gradient(125deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 32%, rgba(255,255,255,0) 70%, rgba(255,255,255,.06) 100%);
}
.wall-col-1 .phone { animation-delay: .15s; } .wall-col-2 .phone { animation-delay: .3s; } .wall-col-3 .phone { animation-delay: .45s; }
.wall-col-4 .phone { animation-delay: .6s; } .wall-col-5 .phone { animation-delay: .75s; }
.hero-glow { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background:
    radial-gradient(28% 38% at 60% 24%, rgba(64,120,255,.30), transparent 70%),
    radial-gradient(24% 32% at 90% 72%, rgba(170,80,255,.24), transparent 70%),
    radial-gradient(22% 28% at 70% 95%, rgba(30,200,150,.18), transparent 70%);
}
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(65% 75% at 0% 85%, rgba(4,4,4,.9) 0%, rgba(4,4,4,.55) 45%, rgba(4,4,4,0) 75%); }
.hero::after { z-index: 1; background: linear-gradient(180deg, rgba(4,4,4,0) 75%, var(--bg) 100%); }
.hero-inner { z-index: 2; }
@keyframes wallUp { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, calc(-50% - var(--gh, 11px)), 0); } }
@keyframes wallDown { from { transform: translate3d(0, calc(-50% - var(--gh, 11px)), 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes phoneIn { from { opacity: 0; transform: translate3d(0, 80px, -160px) rotateX(-20deg); } to { opacity: 1; transform: none; } }
@media (max-width: 1024px) { .hero-wall { left: 10%; right: -40%; } }
@media (max-width: 760px) {
  .hero-wall { left: -35%; right: -55%; top: -20%; bottom: 10%; gap: 12px;
    transform: rotateX(26deg) rotateY(-8deg) rotateZ(-14deg); -webkit-mask-image: none; mask-image: none; }
  .wall-track { gap: 12px; --gh: 6px; }
  .phone { border-radius: 18px; padding: 3px; } .phone img, .phone::after { border-radius: 15px; } .phone::after { inset: 3px; }
  .hero::before { background: linear-gradient(180deg, rgba(4,4,4,.05) 25%, rgba(4,4,4,.7) 55%, rgba(4,4,4,.96) 76%); }
}
@media (prefers-reduced-motion: reduce) { .wall-track { animation: none; } }

/* horizontal rows: visible thin scrollbar, drag cursor, edge fades */
.app-row, .exp-row { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; padding-bottom: 14px; cursor: grab; scroll-snap-type: x proximity; }
.app-row::-webkit-scrollbar, .exp-row::-webkit-scrollbar { display: block; height: 6px; }
.app-row::-webkit-scrollbar-thumb, .exp-row::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 99px; }
.app-row::-webkit-scrollbar-track, .exp-row::-webkit-scrollbar-track { background: rgba(255,255,255,.05); border-radius: 99px; }
.app-row.dragging, .exp-row.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.app-row.dragging *, .exp-row.dragging * { pointer-events: none; }
.app-row { margin-bottom: 0; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.app-row.at-end { -webkit-mask-image: none; mask-image: none; }
.slider-ctrl-apps { margin: 16px 0 56px; }
.slider-ctrl button:disabled { opacity: .3; cursor: default; }
.slider-ctrl button:disabled:hover { background: transparent; }

/* ---------- hover: which cards open a comic case ---------- */
.card-media-wrap { position: relative; }
.card-badge {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(10,10,12,.78); color: #fff; border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.card-badge.is-comic { background: #3D6BFF; border-color: #6d8fff; }
.card-badge.is-comic::before {
  content: ""; width: 14px; height: 14px; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4h7a3 3 0 0 1 3 3v13a2 2 0 0 0-2-2H2z'/%3E%3Cpath d='M22 4h-7a3 3 0 0 0-3 3v13a2 2 0 0 1 2-2h8z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4h7a3 3 0 0 1 3 3v13a2 2 0 0 0-2-2H2z'/%3E%3Cpath d='M22 4h-7a3 3 0 0 0-3 3v13a2 2 0 0 1 2-2h8z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.card:hover .card-badge, .card:focus-visible .card-badge { opacity: 1; transform: none; }
.card.has-comic:hover, .card.has-comic:focus-visible {
  border-color: #3D6BFF; box-shadow: 0 0 0 1px #3D6BFF, 0 18px 50px -12px rgba(61,107,255,.45);
}
.card.has-comic { transition: border-color .25s ease, box-shadow .3s ease; }
.card:not(.has-comic):hover .card-media video, .card:not(.has-comic):hover .card-media img { filter: brightness(.85); }
/* touch screens have no hover: keep the comic badge visible */
@media (hover: none) { .card-badge.is-comic { opacity: 1; transform: none; } }
.card-feature .card-media-wrap { height: 100%; }

/* ---------- comic: the hard parts ---------- */
.hard-parts { grid-column: 2; margin-top: 64px; }
.hard-parts .mid { margin: 0 0 24px; }
.hard-parts ol { display: grid; gap: 12px; }
.hard { position: relative; padding: 24px 24px 24px 72px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.hard-n { position: absolute; left: 24px; top: 25px; font-size: 13px; color: #6d8fff; font-variant-numeric: tabular-nums; }
.hard h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 14px; }
.hard p { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.hard p + p { margin-top: 10px; }
.hard p span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding-top: 3px; }
.hard .hard-m { color: #fff; }
.hard .hard-m span { color: #6d8fff; }
@media (max-width: 640px) {
  .hard { padding: 20px; }
  .hard-n { position: static; display: block; margin-bottom: 8px; }
  .hard p { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- comic: the problem and my role ---------- */
.role-sec { grid-column: 2; margin-top: 64px; display: grid; gap: 56px; }
.role-sec .mid { margin: 0 0 24px; }
.pr-list { display: grid; gap: 12px; }
.pr-list li { padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 18px; line-height: 1.5; color: var(--text-2); }
.pr-list b, .rl-key b { color: #fff; font-weight: 600; }
.rl-title { font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #6d8fff; }
.rl-sub { margin-top: 6px; color: var(--text-3); font-size: 15px; }
.rl-list { margin-top: 24px; border-top: 1px solid var(--line); }
.rl-list li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.rl-n { font-size: 28px; font-weight: 600; line-height: 1; color: #6d8fff; font-variant-numeric: tabular-nums; }
.rl-list h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.rl-list p { margin-top: 4px; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.rl-key { margin-top: 28px; padding: 20px 24px; border: 1px solid rgba(109, 143, 255, .45); border-radius: var(--radius); background: rgba(61, 107, 255, .08); font-size: 18px; line-height: 1.45; color: var(--text-2); }
.rl-key span { display: block; margin-bottom: 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #6d8fff; }
.rl-quote { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
@media (max-width: 640px) {
  .role-sec { gap: 40px; }
  .pr-list li, .rl-key { padding: 16px 18px; font-size: 16px; }
  .rl-list li { grid-template-columns: 40px minmax(0, 1fr); }
  .rl-n { font-size: 22px; }
}

/* ---------- brand identity: accordion ---------- */
.brand-acc { display: flex; gap: 24px; height: clamp(420px, 40vw, 600px); }
.bp { position: relative; flex: 1 1 0; min-width: 0; border-radius: 20px; overflow: hidden; background: #111 repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 1px, transparent 1px 22px); transition: flex-grow .6s cubic-bezier(.2,.7,.2,1); color: #fff; }
.bp.is-open { flex-grow: 4.2; }
.bp-media { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
.bp.is-open .bp-media { opacity: 1; }
.bp-media img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.72); transform: scale(1.04); transition: transform 1.2s ease; }
.bp.is-open .bp-media img { transform: scale(1); }
.bp-glitch { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 2px, transparent 2px 5px); mix-blend-mode: multiply; pointer-events: none; }
.bp.is-open .bp-glitch { animation: bp-flicker 4s steps(1) infinite; }
@keyframes bp-flicker { 0%, 100% { transform: none; } 92% { transform: translateX(2px); filter: hue-rotate(20deg); } 94% { transform: translateX(-3px); } 96% { transform: none; } }
.bp-closed { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 12px; font-size: clamp(17px, 1.6vw, 24px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; transition: opacity .3s ease; }
.bp.is-open .bp-closed { opacity: 0; }
.bp-open { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(24px, 3.4vw, 46px); opacity: 0; transform: translateY(8px); transition: opacity .35s ease .15s, transform .45s ease .15s; text-shadow: 0 2px 18px rgba(0,0,0,.45); }
.bp.is-open .bp-open { opacity: 1; transform: none; }
.bp-title { font-size: clamp(26px, 3vw, 46px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; max-width: 18ch; }
.bp-sub { font-size: clamp(16px, 1.5vw, 22px); font-weight: 500; }
.bp:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 809px) {
  .brand-acc { flex-direction: column; height: auto; gap: 14px; }
  .bp, .bp.is-open { flex: none; height: 260px; }
  .bp .bp-media, .bp .bp-open { opacity: 1; transform: none; }
  .bp .bp-closed { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bp, .bp-media, .bp-open, .bp-media img { transition: none; } .bp.is-open .bp-glitch { animation: none; } }
.app-row[data-autoscroll] { scroll-snap-type: none; }
.case-links { display: flex; flex-wrap: wrap; gap: 10px; }
.case-links:empty { display: none; }
.btn-figma { gap: 10px; }
.fig-ico { width: 12px; height: 18px; flex: none; }
