@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #080808;
  --surface: #0d0d0d;
  --elevated: #111111;
  --line: #202020;
  --text: #e7e7e7;
  --muted: #858585;
  --accent: #e5484d;
  --accent-rgb: 229, 72, 77;
  --accent-glow: rgba(229, 72, 77, 0.35);
  --display: "Manrope", Arial, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  overflow-x: hidden;
  position: relative;
}

/* Фоновая кибер-сетка */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), 
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 80%);
  z-index: -1;
}

/* Рассеянный свет курсора */
.cursor-ambient {
  position: fixed;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.08), transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  filter: blur(50px);
  transition: opacity 0.3s;
}

/* Кастомный скроллбар */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); border-left: 1px solid var(--line); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #ff5f63; }
* { scrollbar-width: thin; scrollbar-color: var(--accent) var(--bg); }

a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }

.noise { 
  position: fixed; 
  inset: 0; 
  opacity: .035; 
  pointer-events: none; 
  z-index: 20; 
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); 
}

.section-shell { width: min(1400px, calc(100% - 80px)); margin: 0 auto; position: relative; z-index: 1; }

/* Шапка сайта */
.site-header {
  position: sticky;
  top: 0;
  z-index: 25;
  height: 76px;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(8,8,8,.82);
  backdrop-filter: blur(20px);
  font: 600 11px/1 var(--mono);
  letter-spacing: .12em;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { 
  display: grid; 
  place-items: center; 
  width: 28px; 
  height: 28px; 
  background: var(--accent); 
  color: white; 
  font-weight: 800; 
  transition: transform .25s, box-shadow .25s; 
  box-shadow: 0 0 12px var(--accent-glow);
}
.brand:hover .brand-mark {
  transform: scale(1.1) rotate(4deg);
  box-shadow: 0 0 20px var(--accent);
}
.site-nav { display: flex; gap: 36px; }
.site-nav a, .site-footer a { color: var(--muted); transition: color .2s, text-shadow .2s; }
.site-nav a:hover, .site-footer a:hover { color: var(--text); text-shadow: 0 0 10px rgba(255,255,255,0.4); }
.status { justify-self: end; color: var(--muted); display: flex; align-items: center; }
.status i { 
  display: inline-block; 
  width: 6px; 
  height: 6px; 
  margin-right: 8px; 
  border-radius: 50%; 
  background: #45c86b; 
  box-shadow: 0 0 10px #45c86b; 
  animation: pulseGreen 2s infinite;
}
@keyframes pulseGreen {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.menu-toggle { display: none; border: 0; background: transparent; cursor: pointer; }

/* Hero */
.hero { 
  min-height: calc(100vh - 76px); 
  padding: 110px 0 90px; 
  position: relative; 
  display: grid; 
  grid-template-columns: 1.2fr .8fr; 
  align-items: center; 
  gap: 7vw; 
}
.eyebrow { margin: 0 0 28px; color: var(--accent); font: 600 11px/1.4 var(--mono); letter-spacing: .14em; }

.hero-actions { display: flex; gap: 14px; }
.hero-links { display: flex; gap: 24px; margin-top: 32px; flex-wrap: wrap; }
.hero-links a { 
  font-family: var(--mono); 
  font-size: 11px; 
  letter-spacing: .08em; 
  color: var(--muted); 
  text-decoration: none; 
  text-transform: uppercase; 
  transition: color .2s, transform .2s; 
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hero-links a:hover { color: var(--accent); transform: translateX(3px); }

/* Кнопки с эффектом скользящего блика */
.button { 
  min-width: 210px; 
  padding: 18px 22px; 
  border: 1px solid var(--line); 
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  font: 600 11px/1 var(--mono); 
  letter-spacing: .09em; 
  transition: all .25s ease; 
  position: relative;
  overflow: hidden;
  background: var(--surface);
}
.button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -80%;
  width: 25%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: rotate(25deg);
  transition: none;
  pointer-events: none;
}
.button:hover::after {
  left: 140%;
  transition: all 0.6s ease-in-out;
}
.button.primary { 
  background: var(--accent); 
  border-color: var(--accent); 
  color: white; 
  box-shadow: 0 4px 20px var(--accent-glow);
}
.button.primary:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.6); 
}
.button.ghost:hover { 
  transform: translateY(-3px);
  border-color: var(--accent); 
  background: rgba(var(--accent-rgb), .08); 
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.15);
}

/* Терминал PROFILE.EXE */
.hero-terminal { 
  background: rgba(13, 13, 13, 0.95); 
  border: 1px solid #292929; 
  box-shadow: 24px 24px 0 rgba(var(--accent-rgb), .05), 0 20px 50px rgba(0,0,0,0.5); 
  transform: rotate(1.5deg); 
  transform-style: preserve-3d;
  transition: border-color .3s, box-shadow .3s, transform 0.15s ease-out;
  backdrop-filter: blur(14px);
}
.hero-terminal:hover {
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 28px 28px 0 rgba(var(--accent-rgb), .08), 0 25px 60px rgba(0,0,0,0.7);
}
.window-bar { 
  height: 42px; 
  padding: 0 15px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  border-bottom: 1px solid var(--line); 
  color: #777; 
  font: 500 10px/1 var(--mono); 
  letter-spacing: .1em; 
  background: rgba(20,20,20,0.7);
}
.terminal-body { padding: 34px; font-family: var(--mono); }
.ascii { display: block; margin-bottom: 26px; color: var(--accent); font-size: 14px; }
.ascii-box { display: inline-flex; flex-direction: column; gap: 4px; border: 1px solid var(--accent); padding: 8px 14px; box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.2); }
.ascii-name { font-family: var(--mono); font-size: 14px; letter-spacing: .18em; color: var(--accent); white-space: nowrap; }
.ascii-bar { display: flex; gap: 0; margin-top: 2px; }
.ascii-fill { display: inline-block; width: 28px; height: 11px; background: var(--accent); }
.ascii-empty { display: inline-block; width: 56px; height: 11px; background: repeating-linear-gradient(90deg, var(--accent) 0px, var(--accent) 1px, transparent 1px, transparent 4px); opacity: .35; }
.terminal-body dl { margin: 0; }
.terminal-body dl div { padding: 10px 0; display: grid; grid-template-columns: 90px 1fr; border-bottom: 1px solid #181818; font-size: 12px; }
.terminal-body dt { color: #555; }
.terminal-body dd { margin: 0; color: #aaa; }
.accent-text { color: var(--accent) !important; font-weight: 700; text-shadow: 0 0 8px var(--accent-glow); }
.terminal-log { margin: 20px 0 0; display: flex; flex-direction: column; gap: 5px; max-height: 90px; overflow-y: auto; }
.terminal-log-line { margin: 0; font: 400 11px/1.5 var(--mono); }
.terminal-log-sent { color: #777; }
.terminal-log-ok  { color: #45c86b; }
.terminal-input-line { margin: 12px 0 0; display: flex; align-items: center; gap: 8px; border-top: 1px dashed #202020; padding-top: 10px; }
.terminal-prompt { color: var(--accent); font: 700 13px/1 var(--mono); flex-shrink: 0; text-shadow: 0 0 8px var(--accent); }
.terminal-input { flex: 1; background: transparent; border: none; outline: none; color: #eee; font: 400 12px/1 var(--mono); letter-spacing: .03em; }
.terminal-input::placeholder { color: #444; }
.cursor { display: inline-block; width: 7px; height: 13px; margin-left: 2px; vertical-align: -2px; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: blink 1s step-end infinite; }
.hero-index { position: absolute; right: 0; bottom: 30px; color: #121212; font: 800 150px/1 var(--mono); z-index: -1; user-select: none; }
@keyframes blink { 50% { opacity: 0; } }

/* Бегущая строка с плавным угасанием по краям */
.ticker { 
  overflow: hidden; 
  border-block: 1px solid var(--line); 
  background: var(--accent); 
  color: white; 
  box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.25);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
}
.ticker div { width: max-content; padding: 13px 0; display: flex; align-items: center; gap: 30px; animation: ticker 28s linear infinite; font: 700 11px/1 var(--mono); letter-spacing: .12em; }
.ticker b { font-size: 7px; opacity: 0.7; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Проекты */
.projects { padding: 130px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 50px; }
.section-heading h2 { margin: 0; font-size: clamp(58px, 7vw, 104px); line-height: .96; letter-spacing: -.065em; font-weight: 700; }
.section-heading h2 span { color: var(--accent); text-shadow: 0 0 20px var(--accent-glow); }

/* Фильтры */
.filters { margin-bottom: 35px; display: flex; gap: 8px; border-bottom: 1px solid var(--line); }
.filter { 
  padding: 16px 20px; 
  border: 0; 
  background: transparent; 
  color: #686868; 
  cursor: pointer; 
  font: 600 11px/1 var(--mono); 
  letter-spacing: .08em; 
  position: relative;
  transition: color .25s ease;
}
.filter::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transition: width .25s ease;
}
.filter sup { margin-left: 4px; font-size: 8px; opacity: .7; }
.filter:hover { color: var(--text); }
.filter.active { color: var(--text); }
.filter.active::after { width: 100%; }

/* Карточки проектов с радиальным Spotlight свечением */
.project-grid { 
  display: grid; 
  grid-template-columns: repeat(3, minmax(0, 1fr)); 
  border-top: 1px solid var(--line); 
  border-left: 1px solid var(--line); 
}
.project-card { 
  min-width: 0; 
  padding: 38px 32px; 
  display: flex; 
  flex-direction: column; 
  align-items: flex-start; 
  border-right: 1px solid var(--line); 
  border-bottom: 1px solid var(--line); 
  background: var(--bg); 
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, background .25s ease, opacity .3s ease;
}

/* Радиальное свечение курсора внутри карточки */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(var(--accent-rgb), 0.12), transparent 50%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}
.project-card:hover::before { opacity: 1; }

/* Скользящий диагональный блик */
.project-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -90%;
  width: 30%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: rotate(25deg);
  transition: none;
  pointer-events: none;
  z-index: 2;
}
.project-card:hover::after {
  left: 140%;
  transition: all 0.75s ease-in-out;
}

.project-card:hover { 
  background: #0d0d0f; 
  transform: translateY(-4px); 
  box-shadow: 0 14px 35px rgba(0,0,0,0.6), 0 0 20px rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.4);
  z-index: 2;
}

.project-top { width: 100%; margin-bottom: 26px; display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 3; }
.project-number { color: #555; font: 600 11px/1 var(--mono); letter-spacing: .1em; }
.project-tag { 
  padding: 5px 10px; 
  border: 1px solid #262626; 
  background: rgba(255,255,255,0.02);
  color: var(--accent); 
  font: 600 9px/1 var(--mono); 
  letter-spacing: .1em; 
  transition: border-color .25s, box-shadow .25s;
}
.project-card:hover .project-tag {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.25);
}
.project-card h3 { 
  margin: 0 0 12px; 
  font-size: clamp(20px, 1.6vw, 25px); 
  line-height: 1.15; 
  letter-spacing: -.03em; 
  position: relative; 
  z-index: 3; 
}
.project-card p { 
  margin: 0 0 24px; 
  color: #909090; 
  font-size: 13px; 
  line-height: 1.6; 
  position: relative; 
  z-index: 3; 
}
.tags { 
  margin: 0 0 28px; 
  padding: 0; 
  display: flex; 
  flex-wrap: wrap; 
  gap: 6px; 
  list-style: none; 
  position: relative; 
  z-index: 3; 
}
.tags li { 
  padding: 7px 10px; 
  border: 1px solid #262626; 
  background: rgba(255,255,255,0.02);
  color: #888; 
  font: 500 8px/1 var(--mono); 
  letter-spacing: .08em; 
  transition: all .2s;
}
.project-card:hover .tags li {
  border-color: #333;
  color: #bbb;
}
.text-link { 
  margin-top: auto; 
  border-bottom: 1px solid #333; 
  padding-bottom: 7px; 
  font: 600 10px/1 var(--mono); 
  letter-spacing: .08em; 
  position: relative; 
  z-index: 3; 
  transition: border-color .2s, color .2s;
}
.text-link span { color: var(--accent); transition: transform .2s; display: inline-block; }
.text-link:hover { border-color: var(--accent); color: #fff; }
.text-link:hover span { transform: translate(3px, -3px); }

/* Футер */
.site-footer { 
  min-height: 88px; 
  padding: 0 40px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  border-top: 1px solid var(--line); 
  color: #666; 
  font: 500 10px/1 var(--mono); 
  letter-spacing: .1em; 
  background: rgba(8,8,8,0.9);
  backdrop-filter: blur(12px);
}
.site-footer a:hover { color: var(--accent); }

/* Scroll Reveal */
.reveal { 
  opacity: 0; 
  transform: translateY(30px); 
  transition: opacity .75s cubic-bezier(0.16, 1, 0.3, 1), transform .75s cubic-bezier(0.16, 1, 0.3, 1); 
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Адаптив под разные экраны */
@media (max-width: 1050px) {
  .section-shell { width: min(100% - 44px, 900px); }
  .hero { grid-template-columns: 1fr; padding-top: 90px; }
  .hero-terminal { width: min(550px, 95%); justify-self: start; transform: none; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .site-header { height: 64px; padding: 0 20px; grid-template-columns: 1fr auto; }
  .status { display: none; }
  .menu-toggle { display: block; justify-self: end; font: 600 10px var(--mono); }
  .site-nav { 
    position: absolute; 
    top: 64px; 
    left: 0; 
    right: 0; 
    padding: 25px 20px; 
    display: none; 
    flex-direction: column; 
    gap: 20px; 
    border-bottom: 1px solid var(--line); 
    background: #090909; 
  }
  .site-nav.open { display: flex; }
  .section-shell { width: calc(100% - 32px); }
  .hero { padding: 75px 0; gap: 50px; }
  .hero-actions { flex-direction: column; }
  .button { min-width: 0; }
  .hero-terminal { width: 100%; transform: none; }
  .terminal-body { padding: 22px; }
  .hero-index { display: none; }
  .projects { padding-block: 85px; }
  .section-heading { display: block; margin-bottom: 35px; }
  .filters { overflow-x: auto; }
  .filter { flex: 0 0 auto; padding-inline: 14px; }
  .project-grid { grid-template-columns: 1fr; }
  .site-footer { padding: 25px 20px; }
}
