:root {
    --bg-color: #000000;
    --surface-color: #0a0a0a;
    --surface-hover: #111111;
    --accent-color: #abd302;
    --accent-hover: #b8e202;
    --text-primary: #f9f9f9;
    --text-secondary: rgba(249, 249, 249, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Montserrat', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
    --transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.gradient-text {
    color: #fff;
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 8rem 0;
    position: relative;
}

/* Header */
/* Logo Top */
.logo-top {
    position: absolute;
    top: 2rem;
    left: 2rem;
    text-decoration: none;
    z-index: 100;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.logo-top:hover {
    transform: scale(1.1);
}


/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('hero.jpg') no-repeat center center / cover;
    transform: scaleX(-1);
    z-index: 0;
}

.hero-left .hero-content {
    text-align: left;
    margin-left: 100px;
    justify-content: flex-start;
    position: relative;
    z-index: 10;
}

.hero-content h1 {
    font-size: 5.5rem;
    line-height: 1.1;
    margin-bottom: 2rem;
    max-width: 900px;
}

.hero-subtitle {
    font-size: 1.8rem;
    color: #fff;
    /* White as requested */
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Buttons */
/* Buttons - Less Template, More Custom */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 1.2rem 3rem;
    border-radius: 4px;
    /* Default more rectangular */
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-rect {
    border-radius: 4px !important;
}

.btn-primary {
    background: var(--accent-color);
    color: #000;
    box-shadow: 4px 4px 0 rgba(171, 211, 2, 0.1);
}

.btn-primary:hover {
    transform: scale(1.02);
    background: var(--accent-hover);
}

.btn-outline:hover {
    background: var(--glass-bg);
    border-color: var(--accent-color);
    transform: scale(1.02);
}

/* Services & Cases Grid */
#cases {
    background-color: #1a1a1a;
    padding-top: 3rem;
}

#cases .section-title h2 {
    font-size: 2.3rem;
    margin-top: 70px;
    margin-bottom: 1rem;
    line-height: 1;
}

/* Masonry Brick Grid for Cases */
.grid-5 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 210px;
    /* Base height for bricks */
    gap: 1.5rem;
    margin-top: 4rem;
    padding: 0;
}

.card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: #1E293B;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* Brick Sizing Logic - 5 items */
.grid-5>.card:nth-child(1) {
    grid-column: span 8;
    grid-row: span 2;
}

.grid-5>.card:nth-child(2) {
    grid-column: span 4;
    grid-row: span 3;
}

.grid-5>.card:nth-child(3) {
    grid-column: span 4;
    grid-row: span 2;
}

.grid-5>.card:nth-child(4) {
    grid-column: span 4;
    grid-row: span 2;
}

.grid-5>.card:nth-child(5) {
    grid-column: span 8;
    grid-row: span 1;
}

/* Symmetric Grid for Services - 6 blocks */
.grid-symmetric {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 4rem;
}

.grid-symmetric .card {
    height: 250px;
    background: rgba(0, 0, 0, 0.25);
    /* Черный с 25% прозрачностью */
    backdrop-filter: blur(10px);
    /* Эффект стекла */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 3rem;
    color: #ffffff;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.grid-symmetric .card:hover {
    transform: scale(1.05);
    /* Небольшой зум */
    border-color: var(--accent-color);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.grid-symmetric .card h3 {
    font-size: 1.3rem;
    margin: 1rem 0 0.5rem;
    color: #ffffff;
}

.grid-symmetric .card p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.grid-symmetric .card .icon-box {
    margin-bottom: 0;
    /* Align with new flex layout */
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 60%);
    z-index: 2;
}

.card-content {
    position: relative;
    z-index: 10;
    margin-top: auto;
    padding: 3rem 2rem;
    text-align: left;
    color: white;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.card-content p {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.9;
}

.card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(1.02);
    z-index: 50;
}

.icon-box {
    width: auto;
    height: auto;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: #808080;
    /* Серый как на заголовке */
    margin: 0 0 1.5rem;
    transition: all 0.3s ease;
    border: none;
    font-size: 2.5rem;
    /* Сделал иконки больше */
}

.card:hover .icon-box {
    transform: scale(1.1);
    color: #fff;
    /* Белый при наведении */
}

/* Two-Column Blocks (Owner & Mission) */
.split-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.photo-placeholder {
    width: 100%;
    aspect-ratio: 4/5;
    background: var(--surface-color);
    border: 1px dashed var(--glass-border);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

/* Glass Button Style */
.btn-glass-style {
    display: inline-flex;
    align-items: center;
    padding: 1.2rem 3rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.4s ease;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.btn-glass-style:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Reveal Overrides to disable scroll animations if needed */
.reveal {
    opacity: 1 !important;
    transform: none !important;
}

/* Popups */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    padding: 4rem;
    border-radius: 32px;
    max-width: 600px;
    width: 90%;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.close-modal {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}

.keys-decoration {
    position: absolute;
    bottom: 0;
    right: calc(10% + 40px);
    width: 20vw;
    /* Approximately 1/5th of the width */
    max-width: 300px;
    z-index: 5;
    pointer-events: none;
    object-fit: contain;
}

/* Utility Classes for Responsive Layouts */
.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5rem 4rem;
}

.smi-articles {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.buy-now-content {
    text-align: left;
    max-width: 800px;
    margin-left: 0;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet: 1024px */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 4rem;
    }

    .hero-left .hero-content {
        margin-left: 40px;
    }

    .grid-5 {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 240px;
    }

    .grid-5 > .card:nth-child(1),
    .grid-5 > .card:nth-child(2),
    .grid-5 > .card:nth-child(3),
    .grid-5 > .card:nth-child(4),
    .grid-5 > .card:nth-child(5) {
        grid-column: span 1;
        grid-row: span 1;
    }

    .grid-symmetric {
        grid-template-columns: repeat(2, 1fr);
    }

    .keys-decoration {
        display: none;
    }

    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Landscape / Large Mobile: 768px */
@media (max-width: 768px) {
    section {
        padding: 5rem 0;
    }

    .hero-content h1 {
        font-size: 2.8rem;
        margin-bottom: 1.2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-left .hero-content {
        margin-left: 0;
        text-align: center;
    }

    .logo-top {
        top: 1.2rem;
        left: 1.2rem;
    }

    .logo-top img {
        height: 24px;
    }

    /* Cases grid → 1 column */
    .grid-5 {
        grid-template-columns: 1fr;
        grid-auto-rows: 220px;
    }

    .grid-5 > .card:nth-child(1),
    .grid-5 > .card:nth-child(2),
    .grid-5 > .card:nth-child(3),
    .grid-5 > .card:nth-child(4),
    .grid-5 > .card:nth-child(5) {
        grid-column: span 1;
        grid-row: span 1;
    }

    .keys-decoration {
        display: none;
    }

    /* Owner/Brand → 1 column */
    .split-block {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Services → 1 column */
    .grid-symmetric {
        grid-template-columns: 1fr;
    }

    .grid-symmetric .card {
        height: auto;
        min-height: 200px;
        padding: 2rem;
    }

    /* Services heading */
    .services-heading {
        font-size: 7vw !important;
    }

    /* Buy-now section */
    #buy-now h2[style*="3.5rem"] {
        font-size: 2.2rem !important;
    }

    /* Trust stats → 1 column */
    .trust-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Trust heading */
    #trust h2 {
        font-size: 2rem !important;
    }

    /* SMI Articles → column */
    .smi-articles {
        flex-direction: column;
        align-items: stretch;
    }

    .smi-articles > a {
        flex: none !important;
        width: 100%;
    }

    /* Buy Now → center on mobile */
    .buy-now-content {
        text-align: center;
        margin: 0 auto;
    }

    /* Mission block */
    #mission .split-block {
        gap: 1.5rem;
    }

    #mission h2[style*="2.5rem"] {
        font-size: 1.8rem !important;
    }

    /* Modal */
    .modal-content {
        padding: 2rem;
        border-radius: 20px;
    }

    /* Footer */
    footer div[style*="justify-content: space-between"] {
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
    }

    footer div[style*="text-align: right"] {
        text-align: center !important;
    }

    footer div[style*="text-align: right"] p {
        margin-left: 0 !important;
        margin: 0 auto !important;
    }

    .nav-links {
        display: none;
    }
}

/* Mobile Portrait: 480px */
@media (max-width: 480px) {
    .container {
        padding: 0 1.2rem;
    }

    .hero-content h1 {
        font-size: 2.1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    section {
        padding: 4rem 0;
    }

    #cases {
        padding-top: 2rem;
    }

    #cases .section-title h2 {
        font-size: 1.6rem;
        margin-top: 30px;
    }

    .grid-5 {
        grid-auto-rows: 200px;
        gap: 1rem;
        margin-top: 2rem;
    }

    .card-content h3 {
        font-size: 1.1rem;
    }

    #owner-brand {
        padding: 3rem 0 !important;
    }

    #owner-brand h2[style] {
        font-size: 1.8rem !important;
    }

    #trust {
        padding: 4rem 0 !important;
    }

    #trust .section-title {
        margin-bottom: 3rem !important;
    }

    #trust div[style*="4.5rem"] {
        font-size: 3.5rem !important;
    }

    #smi h2[style] {
        font-size: 2rem !important;
        margin-bottom: 2rem !important;
    }

    #smi a {
        padding: 1.5rem !important;
    }

    #buy-now {
        padding: 5rem 0 !important;
    }

    #buy-now h2[style] {
        font-size: 1.8rem !important;
    }

    .btn-glass-style {
        padding: 1rem 1.8rem;
        font-size: 0.85rem;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }
}