/* ==========================================================================
   Karafa.net — shared design system
   One stylesheet for every page. Loaded from /assets/css/karafa.css
   ========================================================================== */

/* --- 1. Design tokens ---------------------------------------------------- */

:root {
    /* Surfaces (dark is the default identity of the site) */
    --bg: #0b1120;
    --bg-soft: #111827;
    --panel: rgba(30, 41, 59, 0.5);
    --panel-solid: #131c2e;
    --step-bg: rgba(255, 255, 255, 0.03);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --grid-line: rgba(255, 255, 255, 0.08);

    /* Text */
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Accents */
    --accent: #10b981;          /* emerald — primary / media */
    --accent-ink: #04170f;      /* text on top of --accent */
    --info: #3b82f6;            /* blue — informational */
    --violet: #8b5cf6;          /* storage / swiparr */
    --gold: #fbbf24;            /* support */
    --danger: #ef4444;
    --warn: #f59e0b;

    /* Tinted washes */
    --accent-wash: rgba(16, 185, 129, 0.10);
    --info-wash: rgba(59, 130, 246, 0.10);
    --violet-wash: rgba(139, 92, 246, 0.10);
    --gold-wash: rgba(251, 191, 36, 0.10);
    --danger-wash: rgba(239, 68, 68, 0.10);
    --warn-wash: rgba(245, 158, 11, 0.10);

    /* Type */
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Spacing / shape */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);

    --nav-h: 68px;
    --content-max: 900px;
}

/* Light theme — opt-in via the header toggle, remembered in localStorage. */
html[data-theme="light"] {
    --bg: #f6f8fc;
    --bg-soft: #ffffff;
    --panel: rgba(255, 255, 255, 0.72);
    --panel-solid: #ffffff;
    --step-bg: rgba(15, 23, 42, 0.03);
    --hover-bg: rgba(15, 23, 42, 0.04);
    --border: rgba(15, 23, 42, 0.10);
    --border-strong: rgba(15, 23, 42, 0.22);
    --grid-line: rgba(15, 23, 42, 0.05);

    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;

    --accent: #047857;
    --accent-ink: #ffffff;
    --info: #1d4ed8;
    --violet: #6d28d9;
    --gold: #b45309;

    --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
    --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, 0.25);
}

/* --- 2. Base ------------------------------------------------------------- */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-font-smoothing: antialiased;
}

/* Ambient glow behind everything */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(600px circle at 15% 10%, var(--accent-wash), transparent 60%),
        radial-gradient(800px circle at 85% 90%, var(--info-wash), transparent 60%);
}

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

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

h1, h2, h3, h4 { color: var(--text); line-height: 1.25; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 1rem; }
h2 { font-size: 1.5rem; font-weight: 700; margin: 0 0 1rem; }
h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.5rem; }

p { color: var(--text-muted); margin: 0 0 1rem; }
strong { color: var(--text); font-weight: 600; }

ul, ol { color: var(--text-muted); padding-left: 1.3rem; margin: 0 0 1.25rem; }
li { margin-bottom: 0.5rem; }
li::marker { color: var(--accent); }

code {
    font-family: var(--font-mono);
    background: var(--hover-bg);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--accent);
    font-size: 0.88em;
    word-break: break-word;
}

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* Visible keyboard focus everywhere — the old site had none. */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Screen-reader-only helper + skip link */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 12px; top: -100px;
    background: var(--accent); color: var(--accent-ink);
    padding: 10px 16px; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-weight: 700; text-decoration: none; z-index: 300;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* --- 3. Navigation ------------------------------------------------------- */

.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--nav-h);
    padding: 0.9rem 1.5rem;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand span { color: var(--accent); }
.brand:hover { color: var(--accent); }

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

.lang-switcher { display: flex; gap: 6px; }

.lang-btn, .theme-btn {
    background: var(--hover-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.4;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.lang-btn:hover, .theme-btn:hover { background: var(--border); color: var(--text); }
.lang-btn.active {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
    font-weight: 700;
}

.theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 30px;
    padding: 0;
}
.theme-btn svg { width: 15px; height: 15px; }
/* Show sun in dark mode (click = go light) and moon in light mode. */
.theme-btn .icon-light { display: none; }
html[data-theme="light"] .theme-btn .icon-light { display: block; }
html[data-theme="light"] .theme-btn .icon-dark { display: none; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 17px; height: 17px; }

/* Reading-progress bar for long tutorials */
.progress-bar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--info));
    z-index: 150;
    transition: width 0.1s linear;
}

/* --- 4. Layout ----------------------------------------------------------- */

.container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 2rem;
    animation: fadeIn 0.5s ease;
}
.container.wide { max-width: 1120px; }

.page-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.page-header.center { text-align: center; }

.main-subtitle, .subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 62ch;
    margin: 0;
}
.page-header.center .main-subtitle,
.page-header.center .subtitle { margin-inline: auto; }

/* Breadcrumbs */
.crumbs {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 1.25rem;
}
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: 0.5; }

.section-title {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 3rem 0 1.25rem;
    scroll-margin-top: calc(var(--nav-h) + 20px);
}
.section-title svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }

/* --- 5. Cards & grids ---------------------------------------------------- */

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.75rem;
    backdrop-filter: blur(12px);
}
.card > :last-child { margin-bottom: 0; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }

/* Link cards (tutorial hub, service grid) */
.link-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    text-decoration: none;
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    overflow: hidden;
}
.link-card:hover {
    transform: translateY(-4px);
    background: var(--hover-bg);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}
.link-card:hover .card-icon { transform: scale(1.06); }

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px; height: 52px;
    margin-bottom: 1.25rem;
    border-radius: var(--radius);
    background: var(--accent-wash);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    transition: transform 0.2s ease;
}
.card-icon svg { width: 26px; height: 26px; }

.card-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-desc {
    font-size: 0.93rem;
    color: var(--text-muted);
    flex-grow: 1;
    margin-bottom: 1.25rem;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
}
.card-footer svg { width: 16px; height: 16px; transition: transform 0.2s; }
.link-card:hover .card-footer svg { transform: translateX(5px); }

/* Per-card accent recolouring: <a class="link-card" data-accent="violet"> */
[data-accent="info"]   { --accent: var(--info);   --accent-wash: var(--info-wash);   --accent-ink: #fff; }
[data-accent="violet"] { --accent: var(--violet); --accent-wash: var(--violet-wash); --accent-ink: #fff; }
[data-accent="gold"]   { --accent: var(--gold);   --accent-wash: var(--gold-wash);   --accent-ink: #241a02; }
[data-accent="danger"] { --accent: var(--danger); --accent-wash: var(--danger-wash); --accent-ink: #fff; }

/* --- 6. Chips / tags ----------------------------------------------------- */

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--hover-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}
.chip svg { width: 12px; height: 12px; }
.chip.accent { background: var(--accent-wash); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }
.chip.level-1 { color: #34d399; border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.chip.level-2 { color: #60a5fa; border-color: rgba(96, 165, 250, 0.35); background: rgba(96, 165, 250, 0.08); }
.chip.level-3 { color: #f472b6; border-color: rgba(244, 114, 182, 0.35); background: rgba(244, 114, 182, 0.08); }
html[data-theme="light"] .chip.level-1 { color: #047857; }
html[data-theme="light"] .chip.level-2 { color: #1d4ed8; }
html[data-theme="light"] .chip.level-3 { color: #be185d; }

/* --- 7. Buttons ---------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1.15rem;
    background: var(--hover-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--border); border-color: var(--accent); transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.btn:hover svg { color: var(--accent); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}
.btn-primary svg, .btn-primary:hover svg { color: currentColor; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 82%, #fff); border-color: transparent; }

.btn-group { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 1.25rem; }
.btn-block { justify-content: center; width: 100%; }

/* --- 8. Steps ------------------------------------------------------------ */

.step-box {
    position: relative;
    background: var(--step-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.25rem;
}
.step-box > :last-child { margin-bottom: 0; }

.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.6rem;
}
.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--accent-wash);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
}
.step-num svg { width: 15px; height: 15px; }

/* --- 9. Callouts --------------------------------------------------------- */

.callout {
    display: flex;
    gap: 14px;
    padding: 1.1rem 1.25rem;
    margin: 1.25rem 0;
    border-radius: var(--radius);
    background: var(--info-wash);
    border: 1px solid color-mix(in srgb, var(--info) 28%, transparent);
    font-size: 0.92rem;
    color: var(--text-muted);
}
.callout > svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; color: var(--info); }
.callout > div > :last-child { margin-bottom: 0; }
/* Only the leading label goes full-width; inline <strong> inside the body must
   stay inline, so scope this to the first child rather than every <strong>. */
.callout > div > strong:first-child { display: block; color: var(--text); margin-bottom: 3px; }

.callout.success { background: var(--accent-wash); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.callout.success > svg { color: var(--accent); }
.callout.warn { background: var(--warn-wash); border-color: rgba(245, 158, 11, 0.3); }
.callout.warn > svg { color: var(--warn); }
.callout.danger { background: var(--danger-wash); border-color: rgba(239, 68, 68, 0.3); }
.callout.danger > svg { color: var(--danger); }
.callout.tip { background: var(--violet-wash); border-color: color-mix(in srgb, var(--violet) 28%, transparent); }
.callout.tip > svg { color: var(--violet); }

/* Plain-language explainer used in beginner tutorials */
.plain {
    border-left: 3px solid var(--info);
    background: var(--step-bg);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    font-size: 0.92rem;
}
.plain .plain-label {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--info);
    margin-bottom: 6px;
}
.plain .plain-label svg { width: 13px; height: 13px; }
.plain p:last-child { margin-bottom: 0; }

/* --- 10. Copy boxes & terminal ------------------------------------------- */

.copy-box {
    position: relative;
    display: block;
    width: 100%;
    text-align: center;
    background: var(--bg-soft);
    border: 2px dashed var(--accent);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    margin: 1.25rem 0;
    cursor: pointer;
    font: inherit;
    transition: background 0.2s, transform 0.2s;
}
.copy-box:hover { background: var(--hover-bg); transform: translateY(-1px); }
.copy-box .copy-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.copy-box .copy-value {
    display: block;
    font-family: var(--font-mono);
    font-size: clamp(1rem, 3.5vw, 1.35rem);
    font-weight: 700;
    color: var(--accent);
    word-break: break-all;
}
.copy-box .copy-hint {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 8px;
    font-size: 0.74rem;
    color: var(--text-dim);
}
.copy-box .copy-hint svg { width: 12px; height: 12px; }

.terminal {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--text-muted);
    overflow-x: auto;
}
.terminal .cmd { color: var(--accent); }
.terminal .arg { color: #f472b6; }
.terminal .comment { display: block; color: var(--text-dim); margin-top: 5px; }
.terminal .cursor { animation: blink 1.1s steps(1) infinite; color: var(--accent); }

/* --- 11. Platform tabs --------------------------------------------------- */

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.55rem 0.95rem;
    background: var(--hover-bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.tab-btn svg { width: 15px; height: 15px; }
.tab-btn:hover { color: var(--text); border-color: var(--border-strong); }
.tab-btn[aria-selected="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}
.tab-panel[hidden] { display: none; }
.tab-panel { animation: fadeIn 0.3s ease; }

/* --- 12. FAQ / details --------------------------------------------------- */

.faq {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--step-bg);
    margin-bottom: 0.85rem;
    overflow: hidden;
}
.faq > summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    list-style: none;
}
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary::after {
    content: "+";
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--accent);
    transition: transform 0.2s;
}
.faq[open] > summary::after { content: "−"; }
.faq > summary:hover { background: var(--hover-bg); }
.faq-body { padding: 0 1.25rem 1.15rem; font-size: 0.93rem; }
.faq-body > :last-child { margin-bottom: 0; }

/* --- 13. Table of contents ----------------------------------------------- */

.toc {
    background: var(--step-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
}
.toc-title {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.85rem;
}
.toc-title svg { width: 14px; height: 14px; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { margin-bottom: 6px; counter-increment: toc; }
.toc a {
    display: inline-flex;
    gap: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
}
.toc a::before {
    content: counter(toc, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    opacity: 0.7;
}
.toc a:hover { color: var(--accent); }

/* --- 14. Search / filter (tutorial hub) ---------------------------------- */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    margin-bottom: 2rem;
}
.search-field {
    position: relative;
    flex: 1 1 260px;
}
.search-field svg {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 17px; height: 17px;
    color: var(--text-dim);
    pointer-events: none;
}
.search-field input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: 0.93rem;
}
.search-field input::placeholder { color: var(--text-dim); }
.search-field input:focus { border-color: var(--accent); outline: none; }

.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-pill {
    padding: 0.5rem 0.9rem;
    background: var(--hover-bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.filter-pill:hover { color: var(--text); }
.filter-pill[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}
.no-results {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* --- 15. Tables ---------------------------------------------------------- */

.table-wrap { overflow-x: auto; margin: 1.25rem 0; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 460px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--hover-bg); color: var(--text); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.03em; text-transform: uppercase; }
td { color: var(--text-muted); }
tr:last-child td { border-bottom: 0; }

/* --- 16. Toast ----------------------------------------------------------- */

.toast {
    position: fixed;
    bottom: 30px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex; align-items: center; gap: 10px;
    background: var(--panel-solid);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    z-index: 1000;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    max-width: min(90vw, 480px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- 17. Footer ---------------------------------------------------------- */

.site-footer {
    margin-top: 4.5rem;
    padding: 2rem 0 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); text-decoration: none; border-bottom: 1px dotted var(--border-strong); }
.site-footer a:hover { color: var(--accent); border-color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; margin-bottom: 1rem; }
.footer-note { opacity: 0.65; font-size: 0.8rem; }

.status-dot-inline {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 7px;
    animation: pulse 2.5s infinite;
}

/* --- 18. Animations ------------------------------------------------------ */

@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
    70%  { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- 19. i18n paint guard ------------------------------------------------ */
/* Set by the inline head script only when a non-default language is active,
   so English visitors never pay for it and Slovak visitors never see a flash. */
html.i18n-pending [data-i18n] { visibility: hidden; }

/* --- 20. Responsive ------------------------------------------------------ */

@media (max-width: 720px) {
    .nav-bar { flex-wrap: wrap; padding: 0.75rem 1rem; }
    .brand { font-size: 0.88rem; max-width: 100%; }
    .nav-right { width: 100%; justify-content: space-between; }
    .container { padding-top: 2.5rem; }
    .card, .link-card { padding: 1.35rem; }
    .step-box { padding: 1.15rem 1.15rem; }
    .section-title { font-size: 1.2rem; margin-top: 2.25rem; }
}

/* --- 21. Motion & print -------------------------------------------------- */

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

@media print {
    body { background: #fff; color: #000; }
    body::before, .nav-bar, .progress-bar, .toast, .filter-bar, .theme-btn, .lang-switcher { display: none !important; }
    .card, .step-box, .callout { break-inside: avoid; border-color: #ccc; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
}
