/* ============================================================
   ЭФИРНЕТ — сеть приложения ЭФИР.

   Оформление: тёмная основа, неоновые градиенты, расходящиеся
   радиоволны. Всё движение сделано средствами CSS — ни строчки
   скриптов на сайте по-прежнему нет, а значит нечему тормозить
   и нечего исполнять в браузере читателя.

   Любая анимация выключается при prefers-reduced-motion: эффекты
   здесь украшают, но ни один из них ничего не сообщает, поэтому
   без них страница не теряет смысла.
   ============================================================ */

:root {
    --void: #070B18;
    --deep: #0B1124;
    --panel: rgba(255, 255, 255, 0.045);
    --panel-strong: rgba(255, 255, 255, 0.08);
    --edge: rgba(255, 255, 255, 0.10);

    --cyan: #22D3EE;
    --violet: #8B5CF6;
    --magenta: #F0359C;
    --amber: #FBBF24;

    --text: #E9EEFB;
    --muted: #8C99B8;

    --sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: "SFMono-Regular", "JetBrains Mono", Consolas, monospace;

    --grad: linear-gradient(115deg, var(--cyan), var(--violet) 48%, var(--magenta));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--void);
    color: var(--text);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Две мягкие ауры на фоне: дают глубину, не мешая тексту. */
body::before {
    content: "";
    position: fixed;
    inset: -30vmax 0 auto -20vmax;
    width: 70vmax;
    height: 70vmax;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.20), transparent 62%);
    filter: blur(30px);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    right: -25vmax;
    top: 30vh;
    width: 66vmax;
    height: 66vmax;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.16), transparent 62%);
    filter: blur(30px);
    pointer-events: none;
    z-index: 0;
}

main, header, footer { position: relative; z-index: 1; }

a { color: var(--cyan); text-decoration: none; transition: color 180ms ease; }
a:hover { color: var(--magenta); }

code { font-family: var(--mono); font-size: 0.9em; color: var(--amber); }
.muted { color: var(--muted); }

::selection { background: rgba(139, 92, 246, 0.45); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ------------------------------------------------------------ шапка */

.top {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(14px);
    background: rgba(7, 11, 24, 0.72);
    border-bottom: 1px solid var(--edge);
}

.top-inner, .wrap {
    max-width: 68rem;
    margin: 0 auto;
    padding: 0.9rem 1.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.6rem;
    flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }

/* Пульсирующая точка — единственный элемент, который «дышит» постоянно. */
.brand-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6);
    animation: ping 2.6s ease-out infinite;
    flex: 0 0 auto;
}

@keyframes ping {
    0%   { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55); }
    70%  { box-shadow: 0 0 0 14px rgba(34, 211, 238, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

.brand-mark {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: var(--grad);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: drift 9s ease-in-out infinite;
}

@keyframes drift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.brand-tag { font-size: 0.78rem; color: var(--muted); }

.top-nav { display: flex; gap: 1.5rem; font-size: 0.86rem; }
.top-nav a { color: var(--muted); }
.top-nav a:hover { color: var(--text); }

/* ------------------------------------------------------------ первый экран */

.hero {
    max-width: 68rem;
    margin: 0 auto;
    padding: 6.5rem 1.8rem 5rem;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.74rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cyan);
    border: 1px solid var(--edge);
    border-radius: 100px;
    padding: 0.35rem 0.9rem;
    background: var(--panel);
    margin-bottom: 1.6rem;
}

.hero-title {
    font-size: clamp(2.4rem, 6.2vw, 4.2rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
    font-weight: 700;
    margin: 0 0 1.4rem;
}

.hero-title .glow {
    background: var(--grad);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: drift 9s ease-in-out infinite;
}

.hero-lead {
    font-size: 1.06rem;
    color: var(--muted);
    max-width: 34rem;
    margin: 0 0 2.2rem;
}

.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

/* --- радар: расходящиеся волны --- */

.radar {
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.radar-core {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--grad);
    box-shadow: 0 0 26px rgba(139, 92, 246, 0.85);
    z-index: 2;
}

.radar-ring {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(34, 211, 238, 0.35);
    transform: scale(0.15);
    opacity: 0;
    animation: emit 4.4s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}

.radar-ring:nth-child(2) { animation-delay: 1.1s; border-color: rgba(139, 92, 246, 0.35); }
.radar-ring:nth-child(3) { animation-delay: 2.2s; border-color: rgba(240, 53, 156, 0.30); }
.radar-ring:nth-child(4) { animation-delay: 3.3s; }

@keyframes emit {
    0%   { transform: scale(0.15); opacity: 0; }
    12%  { opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

/* Карточки-сообщения, плывущие вокруг радара. */
.radar-bubble {
    position: absolute;
    background: rgba(11, 17, 36, 0.9);
    border: 1px solid var(--edge);
    border-radius: 12px;
    padding: 0.5rem 0.8rem;
    font-size: 0.76rem;
    color: var(--text);
    white-space: nowrap;
    backdrop-filter: blur(8px);
    animation: float 6s ease-in-out infinite;
    z-index: 3;
}

.radar-bubble b {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cyan);
    font-weight: 600;
}

/* Пузырьки держатся у самого круга: оторвавшись, они читаются как
   случайные обрывки, а не как перехваченные передачи. */
.radar-bubble:nth-of-type(1) { top: 4%; right: -2%; }
.radar-bubble:nth-of-type(2) { bottom: 24%; left: -8%; animation-delay: 1.6s; }
.radar-bubble:nth-of-type(3) { bottom: 2%; right: 8%; animation-delay: 3.1s; }
.radar-bubble:nth-of-type(3) b { color: var(--magenta); }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-9px); }
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--grad);
    background-size: 200% 100%;
    color: #080F1F;
    border: none;
    border-radius: 100px;
    font-family: var(--sans);
    font-size: 0.94rem;
    font-weight: 600;
    padding: 0.8rem 1.7rem;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background-position 400ms ease;
    box-shadow: 0 8px 26px rgba(139, 92, 246, 0.32);
}

.btn:hover {
    color: #080F1F;
    transform: translateY(-2px);
    background-position: 100% 50%;
    box-shadow: 0 12px 34px rgba(240, 53, 156, 0.38);
}

.btn-ghost {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--edge);
    box-shadow: none;
}
.btn-ghost:hover { color: var(--cyan); border-color: var(--cyan); box-shadow: none; }

.btn-danger { background: rgba(240, 53, 156, 0.16); color: var(--magenta); box-shadow: none; }
.btn-danger:hover { background: var(--magenta); color: #080F1F; }

/* ------------------------------------------------------------ разделы */

.section { max-width: 68rem; margin: 0 auto; padding: 5rem 1.8rem; }

.section-head { max-width: 42rem; margin-bottom: 3rem; }

.section-label {
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--cyan);
    margin: 0 0 0.9rem;
}

.section-title {
    font-size: clamp(1.7rem, 3.6vw, 2.5rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
    margin: 0 0 0.9rem;
}

.section-text { color: var(--muted); margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.2rem; }

.card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: 16px;
    padding: 1.6rem 1.4rem;
    overflow: hidden;
    transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.45);
    background: var(--panel-strong);
}

/* Тонкая градиентная полоса сверху — «сигнал» карточки. */
.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--grad);
    opacity: 0.55;
}

.card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.25);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.card h3 { font-size: 1.06rem; margin: 0 0 0.5rem; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* ------------------------------------------------------------ шкала каналов */

.dial {
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: 16px;
    padding: 1.6rem;
    overflow: hidden;
}

.dial-scale {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 0;
    height: 62px;
    margin-bottom: 0.8rem;
}

.dial-tick {
    flex: 1;
    height: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    position: relative;
}

.dial-tick.major { height: 30px; border-left-color: rgba(34, 211, 238, 0.6); }

.dial-tick.major::after {
    content: attr(data-label);
    position: absolute;
    bottom: -1.35rem;
    left: 2px;
    font-size: 0.62rem;
    color: var(--muted);
    font-family: var(--mono);
}

/* Бегущий маркер настройки. */
.dial-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--magenta);
    box-shadow: 0 0 14px var(--magenta);
    animation: sweep 11s ease-in-out infinite;
}

@keyframes sweep {
    0%, 100% { left: 3%; }
    50%      { left: 94%; }
}

.dial-legend {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--muted);
    margin-top: 1.6rem;
}

/* ------------------------------------------------------------ вход в ленту */

.gate {
    border-top: 1px solid var(--edge);
    border-bottom: 1px solid var(--edge);
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.09), transparent);
}

.gate-inner { max-width: 68rem; margin: 0 auto; padding: 5rem 1.8rem; }

.gate-form { display: flex; gap: 0.8rem; flex-wrap: wrap; max-width: 34rem; margin-top: 1.8rem; }

.gate-form input[type=text] {
    flex: 1 1 14rem;
    background: rgba(7, 11, 24, 0.8);
    border: 1px solid var(--edge);
    border-radius: 100px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 1rem;
    letter-spacing: 0.14em;
    padding: 0.8rem 1.3rem;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.gate-form input[type=text]:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

/* ------------------------------------------------------------ лента и записи */

.shell { max-width: 52rem; margin: 0 auto; padding: 3.5rem 1.8rem 6rem; }

.profile-head { padding-bottom: 2rem; border-bottom: 1px solid var(--edge); }

.profile-nick {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 700;
    margin: 0;
    background: var(--grad);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: drift 9s ease-in-out infinite;
}

.profile-sub { margin: 0.6rem 0 0; font-size: 0.88rem; color: var(--muted); }

.profile-code { margin: 1.2rem 0 0; font-size: 0.8rem; color: var(--muted); }
.profile-code code { color: var(--amber); letter-spacing: 0.1em; }

.profile-note {
    margin: 1.8rem 0 0;
    padding: 1rem 1.2rem;
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: 12px;
    font-size: 0.88rem;
    color: var(--muted);
}

.profile-feed { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 1rem; }

.profile-item {
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: 14px;
    padding: 1.3rem 1.4rem;
    transition: transform 200ms ease, border-color 200ms ease;
}

.profile-item:hover { transform: translateX(4px); border-color: rgba(139, 92, 246, 0.45); }

.item-meta {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.74rem;
    color: var(--muted);
    font-family: var(--mono);
    margin-bottom: 0.7rem;
}

.chip {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 100px;
    border: 1px solid var(--edge);
    background: rgba(34, 211, 238, 0.10);
    color: var(--cyan);
    font-size: 0.7rem;
}

.item-title { font-size: 1.14rem; line-height: 1.4; margin: 0 0 0.4rem; font-weight: 600; }
.item-excerpt { margin: 0; color: var(--muted); font-size: 0.92rem; }

.empty { padding: 4rem 0; color: var(--muted); text-align: center; }

.pages { margin-top: 2.4rem; display: flex; gap: 0.9rem; font-family: var(--mono); font-size: 0.88rem; }
.pages strong { color: var(--cyan); }

.post { }

.post-meta {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.76rem;
    color: var(--muted);
    font-family: var(--mono);
    padding-bottom: 1.4rem;
    border-bottom: 1px solid var(--edge);
}

.post-broadcast {
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 2rem 0 0;
    word-break: break-word;
}

.post-broadcast-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 0.8rem;
    font-weight: 400;
}

.post-body { margin: 1.8rem 0 0; white-space: pre-wrap; word-break: break-word; color: var(--muted); }

.post-foot {
    margin-top: 2.6rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--edge);
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--muted);
}

/* ------------------------------------------------------------ подвал */

.bottom { border-top: 1px solid var(--edge); }

.bottom-inner {
    max-width: 68rem;
    margin: 0 auto;
    padding: 2.2rem 1.8rem 3rem;
    display: flex;
    justify-content: space-between;
    gap: 1.4rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--muted);
}

/* ------------------------------------------------------------ формы, установщик, админка */

.page-plain { background: var(--void); }

.install, .admin { max-width: 46rem; margin: 0 auto; padding: 3.5rem 1.8rem 5rem; }
.admin-wide { max-width: 72rem; }

.install > .brand-mark, .admin > .brand-mark { display: block; font-size: 1.4rem; margin-bottom: 0.3rem; }
.install > .muted { margin: 0 0 2rem; font-size: 0.86rem; }

.form { display: grid; gap: 1.2rem; margin-top: 1.6rem; max-width: 34rem; }
.admin-wide .form { max-width: none; }

.form h2, .admin h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.8rem 0 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--edge);
}

label { display: grid; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
label small { font-size: 0.78rem; color: rgba(140, 153, 184, 0.75); }

input[type=text], input[type=password], input[type=number], input[type=url], textarea, select {
    background: rgba(7, 11, 24, 0.8);
    border: 1px solid var(--edge);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.96rem;
    padding: 0.65rem 0.85rem;
    width: 100%;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

textarea { min-height: 7rem; resize: vertical; line-height: 1.6; }

.form .btn { justify-self: start; }

.notice {
    border: 1px solid var(--edge);
    border-left: 3px solid var(--cyan);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin: 1.2rem 0;
    font-size: 0.92rem;
    background: var(--panel);
    max-width: 40rem;
}

.notice p { margin: 0 0 0.5rem; }
.notice p:last-child { margin-bottom: 0; }
.notice-ok { border-left-color: var(--cyan); }
.notice-error { border-left-color: var(--magenta); }
.notice-warn { border-left-color: var(--amber); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.2rem; }

table.rows { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin-top: 1.2rem; }
table.rows th, table.rows td {
    border-bottom: 1px solid var(--edge);
    padding: 0.75rem 0.6rem;
    text-align: left;
    vertical-align: top;
}
table.rows th {
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--muted);
}
table.rows tr.hidden-row td { color: var(--muted); opacity: 0.6; }

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.4rem;
    flex-wrap: wrap;
    padding-bottom: 1.4rem;
    margin-bottom: 1.8rem;
    border-bottom: 1px solid var(--edge);
}

.admin-nav { display: flex; gap: 1.2rem; font-size: 0.84rem; }
.admin-nav a { color: var(--muted); }
.admin-nav a:hover { color: var(--cyan); }

.admin-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 1.4rem; }

.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0 0 2rem; }

.stat {
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: 14px;
    padding: 1rem 1.4rem;
    min-width: 8rem;
}

.stat b {
    display: block;
    font-size: 1.7rem;
    line-height: 1.1;
    font-weight: 700;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat span { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.inline-form { display: inline; }
.inline-form + .inline-form { margin-left: 0.4rem; }

/* ------------------------------------------------------------ узкий экран */

@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; padding-top: 4rem; }
    /* Ширину задаём явно: с `margin: 0 auto` элемент грида переходит на
       размер по содержимому, и aspect-ratio считается от ядра, а не от
       колонки — радар схлопывается в точку. */
    .radar { order: -1; width: min(100%, 17rem); margin-inline: auto; }
    .radar-bubble { display: none; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .top-inner, .hero, .section, .gate-inner, .shell, .bottom-inner,
    .install, .admin { padding-left: 1.1rem; padding-right: 1.1rem; }
    .section { padding-top: 3.2rem; padding-bottom: 3.2rem; }
}
