/* styles.css */

/* =============================================
   1. DESIGN TOKENS
   Палітра: ink-teal графіт + steel aqua + sand
   ============================================= */
:root {
    color-scheme: dark;

    /* Поверхні (фон → поверхня → піднята поверхня) */
    --bg: #0c1014;
    --surface: #131a21;
    --surface-2: #19222b;
    --surface-3: #202b36;
    --code-bg: #0a0e12;

    /* Бордери */
    --border: rgba(160, 196, 212, 0.11);
    --border-strong: rgba(160, 196, 212, 0.22);

    /* Текст */
    --text: #e6ebef;
    --text-soft: #c4ccd4;
    --muted: #98a4af;
    --placeholder: #8a95a0;

    /* Акценти */
    --accent: #8fc4cf;
    --accent-strong: #b6dfe7;
    --accent-ink: #0c1014;
    --accent-2: #d6b38c;
    --accent-tint: rgba(143, 196, 207, 0.1);
    --warn: #e09a74;
    --warn-tint: rgba(224, 154, 116, 0.12);
    --mark-bg: rgba(214, 179, 140, 0.22);
    --focus: #b6dfe7;
    --selection: rgba(143, 196, 207, 0.3);

    /* Радіуси */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    /* Шкала відступів */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 64px;

    /* Layout */
    --gutter: clamp(16px, 4vw, 24px);
    --container: 1200px;
    --header-h: 72px;

    /* Типографіка */
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --fs-body: 1rem;
    --lh-body: 1.75;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* =============================================
   2. RESET & BASE
   ============================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scrollbar-color: #2a3541 var(--bg);
    scrollbar-width: thin;
}

body {
    background-color: var(--bg);
    color: var(--text-soft);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    font-weight: 400;
    line-height: var(--lh-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body > header,
body > main,
body > footer {
    width: 100%;
}

::selection {
    background: var(--selection);
    color: #f4f8fa;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #2a3541;
    border-radius: var(--radius-pill);
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: #3a4857;
}

/* Заголовки */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    letter-spacing: -0.005em;
    overflow-wrap: anywhere;
}

h1 {
    font-size: clamp(1.25rem, 1.05rem + 0.9vw, 2rem);
}

h2 {
    font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.625rem);
}

h3 {
    font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
}

h4 {
    font-size: 1.0625rem;
}

p {
    overflow-wrap: break-word;
}

/* Посилання */
a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(143, 196, 207, 0.4);
    transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
    overflow-wrap: anywhere;
}

a:hover {
    color: var(--accent-strong);
    text-decoration-color: var(--accent-strong);
}

a:visited {
    color: var(--accent-2);
    text-decoration-color: rgba(214, 179, 140, 0.4);
}

a:visited:hover {
    color: var(--accent-strong);
    text-decoration-color: var(--accent-strong);
}

ul,
ol {
    list-style: none;
}

/* Медіа */
img,
picture,
video,
canvas,
svg,
iframe {
    display: block;
    max-width: 100%;
    height: auto;
}

img,
video,
iframe {
    border-radius: var(--radius);
}

img {
    filter: brightness(0.94) saturate(0.92);
}

/* Фокус */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* =============================================
   3. HEADER
   ============================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(12, 16, 20, 0.94);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-3) var(--gutter);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-2) var(--s-4);
}

.logo-name {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-decoration: none;
}

.main-nav {
    order: 3;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-1) var(--s-5);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-top: 1px solid var(--border);
    padding-top: var(--s-1);
}

.main-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--muted);
    text-decoration: none;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s var(--ease);
}

.main-nav a:hover {
    color: var(--text);
}

.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after {
    transform: scaleX(1);
}

.main-nav a[aria-current="page"] {
    color: var(--accent);
}

.lang-switcher {
    display: flex;
    gap: var(--s-2);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 var(--s-2);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.lang-switcher a:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.lang-switcher a.active {
    color: var(--accent-ink);
    background: var(--accent);
    border-color: var(--accent);
}

/* =============================================
   4. MAIN LAYOUT
   ============================================= */
main {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-6) var(--gutter) var(--s-7);
    flex: 1 0 auto;
}

/* =============================================
   5. HERO
   ============================================= */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
    align-items: center;
    margin-bottom: var(--s-7);
}

.hero-visual {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 0;
    filter: brightness(0.9) saturate(0.88);
    transition: transform 0.6s var(--ease);
}

.hero-visual:hover img {
    transform: scale(1.02);
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    min-width: 0;
}

.hero-tag {
    display: inline-block;
    width: fit-content;
    padding: 6px var(--s-3);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-tint);
    border: 1px solid rgba(143, 196, 207, 0.25);
    border-radius: var(--radius-pill);
}

.article-title {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 1.15rem + 1vw, 2rem);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: -0.01em;
}

.lead {
    font-size: 1.0625rem;
    color: var(--muted);
    line-height: 1.7;
}

.meta-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-3) var(--s-5);
    padding-top: var(--s-4);
    border-top: 1px solid var(--border);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    min-width: 0;
}

.meta-item .label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.meta-item .value {
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text);
}

.meta-divider {
    display: none;
    width: 1px;
    height: 28px;
    background: var(--border-strong);
}

/* =============================================
   6. CONTENT WRAPPER (Article + Sidebar)
   ============================================= */
.content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-7);
    align-items: start;
    margin-bottom: var(--s-8);
}

/* =============================================
   7. ARTICLE CONTENT
   ============================================= */
.content-body {
    min-width: 0;
    max-width: 68ch;
    font-size: 1rem;
    line-height: var(--lh-body);
    color: var(--text-soft);
}

.content-body > * + * {
    margin-top: var(--s-5);
}

.content-body p {
    font-size: inherit;
    line-height: inherit;
    color: var(--text-soft);
}

.content-body h2 {
    margin-top: var(--s-8);
    margin-bottom: var(--s-4);
    color: var(--text);
}

.content-body h2::before {
    content: "";
    display: block;
    width: 24px;
    height: 2px;
    margin-bottom: var(--s-3);
    background: var(--accent);
    border-radius: 2px;
}

.content-body h3 {
    margin-top: var(--s-7);
    margin-bottom: var(--s-3);
    color: var(--text);
}

.content-body h2 + *,
.content-body h3 + * {
    margin-top: 0;
}

.content-body ul,
.content-body ol {
    padding-left: 0;
}

.content-body ul > li,
.content-body ol > li {
    position: relative;
    padding-left: var(--s-5);
    margin-top: var(--s-3);
}

.content-body ul > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 6px;
    height: 1px;
    background: var(--accent);
}

.content-body ol {
    counter-reset: item;
    list-style: none;
}

.content-body ol > li::before {
    counter-increment: item;
    content: counter(item, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.content-body a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(143, 196, 207, 0.35);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s var(--ease), color 0.2s var(--ease);
}

.content-body a:hover {
    color: var(--text);
    text-decoration-color: var(--accent);
}

.content-body strong {
    font-weight: 600;
    color: var(--text);
}

.content-body em {
    font-style: italic;
}

.content-body code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding: 0.1em 0.4em;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.content-body pre {
    overflow-x: auto;
    padding: var(--s-4);
    font-size: 0.875rem;
    line-height: 1.6;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.content-body pre code {
    padding: 0;
    border: 0;
    background: transparent;
    font-size: inherit;
}

.content-body blockquote {
    position: relative;
    margin-left: 0;
    padding: var(--s-4) var(--s-5);
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--text);
    background: var(--accent-tint);
    border-left: 2px solid var(--accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.content-body blockquote cite {
    display: block;
    margin-top: var(--s-3);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-style: normal;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.content-body figure {
    margin: var(--s-6) 0;
}

.content-body figure img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.content-body figcaption {
    margin-top: var(--s-2);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--muted);
}

.content-body hr {
    width: 100%;
    height: 1px;
    margin: var(--s-7) 0;
    border: 0;
    background: var(--border);
}

/* Tables: scroll wrapper keeps layout intact on narrow screens */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.content-body table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.content-body th,
.content-body td {
    padding: var(--s-3) var(--s-4);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.content-body th {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface-2);
}

.content-body tr:last-child td {
    border-bottom: 0;
}

/* =============================================
   8. CALLOUTS
   ============================================= */
.callout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--s-3);
    padding: var(--s-4);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-soft);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.callout__icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.callout__title {
    display: block;
    margin-bottom: var(--s-1);
    font-weight: 600;
    color: var(--text);
}

.callout--warning {
    border-color: rgba(230, 180, 90, 0.35);
}

.callout--warning .callout__icon {
    color: var(--warning);
}

.callout--note {
    border-color: rgba(143, 196, 207, 0.3);
}

/* =============================================
   9. SIDEBAR
   ============================================= */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--s-6);
    min-width: 0;
}

.sidebar-card {
    padding: var(--s-5);
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.sidebar-card__title {
    margin-bottom: var(--s-3);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.toc {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9375rem;
}

.toc a {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding-left: var(--s-3);
    color: var(--muted);
    text-decoration: none;
    border-left: 1px solid var(--border);
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.toc a:hover,
.toc a.is-active {
    color: var(--text);
    border-left-color: var(--accent);
}

.toc .toc-sub a {
    padding-left: var(--s-5);
    font-size: 0.875rem;
}

.share-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}

.share-list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.share-list a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.share-list svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* =============================================
   10. BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: 44px;
    padding: 0 var(--s-5);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

.btn--primary {
    color: var(--accent-ink);
    background: var(--accent);
    border-color: var(--accent);
}

.btn--primary:hover {
    color: var(--accent-ink);
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn--ghost {
    border-color: transparent;
    color: var(--muted);
}

.btn--ghost:hover {
    color: var(--text);
    background: var(--surface-2);
}

.btn[disabled],
.btn[aria-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
}

/* =============================================
   11. FOOTER
   ============================================= */
.site-footer {
    margin-top: auto;
    padding: var(--s-6) var(--gutter);
    font-size: 0.8125rem;
    color: var(--muted);
    background: var(--surface-1);
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2) var(--s-5);
}

.footer-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

.footer-nav a:hover {
    color: var(--text);
}

.footer-copy {
    letter-spacing: 0.02em;
}

/* =============================================
   12. UTILITIES
   ============================================= */
.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;
    top: var(--s-2);
    left: var(--s-2);
    z-index: 200;
    padding: var(--s-2) var(--s-3);
    transform: translateY(-200%);
    color: var(--accent-ink);
    background: var(--accent);
    border-radius: var(--radius-sm);
    text-decoration: none;
}

.skip-link:focus {
    transform: translateY(0);
}

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

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* =============================================
   13. RESPONSIVE
   ============================================= */
@media (min-width: 640px) {
    .header-inner {
        flex-wrap: nowrap;
    }

    .main-nav {
        order: 0;
        width: auto;
        border-top: 0;
        padding-top: 0;
    }

    .meta-divider {
        display: block;
    }
}

@media (min-width: 960px) {
    .hero {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--s-7);
    }

    .content-wrapper {
        grid-template-columns: minmax(0, 1fr) 280px;
    }

    .sidebar {
        position: sticky;
        top: 96px;
    }
}

/* =============================================
   14. MOTION PREFERENCES
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }

    .hero-visual:hover img {
        transform: none;
    }
}

/* =============================================
   15. PRINT
   ============================================= */
@media print {
    .site-header,
    .site-footer,
    .sidebar,
    .btn,
    .share-list {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    .content-body a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }
}
===end file===
===end file===
===end file===
===end file===
===end file===
===end file===