:root {
  --bg: #09090b;
  --card: #111113;
  --card-hi: #16161a;
  --line: rgba(255, 255, 255, 0.08);
  --line-hi: rgba(255, 255, 255, 0.16);
  --ink: #f3f0e8;
  --muted: rgba(243, 240, 232, 0.6);
  --faint: rgba(243, 240, 232, 0.4);
  --accent: #ff4a3d;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
  --r: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--text); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
::selection { background: var(--accent); color: #000; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--ink); color: #0a0a0a; font-weight: 600; font-size: 15px;
  text-decoration: none; white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: #fff; transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-hi); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.3); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(9, 9, 11, 0.82); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(1px)) { .nav { background: rgba(9, 9, 11, 0.7); backdrop-filter: blur(14px) saturate(1.4); } }
.nav-in { display: flex; align-items: center; gap: 32px; height: 64px; }
.logo { font: 500 16px var(--display); letter-spacing: -0.02em; text-decoration: none; }
.nav-links { display: flex; gap: 26px; margin-left: auto; font-size: 14px; color: var(--muted); }
.nav-links a { text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }
.lang { font-size: 14px; color: var(--muted); text-decoration: none; padding: 8px 12px; margin-right: -14px; border-radius: 999px; transition: color 0.2s, background-color 0.2s; }
.lang:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }

/* hero */
.hero { overflow: hidden; position: relative; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.2px); background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(70% 80% at 70% 45%, #000, transparent 75%); mask-image: radial-gradient(70% 80% at 70% 45%, #000, transparent 75%); }
.hero-in { position: relative; }
.hero-in { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; min-height: calc(100svh - 64px); padding: 56px 0; }
.status { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); padding: 6px 14px 6px 12px; border: 1px solid var(--line); border-radius: 999px; margin-bottom: 28px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 4px rgba(61, 220, 132, 0.15); }
h1 { font: 500 clamp(44px, 6.2vw, 84px)/1 var(--display); letter-spacing: -0.045em; }
.hero-role { font-size: clamp(20px, 2vw, 26px); line-height: 1.35; margin-top: 24px; max-width: 26ch; letter-spacing: -0.01em; }
.hero-sub { color: var(--muted); margin-top: 16px; max-width: 48ch; font-size: 17px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-meta { margin-top: 24px; font-size: 14px; color: var(--faint); }

.hero-visual { position: relative; height: min(680px, 76svh); --mx: 0; --my: 0; }
.glow { position: absolute; inset: 0 -10% 0 0; background: radial-gradient(40% 45% at 38% 55%, rgba(255, 74, 61, 0.32), transparent 70%), radial-gradient(35% 40% at 72% 35%, rgba(139, 77, 255, 0.28), transparent 70%); }
.mk { position: absolute; height: 88%; width: auto; max-width: none; will-change: transform; transition: transform 0.6s var(--ease); }
.mk-back { right: 0; top: 0; z-index: 1; transform: translate3d(calc(var(--mx) * -14px), calc(var(--my) * -10px), 0); }
.mk-front { left: 2%; bottom: 0; z-index: 2; transform: translate3d(calc(var(--mx) * 22px), calc(var(--my) * 16px), 0); }
.mk-shadow { position: absolute; left: 6%; right: 6%; bottom: -3%; height: 60px; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.7), transparent); z-index: 0; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.stats div { padding: 28px 28px 26px; border-left: 1px solid var(--line); }
.stats div:first-child { border-left: 0; }
.stats dt { font: 500 clamp(28px, 3vw, 40px)/1 var(--display); letter-spacing: -0.04em; }
.stats dd { margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.45; }

/* sections */
.section { padding-top: clamp(96px, 12vw, 152px); }
.head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 48px; align-items: end; margin-bottom: 40px; }
.head h2 { font: 500 clamp(30px, 3.6vw, 48px)/1.08 var(--display); letter-spacing: -0.04em; max-width: 16ch; }
.head p { color: var(--muted); font-size: 17px; max-width: 46ch; }
.head a { color: var(--ink); text-underline-offset: 4px; }
.head a:hover { color: var(--accent); }
.h-sm { font: 500 22px/1.2 var(--display); letter-spacing: -0.03em; margin-bottom: 20px; }

.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); transition: border-color 0.25s, background-color 0.25s, transform 0.25s var(--ease); }
/* spotlight: курсор подсвечивает карточку (только мышь) */
@media (hover: hover) {
  .card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.3s;
    background: radial-gradient(420px circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.06), transparent 60%); }
  .card:hover::after { opacity: 1; }
}
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.card:hover { border-color: var(--line-hi); background: var(--card-hi); }

/* systems map */
.map { display: grid; gap: 12px; position: relative; }
/* хребет: данные бегут между уровнями */
.map::before { content: ""; position: absolute; left: 4px; top: 28px; bottom: 28px; width: 1px; background: var(--line-hi); }
.map::after { content: ""; position: absolute; left: 2px; top: 28px; width: 5px; height: 48px; border-radius: 3px; background: linear-gradient(transparent, var(--accent), transparent); animation: flow 3.2s cubic-bezier(.6, 0, .4, 1) infinite alternate; }
@keyframes flow { to { transform: translateY(calc(var(--mh, 240px) - 104px)); } }
.tier-name { padding-left: 20px; position: relative; }
.tier-name::before { content: ""; position: absolute; left: 0; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-hi); }
.tier-core .tier-name::before { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 74, 61, 0.15); }
.tier { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.tier-name { font-size: 13px; color: var(--faint); text-transform: lowercase; }
.nodes { display: flex; flex-wrap: wrap; gap: 10px; }
.node { flex: 1 1 180px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; transition: border-color 0.25s, transform 0.25s var(--ease); }
.node:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.node b { display: block; font-weight: 600; font-size: 15px; }
.node span { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.tier-core .node { border-color: rgba(255, 74, 61, 0.35); background: linear-gradient(180deg, rgba(255, 74, 61, 0.08), rgba(255, 74, 61, 0.02)), var(--card); }
.tier-core .node:hover { border-color: rgba(255, 74, 61, 0.6); }

/* projects */
.proj { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 32px; padding: 40px; margin-bottom: 16px; overflow: hidden; }
.proj-alt .proj-text { order: 2; }
.proj-tag { font-size: 13px; color: var(--faint); margin-bottom: 10px; }
.proj h3 { font: 500 clamp(30px, 3.4vw, 44px)/1 var(--display); letter-spacing: -0.04em; margin-bottom: 16px; }
.proj-text > p:not([class]) { color: var(--muted); font-size: 17px; }
.facts { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.facts li { position: relative; padding-left: 22px; font-size: 15.5px; line-height: 1.5; }
.facts li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tags span, .chips span { font-size: 13px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 20px; font-size: 15px; }
.links a { text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-hi); padding-bottom: 2px; transition: color 0.2s, border-color 0.2s; }
.links a:hover { color: var(--accent); border-color: var(--accent); }
.proj { position: relative; }
.proj::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(60% 70% at 78% 50%, var(--tint), transparent 70%); }
.proj { --tint: rgba(255, 106, 40, 0.14); }
.proj-alt { --tint: rgba(139, 77, 255, 0.18); }
.proj-alt::before { background: radial-gradient(60% 70% at 22% 50%, var(--tint), transparent 70%); }
.proj > * { position: relative; }
.fan { position: relative; align-self: center; height: clamp(420px, 38vw, 520px); }
.fan img { position: absolute; top: 50%; height: 86%; width: auto; max-width: none; transition: transform 0.6s var(--ease); }
.fan img:nth-child(1) { left: 50%; transform: translate(-134%, -50%) scale(0.86); z-index: 1; }
.fan img:nth-child(2) { left: 50%; height: 96%; transform: translate(-50%, -50%); z-index: 2; }
.fan img:nth-child(3) { left: 50%; transform: translate(34%, -50%) scale(0.86); z-index: 1; }
.proj:hover .fan img:nth-child(1) { transform: translate(-140%, -50%) scale(0.88); }
.proj:hover .fan img:nth-child(2) { transform: translate(-50%, -52%) scale(1.02); }
.proj:hover .fan img:nth-child(3) { transform: translate(40%, -50%) scale(0.88); }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.mini { padding: 28px; display: flex; flex-direction: column; }
.mini h3 { font: 500 20px/1.2 var(--display); letter-spacing: -0.03em; margin-bottom: 12px; }
.mini p { color: var(--muted); font-size: 15px; }
.mini-fig { margin-top: auto !important; padding-top: 22px; color: var(--muted); }
.mini-fig b { font: 500 26px var(--display); letter-spacing: -0.04em; color: var(--ink); margin-right: 6px; }

.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.own { overflow: hidden; }
.browser { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.browser span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.own img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-bottom: 1px solid var(--line); }
.own-text { padding: 24px 28px 28px; }
.own h3 { font: 500 24px/1.1 var(--display); letter-spacing: -0.03em; margin-bottom: 10px; }
.own-text > p:not([class]) { color: var(--muted); font-size: 15.5px; }

/* results */
.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.res { padding: 28px; }
.res-fig { font: 500 clamp(40px, 4.4vw, 56px)/1 var(--display); letter-spacing: -0.05em; color: var(--ink); }
.res h3 { font-size: 16px; font-weight: 600; margin: 14px 0 8px; }
.res p:last-child { color: var(--muted); font-size: 15px; }
.res:first-child .res-fig { color: var(--accent); }

/* process */
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: s; }
.steps li { padding: 24px 22px; counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 74, 61, 0.12); color: var(--accent); font-weight: 600; font-size: 14px; margin-bottom: 18px; }
.steps b { display: block; font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.steps p { color: var(--muted); font-size: 14.5px; line-height: 1.5; }

/* terminal */
.term { margin-top: 12px; overflow: hidden; background: #0c0c0e; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.term-bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.term-bar p { margin-left: 10px; font-size: 13px; color: var(--faint); }
.term-log { list-style: none; margin: 0; padding: 20px 24px 24px; font: 400 14px/1.9 ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace; color: var(--muted); min-height: 13.3em; }
.term-log i { display: inline-block; width: 7ch; font-style: normal; color: var(--accent); }
.term-log em { font-style: normal; color: #3ddc84; }
.js .term-log li { opacity: 0; transform: translateY(4px); transition: opacity 0.35s, transform 0.35s var(--ease); }
.js .term-log li.on { opacity: 1; transform: none; }
.term-log li:last-child.on::after { content: ""; display: inline-block; width: 8px; height: 1.1em; margin-left: 6px; vertical-align: -0.2em; background: var(--ink); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* roles + stack */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { font-size: 14px; padding: 8px 14px; color: var(--ink); }
.stack { display: grid; border-top: 1px solid var(--line); }
.stack div { display: grid; grid-template-columns: 100px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.stack dt { color: var(--faint); }

/* cta */
.cta { display: flex; justify-content: space-between; align-items: center; gap: 32px; padding: 48px; background: radial-gradient(120% 140% at 100% 0%, rgba(255, 74, 61, 0.16), transparent 55%), var(--card); }
.cta h2 { font: 500 clamp(26px, 3vw, 40px)/1.1 var(--display); letter-spacing: -0.04em; max-width: 18ch; }
.cta p { color: var(--muted); margin-top: 14px; max-width: 46ch; }
.cta-btns { display: flex; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }
.cta .btn:first-child { background: var(--accent); color: #0a0a0a; }
.cta .btn:first-child:hover { background: #ff6156; }

.foot { display: flex; justify-content: space-between; gap: 16px; padding: 56px 0 40px; color: var(--faint); font-size: 14px; }
.foot a { margin-left: 20px; text-decoration: none; transition: color 0.2s; }
.foot a:hover { color: var(--ink); }

/* motion */
.js .rv { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), border-color 0.25s, background-color 0.25s; transition-delay: var(--d, 0ms); }
.js .rv.in { opacity: 1; transform: none; }
.mk { animation: float 7s ease-in-out infinite alternate; }
.mk-back { animation-delay: -3.5s; }
@keyframes float { from { translate: 0 0; } to { translate: 0 -12px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; transition: none; }
  .mk, .map::after { animation: none; }
  .card, .node, .btn, .fan img { transition: none; }
  .js .term-log li { opacity: 1; transform: none; }
}

/* tablet */
@media (max-width: 1040px) {
  .nav-links { display: none; }
  .nav-in { justify-content: space-between; }
  .lang { margin-left: auto; margin-right: -20px; }
  .hero-in { grid-template-columns: 1fr; min-height: 0; padding: 48px 0 24px; }
  .hero-visual { height: 560px; max-width: 560px; width: 100%; margin: 0 auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .head { grid-template-columns: 1fr; }
  .proj { grid-template-columns: 1fr; padding: 32px; }
  .proj-alt .proj-text { order: 0; }
  .grid3, .results { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .cta { flex-direction: column; align-items: flex-start; }
}

/* phone */
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .hero-in { padding-top: 36px; }
  .head h2 { font-size: 28px; }
  .hero-visual { height: 440px; }
  .mk { height: 84%; }
  .stats div { padding: 20px; }
  .stats dt { font-size: 24px; white-space: nowrap; }
  .tier { grid-template-columns: 1fr; gap: 8px; }
  .node { flex-basis: calc(50% - 5px); padding: 14px; }
  .node b { font-size: 14px; }
  .node span { font-size: 12.5px; }
  .proj { padding: 22px; gap: 24px; }
  .fan { height: 380px; margin: 0 -10px; }
  .fan img:nth-child(1) { transform: translate(-112%, -50%) scale(0.86); }
  .fan img:nth-child(3) { transform: translate(12%, -50%) scale(0.86); }
  .term-log { font-size: 12.5px; padding: 16px; }
  .term-log i { display: block; width: auto; }
  .grid3, .grid2, .results, .steps { grid-template-columns: 1fr; }
  .cta { padding: 28px; }
  .cta-btns, .cta-btns .btn, .hero-cta .btn { width: 100%; }
  .foot { flex-direction: column; }
  .foot a { margin: 0 20px 0 0; }
}
