/* /portfolio — the main page's language (black + cream, particle sigil, Unbounded / Space Grotesk / JetBrains Mono),
   tuned for reading: 17px body, a labelled top nav, case studies with live screenshots.
   Colour only from the per-section accent that scene.js sets on html[data-sec]. */
:root {
  --bg: #000;
  --fg: #f3f0e8;
  --soft: rgba(243, 240, 232, 0.86);
  --muted: rgba(243, 240, 232, 0.66);
  --faint: rgba(243, 240, 232, 0.46);
  --line: rgba(243, 240, 232, 0.12);
  --glow: rgba(243, 240, 232, 0.42);
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
  --font: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --display: "Unbounded", "Space Grotesk", ui-sans-serif, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --accent: #ff4a3d;
  --accent-soft: rgba(255, 74, 61, 0.35);
  --panel: rgba(16, 16, 16, 0.86);
  --panel-2: rgba(26, 26, 26, 0.9);
  --w: 1200px;
  --gut: 32px;
  --bar: 64px;
}

html[data-sec="1"] { --accent: #6fcfff; --accent-soft: rgba(111, 207, 255, 0.35); }
html[data-sec="2"] { --accent: #6dffa0; --accent-soft: rgba(109, 255, 160, 0.3); }
html[data-sec="3"] { --accent: #ff5a3c; --accent-soft: rgba(255, 90, 60, 0.35); }
html[data-sec="4"] { --accent: #ff8ac0; --accent-soft: rgba(255, 138, 192, 0.35); }

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); color: var(--fg); }
html { color-scheme: dark; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 16px); }

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

::selection { background: var(--accent); color: #000; }

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 30;
  padding: 10px 14px;
  background: var(--fg);
  color: #000;
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- background layers ---------- */
#scene { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 40%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.45) 100%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

main { position: relative; z-index: 2; }

/* ---------- top bar: wordmark, labelled sections, language, résumé ---------- */
.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: calc(var(--bar) + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: env(safe-area-inset-top) max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
  transition: background 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}

.scrolled .bar, .menu-open .bar { background: rgba(0, 0, 0, 0.9); border-bottom-color: var(--line); }

.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.progress span {
  display: block;
  height: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--accent);
}

.home,
.chip {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  text-decoration: none;
  background: rgba(14, 14, 14, 0.78);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.home { padding: 0 14px 0 10px; letter-spacing: 0.16em; flex: none; }
.home img { width: 18px; height: 18px; opacity: 0.85; }
.chip { width: 40px; padding: 0; }
.chip-wide { width: auto; padding: 0 14px; }

.home:hover, .chip:hover, .home:focus-visible, .chip:focus-visible { color: var(--fg); border-color: rgba(243, 240, 232, 0.4); }

.nav { display: flex; align-items: center; gap: 2px; margin: 0 0 0 auto; }

.nav a {
  position: relative;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s ease;
}

.nav > a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.4s var(--ease);
}

.nav a:hover, .nav a:focus-visible { color: var(--fg); }
.nav a.on { color: var(--fg); }
.nav a.on::after { transform: scaleX(1); }
.nav-extra { display: none; }

.bar-right { display: flex; gap: 8px; flex: none; margin-left: auto; }
.menu-btn { display: none; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--bar) + 56px) 24px 96px;
  text-align: center;
}

.open {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 26px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--soft);
}

.open i {
  width: 7px;
  height: 7px;
  background: #3dff8f;
  border-radius: 50%;
  box-shadow: 0 0 12px #3dff8f;
  animation: pulse 2.2s ease-in-out infinite;
}

.hname {
  margin: 0 -0.16em 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 6.2vw, 4.4rem);
  letter-spacing: 0.16em;
  line-height: 1.05;
  text-transform: lowercase;
  text-shadow: 0 0 28px var(--glow), 0 0 90px rgba(255, 74, 61, 0.28), 0 0 160px rgba(255, 138, 192, 0.14);
}

.hname .w { display: inline-block; font-weight: inherit; white-space: nowrap; }
.hname span { display: inline-block; }

.js .hname span {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(0.4em);
  animation: letter 0.9s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 45ms + 100ms);
}

.role {
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--soft);
}

.caret {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 6px;
  vertical-align: -0.15em;
  background: var(--fg);
  opacity: 0.8;
  animation: blink 1.05s steps(1) infinite;
}

.hero-lead {
  max-width: 40rem;
  margin: 28px 0 0;
  font-size: clamp(1.0625rem, 1.9vw, 1.25rem);
  line-height: 1.6;
  color: var(--fg);
}

.when {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 17px 26px;
  overflow: hidden;
  font-family: var(--display);
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  text-decoration: none;
  color: #000;
  background: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 2px;
  box-shadow: 0 0 40px rgba(243, 240, 232, 0.22);
  transition: box-shadow 0.4s ease, transform 0.4s var(--ease), background 0.3s ease, color 0.3s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.9) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sheen 3.6s var(--ease) infinite;
  pointer-events: none;
}

.btn svg { width: 16px; height: 16px; flex: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.4s var(--ease); }
.btn:hover, .btn:focus-visible { box-shadow: 0 0 70px rgba(243, 240, 232, 0.42); transform: translateY(-2px); }
.btn:hover svg { transform: translateX(3px); }
.btn[href^="#"]:hover svg { transform: translateY(3px); }

.btn-line { color: var(--fg); background: rgba(0, 0, 0, 0.55); border-color: rgba(243, 240, 232, 0.5); box-shadow: none; }
.btn-line::after { background: linear-gradient(110deg, transparent 30%, rgba(243, 240, 232, 0.18) 50%, transparent 70%); }
.btn-line:hover, .btn-line:focus-visible { color: #000; background: var(--fg); }

.btn-sm { padding: 11px 16px; gap: 10px; font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: none; }
.btn-sm::after { display: none; }
.btn-sm .go { position: static; width: 14px; height: 14px; color: currentColor; }

/* hero phones: the two apps flank the name on wide screens, sit under the buttons on narrow ones */
.hero-phones { pointer-events: none; }
.ph {
  display: block;
  height: auto;
  filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.7));
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 98%);
  mask-image: linear-gradient(to bottom, #000 62%, transparent 98%);
  animation: ph-in 1.4s var(--ease) 0.9s both, ph-float 7s ease-in-out 2.3s infinite;
}
.ph-r { animation-delay: 1.1s, 3.4s; }

@media (min-width: 1181px) {
  .ph { position: absolute; top: 52%; width: clamp(180px, calc(34vw - 240px), 300px); }
  .ph-l { left: max(40px, calc(50% - 740px)); transform: translateY(-44%) rotate(-7deg); }
  .ph-r { right: max(40px, calc(50% - 740px)); transform: translateY(-56%) rotate(7deg); }
}

@media (max-width: 1180px) {
  .hero { min-height: 0; padding-bottom: 24px; }
  .hero-phones { display: flex; justify-content: center; margin-top: 52px; }
  .ph { width: min(36vw, 230px); }
  .ph-l { transform: translateX(10%) rotate(-6deg); }
  .ph-r { transform: translateX(-10%) translateY(8%) rotate(6deg); }
}

/* ---------- sections ---------- */
.block {
  width: min(100%, calc(var(--w) + 2 * var(--gut)));
  margin: 0 auto;
  padding: clamp(104px, 15vh, 168px) var(--gut) 0;
}

.title {
  margin: 0;
  max-width: 18em;
  background: linear-gradient(100deg, var(--fg) 40%, var(--accent) 75%, var(--fg) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: lowercase;
}

.title-xl { font-size: clamp(2.1rem, 6.4vw, 4.8rem); }

.lead {
  max-width: 42rem;
  margin: 24px 0 0;
  font-size: clamp(1.0625rem, 1.7vw, 1.25rem);
  line-height: 1.6;
  color: var(--soft);
}

.lead a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 4px; }
.lead a:hover { text-decoration-color: var(--accent); }

.sub {
  margin: 88px 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.label {
  margin: 30px 0 10px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--accent);
  transition: color 0.6s ease;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}

.reveal.in { opacity: 1; transform: none; }
html:not(.js) .reveal { opacity: 1; transform: none; }

/* ---------- about ---------- */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 48px; }

.fact { padding: 24px 22px 22px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }

.fact b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px var(--glow);
  white-space: nowrap;
}

.fact span { display: block; margin-top: 10px; font-size: 0.9375rem; line-height: 1.45; color: var(--muted); }

.offers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin: 28px 0 0; padding: 0; list-style: none; }
.offers li { padding-top: 20px; border-top: 2px solid var(--accent); transition: border-color 0.6s ease; }
.offers h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.125rem; letter-spacing: 0.02em; line-height: 1.3; }
.offers p { margin: 12px 0 0; color: var(--soft); }

.marquee {
  margin: 96px calc(50% - 50vw) 0;
  padding: 18px 0;
  overflow: hidden;
  background: rgba(10, 10, 10, 0.7);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  transform: rotate(-1.6deg);
}

.marquee-track { display: flex; align-items: center; gap: 28px; width: max-content; animation: marquee 46s linear infinite; }

.marquee span {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.1rem, 2.6vw, 1.7rem);
  letter-spacing: 0.08em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(243, 240, 232, 0.6);
  white-space: nowrap;
}

.marquee span:nth-of-type(3n + 1) { color: var(--fg); -webkit-text-stroke: 0; }
.marquee span:nth-of-type(5n + 3) { -webkit-text-stroke: 1px var(--accent); }
.marquee i { font-style: normal; color: var(--faint); }

/* ---------- case studies ---------- */
.case {
  margin-top: 56px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.case + .case { margin-top: 24px; }

.case-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 32px; }
.case-tag { margin: 0; font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.06em; color: var(--muted); }

.case-name {
  margin: 10px 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 0.06em;
  text-shadow: 0 0 22px var(--glow);
}

.case-one { max-width: 36rem; margin: 14px 0 0; font-size: clamp(1.0625rem, 1.6vw, 1.1875rem); color: var(--fg); }
.case-links { display: flex; flex-wrap: wrap; gap: 8px; }

.case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  margin-top: 32px;
}

.case-text .label:first-child { margin-top: 4px; }
.case-task { margin: 0; color: var(--soft); }

.list { margin: 0; padding: 0; list-style: none; }

.list li {
  position: relative;
  padding: 8px 0 8px 22px;
  line-height: 1.5;
  color: var(--soft);
}

.list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
  transition: background 0.6s ease;
}

.nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nums div { padding: 14px 14px 12px; background: var(--panel-2); border-radius: 4px; }
.nums b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.1; white-space: nowrap; }
.nums span { display: block; margin-top: 6px; font-size: 0.875rem; line-height: 1.35; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 0; }
.chips i {
  padding: 6px 10px;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.8125rem;
  color: var(--muted);
  background: var(--panel-2);
  border-radius: 2px;
}

/* screenshot viewer: tabs switch between the app and the live site, any picture opens full size */
.viewer { position: sticky; top: calc(var(--bar) + 24px); }

.vtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.vtabs button {
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.vtabs button:hover { color: var(--fg); }
.vtabs button[aria-selected="true"] { color: #000; background: var(--fg); }

.vstage {
  position: relative;
  aspect-ratio: 4 / 3.3;
  overflow: hidden;
  border-radius: 4px;
  background:
    radial-gradient(ellipse 60% 55% at 50% 62%, var(--accent-soft), transparent 70%),
    #060606;
}

.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.5s ease, visibility 0s linear 0.5s; }
.slide.on { opacity: 1; visibility: visible; transition: opacity 0.5s ease; }
html:not(.js) .slide { position: relative; opacity: 1; visibility: visible; }
html:not(.js) .vstage { aspect-ratio: auto; }
html:not(.js) .vtabs { display: none; }

.zoom { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }

.slide-app .zoom { position: absolute; bottom: -9%; width: 38%; transition: transform 0.6s var(--ease); }
.slide-app img { width: 100%; height: auto; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.7)); }
.slide-app .ph-1 { left: 3%; transform: rotate(-7deg) translateY(6%); }
.slide-app .ph-2 { left: 29%; width: 42%; z-index: 1; bottom: -4%; }
.slide-app .ph-3 { right: 3%; transform: rotate(7deg) translateY(6%); }
.slide-app .ph-1:hover { transform: rotate(-4deg) translateY(1%); }
.slide-app .ph-2:hover { transform: translateY(-4%); }
.slide-app .ph-3:hover { transform: rotate(4deg) translateY(1%); }

.slide-site { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 6%; }
.browser { width: 100%; overflow: hidden; border-radius: 6px; background: #151515; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6); transition: transform 0.6s var(--ease); }
.browser:hover { transform: translateY(-4px); }
.browser-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: #1d1d1d; }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(243, 240, 232, 0.2); }
.browser-bar span { margin-left: 10px; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.browser .zoom, .browser img { width: 100%; }

/* more systems: figure first, no boxes */
.more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin: 28px 0 0; padding: 0; list-style: none; }
.more li { padding-top: 22px; border-top: 1px solid var(--line); }
.more-fig { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.more-fig b { font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1; color: var(--accent); transition: color 0.6s ease; }
.more-fig span { font-size: 0.9375rem; color: var(--muted); }
.more h4 { margin: 18px 0 0; font-family: var(--display); font-weight: 400; font-size: 1.0625rem; letter-spacing: 0.03em; }
.more li > p:last-child { margin: 10px 0 0; color: var(--soft); }

/* own products: big live screenshots */
.owns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }

.own {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  transition: border-color 0.4s ease, transform 0.5s var(--ease), opacity 0.9s var(--ease);
}

.own:hover, .own:focus-visible { border-color: var(--accent-soft); transform: translateY(-4px); }
.own-shot { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #060606; }
.own-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.8s var(--ease); }
.own:hover .own-shot img { transform: scale(1.03); }
.own-body { display: flex; flex-direction: column; padding: 24px 26px 26px; }
.own-name { font-family: var(--display); font-size: 1.5rem; letter-spacing: 0.06em; }
.own-text { margin-top: 10px; color: var(--soft); }
.own-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-family: var(--mono); font-size: 0.875rem; color: var(--fg); }
.own-go .go { position: static; width: 15px; height: 15px; }

.go { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.35s var(--ease); }
.own:hover .go, .btn-sm:hover .go, .contacts a:hover .go { transform: translate(3px, -3px); }

/* ---------- results: a ledger ---------- */
.ledger { margin: 48px 0 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }

.row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr) 6rem;
  align-items: baseline;
  gap: 28px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.row::after {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent 60%);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.7s var(--ease);
}

.row:hover::after { transform: scaleX(1); }

.row .v {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 0 26px var(--glow);
  transition: color 0.4s ease;
}

.row:hover .v { color: var(--accent); }

.what { display: flex; flex-direction: column; gap: 8px; }
.what b { font-weight: 500; font-size: 1.1875rem; text-transform: lowercase; }
.what span { max-width: 40rem; color: var(--soft); }

.row .src { justify-self: end; font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: lowercase; color: var(--muted); }

/* ---------- systems ---------- */
.map { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }

.tier { position: relative; padding: 22px 22px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.tier-core { border-color: var(--accent-soft); }

.tier + .tier::before {
  content: "→";
  position: absolute;
  left: -14px;
  top: 20px;
  width: 12px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--muted);
}

.tier-name { margin: 0 0 8px; font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.12em; color: var(--accent); transition: color 0.6s ease; }
.tier ul { margin: 0; padding: 0; list-style: none; }
.tier li { display: flex; flex-direction: column; gap: 4px; padding: 13px 0; border-top: 1px solid var(--line); }
.tier li b { font-weight: 500; font-size: 1.0625rem; }
.tier li span { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); }

/* ---------- process ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 52px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.steps li { position: relative; padding: 24px 22px 0 0; }

.steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: -5px;
  width: 9px;
  height: 9px;
  background: #000;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}

.steps b { display: block; font-family: var(--display); font-weight: 400; font-size: 1rem; letter-spacing: 0.04em; text-transform: lowercase; }
.steps b i { display: block; margin-bottom: 8px; font-family: var(--mono); font-style: normal; font-size: 0.8125rem; color: var(--accent); }
.steps p { margin: 10px 0 0; font-size: 0.9875rem; line-height: 1.55; color: var(--soft); }

.term { margin-top: 56px; border: 1px solid var(--line); border-radius: 4px; background: rgba(6, 6, 6, 0.92); font-family: var(--mono); }

.term-bar { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 0.8125rem; color: var(--muted); }
.term-log { margin: 0; padding: 18px; list-style: none; font-size: 0.875rem; line-height: 1.9; color: var(--soft); overflow-x: auto; }
.term-log li { opacity: 0.2; white-space: nowrap; transition: opacity 0.35s ease; }
.term-log li.on { opacity: 1; }
.term-log i { display: inline-block; width: 5.2rem; font-style: normal; color: var(--accent); }
.term-log em { font-style: normal; color: #6dffa0; }

.stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; margin: 24px 0 0; }
.stack div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 20px; padding: 15px 0; border-top: 1px solid var(--line); }
.stack dt { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); padding-top: 3px; }
.stack dd { margin: 0; color: var(--soft); }

/* ---------- contact ---------- */
.contact { padding-bottom: 32px; }
.contact .actions { justify-content: flex-start; }

.contacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 48px 0 0; padding: 0; list-style: none; }

.contacts a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  height: 100%;
  padding: 18px 20px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  transition: border-color 0.3s ease;
}

.contacts a:hover, .contacts a:focus-visible { border-color: var(--accent-soft); }
.contacts span { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); }
.contacts b { font-weight: 500; }
.contacts .go { position: absolute; right: 16px; top: 18px; color: var(--muted); }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 120px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.foot span:last-child { display: flex; flex-wrap: wrap; gap: 18px; }
.foot a { text-decoration: none; transition: color 0.25s ease; }
.foot a:hover, .foot a:focus-visible { color: var(--fg); }

/* ---------- lightbox ---------- */
.lb { max-width: 96vw; max-height: 96vh; padding: 0; border: 0; background: transparent; overflow: visible; }
.lb::backdrop { background: rgba(0, 0, 0, 0.92); }
.lb img { max-width: 94vw; max-height: 90vh; width: auto; height: auto; border-radius: 6px; }
.lb form { position: fixed; top: 14px; right: 14px; margin: 0; }
.lb-close {
  width: 48px;
  height: 48px;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--fg);
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
}
.lb[open] img { animation: lb-in 0.35s var(--ease); }

/* ---------- keyframes ---------- */
@keyframes letter { to { opacity: 1; filter: none; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes sheen { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes ph-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ph-float { 50% { translate: 0 -14px; } }
@keyframes lb-in { from { opacity: 0; transform: scale(0.96); } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .nav a { padding: 10px 9px; }
  .nav > a::after { left: 9px; right: 9px; }
  .chip-pdf { display: none; }
}

@media (max-width: 980px) {
  .case-grid { grid-template-columns: 1fr; gap: 8px; }
  .viewer { position: relative; top: 0; }
  .steps { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line); margin-left: 5px; }
  .steps li { padding: 0 0 28px 26px; }
  .steps li::before { left: -5px; top: 4px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offers, .more { grid-template-columns: 1fr; gap: 28px; }
  .contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack { grid-template-columns: 1fr; }
}

/* phones and small tablets: the section links move into a menu */
@media (max-width: 860px) {
  :root { --gut: 20px; --bar: 60px; }
  .menu-btn { display: inline-flex; }
  .home span { display: none; }
  .home { padding: 0; width: 40px; }
  .nav {
    position: fixed;
    inset: calc(var(--bar) + env(safe-area-inset-top)) 0 0;
    z-index: 19;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 12px var(--gut) 32px;
    background: #000;
    overflow-y: auto;
  }
  .menu-open .nav { display: flex; }
  .menu-open { overflow: hidden; }
  .nav a { padding: 18px 0; font-family: var(--display); font-size: 1.375rem; letter-spacing: 0.04em; color: var(--fg); border-bottom: 1px solid var(--line); }
  .nav > a::after { display: none; }
  .nav a.on { color: var(--accent); }
  .nav-extra { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
  .nav-extra a { padding: 14px 18px; font-family: var(--mono); font-size: 0.9375rem; border: 1px solid var(--line); border-bottom: 1px solid var(--line); }

  .hero { padding: calc(var(--bar) + 44px) 18px 16px; }
  .hname { font-size: clamp(2rem, 11vw, 3rem); letter-spacing: 0.1em; margin-right: -0.1em; }
  .role { font-size: 0.8125rem; letter-spacing: 0.04em; }
  .when { font-size: 0.75rem; letter-spacing: 0.04em; }
  .open { font-size: 0.75rem; letter-spacing: 0.12em; }

  .block { padding-top: 96px; }
  .sub { margin-top: 64px; }
  .case { margin-top: 40px; padding: 22px 18px; }
  .case-head { gap: 16px; }

  .owns { grid-template-columns: 1fr; }

  .row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; padding: 24px 0; }
  .row .v { grid-column: 1; }
  .row .src { grid-column: 2; grid-row: 1; align-self: center; }
  .what { grid-column: 1 / -1; }

  .stack div { grid-template-columns: 1fr; gap: 4px; }
  .btn { padding: 16px 22px; }
  .foot { margin-top: 72px; }
  .term-bar span:last-child { display: none; }
}

@media (max-width: 640px) {
  .map { grid-template-columns: 1fr; }
  .tier + .tier::before { content: "↓"; left: 22px; top: -15px; width: auto; }
}

@media (max-width: 560px) {
  .case-links { width: 100%; }
  .case-links .btn { flex: 1 1 auto; justify-content: center; }
  .vstage { aspect-ratio: 1 / 1.05; }
  .slide-app .zoom { width: 42%; }
  .slide-app .ph-1 { left: -1%; }
  .slide-app .ph-2 { left: 27%; width: 46%; }
  .slide-app .ph-3 { right: -1%; }
  .slide-site { padding: 4%; }
  .nums { grid-template-columns: 1fr; gap: 8px; }
  .nums div { display: flex; align-items: baseline; gap: 12px; }
  .nums span { margin-top: 0; }
  .actions { width: 100%; }
  .actions .btn { flex: 1 1 100%; justify-content: center; }
  .contacts { grid-template-columns: 1fr; }
  .term-log li { white-space: normal; }
  .term-log i { display: block; width: auto; }
}

@media (max-width: 420px) {
  .facts { grid-template-columns: 1fr; gap: 8px; }
  .fact { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 18px; }
  .fact span { margin-top: 0; text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .hname span { opacity: 1; filter: none; transform: none; }
  .reveal { opacity: 1; transform: none; }
}
.nw { white-space: nowrap; }
.vhint { margin: 10px 0 0; font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); }
