/* ===== Base & Resets ===== */
:root {
    --bg: #0f1115;
    --bg-alt: #151922;
    --text: #e9edf1;
    --muted: #9aa7b2;
    --brand: #7c5cff;
    --brand-2: #18c6ff;
    --card: #191f2b;
    --border: #2a3342;
    --accent: #00e3a5;

    /* Spacing */
    --h: 100px;
    /* header height (fixed) */
    --container: 1200px;
    --pad: 20px;

    /* Typography */
    --ff-en: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --ff-he: "Heebo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --fs-hero: clamp(28px, 4vw, 44px);
    --fs-h2: clamp(22px, 3vw, 32px);
    --fs-h3: clamp(18px, 2.4vw, 24px);
    --fs-base: 16px;
}

/* Hebrew mode overrides when body has .lang-he */
body.lang-he {
    direction: rtl;
}

body.lang-en {
    direction: ltr;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    font-family: var(--ff-en);
    font-size: var(--fs-base);
    -webkit-text-size-adjust: 100%;
}

body.lang-he {
    font-family: var(--ff-he);
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Layout Helpers ===== */
.container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--pad);
}

.section {
    padding: 64px 0;
}

.section.alt {
    background: var(--bg-alt);
}

/* ===== Header (fixed, 100px) ===== */
.site-header {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    height: var(--h);
    background: linear-gradient(180deg, rgba(25, 31, 43, 0.95), rgba(25, 31, 43, 0.7));
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* center brand */
    gap: 16px;
    position: relative;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--pad);
}

/* Burger always right */
.burger {
    position: absolute;
    inset-inline-end: var(--pad);
    inset-block-start: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s ease, background .2s ease, border-color .2s ease;
}

.burger:active {
    transform: translateY(-50%) scale(0.98);
}

.burger i {
    font-size: 20px;
    transition: transform .3s ease, opacity .2s ease;
}

.burger.open i {
    transform: rotate(180deg);
}

/* Brand centered */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text);
    user-select: none;
}

.brand-line1 {
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-line2 {
    font-weight: 600;
    opacity: 0.9;
    color: var(--brand-2);
}

/* Lang switch (left space) */
.lang-switch {
    position: absolute;
    inset-inline-start: var(--pad);
    inset-block-start: 50%;
    transform: translateY(-50%);
}

.lang-btn {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
}

/* Side Nav */
.side-nav {
    position: fixed;
    top: var(--h);
    bottom: 0;
    inset-inline-end: -280px;
    /* hidden off-canvas to the right */
    width: 280px;
    background: var(--card);
    border-inline-start: 1px solid var(--border);
    transition: inset-inline-end .35s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.side-nav.open {
    inset-inline-end: 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-list a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.nav-list a:hover {
    background: #1f2735;
    border-color: var(--border);
}

/* Backdrop */
.nav-backdrop {
    position: fixed;
    inset: 0;
    top: var(--h);
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 998;
}

.nav-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* ===== Main (push below fixed header) ===== */
.site-main {
    padding-top: var(--h);
}

/* ===== Hero ===== */
.hero {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 48px 0 24px;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding-inline: var(--pad);
}

.hero-title {
    font-size: var(--fs-hero);
    font-weight: 800;
    line-height: 1.1;
}

.hero-sub {
    max-width: 850px;
    color: var(--muted);
}

.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-media {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-inline: var(--pad);
}

.hero-media img {
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    background: var(--card);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-color: transparent;
}

.btn.ghost {
    background: transparent;
}

.btn.small {
    padding: 8px 12px;
    font-size: 14px;
}

/* ===== Split layout (About) ===== */
.split {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.split .col {
    flex: 1 1 360px;
    min-width: 280px;
}

.split .col.media img {
    border-radius: 16px;
    border: 1px solid var(--border);
}

/* ===== Cards (Services) ===== */
.cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    flex: 1 1 280px;
    min-width: 260px;
}

.card h3 {
    font-size: var(--fs-h3);
    margin-top: 0;
}

/* ===== Projects ===== */
.projects {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
}

.project-media {
    flex: 1 1 420px;
    min-width: 280px;
}

.project-body {
    flex: 1 1 320px;
    min-width: 260px;
}

/* ===== Contact ===== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-form .row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.contact-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 280px;
}

.contact-form label.full {
    flex: 1 1 100%;
}

input,
textarea {
    background: #0e131b;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--brand-2);
    box-shadow: 0 0 0 3px rgba(24, 198, 255, 0.15);
}

.form-actions {
    display: flex;
    justify-content: flex-start;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--border);
    background: #0b0f15;
    padding: 28px 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    text-align: center;
}

.small {
    color: var(--muted);
    font-size: 14px;
}

/* ===== Language-dependent alignment ===== */
body.lang-en .hero-inner,
body.lang-en .footer-inner {
    text-align: center;
}

body.lang-he .hero-inner,
body.lang-he .footer-inner {
    text-align: center;
}

/* Main text alignment switches for LTR/RTL */
body.lang-en .project-body,
body.lang-en .card,
body.lang-en .contact-form {
    text-align: left;
}

body.lang-he .project-body,
body.lang-he .card,
body.lang-he .contact-form {
    text-align: right;
}

/* Ensure burger remains on the right in both directions */
body.lang-he .burger {
    right: var(--pad);
    left: auto;
}

body.lang-he .lang-switch {
    left: var(--pad);
    right: auto;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(24px, 6vw, 36px);
    }

    .brand-line1 {
        font-size: 18px;
    }

    .brand-line2 {
        font-size: 14px;
    }

    .project {
        padding: 12px;
    }
}

main section {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

main section.active {
    display: block;
    opacity: 1;
}