:root {
    --bg-dark: #000000;
    --card-bg: rgba(22, 22, 23, 0.34);
    --card-bg-strong: rgba(22, 22, 23, 0.46);
    --text-white: #f5f5f7;
    --text-gray: #86868b;
    --accent-blue: #0071e3;
    --accent-blue-soft: rgba(0, 113, 227, .14);
    --font-main: "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}
body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-main);
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }

a { color: inherit; }

.content-wrapper { position: relative; z-index: 1; }
.snap-section {
    min-height: 100svh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    min-height: 64px;
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.nav-content {
    width: min(100%, 1200px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
}

.logo-area { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-img { height: 52px; width: auto; flex: 0 0 auto; }
.logo {
    font-weight: 700;
    font-size: 36px;
    text-decoration: none;
    color: var(--text-white);
    white-space: nowrap;
    line-height: 1;
}

.nav-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--accent-blue);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.hero {
    display: grid;
    align-items: center;
    padding: 96px 20px 40px;
}

.container {
    width: min(100%, 1200px);
    margin: 0 auto;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 24px;
    align-items: stretch;
}

.hero-copy, .hero-panel, .section-head {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 28px;
    padding: clamp(24px, 4vw, 44px);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 20px 50px rgba(0,0,0,.18);
}

.hero-copy { display: flex; flex-direction: column; justify-content: center; overflow: visible; }
.hero-copy h2, .section-head h2 {
    margin: 0;
    color: var(--text-gray);
    font-size: clamp(14px, 2vw, 18px);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.hero-copy h1 {
    font-size: clamp(48px, 7vw, 82px);
    font-weight: 700;
    margin: 10px 0 16px;
    line-height: 1.08;
    padding-bottom: .08em;
    background: linear-gradient(180deg, #fff 30%, #86868b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    overflow: visible;
}

.tagline {
    max-width: 620px;
    font-size: clamp(16px, 2.1vw, 20px);
    line-height: 1.5;
    color: #d1d1d6;
    margin: 0 0 24px;
}

.cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
}
.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-secondary { background: rgba(0, 113, 227, .10); color: #cfe4ff; }

.hero-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

.hero-kicker {
    color: var(--text-gray);
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hero-panel p {
    margin: 0;
    font-size: clamp(15px, 1.8vw, 17px);
    line-height: 1.5;
    color: #d1d1d6;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: auto;
}

.hero-stats div {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.032);
    border: 1px solid rgba(255,255,255,.07);
}

.hero-stats strong {
    display: block;
    font-size: 18px;
    margin-bottom: 2px;
}
.hero-stats span { color: var(--text-gray); font-size: 12px; }

.catalog-section {
    width: min(100%, 1200px);
    margin: 0 auto;
    padding: 96px 20px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-head {
    margin-bottom: 16px;
    padding: 18px 20px;
}
.section-head p { margin: 6px 0 0; color: var(--text-gray); }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    max-height: calc(100svh - 250px);
    overflow: auto;
    padding-right: 4px;
}

.catalog-loading {
    grid-column: 1 / -1;
    border: 1px dashed rgba(255,255,255,.12);
    border-radius: 22px;
    padding: 28px;
    text-align: center;
    color: var(--text-gray);
    background: rgba(255,255,255,.02);
}

.card {
    background: var(--card-bg);
    border-radius: 28px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    min-height: 100%;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.card:hover,
.card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,.18);
    background: var(--card-bg-strong);
    box-shadow: 0 26px 55px rgba(0,0,0,.32);
    outline: none;
}

.card:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 113, 227, .22), 0 26px 55px rgba(0,0,0,.32);
}

.card-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card h3 { font-size: clamp(22px, 2.6vw, 30px); margin: 0; line-height: 1.05; word-break: break-word; overflow-wrap: anywhere; }
.card p { font-size: 16px; line-height: 1.5; color: var(--text-gray); margin: 0; overflow-wrap: anywhere; word-break: break-word; }

.catalog-card-kicker {
    color: #9cc7ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.catalog-card-meta {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.3;
}
.catalog-card-action {
    margin-top: auto;
    color: #cfe4ff;
    font-size: 14px;
    font-weight: 800;
}

.btn-link {
    color: #9cc7ff;
    text-decoration: none;
    font-size: 16px;
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .55s ease, transform .55s ease;
}
.reveal.active { opacity: 1; transform: translateY(0); }

.catalog-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.catalog-modal.is-open {
    display: block;
}

.catalog-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.76);
    backdrop-filter: blur(8px);
}

.catalog-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(100% - 24px, 1120px);
    margin: 4vh auto;
    max-height: 92vh;
    overflow: auto;
    overflow-x: hidden;
    background: rgba(15,15,16,.98);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,.45);
    padding: 18px;
}

.catalog-modal-close {
    position: sticky;
    top: 0;
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(15,23,42,.92);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.catalog-modal-content {
    display: grid;
    grid-template-columns: minmax(320px, .95fr) minmax(280px, 1.05fr);
    gap: 24px;
    align-items: center;
    min-width: 0;
}

.catalog-modal-preview-column,
.catalog-modal-preview {
    min-width: 0;
}

.catalog-modal-info {
    min-width: 0;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: clamp(12px, 3vw, 34px);
    border-left: 1px solid rgba(255,255,255,.08);
}

.catalog-modal-info h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 44px);
    line-height: 1.05;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.catalog-modal-author {
    color: var(--text-gray);
    font-size: 15px;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.catalog-modal-author[hidden],
.catalog-modal-desc[hidden],
.catalog-modal-meta[hidden] { display: none; }

.catalog-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.catalog-modal-meta span {
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    color: #d1d1d6;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
}

.catalog-modal-desc {
    margin: 4px 0 0;
    color: #d1d1d6;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 46ch;
}

.catalog-cover {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.catalog-cover img {
    max-height: 58vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 12px 24px rgba(0,0,0,.18);
}

.catalog-preview-carousel {
    display: grid;
    gap: 10px;
}
.catalog-preview-carousel-body {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 10px;
}
.catalog-preview-viewport {
    overflow: hidden;
    min-width: 0;
    border-radius: 18px;
}
.catalog-preview-track {
    display: flex;
    transition: transform .24s ease;
    will-change: transform;
}
.catalog-preview-slide {
    flex: 0 0 100%;
    margin: 0;
    display: grid;
    gap: 8px;
    justify-items: center;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 12px;
}
.catalog-preview-slide img {
    max-height: 58vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 16px 36px rgba(0,0,0,.22);
}
.catalog-preview-slide figcaption {
    color: var(--text-gray);
    font-size: 13px;
}
.catalog-preview-nav {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(15,15,16,.94);
    color: #fff;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}
.catalog-preview-nav:disabled {
    opacity: .35;
    cursor: not-allowed;
}
.catalog-preview-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 54px;
}
.catalog-preview-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.catalog-preview-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: 0;
    background: rgba(255,255,255,.24);
    cursor: pointer;
}
.catalog-preview-dot.is-active { background: var(--accent-blue); }
.catalog-preview-counter {
    color: var(--text-gray);
    font-size: 13px;
}

.catalog-modal-loading,
.catalog-modal-empty {
    padding: 24px;
    border-radius: 18px;
    background: rgba(255,255,255,.03);
    border: 1px dashed rgba(255,255,255,.12);
    color: var(--text-gray);
    text-align: center;
}

@media (max-width: 900px) {
    html { scroll-snap-type: none; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero { padding-top: 92px; }
    .hero-stats { grid-template-columns: 1fr; }
    .product-grid { max-height: none; overflow: visible; }
    .catalog-modal-content {
        grid-template-columns: 1fr;
    }
    .catalog-modal-info {
        border-left: 0;
        border-top: 1px solid rgba(255,255,255,.08);
        padding: 18px 4px 4px;
    }
}

@media (max-width: 640px) {
    #navbar { min-height: 60px; }
    .nav-content { padding: 0 14px; }
    .logo-img { height: 22px; }
    .logo { font-size: 16px; }
    .nav-login-btn { padding: 9px 14px; font-size: 13px; }
    .hero { padding: 84px 14px 28px; }
    .catalog-section { padding: 84px 14px 36px; }
    .hero { min-height: auto; padding-top: 84px; padding-bottom: 24px; }
    .hero-copy h1 { font-size: clamp(34px, 12vw, 52px); max-width: 100%; line-height: 1.12; }
    .tagline { font-size: 16px; }
    .logo-img { height: 44px; }
    .logo { font-size: 28px; }
    .hero-panel { gap: 14px; }
    .hero-stats { grid-template-columns: 1fr; }
    .hero-copy, .hero-panel, .section-head, .card { border-radius: 22px; }
    .cta-group { width: 100%; }
    .btn-primary, .btn-secondary { flex: 1 1 0; }
    .catalog-modal-dialog {
        width: min(100% - 14px, 1100px);
        padding: 16px;
        margin: 12px auto;
    }
    .catalog-preview-carousel-body {
        grid-template-columns: 36px minmax(0, 1fr) 36px;
        gap: 8px;
    }
    .catalog-preview-nav {
        width: 36px;
        height: 36px;
        font-size: 26px;
    }
    .catalog-preview-slide img,
    .catalog-cover img {
        max-height: 42vh;
    }
    .catalog-preview-footer { padding: 0 44px; }
}
