/* ==========================================================================
   guide.css — страница гайда в стилистике «profit os»: терминальный герой,
   правая рейка-навигация как станции на главной, редакционная типографика.
   Переиспользует блоки из cases.css и переопределяет их под гайд.
   ========================================================================== */

/* ── прогресс чтения ── */
.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 60;
    pointer-events: none;
}

.read-progress i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--grad-r);
    box-shadow: 0 0 12px rgba(255, 59, 31, .55);
    transition: width .1s linear;
}

/* ── герой ── */
.g-hero {
    position: relative;
    padding: clamp(48px, 8vw, 120px) var(--pad) clamp(36px, 5vw, 72px);
    overflow: hidden;
}

.g-hero-inner {
    position: relative;
    z-index: 1;
    width: min(880px, 100%);
    margin-inline: auto;
    text-align: center;
}

.g-hero-glow {
    position: absolute;
    inset: -40% -20% auto;
    height: 130%;
    background: radial-gradient(ellipse 60% 55% at 50% 0%, rgba(255, 59, 31, .14), transparent 70%);
    pointer-events: none;
}

.g-boot {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 26px;
}

.g-boot::after {
    content: "_";
    color: var(--av2);
    animation: g-blink 1.1s steps(2) infinite;
}

@keyframes g-blink {
    50% { opacity: 0 }
}

.g-title {
    margin: 0 0 18px;
    font-family: var(--disp);
    font-weight: 900;
    font-size: clamp(26px, 4.6vw, 56px);
    line-height: 1.04;
    letter-spacing: -.02em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-wrap: balance;
}

.g-sub {
    margin: 0 auto;
    max-width: 58ch;
    font-size: clamp(15px, 1.6vw, 19px);
    line-height: 1.65;
    color: var(--soft);
    text-wrap: balance;
}

.g-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.g-chip {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--faint);
    padding: 7px 13px;
    border: 1px solid var(--rule2);
    border-radius: 999px;
    background: rgba(255, 255, 255, .015);
}

.g-chip b {
    color: var(--av2);
    font-weight: 500;
}

/* ── правая рейка-навигация ── */
.g-rail {
    position: fixed;
    right: clamp(10px, 2vw, 28px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    display: grid;
    gap: 14px;
    justify-items: end;
}

.g-rail a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--faint);
}

.g-rail i {
    width: 8px;
    height: 8px;
    border: 1px solid var(--rule2);
    border-radius: 50%;
    background: transparent;
    transition: background .25s, border-color .25s, box-shadow .25s;
}

.g-rail span {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width .3s ease, opacity .3s ease;
}

.g-rail a:hover span,
.g-rail a.is-active span {
    max-width: 300px;
    opacity: 1;
}

.g-rail a:hover i,
.g-rail a.is-active i {
    background: var(--av1);
    border-color: var(--av2);
    box-shadow: 0 0 10px rgba(255, 59, 31, .7);
}

.g-rail a.is-active {
    color: var(--av2);
}

@media (max-width: 1100px) {
    .g-rail {
        display: none;
    }
}

/* ── тело: одна колонка ── */
.g-body {
    width: min(780px, 100% - 2 * var(--pad));
    margin-inline: auto;
    padding-bottom: 60px;
}

.g-body .wrap {
    width: 100%;
    margin-inline: 0;
}

.g-body .sec {
    padding: clamp(26px, 4vw, 48px) 0;
}

.guide-anchor {
    scroll-margin-top: 84px;
}

/* ── заголовки разделов как «станции» главной ── */
.g-body {
    counter-reset: gsec;
}

.g-body .block-head {
    margin-bottom: 22px;
}

.g-body .block-head .bh-kicker {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 16px;
}

.g-body .block-head .bh-kicker::before {
    counter-increment: gsec;
    content: counter(gsec, decimal-leading-zero);
    color: var(--av1);
    font-weight: 700;
    font-size: 13px;
}

.g-body .block-head .bh-kicker::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--rule2), transparent);
}

.g-body .bh-title {
    font-family: var(--disp);
    font-size: clamp(21px, 2.8vw, 33px);
    line-height: 1.15;
    letter-spacing: -.01em;
    margin: 0;
    max-width: 24ch;
}

/* ── текстовые блоки ── */
.g-body .block-lead {
    font-size: 17px;
    line-height: 1.7;
    color: var(--soft);
    max-width: 62ch;
}

.g-body .guide-anchor:first-child .block-lead::first-letter {
    font-family: var(--disp);
    font-weight: 900;
    font-size: 3em;
    line-height: .82;
    float: left;
    margin: 5px 12px 0 0;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.g-body .text-points {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    display: grid;
    gap: 2px;
}

.g-body .text-points li {
    position: relative;
    padding: 10px 14px 10px 34px;
    border-left: 1px solid var(--rule);
    color: var(--soft);
    font-size: 15px;
    transition: border-color .25s, background .25s;
}

.g-body .text-points li::before {
    content: ">";
    position: absolute;
    left: 13px;
    font-family: var(--mono);
    color: var(--av2);
}

.g-body .text-points li:hover {
    border-left-color: var(--av1);
    background: rgba(255, 59, 31, .03);
}

/* ── шаги как терминальная цепочка ── */
.g-body .steps-list {
    display: grid;
    gap: 0;
}

.g-body .step {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 18px;
    padding: 20px 0;
    border: 0;
    position: relative;
}

.g-body .step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 21px;
    top: 58px;
    bottom: -6px;
    width: 1px;
    background: linear-gradient(180deg, var(--rule2), transparent);
}

.g-body .step-n {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--av2);
    border: 1px solid var(--glass-br);
    border-radius: 50%;
    background: var(--glass);
    box-shadow: 0 0 18px rgba(255, 59, 31, .12);
}

.g-body .step-title {
    margin: 8px 0 8px;
    font-size: 17px;
}

.g-body .step-text {
    margin: 0;
    color: var(--dim);
    font-size: 14.5px;
    line-height: 1.65;
    max-width: 56ch;
}

/* ── callout как редакционная врезка ── */
.g-body .callout {
    background: transparent;
    border: 0;
    border-left: 3px solid;
    border-image: var(--grad) 1;
    border-radius: 0;
    padding: 4px 0 4px 22px;
}

.g-body .callout-body {
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--soft);
}

/* ── чек-лист в терминальном стиле ── */
.check-progress {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .12em;
    color: var(--av2);
    margin-bottom: 14px;
    padding: 6px 12px;
    border: 1px dashed var(--glass-br);
    border-radius: 8px;
}

.check-progress.is-complete {
    color: var(--ok);
    border-color: rgba(58, 209, 124, .45);
}

.check-progress.is-complete::after {
    content: " · чисто. вы защищены лучше большинства";
    color: var(--ok);
}

.g-body .checklist {
    border: 1px solid var(--rule);
    border-radius: 14px;
    overflow: hidden;
    padding: 0;
    margin: 0;
    list-style: none;
}

.g-body .check-item {
    display: flex;
    gap: 14px;
    align-items: baseline;
    padding: 16px 18px;
    cursor: pointer;
    user-select: none;
    border: 0;
    transition: background .2s;
}

.g-body .check-item + .check-item {
    border-top: 1px solid var(--rule);
}

.g-body .check-item:hover {
    background: rgba(255, 138, 61, .04);
}

.g-body .check-item:focus-visible {
    outline: 2px solid var(--av1);
    outline-offset: -2px;
}

.g-body .check-mark {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--faint);
    flex-shrink: 0;
    transition: color .2s;
}

/* мono-чекбокс: [ ] → [x] */
.g-body .check-mark {
    visibility: hidden;
    position: relative;
    width: 30px;
}

.g-body .check-mark::before {
    visibility: visible;
    position: absolute;
    left: 0;
    content: "[ ]";
}

.g-body .check-item.is-done .check-mark::before {
    content: "[x]";
    color: var(--av2);
}

.g-body .check-text {
    color: var(--soft);
    font-size: 15px;
    transition: color .2s, opacity .2s;
}

.g-body .check-item.is-done .check-text {
    opacity: .55;
}

.g-body .check-text b {
    color: var(--fg);
    font-weight: 600;
}

/* ── врезка-калькулятор: тихий терминал ── */
.calc-strip {
    border: 1px dashed var(--glass-br);
    border-radius: 14px;
    padding: 20px 22px;
    background: rgba(255, 59, 31, .025);
    max-width: 620px;
}

.cs-result {
    margin: 0 0 18px;
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: .04em;
    color: var(--dim);
}

.cs-result b {
    color: var(--accent);
    font-size: 15px;
    white-space: nowrap;
}

.cs-controls {
    display: grid;
    gap: 14px;
}

.cs-field {
    display: grid;
    grid-template-columns: 118px 1fr 84px;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.cs-label {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--faint);
}

.cs-field input[type="range"] {
    width: 100%;
    height: 2px;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(90deg, rgba(255, 59, 31, .55), rgba(255, 138, 61, .55));
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.cs-field input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--av2);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px rgba(255, 138, 61, .6), 0 0 10px rgba(255, 59, 31, .5);
    cursor: grab;
}

.cs-field input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--av2);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px rgba(255, 138, 61, .6), 0 0 10px rgba(255, 59, 31, .5);
    cursor: grab;
}

.cs-out {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--fg);
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 520px) {
    .cs-field {
        grid-template-columns: 1fr 84px;
    }

    .cs-label {
        grid-column: 1 / -1;
    }
}

/* ── финал ── */
.g-colophon {
    margin-top: 30px;
    padding-top: 26px;
    border-top: 1px solid var(--rule);
}
