/* === Design C: Terminal / Monochrome === */
/* Акценты: оранжевый для ссылок/жирного, зелёный для подчёркиваний, полностью моноширинная типографика */

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

body {
    font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, "Courier New", monospace;
    background-color: #ffffff;
    color: #2a2a2a;
    line-height: 1.8;
    font-size: 14px;
}

a {
    color: #d45d00;
    text-decoration: none;
    border-bottom: 1px dashed #d45d00;
    transition: all 0.15s ease;
}

a:hover {
    color: #b34700;
    border-bottom-style: solid;
}

strong {
    color: #d45d00;
    font-weight: 700;
}

u, .underline-accent {
    color: #1a8a5c;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.container {
    max-width: 60%;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (max-width: 1024px) {
    .container { max-width: 85%; }
}

@media (max-width: 640px) {
    .container { max-width: 95%; }
}

/* Header */
.site-header {
    border-bottom: 2px solid #2a2a2a;
    padding: 1.2rem 0;
    margin-bottom: 2.5rem;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.01em;
}

.prompt-char {
    color: #d45d00;
    margin-right: 0.3rem;
}

.page-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    font-size: 0.85rem;
    color: #666;
    border-bottom: none;
    transition: color 0.15s ease;
}

.nav-link:hover {
    color: #d45d00;
    border-bottom: none;
}

.nav-link.active {
    color: #d45d00;
    font-weight: 700;
}

/* Hero */
.hero {
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.hero p {
    margin-bottom: 1rem;
    color: #444;
}

/* OS Instructions */
.os-instructions h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: #1a1a1a;
}

.os-block {
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.os-block summary {
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
    color: #2a2a2a;
    background: #e8f5e9;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.os-block summary::-webkit-details-marker { display: none; }

.marker {
    color: #d45d00;
    font-size: 0.75rem;
    transition: transform 0.15s ease;
    display: inline-block;
}

.os-block[open] .marker {
    transform: rotate(90deg);
}

.os-content {
    padding: 0.8rem 1rem 1.2rem;
    border-top: 1px dashed #d0d0d0;
}

.os-content p {
    margin-bottom: 0.6rem;
    color: #444;
}

/* Code blocks */
.code-block {
    position: relative;
    margin: 0.6rem 0;
}

.code-block pre {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 1rem 1.1rem;
    overflow-x: auto;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: #e0e0e0;
    tab-size: 4;
    white-space: pre;
}

.copy-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: transparent;
    color: #888;
    border: 1px solid #555;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    text-transform: lowercase;
    z-index: 1;
}

.code-block:hover .copy-btn,
.code-block:focus-within .copy-btn { opacity: 1; }

.copy-btn:hover {
    color: #d45d00;
    border-color: #d45d00;
}

.copy-btn.copied {
    color: #1a8a5c;
    border-color: #1a8a5c;
}

/* Packages */
.packages-list h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.packages-intro {
    color: #666;
    margin-bottom: 2rem;
}

.package-item {
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.package-item summary {
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
    color: #2a2a2a;
    background: #e8f5e9;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.package-item summary::-webkit-details-marker { display: none; }

.package-item summary::before {
    content: "▹";
    color: #d45d00;
    font-size: 0.75rem;
    transition: transform 0.15s ease;
    display: inline-block;
}

.package-item[open] summary::before {
    transform: rotate(90deg);
}

.package-content {
    padding: 1.2rem 1.5rem 1.5rem;
    border-top: 1px dashed #d0d0d0;
}

.package-content p {
    margin-bottom: 0.6rem;
    color: #444;
}

.package-content ul,
.package-content ol {
    padding-left: 1.5rem;
    margin-bottom: 0.6rem;
}

.package-content li {
    margin-bottom: 0.3rem;
}

.package-articles {
    margin-top: 0.8rem;
    padding-left: 0;
    list-style: none;
}

.package-articles li {
    margin-bottom: 0.3rem;
}

.package-articles li::before {
    content: "→ ";
    color: #1a8a5c;
}

.package-articles a { font-size: 0.88rem; }

.package-articles-label {
    font-weight: 700;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.3rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.pagination button {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    color: #2a2a2a;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.15s ease;
}

.pagination button:hover:not(:disabled) {
    border-color: #d45d00;
    color: #d45d00;
}

.pagination button.active {
    background: #2a2a2a;
    border-color: #2a2a2a;
    color: #fff;
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Footer */
.site-footer {
    margin-top: 4rem;
    padding: 1.2rem 0;
    border-top: 2px solid #2a2a2a;
    text-align: center;
    font-size: 0.78rem;
    color: #999;
}

/* ============================================
   Responsive: Tablet (≤1024px)
   ============================================ */
@media (max-width: 1024px) {
    body {
        font-size: 13.5px;
    }

    .container {
        max-width: 85%;
        padding: 0 1.25rem;
    }

    .hero h2,
    .packages-list h2 {
        font-size: 1.25rem;
    }

    .os-instructions h3 {
        font-size: 1.05rem;
    }

    .site-title {
        font-size: 0.92rem;
    }
}

/* ============================================
   Responsive: Mobile (≤640px)
   ============================================ */
@media (max-width: 640px) {
    body {
        font-size: 13px;
        line-height: 1.7;
    }

    .container {
        max-width: 100%;
        padding: 0 0.85rem;
    }

    /* Header: stack vertically */
    .site-header {
        padding: 1rem 0;
        margin-bottom: 1.8rem;
    }

    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .site-title {
        font-size: 0.88rem;
        line-height: 1.4;
    }

    .page-nav {
        gap: 0.6rem;
    }

    .nav-link {
        font-size: 0.8rem;
    }

    /* Hero */
    .hero {
        margin-bottom: 2rem;
    }

    .hero h2,
    .packages-list h2 {
        font-size: 1.15rem;
    }

    .hero p {
        font-size: 0.88rem;
    }

    /* OS / Package blocks */
    .os-instructions h3 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }

    .os-block summary,
    .package-item summary {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
        gap: 0.4rem;
    }

    .os-content,
    .package-content {
        padding: 0.7rem 0.8rem 1rem;
    }

    .os-content p,
    .package-content p {
        font-size: 0.85rem;
    }

    /* Code blocks: always show copy btn on touch */
    .code-block pre {
        padding: 0.8rem 0.75rem;
        font-size: 0.75rem;
        line-height: 1.6;
        border-radius: 4px;
    }

    .copy-btn {
        opacity: 1;
        position: relative;
        top: auto;
        right: auto;
        display: inline-block;
        margin-top: 0.4rem;
        padding: 0.35rem 0.8rem;
        font-size: 0.75rem;
    }

    .code-block {
        display: flex;
        flex-direction: column;
    }

    /* Articles */
    .package-articles a {
        font-size: 0.82rem;
    }

    .package-articles-label {
        font-size: 0.75rem;
    }

    /* Pagination */
    .pagination {
        gap: 0.25rem;
        margin-top: 2rem;
    }

    .pagination button {
        padding: 0.45rem 0.65rem;
        font-size: 0.78rem;
        min-width: 2.2rem;
    }

    /* Footer */
    .site-footer {
        margin-top: 2.5rem;
        padding: 1rem 0;
        font-size: 0.72rem;
    }

    /* Search FAB mobile */
    .search-fab-btn {
        width: 44px;
        height: 44px;
    }

    .search-fab-panel.open {
        width: calc(100vw - 2rem);
        right: 0;
    }

    .search-fab-panel input {
        font-size: 0.82rem;
        padding: 0.5rem 2rem 0.5rem 0.7rem;
    }
}

/* ============================================
   Search FAB (floating action button)
   ============================================ */
.search-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.search-fab-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #2a2a2a;
    background: #fff;
    color: #2a2a2a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.search-fab-btn:hover {
    background: #2a2a2a;
    color: #fff;
}

.search-fab-btn.active {
    background: #2a2a2a;
    color: #fff;
    transform: rotate(90deg);
}

.search-fab-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    height: 50px;
    width: 0;
    overflow: hidden;
    background: #fff;
    border: 2px solid #2a2a2a;
    border-radius: 25px;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.2s ease;
    z-index: 1;
}

.search-fab-panel.open {
    width: 320px;
    opacity: 1;
    padding-right: 50px;
}

.search-fab-panel input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.88rem;
    color: #2a2a2a;
    padding: 0.5rem 2rem 0.5rem 1rem;
    height: 100%;
}

.search-fab-panel input::placeholder {
    color: #aaa;
}

.search-clear {
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    line-height: 1;
    display: none;
    font-family: inherit;
}

.search-clear.visible {
    display: block;
}

.search-clear:hover {
    color: #d45d00;
}

.search-no-results {
    text-align: center;
    padding: 2rem 0;
    color: #999;
    font-size: 0.9rem;
}
