/* components.css — компоненты в стиле nolejje:
   .header (sticky grid 1fr auto 1fr, blur), .header-nav-a c красным подчёркиванием,
   .accent-button/.secondary-button (JBM 28px), .feature-card (30px, gradient surf),
   .stat-card, .term, .tunnels, .line-ticker. */

@layer components {
  /* ===== Header — как nolejje ===== */
  .header {
    position: sticky; top: 0; z-index: 100;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    padding: 24px 40px;
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    background: rgba(14, 14, 14, 0.78);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .header-left, .header-center, .header-right { display: flex; align-items: center; }
  .header-center { justify-content: center; }
  .header-right { justify-content: flex-end; }

  .logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
  .logo img { height: 34px; width: 34px; border-radius: 50%; object-fit: cover; }
  .logo b { font-family: var(--font-body); font-weight: 700; font-size: 15px; color: #fff; }

  #header-nav { display: flex; align-items: center; gap: 26px; }
  .header-nav-a {
    position: relative; color: #777; text-decoration: none;
    font-family: var(--font-body); font-size: 15px; font-weight: 500;
    transition: 0.2s;
  }
  .header-nav-a:hover, .header-nav-a.active { color: #fff; }
  .header-nav-a::after {
    content: ""; position: absolute; left: 0; bottom: -6px;
    width: 0%; height: 2px; background: var(--accent); transition: 0.2s;
  }
  .header-nav-a:hover::after, .header-nav-a.active::after { width: 100%; }

  #auth-buttons { display: flex; gap: 12px; }

  /* ===== Кнопки nolejje ===== */
  .header-btn, .accent-button, .secondary-button, .ghost-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    border: 1px solid transparent; border-radius: var(--r-chip);
    font-family: var(--font-body); line-height: 1; cursor: pointer; text-decoration: none;
    transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s;
  }
  .header-btn, .secondary-button, .ghost-button {
    padding: 12px 20px;
    color: #ccc; background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
  }
  .header-btn:hover, .secondary-button:hover, .ghost-button:hover {
    transform: translateY(-1px); background: rgba(255, 255, 255, 0.08); color: #fff;
  }
  .accent-button {
    padding: 16px 28px;
    color: #fff; background: var(--accent);
    box-shadow: 0 0 40px var(--glow-sm);
  }
  .accent-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px var(--glow);
  }
  .accent-btn { background: rgba(255, 51, 85, 0.14); border-color: rgba(255, 51, 85, 0.4); color: #fff; padding: 12px 20px; }
  .accent-btn:hover { transform: translateY(-1px); background: rgba(255, 51, 85, 0.2); }

  /* ===== Стат-карточки (.stat-card как у nolejje) ===== */
  .stat-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 42px; }
  .stat-card {
    min-width: 150px;
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    border: 1px solid var(--border);
    border-radius: var(--r-chip);
    padding: 18px 22px;
    box-shadow: none;
  }
  .stat-card .mono-caps { font-size: 11px; }
  .stat-card b { display: block; margin-top: 8px; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: #fff; }

  /* лейбл-чипы (ui.css .intro-label семейство) */
  .tag-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: var(--r-full);
    background: rgba(255, 51, 85, 0.12);
    border: 1px solid rgba(255, 51, 85, 0.2);
    color: var(--chip-text);
    font-family: var(--font-body); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  }

  /* статус-чипы: зелёный «в бою», янтарный не нужен — nolejje зелёный */
  .chip-status {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: var(--r-full);
    font-family: var(--font-body); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
    color: var(--success); border: 1px solid rgba(145, 231, 181, 0.3); background: rgba(145, 231, 181, 0.08);
  }
  .chip-status.red { color: var(--accent); border-color: var(--border-accent); background: rgba(255, 51, 85, 0.1); }
  .chip-status.offline {
    color: var(--faint); border-color: var(--border); background: rgba(255, 255, 255, 0.03);
  }
  .chip-status.offline .dot::after { display: none; }
  .dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
  .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 1.8s var(--ease-decel) infinite; }

  /* стектех-чипы: JBM, surface .04, hover красный */
  .tech-chip {
    display: inline-flex; align-items: center;
    padding: 9px 15px; border-radius: var(--r-chip);
    font-family: var(--font-body); font-size: 14px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ccc; cursor: default;
    transition: transform .25s var(--spring-fast), background .2s, border-color .2s, color .2s;
  }
  .tech-chip:hover { border-color: rgba(255, 51, 85, 0.5); color: #fff; transform: translateY(-2px); }
  .tech-chip.lead { background: var(--accent); border-color: transparent; color: #fff; }
  .tech-chip.lead:hover { background: #ff4a68; }

  /* ===== HERO — как nolejje (.hero / .hero-title-row) ===== */
  .hero {
    position: relative;
    display: grid; grid-template-columns: 1.15fr .85fr;
    align-items: center; gap: clamp(20px, 4vw, 60px);
    padding: calc(var(--nav-h) + 40px) 0 0;
  }
  .hero-title-row { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
  .red-title {
    display: inline-flex; flex-wrap: wrap; gap: 0 .04em; margin: 0;
    font-family: var(--font-display); font-size: var(--h-display);
    font-weight: 900; line-height: 1; color: #ece0df;
  }
  .red-title .rt-red {
    color: var(--accent);
  }
  .red-title .wipe { display: inline-block; }
  .hero-sub {
    margin-bottom: 22px; color: #aaa;
    font-family: var(--font-body); font-size: 28px; white-space: nowrap;
  }
  .hero-desc { margin-top: 30px; max-width: 640px; font-size: var(--t-body); line-height: 1.9; color: var(--muted); }
  .hero-buttons { display: flex; gap: 16px; margin-top: 42px; flex-wrap: wrap; }

  /* аватар-блоб (наш; репainted под красный) */
  .hero-avatar { position: relative; width: min(320px, 70vw); justify-self: center; }
  .blobwrap { width: 100%; height: auto; overflow: visible; }

  /* спутники-капли вращаются вокруг авы: родитель крутится вокруг центра,
     д-spin ребёнка выравнивает фигуру и двигает её по орбите через left */
  .orbit { position: absolute; top: 50%; left: 50%; width: 0; height: 0; animation: orbitSpin var(--o-dur, 24s) linear infinite; will-change: transform; }
  .orbit.o1 { --orbit-r: 195px; --o-dur: 24s; }
  .orbit.o2 { --orbit-r: 225px; --o-dur: 16s; animation-direction: reverse; }
  .orb-blob {
    position: absolute; top: 0; left: var(--orbit-r, 195px);
    width: 44px; height: 44px; margin-top: -22px; margin-left: -22px;
    animation: blobSpin var(--o-dur, 24s) linear infinite;
  }
  .orbit.o2 .orb-blob { width: 30px; height: 30px; margin-top: -15px; margin-left: -15px; animation-direction: reverse; }
  @keyframes orbitSpin { to { transform: rotate(1turn); } }
  @keyframes blobSpin { to { transform: rotate(-1turn); } }

  /* ===== LINE / тикер — точь-в-точь nolejje ===== */
  .line { width: 100%; overflow: hidden; margin-top: clamp(48px, 8vw, 120px); user-select: none; }
  .line-track { display: flex; width: max-content; animation: tickerMove 22s linear infinite; will-change: transform; }
  .line-track a {
    font-family: var(--font-display); font-size: 50px; font-weight: 900;
    color: #777; margin-right: 60px; white-space: nowrap;
    text-decoration: none; transition: 0.3s;
  }
  .line-track a:hover { color: #fff; transform: scale(1.03); }

  /* ===== Карточки проектов — .feature-card nolejje ===== */
  .features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin-top: 70px; }
  .feature-card {
    position: relative; min-height: 240px; padding: 42px; border-radius: var(--r-card);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border);
    overflow: hidden; transition: 0.25s;
    display: flex; flex-direction: column; gap: 16px;
    text-decoration: none; color: inherit;
  }
  .feature-card:hover { border-color: rgba(255, 51, 85, 0.22); transform: translateY(-3px); }
  /* stretched-link: внешняя ссылка — плёнка поверх карточки, внутренние ссылки (чипы) поверх плёнки;
     вложенные <a> запрещены в HTML — из-за них раньше ломалась раскладка */
  .stretch-link { position: absolute; inset: 0; border-radius: inherit; z-index: 0; outline-offset: -2px; }
  .feature-card > *:not(.stretch-link) { position: relative; z-index: 1; }
  .feature-card:target { border-color: rgba(255, 51, 85, 0.6); box-shadow: 0 0 60px rgba(255, 51, 85, 0.15); }
  .feature-card.wide { grid-column: 1 / -1; }
  .proj-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .proj-name { font-family: var(--font-display); font-size: var(--h-card); font-weight: 700; color: #fff; }
  .proj-desc { margin: 0; max-width: 560px; font-family: var(--font-body); line-height: 1.8; color: var(--muted); font-size: 15.5px; }
  .proj-stack { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
  .proj-stack .tech-chip { font-size: 12px; padding: 6px 12px; border-radius: 10px; }

  /* spotlight (из системы, цвет красный) */
  .feature-card::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    opacity: 0; transition: opacity .25s;
    background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 51, 85, 0.14), transparent 70%);
  }
  .feature-card:hover::after { opacity: 1; }

  /* ===== Инфра ===== */
  .infra-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 28px; margin-top: 70px; }
  .node-card {
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    border: 1px solid var(--border); border-radius: var(--r-chip);
    padding: 24px 26px;
    transition: 0.25s;
  }
  .node-card:hover { border-color: rgba(255, 51, 85, 0.22); }
  .node-card.hot { background: linear-gradient(180deg, rgba(255,51,85,.08), rgba(255,51,85,.02)); border-color: rgba(255,51,85,.25); }
  .node-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .node-name { font-family: var(--font-body); font-weight: 700; font-size: 16px; color: #fff; letter-spacing: .04em; }
  .node-what { margin-top: 10px; font-size: 14px; line-height: 1.8; color: var(--muted); }
  .node-note { margin-top: 14px; font-size: 12.5px; color: var(--faint); }

  .term {
    margin-top: 18px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border); border-radius: var(--r-chip);
    padding: 18px 20px;
    font-family: var(--font-body); font-size: 13.5px; line-height: 1.7;
    overflow: hidden;
  }
  .term-head { display: flex; gap: 8px; margin-bottom: 12px; }
  .term-head i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
  .term-head i:first-child { background: rgba(255, 51, 85, 0.6); }
  .term-body { color: #ddd; white-space: nowrap; }
  .term-caret { display: inline-block; width: 9px; height: 17px; background: var(--accent); vertical-align: text-bottom; margin-left: 2px; animation: caret 1s steps(2) infinite; }

  .tunnels { width: 100%; height: auto; margin-top: 14px; }
  .tunnels text { font: 600 10px var(--font-body); fill: var(--faint); letter-spacing: .1em; }
  .tunnels .lane { stroke: rgba(255, 255, 255, 0.14); stroke-width: 2; fill: none; }
  .tunnels .dash { stroke: var(--accent); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-dasharray: 6 44; animation: dash 2.6s linear infinite; }
  .tunnels .dash.d2 { animation-delay: -1.3s; }
  .tunnels .node-box { fill: rgba(255, 255, 255, 0.05); stroke: var(--border); }

  .ip-copy { cursor: pointer; border-bottom: 1px dashed var(--faint); transition: color .2s; }
  .ip-copy:hover { color: var(--accent); }

  /* ===== Контакт ===== */
  .contact-wrap { margin-top: 70px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

  /* ===== Футер ===== */
  .foot {
    margin-top: clamp(64px, 9vw, 120px);
    padding: 32px var(--pad-x) 56px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
    color: var(--faint); font-size: 12.5px;
  }
  .foot a { color: #aaa; text-decoration: none; }
  .foot a:hover { color: var(--accent); }
  .api-chips { display: flex; gap: 10px; }
  .api-chips a {
    padding: 6px 12px; border-radius: var(--r-full);
    border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04);
    font-size: 12px; transition: 0.2s;
  }
  .api-chips a:hover { border-color: rgba(255, 51, 85, 0.4); color: #fff; }

  /* ===== Мини-терминал easter egg (нативный dialog) ===== */
  dialog.term-dialog {
    margin: auto; width: min(560px, calc(100vw - 32px));
    background: #0f0f13; color: var(--text);
    border: 1px solid var(--border); border-radius: var(--r-card);
    padding: 28px;
    box-shadow: var(--shadow);
  }
  dialog.term-dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
  .term-dialog .term { border: none; background: transparent; margin: 0; padding: 0; }
  .term-dialog p { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
  .term-dialog ul { list-style: none; padding: 0; margin: 0; font-size: 13.5px; line-height: 2.2; }
  .term-dialog a { color: var(--accent); text-decoration: none; }
  .term-dialog a:hover { color: var(--accent-soft); }

  /* ===== Мобайл (размеры как у nolejje) ===== */
  @media (max-width: 1100px) {
    .red-title { font-size: clamp(64px, 14vw, 160px); }
    .hero-sub { font-size: 18px !important; margin-bottom: 18px; }
  }
  @media (max-width: 760px) {
    .header { grid-template-columns: auto 1fr; padding: 14px 16px; }
    .header-center { justify-content: flex-end; }
    .header-right { display: none; }
    #header-nav { gap: 14px; }
    .hero { grid-template-columns: 1fr; }
    .hero-avatar { order: -1; width: min(220px, 56vw); }
    .red-title { font-size: 17vw; }
    .orbit.o1 { --orbit-r: 118px; } .orbit.o1 .orb-blob { width: 32px; height: 32px; margin: -16px; }
    .orbit.o2 { --orbit-r: 140px; } .orbit.o2 .orb-blob { width: 22px; height: 22px; margin: -11px; }
    .hero-sub { font-size: 14px !important; white-space: normal; }
    .hero-buttons { gap: 10px; margin-top: 26px; }
    .accent-button, .secondary-button { font-size: 15px; padding: 14px 18px; border-radius: 12px; }
    .line { margin-top: 40px; }
    .line-track a { font-size: 18px; margin-right: 24px; }
    .features-grid, .infra-grid { grid-template-columns: 1fr; gap: 16px; }
    .feature-card { min-height: auto; padding: 26px 22px; border-radius: var(--r-mob); }
    .proj-name { font-size: 21px; }
    .stat-row { gap: 10px; }
    .stat-card { flex: 1 1 30%; min-width: 0; padding: 14px 16px; }
    .stat-card b { font-size: 17px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .line-track, .term-caret, .dot::after { animation: none !important; }
    .orbit, .orb-blob { animation: none !important; }
  }
}
