:root {
    --bg: #ffffff;
    --bg-alt: #f4f6f9;
    --surface: #ffffff;
    --ink: #0d2238;
    --ink-soft: #3a4a5e;
    --muted: #6a7886;
    --line: #e1e6ee;
    --accent: #1565c0;
    --accent-ink: #ffffff;
    --accent-soft: #e8f0fb;
    --code-bg: #0d2238;
    --code-ink: #e8f0fb;
    --shadow-sm: 0 1px 2px rgba(13, 34, 56, 0.06);
    --shadow-md: 0 8px 24px rgba(13, 34, 56, 0.08);
    --radius: 10px;
    --radius-sm: 6px;
    --maxw: 1120px;
    --gap: 24px;
    --pad: clamp(16px, 4vw, 32px);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg {
    display: block;
    max-width: 100%;
}

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

a:hover,
a:focus-visible {
    text-decoration: underline;
}

h1,
h2,
h3 {
    color: var(--ink);
    line-height: 1.2;
    margin: 0 0 12px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
    font-size: 1.125rem;
}

p {
    margin: 0 0 12px;
    color: var(--ink-soft);
}

code,
pre {
    font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
}

code {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    white-space: pre;
}

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding-left: var(--pad);
    padding-right: var(--pad);
}

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

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

/* ------- Header ------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
    height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.brand:hover {
    text-decoration: none;
}

.brand-name em {
    font-style: normal;
    color: var(--muted);
    font-weight: 500;
    margin-left: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.primary-nav {
    display: flex;
    gap: 24px;
}

.primary-nav a {
    color: var(--ink-soft);
    font-size: 0.95rem;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
    color: var(--accent);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 0;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    transform: translateY(3px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-3px) rotate(-45deg);
}

/* ------- Language switcher ------- */
.lang-switcher {
    position: relative;
}

.lang-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lang-current:hover,
.lang-current:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    outline: none;
}

.lang-current .flag {
    width: 22px;
    height: 14px;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 110;
}

.lang-menu[hidden] {
    display: none;
}

.lang-menu li {
    margin: 0;
}

.lang-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 0.95rem;
    text-decoration: none;
}

.lang-menu a:hover,
.lang-menu a:focus-visible {
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
    outline: none;
}

.lang-menu a[aria-current="true"] {
    background: var(--bg-alt);
    color: var(--ink);
    font-weight: 600;
}

.lang-menu .flag {
    width: 22px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* ------- Hero ------- */
.hero {
    padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px);
    background:
        radial-gradient(ellipse at top right, rgba(21, 101, 192, 0.10), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(24px, 5vw, 64px);
    align-items: center;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 600;
    margin: 0 0 12px;
}

.lead {
    font-size: 1.125rem;
    color: var(--ink-soft);
    max-width: 56ch;
}

.meta {
    color: var(--muted);
    font-size: 0.92rem;
}

.meta strong {
    color: var(--ink);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.98rem;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background: #0d4ea2;
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}

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

/* Device frame illusztráció */
.hero-aside {
    display: flex;
    justify-content: center;
}

.device-frame {
    width: 260px;
    aspect-ratio: 9 / 16;
    border-radius: 28px;
    background: linear-gradient(160deg, #122a45, #0d2238);
    padding: 14px;
    box-shadow: var(--shadow-md);
    position: relative;
}

.device-frame::before {
    content: "";
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 6px;
    background: #000;
    border-radius: 3px;
}

.device-screen {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    background: #f4f6f9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px;
    padding: 22px 18px;
    position: relative;
    overflow: hidden;
}

.device-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(21, 101, 192, 0.5);
    box-shadow: 0 0 12px rgba(21, 101, 192, 0.6);
    animation: scan 2.4s ease-in-out infinite;
}

@keyframes scan {
    0%, 100% { transform: translateY(-60px); opacity: 0.8; }
    50% { transform: translateY(60px); opacity: 0.4; }
}

.device-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 70px;
}

.device-bars span {
    display: block;
    width: 5px;
    background: var(--ink);
    border-radius: 1px;
}

.device-bars span:nth-child(1) { height: 60%; }
.device-bars span:nth-child(2) { height: 95%; width: 3px; }
.device-bars span:nth-child(3) { height: 70%; }
.device-bars span:nth-child(4) { height: 100%; width: 7px; }
.device-bars span:nth-child(5) { height: 50%; width: 3px; }
.device-bars span:nth-child(6) { height: 85%; }
.device-bars span:nth-child(7) { height: 65%; width: 3px; }
.device-bars span:nth-child(8) { height: 95%; width: 5px; }
.device-bars span:nth-child(9) { height: 75%; width: 3px; }

.device-code {
    font-family: "SF Mono", Menlo, monospace;
    font-size: 0.85rem;
    color: var(--ink);
    letter-spacing: 0.08em;
}

.device-callout {
    margin-top: 8px;
    font-family: "SF Mono", Menlo, monospace;
    font-size: 0.72rem;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 10px;
    border-radius: 12px;
}

/* ------- Sections ------- */
.section {
    padding: clamp(48px, 8vw, 88px) 0;
    border-top: 1px solid var(--line);
}

.section-alt {
    background: var(--bg-alt);
}

.section-header {
    max-width: 720px;
    margin-bottom: clamp(24px, 4vw, 40px);
}

.section-header p {
    font-size: 1.05rem;
}

/* ------- Feature grid ------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--gap);
}

.feature-grid.two-col {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(21, 101, 192, 0.35);
}

.feature-card h3 {
    margin-bottom: 8px;
    color: var(--accent);
}

.feature-card p:last-child {
    margin-bottom: 0;
}

.bullet-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.bullet-list li {
    color: var(--ink-soft);
    padding-left: 16px;
    position: relative;
}

.bullet-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* ------- Steps ------- */
.steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 16px;
}

.steps li {
    counter-increment: step;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 24px 24px 64px;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 20px;
    top: 22px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.steps h3 {
    margin-bottom: 8px;
}

/* ------- Tables ------- */
.kv-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.kv-table th,
.kv-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.94rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.kv-table tr:last-child th,
.kv-table tr:last-child td {
    border-bottom: 0;
}

.kv-table thead th {
    background: var(--bg-alt);
    color: var(--ink);
    font-weight: 600;
}

.kv-table tbody th {
    color: var(--ink);
    font-weight: 500;
    width: 40%;
}

.kv-table td {
    color: var(--ink-soft);
}

/* ------- Code blocks ------- */
.code-block,
.code-inline {
    background: var(--code-bg);
    color: var(--code-ink);
    border-radius: var(--radius);
    padding: 16px 18px;
    overflow-x: auto;
    margin: 0 0 12px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.code-inline {
    display: inline-block;
    padding: 8px 14px;
}

.code-block {
    position: relative;
}

.code-block[data-copy] {
    padding-right: 80px;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--code-ink);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.copy-btn.copied {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
}

/* ------- Config grid ------- */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
    align-items: start;
}

.note {
    margin-top: 20px;
    padding: 14px 18px;
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: 0.94rem;
}

/* ------- Download / meta ------- */
.download-block {
    text-align: left;
}

.meta-list {
    margin: 24px 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.meta-list > div {
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.meta-list dt {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.meta-list dd {
    margin: 0;
    color: var(--ink);
    font-weight: 500;
}

/* ------- Footer ------- */
.site-footer {
    background: var(--ink);
    color: rgba(255, 255, 255, 0.75);
    padding: 32px 0;
}

.site-footer p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 4px;
    font-size: 0.92rem;
}

.site-footer .muted {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.site-footer code {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ------- Responsive ------- */
@media (max-width: 860px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-aside {
        order: -1;
    }

    .device-frame {
        width: 200px;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .nav-toggle {
        display: flex;
    }

    .primary-nav {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        gap: 0;
        padding: 8px var(--pad) 16px;
        box-shadow: var(--shadow-md);
        display: none;
    }

    .primary-nav.is-open {
        display: flex;
    }

    .primary-nav a {
        padding: 12px 0;
        border-bottom: 1px solid var(--line);
    }

    .primary-nav a:last-child {
        border-bottom: 0;
    }

    .primary-nav a:hover,
    .primary-nav a:focus-visible {
        border-bottom-color: var(--line);
    }
}

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