:root {
  --bg: #0f0f0d;
  --bg-2: #171714;
  --line: #2a2a25;
  --text: #f1eee6;
  --muted: #8f8b80;
  --accent: #ff5a1f;
  --oss: #c6f24e;
  --com: #7cc4ff;
  --radius: 18px;
  --pad: clamp(20px, 5vw, 72px);
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
code { font-family: var(--mono); font-size: .88em; background: var(--bg-2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; color: var(--oss); }

/* шум поверх фона */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .06;
  transform: translateZ(0); will-change: transform; /* отдельный слой — не перерисовывается при скролле */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== верхняя панель ===== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--pad);
  background: linear-gradient(var(--bg) 40%, transparent);
}
.logo { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 28px; font-size: 14px; color: var(--muted); }
.nav a { transition: color .2s; }
.nav a:hover { color: var(--text); }
.counter { color: var(--muted); }
.counter span:first-child { color: var(--text); }

/* ===== слайды ===== */
.slide {
  position: relative;
  min-height: 100vh;
  padding: 120px var(--pad) 80px;
  display: flex; flex-direction: column; justify-content: center;
  border-bottom: 1px solid var(--line);
}

.kicker { color: var(--accent); margin-bottom: 18px; }
h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(32px, 5vw, 64px); line-height: 1.05; letter-spacing: -.03em;
}

/* ===== 01 hero ===== */
.hero { overflow: hidden; }
.hero-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); margin-bottom: 32px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--oss); box-shadow: 0 0 0 4px rgba(198,242,78,.15); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(198,242,78,0); } }

.hero-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(44px, 8.4vw, 132px); line-height: .95; letter-spacing: -.045em;
  max-width: 14ch; position: relative; z-index: 2;
}
.hero-title em {
  font-style: normal; color: var(--bg);
  background: var(--accent); padding: 0 .12em; border-radius: .12em;
  display: inline-block; transform: rotate(-1.5deg);
}
.hero-lead { max-width: 560px; margin-top: 36px; color: var(--muted); font-size: clamp(16px, 1.4vw, 19px); position: relative; z-index: 2; }

.hero-stats { display: flex; gap: clamp(24px, 5vw, 64px); margin-top: 56px; position: relative; z-index: 2; }
.stat b { display: block; font-family: var(--display); font-weight: 600; font-size: clamp(36px, 4vw, 56px); line-height: 1; }
.stat span { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.scroll-hint { position: absolute; bottom: 36px; left: var(--pad); color: var(--muted); display: flex; gap: 10px; transition: color .2s; }
.scroll-hint:hover { color: var(--text); }
.scroll-hint span { display: inline-block; animation: bob 1.6s infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

.hero-mark {
  position: absolute; right: -4vw; bottom: -12vw; z-index: 1;
  font-family: var(--display); font-weight: 800; font-size: 62vw; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px var(--line);
  user-select: none;
}

/* ===== 02 projects ===== */
.projects { justify-content: flex-start; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 48px; }
.filters { display: flex; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); }
.filter {
  font: 500 13px var(--body); color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; transition: all .2s;
}
.filter:hover { color: var(--text); }
.filter.is-active { background: var(--text); color: var(--bg); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 20px; }

.card {
  position: relative; display: flex; flex-direction: column;
  padding: 28px; min-height: 420px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .25s, transform .25s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 0%), rgba(255,90,31,.10), transparent 40%);
  opacity: 0; transition: opacity .3s;
}
.card:hover { border-color: #3d3d36; transform: translateY(-4px); }
.card:hover::before { opacity: 1; }

.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.card-num { color: var(--muted); }
.badge { padding: 6px 10px; border-radius: 999px; border: 1px solid currentColor; font-size: 10.5px; }
.badge.oss { color: var(--oss); }
.badge.com { color: var(--com); }

.card-name { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 3vw, 40px); line-height: 1; letter-spacing: -.035em; }
.card-tagline { margin-top: 10px; color: var(--accent); font-weight: 500; }
.card-desc { margin-top: 18px; color: var(--muted); font-size: 15.5px; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.chips li { font-family: var(--mono); font-size: 11.5px; padding: 5px 9px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); color: #c9c5b9; }

.card-foot { margin-top: auto; padding-top: 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-meta { color: var(--muted); }
.card-links { display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 14px var(--body); padding: 11px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg); transition: background .2s, transform .2s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--accent); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--text); background: transparent; }

.card.placeholder {
  background: transparent; border-style: dashed; align-items: flex-start; justify-content: flex-end;
}
.card.placeholder:hover { transform: none; }
.card.placeholder .card-name { color: var(--line); -webkit-text-stroke: 1px #3d3d36; color: transparent; }
.card.placeholder p { color: var(--muted); margin-top: 14px; font-size: 15px; }

.empty { color: var(--muted); padding: 40px 0; }


/* ===== 03 install ===== */
.install { justify-content: flex-start; }
.install-for { color: var(--muted); padding: 9px 14px; }
.install-for b { color: var(--text); font-weight: 500; }

.install-panel { min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); overflow: hidden; }
.install-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.install-tab {
  display: flex; align-items: center; gap: 14px; text-align: left;
  font: 600 clamp(15px, 1.5vw, 19px) var(--display); letter-spacing: -.02em;
  color: var(--muted); background: transparent; border: 0; cursor: pointer;
  padding: 22px 28px; position: relative; transition: color .2s, background .2s;
}
.install-tab + .install-tab { border-left: 1px solid var(--line); }
.install-tab .mono { color: inherit; opacity: .7; }
.install-tab:hover { color: var(--text); }
.install-tab.is-active { color: var(--text); background: var(--bg); }
.install-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.install-tab.is-active .mono { color: var(--accent); opacity: 1; }

.install-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); background: var(--bg); }
.steps { min-width: 0; list-style: none; padding: 12px 28px 28px; counter-reset: s; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 20px 0; border-bottom: 1px dashed var(--line); }
.step:last-child { border-bottom: 0; }
.step-n { color: var(--accent); padding-top: 4px; }
.step h4 { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.step-body { min-width: 0; }
.step p { color: var(--muted); font-size: 15px; margin-top: 6px; }
.step .code { margin-top: 12px; }

.install-side { min-width: 0; border-left: 1px solid var(--line); padding: 28px; display: flex; flex-direction: column; gap: 22px; background: var(--bg-2); }
.side-title { color: var(--muted); margin-bottom: 10px; }
.side-box p { color: var(--muted); font-size: 14.5px; }

.code { position: relative; background: #0a0a09; border: 1px solid var(--line); border-radius: 12px; }
.code pre {
  font-family: var(--mono); font-size: 13px; line-height: 1.65; color: #e6e2d6;
  padding: 14px 16px; padding-right: 110px; overflow-x: auto; white-space: pre;
}
.code-shell pre { padding-left: 34px; }
.code-shell pre::before { content: "$"; position: absolute; left: 16px; color: var(--accent); }
.code-yaml pre { color: var(--oss); padding-right: 16px; padding-top: 44px; }
.code-url pre { color: var(--com); }
.code-path pre { color: #c9c5b9; }
.copy {
  position: absolute; top: 8px; right: 8px;
  font-size: 10.5px; padding: 6px 9px; border-radius: 7px; cursor: pointer;
  color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); transition: all .2s;
}
.copy:hover { color: var(--text); border-color: #3d3d36; }
.copy.ok { color: var(--oss); border-color: var(--oss); }

.card-links { flex-wrap: wrap; justify-content: flex-end; }

/* ===== 04 principles ===== */
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 56px; border-top: 1px solid var(--line); }
.rule { padding: 32px 32px 0 0; border-right: 1px solid var(--line); }
.rule + .rule { padding-left: 32px; }
.rule:last-child { border-right: 0; }
.rule-n { color: var(--accent); }
.rule h4 { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -.02em; line-height: 1.15; margin: 18px 0 12px; }
.rule p { color: var(--muted); font-size: 15.5px; }

/* ===== 05 contact ===== */
.contact { border-bottom: 0; }
.contact-title { max-width: 16ch; font-size: clamp(36px, 6.4vw, 96px); }
.contact-links { margin-top: 56px; }
.big-link {
  display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 24px;
  padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: padding .3s, color .3s;
}
.big-link .mono { color: var(--muted); }
.big-link b { font-family: var(--display); font-weight: 400; font-size: clamp(20px, 3vw, 40px); letter-spacing: -.03em; }
.big-link i { font-style: normal; font-size: 32px; transition: transform .3s; }
.big-link:hover { color: var(--accent); padding-left: 16px; }
.big-link:hover i { transform: translate(6px, -6px); }

.footer { position: absolute; bottom: 32px; left: var(--pad); right: var(--pad); display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }

/* ===== появление ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== мобильные ===== */
@media (max-width: 860px) {
  .nav { display: none; }
  .rules { grid-template-columns: 1fr; }
  .rule, .rule + .rule { padding: 28px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .big-link { grid-template-columns: 1fr auto; }
  .big-link .mono { display: none; }
  .footer { flex-direction: column; gap: 6px; }
  .install-tabs { grid-template-columns: 1fr; }
  .install-tab + .install-tab { border-left: 0; border-top: 1px solid var(--line); }
  .install-body { grid-template-columns: minmax(0, 1fr); }
  .install-side { border-left: 0; border-top: 1px solid var(--line); padding: 22px 18px; }
  .steps { padding: 4px 18px 18px; }
  .step { grid-template-columns: 32px 1fr; }
  .card-foot { flex-wrap: wrap; }
  .code { display: flex; flex-direction: column; }
  .code pre, .code-yaml pre { padding-right: 16px; padding-top: 14px; }
  .copy { position: static; align-self: flex-end; margin: 0 8px 8px; }
  .slide { padding-top: 96px; }
}
