/*
 * Стили визитки ironline.su. Оформление — по мотивам интерфейса Кузьмы (reference/theme.css):
 * тёмный фон, бирюза, рамки с уголками, подпись на рамке, ползущая полоска.
 * В отличие от Кузьмы: страница прокручивается, тексты обычным читаемым шрифтом без капса,
 * моноширинный — только для мелких HUD-подписей. Mobile-first: без прокрутки вбок на 390 px.
 */

:root {
    --c: #00f2ff;
    --c-dim: rgba(0, 242, 255, 0.55);
    --line: rgba(0, 242, 255, 0.15);
    --frame: rgba(0, 242, 255, 0.3);
    --bg: #010a0f;
    --panel: rgba(0, 242, 255, 0.03);
    --text: #d7f4f6;
    --muted: #8fb3b8;
    --mono: Consolas, 'SFMono-Regular', Menlo, monospace;
    --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    /* Фон как в ConnectorBotFusion (webApp.php): свечение сверху и едва заметная квадратная сетка 32 px, фон не едет при
       прокрутке; горизонтальные полосы через 48 px Виктору не понравились (13.10.2026) */
    background-image:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 242, 255, 0.10), transparent 70%),
        linear-gradient(rgba(0, 242, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.035) 1px, transparent 1px);
    background-size: 100% 100%, 32px 32px, 32px 32px;
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--c); text-decoration: none; overflow-wrap: anywhere; }
a:hover, a:focus-visible { text-decoration: underline; text-shadow: 0 0 8px var(--c); }
a:focus-visible { outline: 1px solid var(--c); outline-offset: 2px; }

h1, h2, h3 { color: #fff; line-height: 1.25; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: clamp(28px, 7vw, 48px); }
h2 { font-size: clamp(22px, 5vw, 30px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.2em; }
li { margin-bottom: 0.35em; }
li::marker { color: var(--c); }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Мелкие HUD-подписи — единственное место для моноширинного шрифта */
.hud {
    font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--c-dim);
}

/* ===== Рамка с уголками, как .module-frame у Кузьмы ===== */
.frame {
    position: relative;
    border: 1px solid var(--frame);
    background-color: var(--panel);
    padding: 28px 18px 20px;
    min-width: 0;
}
.frame::before, .frame::after {
    content: ''; position: absolute; width: 15px; height: 15px; border: 2px solid var(--c);
}
.frame::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.frame::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.frame-title {
    position: absolute; top: -10px; left: 24px;
    background: var(--bg); padding: 0 10px;
    font-family: var(--mono); font-size: 11px; letter-spacing: 3px; color: #fff;
    line-height: 20px;
}

/* ===== Шапка ===== */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.logo { font-family: var(--mono); letter-spacing: 2px; color: #fff; white-space: nowrap; }
.logo b { color: var(--c); font-weight: normal; }
.nav { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; font-size: 15px; }
@media (max-width: 520px) { .nav { display: none; } }

/* ===== Первый экран ===== */
.hero { padding: 40px 0 32px; }
.hero .frame {
    display: grid; gap: 24px; align-items: center;
    padding: 36px 20px 28px;
    /* Ползущая полоска, как у Кузьмы — одна дешёвая анимация background-position */
    background-image: linear-gradient(rgba(0, 242, 255, 0.08), rgba(0, 242, 255, 0.08));
    background-size: 100% 1px; background-repeat: no-repeat;
    animation: scan 8s linear infinite;
}
@keyframes scan { from { background-position: 0 0; } to { background-position: 0 100%; } }
.hero h1 span { color: var(--c); }
.lead { font-size: clamp(17px, 2.6vw, 20px); color: var(--text); max-width: 34em; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.tags li {
    margin: 0; padding: 4px 10px; border: 1px solid var(--frame); font-size: 14px; color: var(--c);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
    display: inline-block; padding: 10px 18px; border: 1px solid var(--c); color: var(--c);
    background: rgba(0, 242, 255, 0.06); font-size: 16px;
}
.btn:hover, .btn:focus-visible { background: rgba(0, 242, 255, 0.15); text-decoration: none; box-shadow: 0 0 12px rgba(0, 242, 255, 0.35); }
.btn-ghost { border-color: var(--frame); color: var(--text); background: transparent; }

/* Ядро первого экрана: без JS (и при prefers-reduced-motion) — статичный SVG в .core; с JS assets/core.js кладёт
   холст .hero-fx на всю рамку под текст и рисует ядро на месте .core, волну — через рамку (#756) */
.core { justify-self: center; width: min(220px, 60vw); aspect-ratio: 1; }
.core svg { display: block; width: 100%; height: 100%; }
.core.live svg { visibility: hidden; }
.hero .frame > div { position: relative; z-index: 1; }
.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

@media (min-width: 760px) {
    .hero { padding: 64px 0 48px; }
    .hero .frame { grid-template-columns: 1fr 240px; padding: 48px 40px 40px; }
    .core { width: 240px; }
}

/* Ядро видно всегда (#765): когда ядро первого экрана уходит вверх, assets/core.js выдвигает сверху закреплённую полосу
   с тем же ядром справа и волной; проекты прокручиваются под ней. Фон плотный — текст под полосой не просвечивает */
.core-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 10;
    padding: 14px 0 10px;
    background: rgba(1, 10, 15, 0.96);
    border-bottom: 1px solid var(--line);
    transform: translateY(-110%); opacity: 0; visibility: hidden;
    transition: transform 0.35s ease, opacity 0.35s ease, visibility 0s linear 0.35s;
}
.core-bar.on { transform: none; opacity: 1; visibility: visible; transition: transform 0.35s ease, opacity 0.35s ease; }
.core-bar .frame { height: 96px; padding: 0; background-color: transparent; }
.core-bar-fx { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ===== Разделы ===== */
/* Переход по меню — заголовок раздела не прячется под полосой с ядром */
.section { padding: 32px 0; scroll-margin-top: 110px; }
@media (min-width: 760px) {
    .core-bar .frame { height: 128px; }
    .section { scroll-margin-top: 140px; }
}
.section > .wrap > .hud { display: block; margin-bottom: 6px; }
.section-intro { color: var(--muted); max-width: 40em; }

.grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.project { display: flex; flex-direction: column; }
.project p { color: var(--text); }
.project .links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.muted { color: var(--muted); }

/* Места под снимки Кузьмы в режиме ДЕМО */
.shots { display: grid; gap: 12px; margin: 4px 0 16px; }
@media (min-width: 520px) { .shots { grid-template-columns: 1fr 1fr; } }
.shot { margin: 0; border: 1px solid var(--frame); }
.shot a { display: block; }
.shot img { display: block; width: 100%; height: auto; }

.services li { margin-bottom: 0.6em; }

/* ===== Контакты ===== */
.contacts dl { display: grid; gap: 4px 20px; margin: 0; }
.contacts dt { color: var(--muted); font-size: 15px; }
.contacts dd { margin: 0 0 10px; overflow-wrap: anywhere; }
@media (min-width: 620px) {
    .contacts dl { grid-template-columns: 200px 1fr; }
    .contacts dd { margin: 0; }
}
@media (min-width: 760px) {
    .contacts .grid-2 { grid-template-columns: 1fr 1.2fr; }
    .contacts dl { grid-template-columns: 120px 1fr; }
}

/* Форма заявки (#758): шрифт полей 16 px — иначе iPhone приближает страницу при вводе */
.lead-form { display: grid; gap: 14px; }
.lead-form p { margin: 0; }
.lead-form label { display: grid; gap: 4px; color: var(--muted); font-size: 15px; }
.lead-form input, .lead-form textarea {
    width: 100%; padding: 9px 10px; border: 1px solid var(--frame); border-radius: 0;
    background: rgba(1, 10, 15, 0.8); color: var(--text); font: 16px/1.4 var(--sans);
}
.lead-form textarea { resize: vertical; min-height: 120px; }
.lead-form input:focus, .lead-form textarea:focus { outline: none; border-color: var(--c); box-shadow: 0 0 8px rgba(0, 242, 255, 0.3); }
.lead-form .consent { display: flex; gap: 10px; align-items: flex-start; }
.lead-form .consent input { width: auto; margin: 4px 0 0; accent-color: var(--c); }
.lead-form .btn { justify-self: start; cursor: pointer; font-family: var(--sans); }
/* Ловушка для ботов: людям не видна, в порядок Tab не входит */
.lead-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Окна после отправки заявки (#819): видны по :target (/#lead-sent, /#lead-error-<код>), без JS.
   .closed ставит assets/lead.js — после замены адреса без метки :target сам не сбрасывается */
.lead-modal {
    display: none; position: fixed; inset: 0; z-index: 20;
    align-items: center; justify-content: center;
    padding: 24px 16px; overflow-y: auto;
}
.lead-modal:target:not(.closed) { display: flex; }
body:has(.lead-modal:target:not(.closed)) { overflow: hidden; }
.lead-modal-bg { position: fixed; inset: 0; background: rgba(1, 10, 15, 0.85); }
.lead-modal-bg:hover, .lead-modal-bg:focus-visible { text-shadow: none; }
.lead-modal .frame {
    width: 100%; max-width: 480px; margin: auto;
    background-color: var(--bg); box-shadow: 0 0 32px rgba(0, 242, 255, 0.15);
    padding: 32px 20px 22px;
}
.lead-modal h2 { padding-right: 28px; }
.lead-modal-x {
    position: absolute; top: 8px; right: 8px; width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 26px; line-height: 1;
}
.lead-modal-x:hover, .lead-modal-x:focus-visible { color: var(--c); text-decoration: none; }

.foot { border-top: 1px solid var(--line); padding: 20px 0 28px; margin-top: 24px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero .frame { animation: none; }
}

/* ===== Полоса фактов под первым экраном и «Как я работаю» (15.10.2026) ===== */
.facts { padding: 8px 0 0; }
.facts-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.facts-list li { margin: 0; padding: 12px 16px; border-left: 2px solid var(--c); background: var(--panel); color: var(--muted); font-size: 15px; line-height: 1.45; }
.facts-list b { display: block; color: var(--c); font-size: 22px; font-weight: 600; line-height: 1.3; }
@media (min-width: 620px) { .facts-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .facts-list { grid-template-columns: repeat(4, 1fr); } }
.approach .frame h3 { margin-top: 0; }
.approach .frame p:last-child { margin-bottom: 0; }

/* ===== Частые вопросы и подпись про Кузьму у контактов (15.10.2026) ===== */
.faq { display: grid; gap: 14px; }
.faq .frame { padding: 0; }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; position: relative; padding-right: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--c); font: 22px var(--mono); }
.faq details[open] summary::after { content: "−"; }
.faq summary:focus-visible { outline: 1px solid var(--c); outline-offset: 2px; }
.faq details p { margin: 0; padding: 0 20px 16px; color: var(--muted); }
.kuzma-note { margin: 18px 0 0; font-size: 15px; }

/* ===== Заставка при открытии (#835): терминал → код → «вёрстка» первого экрана → вся страница =====
   .intro на <html> ставит скрипт в <head>, дальше стадии ведёт assets/intro.js: .intro-run (терминал, блоки .ib скрыты),
   .intro-wire (терминал ушёл, блоки встают по очереди пунктирными рамками), .intro-fill (в рамки приходит текст),
   .intro-done (остальная страница). Анимируются только opacity, transform и цвета — дёшево для слабых телефонов */
/* Пока intro.js не запустился, страница скрыта; не загрузился вовсе — через 6 с её покажет эта же анимация */
html.intro:not(.intro-run) :is(.top, main, .foot) { opacity: 0; animation: intro-safe 0s linear 6s forwards; }
@keyframes intro-safe { to { opacity: 1; } }

html.intro-run .ib {
    opacity: 0; transform: translateY(8px);
    outline: 1px dashed transparent; outline-offset: 3px;
    transition: opacity 0.35s ease, transform 0.35s ease, outline-color 0.35s ease;
    transition-delay: calc(var(--i) * 55ms);
}
html.intro-wire .ib { opacity: 1; transform: none; outline-color: rgba(0, 242, 255, 0.5); }
/* До .intro-fill блоки — пустые рамки: текст прозрачный */
html.intro-run:not(.intro-fill) :is(.ib, .ib *) { color: transparent; text-shadow: none; }
/* Последние блоки ещё встают, когда приходит текст: их opacity/transform остаются в списке, иначе переход оборвётся */
html.intro-fill :is(.ib, .ib *) {
    transition: opacity 0.35s ease calc(var(--i) * 55ms), transform 0.35s ease calc(var(--i) * 55ms),
        color 0.4s ease calc(var(--i) * 30ms), outline-color 0.4s ease calc(var(--i) * 30ms);
}
html.intro-fill .ib { outline-color: transparent; }
html.intro-run :is(main > section:not(.hero):not(.facts), .foot) { opacity: 0; transition: opacity 0.5s ease; }
html.intro-done :is(main > section:not(.hero):not(.facts), .foot) { opacity: 1; }

.intro-term { display: none; }
html.intro-run .intro-term {
    position: fixed; inset: 0; z-index: 30;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    background: var(--bg) radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 242, 255, 0.10), transparent 70%);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
html.intro-wire .intro-term { opacity: 0; transform: translateY(-24px); pointer-events: none; }
.intro-term .frame { width: 100%; max-width: 620px; padding: 30px 18px 20px; background-color: var(--bg); }
.intro-code {
    margin: 0; min-height: 11.2em; /* 7 строк — рамка не растёт при печати */
    font: 13px/1.6 var(--mono); color: var(--text);
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.intro-cursor {
    display: inline-block; width: 0.6em; height: 1.15em; vertical-align: -0.2em; margin-left: 1px;
    background: var(--c); box-shadow: 0 0 8px var(--c);
    animation: intro-blink 1s steps(1) infinite;
}
@keyframes intro-blink { 50% { opacity: 0; } }
.intro-skip {
    position: absolute; right: 16px; bottom: 16px;
    padding: 6px 12px; border: 1px solid var(--frame); background: transparent; color: var(--muted);
    font: 14px var(--sans); cursor: pointer;
}
.intro-skip:hover { color: var(--c); border-color: var(--c); }
@media (min-width: 760px) { .intro-code { font-size: 15px; } }

/* ===== Свежие работы (#1012): раздел пишет Кузьма, раз в неделю после одобрения Виктора ===== */
.feed { display: grid; gap: 24px; margin-top: 18px; }
.feed-head { display: flex; align-items: flex-end; gap: 16px; }
.feed-head .section-intro { margin: 0; }
.feed-pet { flex: none; width: 68px; }
.feed-pet img { display: block; width: 68px; height: auto; }
.feed-week > .hud { display: block; margin-bottom: 14px; }
.feed-cases { gap: 24px; }
.feed-cases h3 { margin: 0 0 8px; font-size: 18px; }
.feed-cases p { margin: 0; color: var(--text); }
@media (min-width: 760px) {
    .feed-pet, .feed-pet img { width: 88px; }
    .feed-cases { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
