/* ==========================================================================
   V.AFANASIEV.ENG — токены
   Фон: холодный почти-чёрный. Акцент: индустриальный оранжевый (разметка,
   маркировка ремонтных зон). Вторичный акцент: холодный синий — только
   для "сканирующих" элементов (линия, меш, точки).
   ========================================================================== */

:root {
  --bg:            #0A0C0F;
  --bg-raised:     #12151A;
  --bg-card:       #14171D;
  --border:        #22262E;
  --border-hover:  #343A44;

  --text:          #EDEFF2;
  --text-dim:      #9AA2AF;
  --text-faint:    #5B626E;

  --accent:        #FF6A1A;
  --accent-dim:    #C4531A;
  --accent-soft:   rgba(255, 106, 26, 0.12);

  --scan:          #3DA9FC;
  --scan-soft:     rgba(61, 169, 252, 0.16);

  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 3px;
  --radius-md: 6px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1180px;
}

/* ==========================================================================
   RESET
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

h1, h2, h3 { margin: 0; font-family: var(--font-mono); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }

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

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

/* ==========================================================================
   ФОНОВЫЕ ЭФФЕКТЫ — компенсируют отсутствие фото
   ========================================================================== */

.scan-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  height: 100svh;
  background:
    radial-gradient(ellipse 900px 500px at 78% -8%, rgba(255, 106, 26, 0.10), transparent 60%),
    radial-gradient(ellipse 700px 500px at 8% 30%, rgba(61, 169, 252, 0.06), transparent 55%),
    var(--bg);
  overflow: hidden;
}

#scanCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

/* Горизонтальная линия сканера, идущая сверху вниз бесконечно */
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--scan) 20%, var(--scan) 80%, transparent);
  box-shadow: 0 0 14px 1px var(--scan-soft), 0 0 2px var(--scan);
  animation: scanTravel 7s linear infinite;
  opacity: 0.75;
}

@keyframes scanTravel {
  0%   { top: -2%; opacity: 0; }
  8%   { opacity: 0.8; }
  92%  { opacity: 0.8; }
  100% { top: 100%; opacity: 0; }
}

.vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 40%, var(--bg) 96%),
    radial-gradient(ellipse 90% 60% at 50% 0%, transparent 55%, var(--bg) 100%);
  pointer-events: none;
}

/* Тонкая зерновая текстура поверх всего — придаёт материальность без фото */
.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ==========================================================================
   ХЕДЕР
   ========================================================================== */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 56px);
  backdrop-filter: blur(14px);
  background: rgba(10, 12, 15, 0.65);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.topbar.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 12, 15, 0.86);
}

.topbar__mark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.topbar__mark-sub { color: var(--accent); }

.topbar__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px 1px var(--accent-soft);
  flex-shrink: 0;
}

.topbar__nav {
  display: flex;
  gap: clamp(16px, 2.4vw, 34px);
  font-size: 13.5px;
  color: var(--text-dim);
}

.topbar__nav a {
  position: relative;
  padding: 4px 0;
  transition: color 0.2s var(--ease);
}

.topbar__nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}

.topbar__nav a:hover { color: var(--text); }
.topbar__nav a:hover::after { width: 100%; }

.topbar__cta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
  white-space: nowrap;
}

.topbar__cta:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

@media (max-width: 860px) {
  .topbar__nav { display: none; }
}

@media (max-width: 560px) {
  .topbar__cta span,
  .topbar__cta { font-size: 0; gap: 0; padding: 9px; }
  .topbar__cta svg { width: 17px; height: 17px; }
}

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px clamp(20px, 4vw, 56px) 80px;
  max-width: var(--container);
  margin: 0 auto;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 28px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3ED598;
  box-shadow: 0 0 0 0 rgba(62, 213, 152, 0.6);
  animation: pulse 2.2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(62, 213, 152, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(62, 213, 152, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 213, 152, 0); }
}

.hero__name {
  font-size: clamp(46px, 8vw, 88px);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}

.hero__role {
  font-family: var(--font-mono);
  font-size: clamp(16px, 2.1vw, 21px);
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 26px;
}

.hero__role-accent { color: var(--accent); }

.hero__pitch {
  max-width: 46ch;
  font-size: 16.5px;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 40px;
}

.hero__pitch strong { color: var(--text); font-weight: 600; }

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---- Кнопки ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.btn svg { transition: transform 0.2s var(--ease); }

.btn--primary {
  background: var(--accent);
  color: #14100C;
  box-shadow: 0 0 0 0 rgba(255, 106, 26, 0);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px rgba(255, 106, 26, 0.55);
}

.btn--primary:hover svg { transform: translateX(3px); }

.btn--ghost {
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--border-hover);
  background: var(--bg-raised);
  transform: translateY(-2px);
}

/* ---- Технический readout справа ---- */

.readout {
  background: linear-gradient(165deg, var(--bg-card), var(--bg-raised));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 22px 8px;
  position: relative;
  overflow: hidden;
}

.readout::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

.readout__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}

.readout__ok {
  color: #3ED598;
  font-weight: 700;
}

.readout__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}

.readout__row:last-of-type { border-bottom: none; }

.readout__label {
  font-size: 12.5px;
  color: var(--text-dim);
}

.readout__value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.readout__value small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  margin-left: 2px;
}

.readout__mesh {
  margin: 12px -6px 0;
  height: 90px;
  opacity: 0.9;
}

.mesh-line {
  stroke: var(--scan);
  stroke-width: 1;
  opacity: 0.35;
}

.mesh-line--2 { stroke: var(--accent); opacity: 0.22; }

.mesh-node {
  fill: var(--scan);
  animation: nodeBlink 3.4s ease-in-out infinite;
}

.mesh-node:nth-child(4) { animation-delay: 0.6s; }
.mesh-node:nth-child(5) { animation-delay: 1.2s; }
.mesh-node:nth-child(6) { animation-delay: 1.8s; }

@keyframes nodeBlink {
  0%, 100% { opacity: 0.4; r: 2.4; }
  50%      { opacity: 1;   r: 3.2; }
}

@media (max-width: 900px) {
  .hero__readout { max-width: 420px; }
}

.hero__scrollcue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
}

.scrollcue__line {
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, var(--text-faint), transparent);
  position: relative;
  overflow: hidden;
}

.scrollcue__line::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--accent));
  animation: cueDrop 1.8s ease-in-out infinite;
}

@keyframes cueDrop {
  0%   { top: -100%; }
  100% { top: 100%; }
}

@media (max-width: 700px) {
  .hero__scrollcue { display: none; }
}

/* ==========================================================================
   СЕКЦИИ — общее
   ========================================================================== */

.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 100px clamp(20px, 4vw, 56px);
  position: relative;
}

.section__head { margin-bottom: 52px; }

.section__eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 14px;
}

.section__title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* ==========================================================================
   О СПЕЦИАЛИСТЕ
   ========================================================================== */

.about__lead {
  font-size: clamp(19px, 2.4vw, 25px);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 62ch;
  margin-bottom: 56px;
  font-weight: 400;
}

.about__lead strong {
  color: var(--accent);
  font-weight: 700;
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.about__card {
  background: var(--bg-card);
  padding: 30px 26px;
  transition: background 0.25s var(--ease);
}

.about__card:hover { background: var(--bg-raised); }

.about__card-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  margin-bottom: 18px;
}

.about__card h3 {
  font-size: 16.5px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.about__card p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ==========================================================================
   НАВЫКИ — чипсы
   ========================================================================== */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 11px 18px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--bg-card);
  position: relative;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
  cursor: default;
}

.chip:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-3px);
}

/* ==========================================================================
   УСЛУГИ
   ========================================================================== */

.service-list {
  display: flex;
  flex-direction: column;
}

.service {
  display: grid;
  grid-template-columns: 70px 60px 1fr;
  align-items: start;
  gap: 24px;
  padding: 36px 0;
  border-top: 1px solid var(--border);
  transition: padding-left 0.3s var(--ease);
}

.service:last-child { border-bottom: 1px solid var(--border); }

.service:hover { padding-left: 10px; }

.service__index {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-faint);
  padding-top: 8px;
  transition: color 0.3s var(--ease);
}

.service:hover .service__index { color: var(--accent); }

.service__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}

.service__icon svg { width: 26px; height: 26px; }

.icon-accent { stroke: var(--accent); }

.service:hover .service__icon {
  border-color: var(--accent);
  color: var(--text);
  transform: rotate(-4deg) scale(1.05);
}

.service__text h3 {
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.service__text p {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 58ch;
}

@media (max-width: 640px) {
  .service {
    grid-template-columns: 44px 1fr;
    gap: 16px;
  }
  .service__index { display: none; }
}

/* ==========================================================================
   КОНТАКТЫ
   ========================================================================== */

.contacts__sub {
  margin-top: 14px;
  font-size: 15.5px;
  color: var(--text-dim);
  max-width: 50ch;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 640px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s var(--ease);
}

.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.contact-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  background: var(--bg-raised);
}

.contact-card:hover::before { opacity: 1; }

.contact-card__icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
  position: relative;
  z-index: 1;
}

.contact-card:hover .contact-card__icon {
  border-color: var(--accent);
  color: var(--accent);
}

.contact-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.contact-card__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.contact-card__value {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-card__value--small { font-size: 14px; }

.contact-card__hint {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  position: relative;
  z-index: 1;
  white-space: nowrap;
  padding-left: 8px;
}

.contact-card:hover .contact-card__hint {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 900px) {
  .contact-card__hint { display: none; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 56px) 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   ТОСТ (уведомление "скопировано")
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  background: var(--bg-raised);
  border: 1px solid var(--accent);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px -8px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,106,26,0.15);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  display: flex;
  align-items: center;
  gap: 9px;
}

.toast::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   SCROLL REVEAL — появление элементов при скролле

   ВАЖНО: контент не должен зависеть от того, что JS успешно отработает.
   По умолчанию .reveal ВИДЕН (opacity: 1). Класс .js-ready (его сразу же
   вешает script.js на <html> при старте) переключает на анимационный
   режим — прячет элементы, чтобы IntersectionObserver мог их показать.
   Если JS не запустился (заблокирован, ошибка, file://, медленная сеть) —
   .js-ready не появится, и весь контент останется видимым как обычная
   статичная страница, без анимации, но полностью читаемой.
   ========================================================================== */

.reveal {
  opacity: 1;
  transform: none;
}

html.js-ready .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--delay, 0ms);
}

html.js-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   МЕЛКИЕ УТИЛИТЫ
   ========================================================================== */

@media (max-width: 560px) {
  .br-mobile-hide { display: none; }
}
