/* ============================================================
   Yair Klausner — Portfolio
   Design system: dark slate + electric teal accent, Heebo type
   ============================================================ */

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

:root {
    --bg: #0a0e14;
    --bg-alt: #0e131b;
    --surface: #131a24;
    --surface-hover: #182130;
    --border: rgba(148, 163, 184, 0.12);
    --border-strong: rgba(148, 163, 184, 0.22);

    --accent: #2dd4bf;
    --accent-strong: #14b8a6;
    --accent-soft: rgba(45, 212, 191, 0.1);
    --accent-border: rgba(45, 212, 191, 0.3);

    --text: #e6edf5;
    --text-soft: #a8b3c2;
    --text-faint: #6b7787;

    --font-sans: 'Heebo', 'Segoe UI', Tahoma, sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, monospace;

    --radius: 12px;
    --radius-sm: 8px;
    --container: 1120px;
    --header-h: 68px;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.35);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: var(--accent);
    color: #04211d;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

p {
    color: var(--text-soft);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--accent);
    color: #04211d;
}

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

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

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-text {
    background: transparent;
    color: var(--text-soft);
    padding-inline: 0.5rem;
}

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

.btn-small {
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ---------- Header ---------- */

.site-header {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: transparent;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
    background: rgba(10, 14, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--border);
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.brand-name {
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: 0.01em;
}

.site-nav {
    display: flex;
    gap: 1.75rem;
}

.site-nav a {
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.site-nav a:hover {
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-link {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    transition: color 0.2s ease, background 0.2s ease;
}

.icon-link:hover {
    color: var(--text);
    background: var(--surface);
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 78% 18%, rgba(45, 212, 191, 0.09), transparent 60%),
        radial-gradient(ellipse 50% 45% at 15% 85%, rgba(56, 130, 246, 0.07), transparent 65%);
    pointer-events: none;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, black 25%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, black 25%, transparent 75%);
}

.hero-inner {
    position: relative;
    padding-top: var(--header-h);
    padding-bottom: 3rem;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 1rem;
    letter-spacing: 0.04em;
}

.hero-title {
    font-size: clamp(2.6rem, 7vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
}

.hero-desc {
    font-size: 1.15rem;
    max-width: 620px;
    margin-bottom: 2.25rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 3rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style: none;
}

.hero-meta li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    color: var(--text-faint);
}

.hero-meta svg {
    color: var(--text-faint);
    flex-shrink: 0;
}

.hero-meta-available {
    color: var(--accent) !important;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.35;
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% { transform: scale(0.6); opacity: 0.4; }
    70%, 100% { transform: scale(1.6); opacity: 0; }
}

/* ---------- Sections ---------- */

.section {
    padding: 6.5rem 0;
}

.section-alt {
    background: var(--bg-alt);
    border-block: 1px solid var(--border);
}

.section-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 3rem;
}

.section-num {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--accent);
}

.section-head h2 {
    font-size: clamp(1.7rem, 3.5vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ---------- About ---------- */

.about-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 3.5rem;
    align-items: start;
}

.about-text p {
    font-size: 1.08rem;
    margin-bottom: 1.4rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-facts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    transition: border-color 0.2s ease;
}

.fact-card:hover {
    border-color: var(--accent-border);
}

.fact-value {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--accent);
}

.fact-label {
    font-size: 0.9rem;
    color: var(--text-soft);
}

/* ---------- Technologies ---------- */

.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.tech-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.6rem;
    transition: border-color 0.2s ease;
}

.tech-card:hover {
    border-color: var(--border-strong);
}

.tech-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags span {
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.84rem;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid transparent;
}

.tags-ghost span {
    background: transparent;
    color: var(--text-soft);
    border-color: var(--border);
}

/* ---------- Projects ---------- */

.project-featured {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
}

.project-featured-media {
    min-height: 320px;
    position: relative;
}

.project-featured-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-featured-body {
    padding: 2.25rem 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-kicker {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-featured-body h3 {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.3;
}

.project-featured-body > p {
    font-size: 0.98rem;
}

.project-featured .project-links {
    margin-top: auto;
    padding-top: 0.5rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lift);
}

.project-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-media img {
    transform: scale(1.04);
}

.project-body {
    padding: 1.4rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex-grow: 1;
}

.project-body h3 {
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
}

.project-body > p {
    font-size: 0.92rem;
    flex-grow: 1;
}

.project-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-link svg {
    transition: transform 0.2s ease;
}

.text-link:hover svg {
    transform: translate(-2px, -2px);
}

/* ---------- Contact ---------- */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 3rem;
    align-items: start;
}

.contact-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.contact-list {
    list-style: none;
    margin-top: 1.75rem;
    display: flex;
    flex-direction: column;
}

.contact-list li {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.97rem;
}

.contact-list li:last-child {
    border-bottom: none;
}

.contact-label {
    min-width: 72px;
    color: var(--text-faint);
    font-size: 0.85rem;
}

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

.contact-list a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-soft);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-faint);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-status {
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.form-status--ok {
    color: var(--accent);
}

.form-status--error {
    color: #f87171;
}

.form-honey {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-footer p {
    font-size: 0.88rem;
    color: var(--text-faint);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s ease;
}

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

/* ---------- Reveal animation ---------- */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

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

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .pulse-dot::after {
        animation: none;
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .about-facts {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .fact-card {
        flex: 1 1 200px;
    }

    .project-featured {
        grid-template-columns: 1fr;
    }

    .project-featured-media {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

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

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 720px) {
    .site-nav {
        display: none;
    }

    .brand-name {
        display: none;
    }

    .section {
        padding: 4.5rem 0;
    }

    .tech-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .hero-actions .btn {
        flex: 1 1 auto;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}
