/* ==========================================================================
   TOMPA — Design tokens
   ========================================================================== */
:root {
    --bg-deep: #0d0f16;
    --bg-surface: #161a24;
    --bg-card: #1c2130;
    --bg-elevated: #202635;
    --border-subtle: #232a3b;
    --border-strong: #2e3c54;
    --text-main: #ffffff;
    --text-sub: #b6c2d4;
    --text-muted: #7d8aa3;
    --tompa-blue: #38bdf8;
    --tompa-blue-hover: #7dd3fc;
    --tompa-glow: rgba(56, 189, 248, 0.15);
    --focus-border: #f59e0b;
    --success: #34d399;

    --radius-sm: 5px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px var(--tompa-glow);

    --font-body: 'Assistant', sans-serif;
    --font-heading: 'Rubik', 'Assistant', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --grid-line: rgba(56, 189, 248, 0.06);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-deep);
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.07) 0%, transparent 45%);
    background-size: 48px 48px, 48px 48px, 100% 100%;
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3,
.section-title,
.logo-box span {
    font-family: var(--font-heading);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px;
}

.skip-to-main {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--tompa-blue);
    color: #000;
    padding: 10px 20px;
    z-index: 999;
    font-weight: bold;
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.skip-to-main:focus {
    top: 20px;
    outline: 3px solid var(--focus-border);
}

a:focus,
button:focus,
[tabindex="0"]:focus,
input:focus,
textarea:focus {
    outline: 3px solid var(--focus-border);
    outline-offset: 4px;
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
header#site-header {
    background-color: transparent;
    border-bottom: 1px solid transparent;
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 20px 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, padding 0.3s ease, backdrop-filter 0.3s ease;
}

header#site-header.scrolled {
    background-color: rgba(13, 15, 22, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo-box img {
    max-height: 32px;
    display: block;
    border-radius: 4px;
    transition: max-height 0.3s ease;
}

header#site-header.scrolled .logo-box img {
    max-height: 28px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 26px;
    align-items: center;
}

.main-nav a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.02rem;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--tompa-blue);
}

.nav-cta {
    background: var(--tompa-blue);
    color: #06131c !important;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700 !important;
    transition: background 0.2s, transform 0.2s;
}

.nav-cta:hover {
    background: var(--tompa-blue-hover);
    color: #06131c !important;
    transform: translateY(-1px);
}

/* Language switcher */
.lang-switcher {
    position: relative;
}

.btn-lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-lang:hover,
.btn-lang[aria-expanded="true"] {
    border-color: var(--tompa-blue);
    color: var(--tompa-blue);
    background: var(--tompa-glow);
}

.btn-lang .chevron {
    font-size: 0.65rem;
    transition: transform 0.2s;
}

.btn-lang[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    list-style: none;
    min-width: 160px;
    padding: 6px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 200;
}

.lang-switcher.open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-menu li + li {
    margin-top: 2px;
}

.lang-menu a {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-sub);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
}

.lang-menu a:hover {
    background: var(--tompa-glow);
    color: var(--tompa-blue);
}

.lang-menu a.active {
    color: var(--tompa-blue);
    background: var(--tompa-glow);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle .bar {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    position: relative;
}

.nav-toggle .bar::before,
.nav-toggle .bar::after {
    content: '';
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease;
}

.nav-toggle .bar::before {
    top: -6px;
}

.nav-toggle .bar::after {
    top: 6px;
}

@media (max-width: 860px) {
    .nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        position: fixed;
        inset-inline: 0;
        top: var(--header-h, 66px);
        background: rgba(13, 15, 22, 0.98);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border-subtle);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 20px 20px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.25s ease;
    }

    .main-nav.open {
        max-height: 80vh;
        opacity: 1;
        overflow-y: auto;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .main-nav ul li a {
        display: block;
        padding: 14px 6px;
        border-bottom: 1px solid var(--border-subtle);
    }

    .main-nav .nav-cta {
        text-align: center;
        margin-top: 10px;
    }

    .lang-switcher {
        margin-top: 14px;
    }

    .lang-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        margin-top: 8px;
        box-shadow: none;
        width: 100%;
    }

    .lang-switcher.open .lang-menu {
        display: block;
    }
}

/* ==========================================================================
   Reveal-on-scroll animation
   ========================================================================== */
.reveal {
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
    will-change: transform, opacity;
}

.reveal-left { transform: translateX(-50px); }
.reveal-right { transform: translateX(50px); }
.reveal-bottom { transform: translateY(40px); }

.reveal.active {
    opacity: 1;
    transform: translate(0, 0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: var(--tompa-blue);
    color: #06131c;
    box-shadow: 0 8px 20px -6px rgba(56, 189, 248, 0.5);
}

.btn-primary:hover {
    background: var(--tompa-blue-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-strong);
}

.btn-outline:hover {
    border-color: var(--tompa-blue);
    color: var(--tompa-blue);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero-center {
    min-height: 78vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 40px 0;
    width: 100%;
}

.hero-center > * {
    max-width: 100%;
}

.main-logo {
    max-width: 320px;
    width: 100%;
    margin-bottom: 24px;
}

.hero-lead {
    font-size: 1.3rem;
    color: var(--text-sub);
    max-width: min(680px, 100%);
    margin: 18px auto 36px;
}

.hero-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 56px;
}

.stat-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 48px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--tompa-blue);
    line-height: 1.2;
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* ==========================================================================
   Section titles
   ========================================================================== */
.section-title {
    display: flex;
    align-items: baseline;
    gap: 16px;
    font-size: 2.1rem;
    font-weight: 700;
    margin: 0 0 32px 0;
    position: relative;
    padding-bottom: 14px;
}

.section-index {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    opacity: 0.75;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background-color: var(--tompa-blue);
}

html[dir="rtl"] .section-title { text-align: right; }
html[dir="rtl"] .section-title::after { right: 0; left: auto; }
html[dir="ltr"] .section-title { text-align: left; }
html[dir="ltr"] .section-title::after { left: 0; right: auto; }

.section-title.text-center { justify-content: center; text-align: center; }
.section-title.text-center::after { left: 50%; right: auto; transform: translateX(-50%); }

.section-eyebrow {
    display: block;
    font-family: var(--font-mono);
    color: var(--tompa-blue);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

section.page-section {
    padding: 70px 0;
    border-top: 1px solid var(--border-subtle);
}

section.page-section:first-of-type {
    border-top: none;
}

/* ==========================================================================
   Skills
   ========================================================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 36px 40px;
}

.skill-bar { margin-bottom: 4px; }
.skill-info { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600; }
.progress-track { background: var(--bg-card); height: 10px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-subtle); }
.progress-fill { background: linear-gradient(90deg, var(--tompa-blue), var(--tompa-blue-hover)); height: 100%; border-radius: 10px; }

/* ==========================================================================
   About
   ========================================================================== */
.about-section { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; align-items: start; }
.about-image { width: 100%; border-radius: var(--radius-md); border: 2px solid var(--border-subtle); }
.about-text-block p { font-size: 1.12rem; line-height: 1.85; color: var(--text-sub); margin-bottom: 20px; }

.process {
    margin-top: 34px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 30px 30px 26px;
}

.process-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 26px;
}

.process-steps {
    list-style: none;
}

.process-step {
    position: relative;
    padding-inline-start: 46px;
    padding-bottom: 26px;
}

.process-step:last-child {
    padding-bottom: 0;
}

.process-step-number {
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--tompa-blue);
    color: var(--tompa-blue);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
}

.process-step:not(:last-child)::before {
    content: '';
    position: absolute;
    inset-inline-start: 15px;
    top: 32px;
    bottom: -26px;
    width: 2px;
    background: linear-gradient(var(--tompa-blue), transparent 90%);
    opacity: 0.4;
}

.process-step-label {
    display: block;
    padding-top: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-sub);
}

@media (max-width: 768px) {
    .process { text-align: start; }
}

@media (max-width: 768px) {
    .about-section { grid-template-columns: 1fr; text-align: center; }
    .about-image { max-width: 280px; margin: 0 auto; }
}

/* ==========================================================================
   Projects
   ========================================================================== */
.projects-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 28px;
}

.project-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.project-item:hover {
    border-color: var(--tompa-blue);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.project-item::before,
.project-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, width 0.25s ease, height 0.25s ease;
}

.project-item::before {
    top: -1px;
    inset-inline-start: -1px;
    border-top: 2px solid var(--tompa-blue);
    border-inline-start: 2px solid var(--tompa-blue);
    border-start-start-radius: var(--radius-md);
}

.project-item::after {
    bottom: -1px;
    inset-inline-end: -1px;
    border-bottom: 2px solid var(--tompa-blue);
    border-inline-end: 2px solid var(--tompa-blue);
    border-end-end-radius: var(--radius-md);
}

.project-item:hover::before,
.project-item:hover::after {
    opacity: 1;
    width: 24px;
    height: 24px;
}

@media (prefers-reduced-motion: reduce) {
    .project-item, .project-item::before, .project-item::after {
        transition: none;
    }
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}

.project-category {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--tompa-blue);
    background: var(--tompa-glow);
    padding: 4px 10px;
    border-radius: 4px;
}

.project-icon-img {
    height: 3.6em;
    width: auto;
    border-radius: 6px;
}

.project-icon-emoji {
    font-size: 1.7rem;
}

.project-item h3 {
    font-size: 1.45rem;
    margin-bottom: 12px;
    color: #ffffff;
}

.project-item p {
    color: var(--text-sub);
    font-size: 1.02rem;
    margin-bottom: 24px;
    flex-grow: 1;
}

.tag-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.tag-pill {
    background: #131826;
    border: 1px solid var(--border-strong);
    color: #94a3b8;
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 4px;
}

.action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #06131c;
    background-color: var(--tompa-blue);
    text-decoration: none;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    transition: background 0.2s, transform 0.2s;
    align-self: flex-start;
}

.action-link:hover {
    background-color: var(--tompa-blue-hover);
    transform: translateY(-1px);
}

/* ==========================================================================
   Reviews
   ========================================================================== */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.review-card {
    background: var(--bg-surface);
    padding: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    position: relative;
}

.review-card::before {
    content: '"';
    position: absolute;
    top: 6px;
    inset-inline-end: 20px;
    font-size: 4rem;
    color: rgba(56, 189, 248, 0.12);
    font-family: sans-serif;
}

.review-text {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-main);
    margin-bottom: 20px;
}

.review-attribution {
    border-top: 1px solid var(--border-strong);
    padding-top: 15px;
}

.review-name {
    color: var(--tompa-blue);
    display: block;
    font-weight: 700;
}

.review-role {
    color: var(--text-sub);
    font-size: 0.9rem;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-form {
    background: var(--bg-surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    max-width: 600px;
    margin: 0 auto;
}

.form-group { margin-bottom: 20px; text-align: start; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-sub); font-weight: 600; }

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 15px;
    background: var(--bg-deep);
    border: 1px solid var(--border-strong);
    color: #fff;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--tompa-blue);
}

.honeypot-field { display: none; } /* חיוני למניעת ספאם מבוטים */

.form-alert {
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid var(--success);
    color: #fff;
    padding: 15px;
    border-radius: var(--radius-sm);
    max-width: 600px;
    margin: 0 auto 20px auto;
    font-weight: 700;
    display: none;
}

.form-alert.visible {
    display: block;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    margin-top: 60px;
    padding: 60px 0 30px 0;
    border-top: 1px solid var(--border-subtle);
    background: #08090e;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 40px;
}

.footer-logo {
    max-height: 36px;
    margin-bottom: 15px;
    filter: grayscale(100%) opacity(75%);
}

.footer-tagline {
    color: var(--text-sub);
    font-size: 0.95rem;
    max-width: 320px;
}

.footer-heading {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.05rem;
    font-weight: 700;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: var(--text-sub);
    text-decoration: none;
    transition: color 0.15s;
}

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

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Project detail page
   ========================================================================== */
.back-link {
    color: var(--tompa-blue);
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    font-size: 1.05rem;
}

.project-detail-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 40px;
    border-radius: var(--radius-lg);
    position: relative;
}

.project-detail-header {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 25px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.project-detail-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
}

.project-detail-icon {
    font-size: 3rem;
    background: #131826;
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-detail-icon img {
    height: auto;
    max-width: 100%;
    max-height: 60px;
}

.detail-label {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.project-detail-body {
    font-size: 1.15rem;
    line-height: 1.85;
    color: var(--text-sub);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-detail-body a {
    color: var(--tompa-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.project-detail-body a:hover {
    color: var(--tompa-blue-hover);
}

.project-detail-summary {
    font-weight: 600;
    color: #ffffff;
    font-size: 1.3rem;
}

.project-detail-more {
    border-inline-start: 3px solid var(--tompa-blue);
    font-style: italic;
    background: rgba(56, 189, 248, 0.03);
    padding: 15px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
