:root {
    --ink: #f3f6fc;
    --ink-soft: #b7c4dc;
    --accent: #6fb8ff;
    --on-accent: #071019;
    --danger: #ff9b86;
    --danger-bg: rgba(255, 138, 110, .16);
    --surface: rgba(8, 14, 24, .4);
    --surface-strong: rgba(6, 11, 20, .82);
    --line: rgba(255, 255, 255, .22);
    --radius: 3px;
    --f-display: 'Unbounded', 'Segoe UI', sans-serif;
    --f-body: 'Golos Text', 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
    --f-mono: 'JetBrains Mono', 'Consolas', 'SFMono-Regular', monospace;
}

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

html, body { height: 100%; }

body {
    margin: 0;
    background: url('../img/hero.jfif') center / cover no-repeat fixed;
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 14.5px;
    line-height: 1.55;
}

img { max-width: 100%; height: auto; }

h1, h2 { text-wrap: balance; font-family: var(--f-display); margin: 0; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: var(--accent); color: var(--on-accent);
    padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

a { color: var(--accent); }

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(20px, 3vw, 56px);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { height: 26px;
    border-radius: 5px;
    display: block;
    padding-left: 30px; }
.brand-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .02em;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

.status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(111, 184, 255, .22);
    flex: 0 0 auto;
}
.status-dot.is-live { animation: pulse 2.4s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

.main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: clamp(24px, 3vw, 48px);
    padding: clamp(20px, 3vh, 34px) clamp(20px, 3vw, 56px);
    min-height: 0;
}

.editorial { min-width: 0; padding: 30px 32px; }

.editorial h1 {
    font-size: clamp(1.7rem, 2.3vw, 2.3rem);
    line-height: 1.18;
    font-weight: 800;
    max-width: 18ch;
}

.dek {
    margin: 14px 0 0;
    max-width: 56ch;
    color: var(--ink-soft);
    font-size: 15px;
}

.notes {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 26px;
    max-width: 62ch;
}

.notes h2 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.notes p { margin: 0; font-size: 14px; color: var(--ink); }
.notes strong { font-weight: 700; }

.side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.access-card { padding: 26px 26px 22px; }

.eyebrow {
    margin: 0 0 8px;
    font-family: var(--f-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
}

.access-card h2 { font-size: 19px; font-weight: 700; margin-bottom: 20px; }

.captcha-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.captcha-image-wrap { position: relative; flex: 0 0 auto; display: flex; align-items: center; }

.captcha-image {
    display: block;
    width: 158px;
    height: 56px;
    border-radius: var(--radius);
    background: var(--surface);
    pointer-events: none;
    user-select: none;
}

.captcha-reload {
    position: absolute;
    right: -7px; bottom: -7px;
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.captcha-reload:hover { background: var(--accent); color: var(--on-accent); }
.captcha-reload.is-spinning svg { animation: spin .6s linear; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.captcha-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 56px;
    padding: 0 12px;
    font-family: var(--f-mono);
    font-size: 19px;
    font-weight: 500;
    letter-spacing: 5px;
    text-transform: uppercase;
    text-align: center;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .15s ease;
}
.captcha-input::placeholder { letter-spacing: normal; text-transform: none; color: var(--ink-soft); font-family: var(--f-body); font-size: 14px; }
.captcha-input:focus { outline: none; border-color: var(--accent); }
.captcha-input.is-invalid { border-color: var(--danger); }

.captcha-error {
    margin: 12px 0 0;
    padding: 9px 11px;
    background: var(--danger-bg);
    border-radius: var(--radius);
    color: var(--danger);
    font-size: 13px;
}
.captcha-error[hidden] { display: none; }

.access-card.shake { animation: shake .3s ease; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px 18px;
    font-family: var(--f-body);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }

.hint { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-soft); }

.console { color: var(--ink); flex: 1; min-height: 0; display: flex; flex-direction: column; }

.console__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    flex: 0 0 auto;
}

.console__dots { display: flex; gap: 5px; }
.console__dots i {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--ink-soft);
    display: block;
    opacity: .6;
}

.console__name { font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); }

.console__live {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: .08em;
    color: var(--accent);
}

.console__live .pulse {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    animation: pulse 2.4s ease-in-out infinite;
}

.console__body {
    margin: 0;
    padding: 12px 14px 14px;
    font-family: var(--f-mono);
    font-size: 12px;
    line-height: 1.75;
    color: var(--ink);
    overflow: auto;
}

.console__body .logline { display: block; white-space: pre; }
.console__body .ok { color: var(--accent); }
.console__body .dim { color: var(--ink-soft); }

.console__caret {
    display: inline-block;
    width: 7px;
    height: 13px;
    margin-left: 1px;
    background: var(--accent);
    vertical-align: -2px;
    animation: caret-blink 1s step-end infinite;
}

@keyframes caret-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.footer { padding: 14px clamp(20px, 3vw, 56px) 18px; }

.footer p {
    margin: 0;
    max-width: 100ch;
    font-size: 11.5px;
    color: var(--ink-soft);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal[hidden] { display: none !important; }

.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 6, 12, .68);
    animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    overflow: hidden;
    animation: pop .18s ease;
}
@keyframes pop {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
}

.modal__body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}
.modal__title { margin: 0; font-family: var(--f-display); font-size: 17px; font-weight: 700; color: var(--ink); }
.modal__close {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; line-height: 1;
    color: var(--ink-soft);
    background: transparent;
    border: 0; border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.modal__close:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }

.tabs {
    display: flex;
    gap: 4px;
    padding: 0 22px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
}
.tab {
    flex: 0 0 auto;
    padding: 12px 14px;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.tab:hover { color: var(--accent); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.panels { padding: 18px 22px 24px; overflow-y: auto; }

.links-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 2px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.links-list a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 0;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}
.link-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-url { font-family: var(--f-mono); font-size: 11px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links-list a:hover .link-name { color: var(--accent); }

body.modal-open { overflow: hidden; }

@media (min-width: 1400px) and (min-height: 760px) {
    html, body { overflow: hidden; }
}

@media (max-width: 1100px) {
    .main { grid-template-columns: 1fr; }
    .editorial h1 { max-width: none; }
    .console { min-height: 220px; }
}

@media (max-width: 640px) {
    .topbar { flex-wrap: wrap; }
    .captcha-row { flex-direction: column; }
    .captcha-image { width: 100%; }
    .captcha-reload { right: 0; }
    .modal { padding: 0; }
    .modal__dialog { max-width: none; max-height: 100%; height: 100%; }
    .links-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
