/* ==========================================================================
   NewTab 5.1 – landing page
   Same design language as rapcsak.com: light-first, one accent, no noise.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --border: #e3e6eb;
    --text: #15181e;
    --text-2: #4b5563;
    --text-3: #7b8494;
    --accent: #2457c5;
    --accent-hover: #1c47a3;
    --accent-soft: #e8eefb;
    --on-accent: #ffffff;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.12);

    --radius: 12px;
    --radius-sm: 8px;
    --header-h: 64px;
    --gutter: 16px;
    --max-w: 1120px;

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1115;
        --surface: #161a21;
        --surface-2: #1d222b;
        --border: #272d38;
        --text: #e8eaee;
        --text-2: #aab2bf;
        --text-3: #7f8896;
        --accent: #8ab0ff;
        --accent-hover: #a5c2ff;
        --accent-soft: rgba(138, 176, 255, 0.12);
        --on-accent: #0f1115;
        --shadow: none;
        --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
    }
}

:root[data-theme="dark"] {
    --bg: #0f1115;
    --surface: #161a21;
    --surface-2: #1d222b;
    --border: #272d38;
    --text: #e8eaee;
    --text-2: #aab2bf;
    --text-3: #7f8896;
    --accent: #8ab0ff;
    --accent-hover: #a5c2ff;
    --accent-soft: rgba(138, 176, 255, 0.12);
    --on-accent: #0f1115;
    --shadow: none;
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3 {
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
    font-weight: 600;
}

p {
    margin: 0;
}

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

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

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

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

figure {
    margin: 0;
}

button {
    font: inherit;
    color: inherit;
}

code {
    font-family: var(--mono);
    font-size: 0.875em;
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

[hidden] {
    display: none !important;
}

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

.icon {
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    z-index: 200;
}

.skip-link:focus {
    top: 12px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.925rem;
    font-weight: 500;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

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

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

.btn-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--text-3);
    color: var(--text);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.icon-btn:hover {
    color: var(--text);
    border-color: var(--text-3);
}

.icon-btn .icon {
    width: 18px;
    height: 18px;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.brand:hover {
    color: var(--text);
}

.brand .version {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--mono);
}

.brand-by {
    color: var(--text-3);
    font-size: 0.85rem;
    white-space: nowrap;
}

.brand-by:hover {
    color: var(--text-2);
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-links a {
    display: inline-block;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 0.925rem;
    font-weight: 500;
    transition: color 0.15s, background-color 0.15s;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--surface-2);
}

.nav-links a.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lang-switch {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
}

.lang-btn {
    padding: 4px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-3);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.lang-btn[aria-pressed="true"] {
    background: var(--text);
    color: var(--bg);
}

/* Theme toggle: show the icon of the theme you would switch TO */
.icon-moon { display: none; }
.icon-sun  { display: block; }

:root[data-theme="dark"] .icon-moon { display: block; }
:root[data-theme="dark"] .icon-sun  { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-moon { display: block; }
    :root:not([data-theme="light"]) .icon-sun  { display: none; }
}

.menu-btn {
    display: none;
}

.menu-btn .icon-close { display: none; }
.menu-btn[aria-expanded="true"] .icon-open  { display: none; }
.menu-btn[aria-expanded="true"] .icon-close { display: block; }

/* ---------- Sections ---------- */
main {
    padding-bottom: 16px;
}

.section {
    padding: 28px 0;
}

.section-title {
    font-size: 1.125rem;
    letter-spacing: -0.01em;
    margin-bottom: 14px;
}

/* ---------- Hero ---------- */
.hero {
    padding: 32px 0 20px;
    text-align: center;
}

.eyebrow {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 12px;
}

.hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    letter-spacing: -0.03em;
    max-width: 20ch;
    margin: 0 auto 10px;
}

.hero .lead {
    font-size: 1rem;
    color: var(--text-2);
    max-width: 48ch;
    margin: 0 auto;
}

.hero .actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.hero .meta {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-3);
}

/* Framed screenshot below the hero text */
.hero-shot {
    margin-top: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    background: #1e2430;
    cursor: zoom-in;
}

.hero-shot .shot-open {
    all: unset;
    display: block;
    width: 100%;
    cursor: zoom-in;
}

.hero-shot .shot-open:focus-visible {
    outline: 2px solid var(--accent);
}

.hero-shot img {
    width: 100%;
}

/* ---------- Features ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.feature {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    transition: border-color 0.15s;
}

.feature:hover {
    border-color: var(--text-3);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 2px;
}

.feature-icon .icon {
    width: 16px;
    height: 16px;
}

.feature h3 {
    font-size: 0.925rem;
}

.feature p {
    font-size: 0.825rem;
    line-height: 1.45;
    color: var(--text-2);
}

/* ---------- Screenshots ---------- */
.shot-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter);
}

.shot-grid::-webkit-scrollbar {
    display: none;
}

.shot {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
    height: 240px;
    aspect-ratio: var(--ar);
    scroll-snap-align: start;
    min-width: 0;
}

.shot button {
    flex: 1;
    min-height: 0;
}

.shot img {
    height: 100%;
    object-fit: contain;
}

.shot button {
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #1e2430;
    cursor: zoom-in;
    width: 100%;
    display: block;
    transition: border-color 0.15s;
}

.shot button:hover {
    border-color: var(--text-3);
}

.shot figcaption {
    font-size: 0.8rem;
    color: var(--text-3);
    white-space: nowrap;
}

/* ---------- Install ---------- */
.install-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.install-card {
    padding: 16px;
}

.steps {
    counter-reset: step;
    display: grid;
    gap: 10px;
}

.steps li {
    position: relative;
    padding-left: 34px;
    font-size: 0.9rem;
    color: var(--text-2);
}

.steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
}

.steps li strong {
    color: var(--text);
    font-weight: 600;
}

.facts {
    display: grid;
    gap: 8px;
    font-size: 0.9rem;
}

.facts li {
    display: grid;
    grid-template-columns: 6rem 1fr;
    gap: 2px 8px;
    overflow-wrap: anywhere;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
}

.facts li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.facts .k {
    color: var(--text-3);
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    font-size: 0.875rem;
    color: var(--text-3);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-3);
}

.footer-links a:hover {
    color: var(--accent);
}

/* ---------- Lightbox ---------- */
.lightbox {
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    max-width: min(96vw, 1400px);
    max-height: 92vh;
    overflow: visible;
}

.lightbox::backdrop {
    background: rgba(15, 17, 21, 0.85);
    backdrop-filter: blur(4px);
}

.lightbox img {
    max-width: min(96vw, 1400px);
    max-height: 92vh;
    width: auto;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.lightbox .close {
    position: absolute;
    top: -14px;
    right: -14px;
}

/* ==========================================================================
   Breakpoints
   ========================================================================== */
@media (min-width: 640px) {
    :root {
        --gutter: 24px;
    }

    .hero {
        padding-top: 44px;
    }

    .section {
        padding: 36px 0;
    }

    .feature-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    /* Column widths proportional to the aspect ratios keep all three images the same height */
    .shot-grid {
        display: grid;
        grid-template-columns: 1063fr 482fr 1214fr;
        gap: 14px;
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    .shot {
        height: auto;
        aspect-ratio: auto;
    }

    .shot img {
        width: 100%;
        height: auto;
    }

    .install-grid {
        grid-template-columns: 3fr 2fr;
        align-items: start;
        gap: 12px;
    }
}

@media (min-width: 900px) {
    :root {
        --gutter: 32px;
    }

    .hero {
        padding-top: 56px;
    }

    .section {
        padding: 44px 0;
    }

    .install-card {
        padding: 20px;
    }
}

/* Wide screens: all six feature tiles in one row */
@media (min-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* Mobile navigation */
@media (max-width: 899px) {
    .brand-by {
        display: none;
    }

    .menu-btn {
        display: inline-flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 8px var(--gutter) 12px;
        display: none;
    }

    .nav-menu.is-open {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        gap: 2px;
    }

    .nav-links a {
        display: block;
        padding: 10px 12px;
        font-size: 1rem;
    }
}

@media (max-width: 380px) {
    .lang-switch {
        display: none;
    }
}
