/* ── A. Custom properties + reset ─────────────────── */
:root {
    --bg:           #0d1117;
    --surface:      #161b22;
    --surface-2:    #21262d;
    --border:       #30363d;
    --border-hover: #58a6ff;
    --accent:       #58a6ff;
    --accent-dark:  #1f4b8e;
    --text:         #e6edf3;
    --text-muted:   #8b949e;
    --radius:       10px;
    --nav-h:        60px;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* ── Light theme ───────────────────────────────────── */
[data-theme="light"] {
    --bg:           #edf0f4;
    --surface:      #ffffff;
    --surface-2:    #e2e6eb;
    --border:       #b8c2cc;
    --border-hover: #0969da;
    --accent:       #0969da;
    --accent-dark:  #ddf4ff;
    --text:         #1f2328;
    --text-muted:   #576069;
}
[data-theme="light"] .site-nav        { background: rgba(255,255,255,.92); border-bottom-color: #b8c2cc; }
[data-theme="light"] .nav-links.open  { background: rgba(255,255,255,.98); }
[data-theme="light"] .hero            { background: radial-gradient(ellipse 80% 60% at 50% -10%, #c0d8f8 0%, var(--bg) 65%); }
[data-theme="light"] .btn-cta         { color: #fff; }
[data-theme="light"] .section-products { background: #e2e6eb; }
[data-theme="light"] .product-card     { background: #ffffff; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: #79b8ff; }

/* ── B. Navbar ─────────────────────────────────────── */
.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(13, 17, 23, .85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 32px;
    gap: 32px;
    z-index: 1000;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
    flex: 1;
}
.nav-logo:hover { color: var(--text); }
.nav-logo img { height: 28px; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: .9rem; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-lang { display: flex; gap: 8px; align-items: center; }
.nav-lang img { height: 18px; opacity: .65; transition: opacity .2s; }
.nav-lang img:hover { opacity: 1; }
.nav-hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
.nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(13, 17, 23, .97);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    z-index: 99;
}

/* ── C. Page wrapper (standard layout) ─────────────── */
.page-body { padding-top: var(--nav-h); min-height: calc(100vh - var(--nav-h)); }
.page-container { max-width: 1080px; margin: 0 auto; padding: 48px 24px; }

/* ── D. Typography ─────────────────────────────────── */
h1, h2, h3, h4 { color: var(--text); }
.page-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; margin-bottom: 24px; }
.text-muted { color: var(--text-muted) !important; }
p { margin-bottom: 14px; }
ul, ol { padding-left: 1.5em; margin-bottom: 14px; }
li { margin-bottom: 4px; }

/* ── Bootstrap 3 collapse compatibility ────────────── */
.collapse { display: none; }
.collapse.in { display: block; }
.collapsing { position: relative; height: 0; overflow: hidden; transition: height .35s ease; }

/* ── E. Panel system ───────────────────────────────── */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}
.panel-heading {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
}
.panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    flex: 1;
}
.panel-title a { color: var(--text); }
.panel-title a:hover { color: var(--accent); }
.panel-body { padding: 18px; color: var(--text); }
.panel-main  { background: var(--surface); border-color: var(--border); }
.panel-default { background: var(--surface); border-color: var(--border); }
.panel-group { margin-bottom: 8px; }
.panel-collapse { overflow: hidden; }
.panel-collapse:not(.show):not(.in) { display: none; }

/* ── F. Hintbox ────────────────────────────────────── */
.hintbox {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    overflow: hidden;
}
.hintbox_highlight {
    background: var(--surface-2);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    overflow: hidden;
}
.hintbox img.thumb,
.hintbox_highlight img.thumb { margin-right: 12px; margin-bottom: 4px; }
.biglink { color: var(--accent); font-weight: 600; }
.biglink:hover { color: #79b8ff; }

/* ── G. SubMenu ────────────────────────────────────── */
.sub-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.sub-menu-label { color: var(--text-muted); font-size: .85rem; white-space: nowrap; }
.sub-menu ul { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.sub-menu ul li a {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: .85rem;
    display: inline-block;
    transition: border-color .2s, color .2s;
}
.sub-menu ul li a:hover { border-color: var(--accent); color: var(--accent); }

/* ── H. Highlights ─────────────────────────────────── */
.highlights-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.highlight-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    overflow: hidden;
}
.highlight-box img { margin-right: 10px; margin-bottom: 4px; }
.highlight-link { font-weight: 600; color: var(--text); display: block; margin: 8px 0 4px; }
.highlight-link:hover { color: var(--accent); }
.highlight-body { color: var(--text-muted); font-size: .875rem; }

/* ── I. Products page grid ─────────────────────────── */
.products-grid-page {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* ── J. Screenshot gallery ─────────────────────────── */
.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.screenshot-cell {
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}
.screenshot-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.screenshot-cell:hover img { transform: scale(1.04); }
.paginator-bar { display: flex; gap: 8px; margin-top: 20px; align-items: center; }

/* ── Language selector ─────────────────────────────── */
.nav-lang-selector { position: relative; }
.lang-toggle img   { display: block; }
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    display: none;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.lang-dropdown.open { display: flex; }
.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    color: var(--text);
    border-radius: 6px;
    font-size: .85rem;
    transition: background .15s;
}
.lang-option:hover { background: var(--surface-2); color: var(--text); }
.lang-option.lang-active { color: var(--accent); font-weight: 600; }
.lang-option img { height: 16px; width: auto; }

/* ── Theme toggle ──────────────────────────────────── */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, color .2s;
    flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ── K. Buttons ────────────────────────────────────── */
.btn-default {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 18px;
    border-radius: var(--radius);
    display: inline-block;
    transition: border-color .2s, color .2s;
    cursor: pointer;
    font-size: .9rem;
    text-decoration: none;
}
.btn-default:hover { border-color: var(--accent); color: var(--accent); }
.btn-default:disabled,
.btn-default[disabled] { opacity: .4; cursor: default; pointer-events: none; }

/* ── L. Footer ─────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 24px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 32px;
}
.footer-col h5 {
    font-weight: 700;
    font-size: .85rem;
    margin-bottom: 12px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .07em;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: var(--text-muted); font-size: .875rem; transition: color .2s; }
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: .8rem;
    max-width: 1080px;
    margin: 0 auto;
}
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--accent); }

/* ── M. Landing sections ───────────────────────────── */
.section { padding: 96px 24px; }
.section-inner { max-width: 1080px; margin: 0 auto; }
.section-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin-bottom: 8px; }
.section-sub { color: var(--text-muted); margin-bottom: 48px; max-width: 560px; }

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--nav-h) + 32px) 24px 64px;
    background: radial-gradient(ellipse 80% 60% at 50% -10%, #1a2f5e 0%, var(--bg) 65%);
}
.hero-eyebrow {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
}
.hero-title {
    font-size: clamp(2.2rem, 6vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
    margin-bottom: 24px;
}
.hero-title span { color: var(--accent); }
.hero-sub { font-size: 1.15rem; color: var(--text-muted); max-width: 520px; margin-bottom: 44px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

.btn-cta {
    background: var(--accent);
    color: #000;
    font-weight: 700;
    padding: 14px 32px;
    border-radius: var(--radius);
    transition: opacity .2s;
    display: inline-block;
}
.btn-cta:hover { opacity: .85; color: #000; }
.btn-ghost {
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 28px;
    border-radius: var(--radius);
    transition: border-color .2s, color .2s;
    display: inline-block;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.section-products { background: var(--surface); }
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 16px;
}
.product-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: border-color .2s, transform .2s;
    color: var(--text);
}
.product-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    color: var(--text);
}
.product-card img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    margin-top: 2px;
    filter: drop-shadow(0 0 6px rgba(88,166,255,.25));
}
.product-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.product-desc { color: var(--text-muted); font-size: .875rem; line-height: 1.45; }
.product-arrow { margin-left: auto; align-self: center; color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0; }

.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.news-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: border-color .2s;
}
.news-card:hover { border-color: var(--border-hover); }
.news-badge { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.news-date  { font-size: .75rem; font-weight: 400; color: var(--text-muted); margin-left: .5rem; }
.news-title { font-size: .9rem; line-height: 1.45; color: var(--text); }
.news-date { font-size: .78rem; color: var(--text-muted); margin-top: 8px; }

.section-social { text-align: center; }
.social-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.social-links a img { height: 32px; opacity: .7; transition: opacity .2s; }
.social-links a:hover img { opacity: 1; }

/* ── Registration form ────────────────────────────── */
.reg-form { display: grid; gap: 12px 0; }
.reg-row { display: grid; grid-template-columns: 180px 1fr; gap: 8px; align-items: start; }
.reg-row--full { grid-template-columns: 1fr; gap: 4px; }
.reg-input {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 6px 10px;
    font-size: .95rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .2s;
}
.reg-input:focus { outline: none; border-color: var(--accent); }
.reg-row label { padding-top: 7px; font-size: .9rem; }
.text-danger { color: #e05050; font-size: .8rem; display: block; margin-top: 2px; }
@media (max-width: 600px) {
    .reg-row { grid-template-columns: 1fr; }
}

/* ── YouTube embed ────────────────────────────────── */
.yt-embed { margin: 1rem 0; }
.yt-embed iframe { max-width: 100%; border-radius: var(--radius); }

/* ── Lightbox ──────────────────────────────────────── */
.lb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.lb-overlay.lb-active {
    display: flex;
    animation: lb-in .22s ease forwards;
}
@keyframes lb-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.lb-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: 0 16px 64px rgba(0, 0, 0, .8);
    object-fit: contain;
    display: block;
    transition: opacity .15s ease;
    user-select: none;
}
.lb-img.lb-switching { opacity: 0; }
.lb-btn {
    position: absolute;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    user-select: none;
}
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-close  { top: 20px;   right: 24px; font-size: 1.1rem; }
.lb-prev   { left: 20px;  top: 50%; transform: translateY(-50%); }
.lb-next   { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.55);
    font-size: .82rem;
    letter-spacing: .06em;
    pointer-events: none;
}

/* Spot (external resources) */
.spot {
    margin: 12px 0;
    padding: 14px;
    background: var(--surface-2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* ── N. Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
    .nav-hamburger { display: block; }
    .nav-links { display: none; }
    .nav-links.open { display: flex; }
    .site-nav { padding: 0 20px; gap: 16px; }
    .page-container { padding: 32px 16px; }
    .footer-inner { grid-template-columns: 1fr; padding: 32px 16px 16px; }
    .highlights-row { grid-template-columns: 1fr; }
    .products-grid-page { grid-template-columns: 1fr; }
    .screenshot-grid { grid-template-columns: 1fr 1fr; }
    .section { padding: 64px 16px; }
    .products-grid { grid-template-columns: 1fr; }
    .news-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .screenshot-grid { grid-template-columns: 1fr; }
    .hero-title { letter-spacing: -.02em; }
}
