/* =====================================================
   IDO HOMRI · AI ENGINEER PORTFOLIO — LIGHT THEME
   ===================================================== */

/* ===== CSS Variables ===== */
:root {
    --font: 'Poppins', sans-serif;

    /* Light theme palette */
    --bg: #f4f7ff;
    --surface: #ffffff;
    --surface-alt: #eef2fc;

    --text: #0d1b35;
    --text-mid: #3a5278;
    --text-muted: #7a93b8;

    /* Accent — teal */
    --accent: #5be4d4;
    --accent-text: #0aada2; /* darker teal for text on light bg */
    --accent-bg: rgba(91, 228, 212, 0.1);
    --accent-border: rgba(91, 228, 212, 0.4);
    --accent-glow: rgba(91, 228, 212, 0.22);

    /* Borders & shadows */
    --border: rgba(13, 27, 53, 0.09);
    --border-hover: rgba(13, 27, 53, 0.2);
    --shadow: 0 2px 24px rgba(13, 27, 53, 0.07);
    --shadow-hover: 0 10px 48px rgba(13, 27, 53, 0.13);

    /* Hero dark bg */
    --hero-bg: #0a1628;

    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.3s ease;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 5px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: rgba(91, 228, 212, 0.4);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-text);
}

/* ===== Shared Utilities ===== */
.section-tag {
    display: none;
    /* display: inline-block; */
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent-text);
    padding: 0.28rem 0.95rem;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: 50px;
    margin-bottom: 1rem;
    opacity: 0;
}

.section-intro {
    text-align: center;
    margin-bottom: 4.5rem;
}

.section-intro h2 {
    font-size: clamp(2.4rem, 4.5vw, 3.8rem);
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    letter-spacing: -0.02em;
    opacity: 0;
}

.section-desc {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 0.85rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    opacity: 0;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.4rem 5rem;
    transition:
        background var(--transition),
        backdrop-filter var(--transition),
        border-color var(--transition);
}

.navbar.scrolled {
    background: rgba(244, 247, 255, 0.88);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.08em;
    color: var(--accent-text);
    transition: color var(--transition);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.04em;
    color: var(--text-mid);
    transition: color var(--transition);
}

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

/* ===== HERO (light — matches site bg) ===== */
#hero {
    position: relative;
    height: 100vh;
    min-height: 720px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#node-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 860px;
    padding: 2rem;
}
.hero-content a{
    color: var(--hero-bg);
}

.hero-eyebrow {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.38em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-bottom: 1.3rem;
    opacity: 0;
}

.hero-title {
    font-size: clamp(3.4rem, 8vw, 6.5rem);
    font-weight: 800;
    line-height: 1.03;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    opacity: 0;
}

.hero-name {
    background: linear-gradient(
        130deg,
        var(--text) 0%,
        var(--accent-text) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: clamp(1.05rem, 1.9vw, 1.25rem);
    font-weight: 300;
    line-height: 1.8;
    color: var(--text-mid);
    max-width: 600px;
    margin: 0 auto 3rem;
    opacity: 0;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.05rem 2.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, #3dbfb0 100%);
    color: var(--hero-bg);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    border-radius: 50px;
    box-shadow: 0 4px 30px rgba(91, 228, 212, 0.35);
    transition:
        transform var(--transition),
        box-shadow var(--transition);
    opacity: 0;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 55px rgba(91, 228, 212, 0.55);
}

.btn-arrow {
    transition: transform var(--transition);
}
.btn-primary:hover .btn-arrow {
    transform: translateX(4px);
}

.hero-scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0;
}

.scroll-line {
    width: 1px;
    height: 44px;
    background: linear-gradient(to bottom, var(--accent-text), transparent);
    animation: scrollPulse 2.2s ease-in-out infinite;
}

/* ===== RESUME / TIMELINE ===== */
#resume {
    max-width: 1060px;
    margin: 0 auto;
    padding: 9rem 5rem 8rem;
}

.btn-cv {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.4rem;
    background: var(--surface);
    color: var(--accent-text);
    border: 1.5px solid var(--accent-border);
    border-radius: 50px;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    opacity: 0;
}

.btn-cv:hover {
    background: var(--accent);
    color: var(--hero-bg);
    border-color: var(--accent);
    box-shadow: 0 4px 24px var(--accent-glow);
    transform: translateY(-2px);
}

/* CV email send flow */
@keyframes cvSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes cvFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cv-send-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.4rem;
}

/* Reset <button> defaults and match anchor styling */
.btn-cv {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.cv-email-row {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
    max-width: 320px;
}

.cv-email-row.open {
    display: flex;
    animation: cvSlideDown 0.25s ease forwards;
}

.cv-email-input {
    width: 100%;
    padding: 0.55rem 1.1rem;
    border: 1.5px solid var(--border-hover);
    border-radius: 50px;
    font-family: var(--font);
    font-size: 0.85rem;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition);
    box-shadow: var(--shadow);
    text-align: center;
}

.cv-email-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.cv-email-input.invalid {
    border-color: #e55;
    box-shadow: 0 0 0 3px rgba(220, 60, 60, 0.12);
}

.cv-email-error {
    font-size: 0.75rem;
    color: #d44;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.cv-email-error.visible {
    opacity: 1;
}

.cv-thanks {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-text);
    margin: 0;
}

.cv-thanks.visible {
    display: inline-flex;
    animation: cvFadeIn 0.4s ease forwards;
}

/* ─── Resume AI Chat ─────────────────────────────── */
/* ─── Inline chat trigger ────────────────────────── */
.resume-chat {
    margin-top: 3.5rem;
}

.resume-chat-input-row {
    display: flex;
    width: 100%;
    max-width: 400px;
    align-items: center;
    margin: 0 auto;
    gap: 0;
    background: var(--surface);
    border: 1.5px solid var(--border-hover);
    border-radius: 50px;
    padding: 0.45rem 0.45rem 0.45rem 1.2rem;
    box-shadow: var(--shadow);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.resume-chat-input-row:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.resume-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 0.875rem;
    color: var(--text);
    outline: none;
    font-family: inherit;
    padding: 0;
}

.resume-chat-input::placeholder { color: var(--text-muted); }

.resume-chat-send {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity var(--transition);
}

.resume-chat-send:hover { opacity: 0.8; }

/* ─── Chat backdrop ──────────────────────────────── */
.chat-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 53, 0.4);
    backdrop-filter: blur(3px);
    z-index: 499;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.chat-backdrop.is-open {
    opacity: 1;
    pointer-events: all;
}

/* ─── Chat popup ─────────────────────────────────── */
.chat-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 500;
    /* width: 440px; */
    width: 90vw;
    max-width: 800px;
    min-height: 400px;
    /* max-width: calc(100vw - 2rem); */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.chat-popup.is-open {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
}

.chat-popup-head {
    /* display: none; */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
    flex-shrink: 0;
}

.chat-popup-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-text);
}

.chat-popup-close {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color var(--transition);
}

.chat-popup-close:hover { color: var(--text); }

.chat-popup-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2.1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    scroll-behavior: smooth;
    max-height: 500px;
}

.chat-popup-messages::-webkit-scrollbar { width: 3px; }
.chat-popup-messages::-webkit-scrollbar-track { background: transparent; }
.chat-popup-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* Bubble rows (avatar + text) */
.chat-bubble-row {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Bubbles */
.chat-bubble {
    max-width: 82%;
    font-size: 1rem;
    line-height: 1.6;
    word-break: break-word;
    animation: bubbleIn 0.18s ease;
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-bubble--assistant {
    color: var(--text-mid);
    align-self: flex-start;
    /* background: var(--surface-alt); */
    border-radius: 0 12px 12px 12px;
    padding: .1rem 1rem;
}

/* Markdown content inside assistant bubbles */
.chat-bubble--assistant p { margin: 0 0 0.5em; }
.chat-bubble--assistant p:last-child { margin-bottom: 0; }
.chat-bubble--assistant ul,
.chat-bubble--assistant ol {
    margin: 0.25em 0 0.5em;
    padding-inline-start: 1.25em;
}
.chat-bubble--assistant li { margin-bottom: 0.15em; }
.chat-bubble--assistant strong { color: var(--text); font-weight: 600; }
.chat-bubble--assistant em { font-style: italic; }
.chat-bubble--assistant code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8em;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.1em 0.35em;
}
.chat-bubble--assistant pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 6px);
    padding: 0.6em 0.8em;
    overflow-x: auto;
    margin: 0.4em 0;
}
.chat-bubble--assistant pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.78em;
}

.chat-bubble--user {
    color: var(--accent-text);
    align-self: flex-end;
    font-weight: 500;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: 12px 12px 0 12px;
    padding: 0.55rem 0.75rem;
}

.chat-bubble--typing {
    display: flex;
    align-items: center;
    gap: 4px;
    /* padding: 2px 0; */
}

.chat-bubble--typing span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingDot 1.2s infinite ease-in-out;
}

.chat-bubble--typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble--typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30%            { transform: translateY(-4px); opacity: 1; }
}

.chat-popup-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.75rem 1.1rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-popup-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 0.875rem;
    color: var(--text);
    outline: none;
    font-family: inherit;
    padding: 0;
}

.chat-popup-input::placeholder { color: var(--text-muted); }

.chat-popup-send {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color var(--transition);
}

.chat-popup-send:hover { color: var(--accent-text); }
.chat-popup-send:disabled { opacity: 0.3; cursor: default; }

/* Left-edge timeline — cards are wide */
.timeline-wrap {
    position: relative;
    padding-left: 56px;
}

.timeline-track {
    position: absolute;
    left: 14px;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--border);
    border-radius: 2px;
}

.timeline-progress {
    width: 100%;
    height: 0%;
    background: linear-gradient(
        to bottom,
        var(--accent),
        rgba(91, 228, 212, 0.3)
    );
    box-shadow: 0 0 12px var(--accent-glow);
    border-radius: 2px;
    transform-origin: top;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    opacity: 0;
}

.timeline-dot {
    position: absolute;
    left: -49px;
    top: 1.6rem;
    width: 13px;
    height: 13px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid var(--bg);
    box-shadow:
        0 0 0 2px var(--accent-border),
        0 0 16px var(--accent-glow);
    z-index: 2;
    transition: transform var(--transition);
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.5);
}

.timeline-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2.4rem;
    box-shadow: var(--shadow);
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
    will-change: transform;
}

.timeline-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.tl-period {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-bottom: 0.45rem;
}

.timeline-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.tl-company {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1.2rem;
}

.tl-bullets {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.tl-bullets li {
    font-size: 0.875rem;
    color: var(--text-mid);
    padding-left: 1.3rem;
    position: relative;
    line-height: 1.65;
}

.tl-bullets li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-text);
    font-size: 0.72rem;
    top: 0.22em;
}

/* ===== ARSENAL ===== */
#stack {
    max-width: 1060px;
    margin: 0 auto;
    padding: 7rem 5rem 8rem;
    border-top: 1px solid var(--border);
}

.skills-wrap {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

.skill-group {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.group-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
    opacity: 0;
}

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

.skill-tag {
    display: inline-block;
    padding: 0.42rem 1.05rem;
    background: var(--surface);
    border: 1px solid var(--border-hover);
    border-radius: 50px;
    font-size: 0.845rem;
    font-weight: 500;
    color: var(--text-mid);
    cursor: default;
    transition: all 0.22s ease;
    user-select: none;
    will-change: transform;
    box-shadow: var(--shadow);
    opacity: 0;
}

.skill-tag:hover {
    border-color: var(--accent);
    color: var(--accent-text);
    background: var(--accent-bg);
    box-shadow: 0 4px 18px var(--accent-glow);
}

/* ===== PROJECTS ===== */
#projects {
    max-width: 1500px;
    margin: 0 auto;
    padding: 7rem 5rem 8rem;
    border-top: 1px solid var(--border);
}

.projects-loading {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 3rem;
}

.projects-gallery-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.projects-gallery-row .projects-grid {
    flex: 1;
    min-width: 0;
}

.projects-nav-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-mid);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition), opacity var(--transition);
}

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

.projects-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.projects-scroll-hint {
    display: none;
}

.projects-grid {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
    /* hide scrollbar but keep functionality */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.projects-grid::-webkit-scrollbar {
    display: none;
}

.projects-scrollbar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.proj-autoplay-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.proj-autoplay-wrap .projects-nav-btn {
    position: relative;
    z-index: 1;
}

.proj-countdown-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: rotate(-90deg);
    z-index: 2;
}

.proj-ring-track {
    fill: none;
    stroke: var(--border);
    stroke-width: 2;
}

.proj-ring-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 94.25;
    stroke-dashoffset: 94.25;
    /* duration overridden by JS to match PROJECTS_SCROLL_INTERVAL */
    transition: stroke-dashoffset 3s linear;
}


.projects-scrollbar {
    position: relative;
    height: 3px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    flex: 1;
}

.projects-thumb {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: left 0.08s linear, width 0.08s linear;
}

.project-card {
    min-width: 500px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        scale var(--transition),
        transform var(--transition);
    will-change: transform;
    flex: 0 0 340px;
    scroll-snap-align: start;
    overflow: hidden;
    opacity: 0;
}

.project-card:hover {
    border-color: var(--accent-border);
    scale: 1.02;
    transform: translateY(-5px);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.project-card-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.project-card-title svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.project-card-title h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    letter-spacing: -0.01em;
}

.project-stars {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.project-desc {
    font-size: 0.875rem;
    color: var(--text-mid);
    line-height: 1.7;
    flex: 1;
}

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

.project-tag {
    padding: 0.22rem 0.7rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-mid);
    letter-spacing: 0.02em;
}

.project-install {
    background: #0d1b35;
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.install-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-text);
    white-space: nowrap;
}

.install-cmd {
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    background: rgba(91, 228, 212, 0.12);
    border: 1px solid rgba(91, 228, 212, 0.25);
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: rgba(91, 228, 212, 0.25);
}
.copy-btn.copied {
    color: #5be470;
    border-color: rgba(91, 228, 212, 0.4);
}

/* ===== CALLIE ===== */
.callie-featured-text {
    opacity: 0;
}

#callie {
    max-width: 1100px;
    margin: 0 auto;
    padding: 7rem 5rem 8rem;
    border-top: 1px solid var(--border);
}

/* Featured card: text left, phone right */
.callie-featured {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem 3rem 3rem 3.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.callie-featured-text .panel-tag {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-bottom: 0.75rem;
    display: block;
}

.callie-featured-text h3 {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.callie-featured-text p {
    font-size: 0.94rem;
    color: var(--text-mid);
    line-height: 1.82;
    margin-bottom: 1.4rem;
}

.panel-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.panel-list li {
    font-size: 0.875rem;
    color: var(--text-mid);
    padding-left: 1.3rem;
    position: relative;
    line-height: 1.6;
}

.panel-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-text);
    font-size: 0.78rem;
}

/* Technical cards below featured */
.callie-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.callie-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem 2rem;
    box-shadow: var(--shadow);
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
    opacity: 0;
}

.callie-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.callie-card-icon {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    display: block;
}

.callie-card .panel-tag {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-bottom: 0.5rem;
    display: block;
}

.callie-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.callie-card p {
    font-size: 0.875rem;
    color: var(--text-mid);
    line-height: 1.75;
    margin-bottom: 1rem;
}

.panel-list-sm {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.panel-list-sm li {
    font-size: 0.83rem;
    color: var(--text-muted);
    padding-left: 1.2rem;
    position: relative;
    line-height: 1.55;
}

.panel-list-sm li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-text);
    font-size: 0.74rem;
}

.callie-cta {
    display: flex;
    justify-content: center;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem 2.6rem;
    background: transparent;
    color: var(--accent-text);
    border: 1.5px solid var(--accent-border);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--hero-bg);
    border-color: var(--accent);
    box-shadow: 0 6px 36px var(--accent-glow);
    transform: translateY(-2px);
}

/* ===== PHONE MOCKUP ===== */
.callie-featured-phone {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
}

.phone-glow {
    position: absolute;
    width: 280px;
    height: 560px;
    background: radial-gradient(
        ellipse at center,
        rgba(91, 228, 212, 0.12) 0%,
        transparent 70%
    );
    filter: blur(28px);
    pointer-events: none;
}

.phone-frame {
    position: relative;
    width: 260px;
    height: 520px;
    background: #0d0d1a;
    border-radius: 40px;
    border: 2px solid rgba(91, 228, 212, 0.2);
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 25px 70px rgba(0, 0, 0, 0.3),
        0 0 100px rgba(91, 228, 212, 0.06);
}

.phone-notch {
    width: 80px;
    height: 20px;
    background: #0d0d1a;
    border-radius: 0 0 12px 12px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.wa-header {
    background: #075e54;
    padding: 0.55rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.wa-back {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1;
}

.wa-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), #3dbfb0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #0a1628;
    flex-shrink: 0;
}

.wa-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.wa-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    line-height: 1.2;
}
.wa-status {
    font-size: 0.57rem;
    color: rgba(255, 255, 255, 0.6);
}
.wa-icons {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.65);
}

.chat-bg {
    background: #e5ddd5;
    height: calc(100% - 72px); /* notch(20px) + header(52px) */
    padding: 0.65rem 0.55rem 1rem;
    overflow-y: scroll;
    scrollbar-width: none; /* Firefox */
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
}

.chat-bg::-webkit-scrollbar {
    display: none;
} /* Chrome/Safari */

.chat-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9b99a' fill-opacity='0.12'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.chat-msg {
    max-width: 80%;
    padding: 0.42rem 0.65rem 0.32rem;
    border-radius: 9px;
    font-size: 0.69rem;
    line-height: 1.45;
    color: #2d2d2d;
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 0.35s ease,
        transform 0.35s ease;
    position: relative;
    word-break: break-word;
}

.chat-msg.visible {
    opacity: 1;
    transform: translateY(0);
}
.chat-msg.user {
    background: #dcf8c6;
    align-self: flex-end;
    border-radius: 9px 9px 2px 9px;
}
.chat-msg.callie {
    background: white;
    align-self: flex-start;
    border-radius: 9px 9px 9px 2px;
}

.msg-img {
    display: block;
    width: 100%;
    max-width: 180px;
    border-radius: 6px;
    margin-bottom: 0.3rem;
    object-fit: cover;
}

.msg-time {
    font-size: 0.57rem;
    color: rgba(0, 0, 0, 0.38);
    text-align: right;
    margin-top: 2px;
}

.voice-msg {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 140px;
}

.voice-play {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #25d366;
    color: white;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding-left: 2px;
}

.voice-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.voice-wave span {
    width: 2px;
    border-radius: 1px;
    background: rgba(0,0,0,0.35);
    display: block;
}

.voice-duration {
    font-size: 0.57rem;
    color: rgba(0,0,0,0.45);
    white-space: nowrap;
}

.typing-bubble {
    background: white;
    align-self: flex-start;
    border-radius: 9px 9px 9px 2px;
    padding: 0.45rem 0.7rem;
    display: inline-flex;
    gap: 3px;
    align-items: center;
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.typing-bubble.visible {
    opacity: 1;
    transform: translateY(0);
}

.typing-bubble span {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #aaa;
    animation: typingBounce 1s ease infinite;
}

.typing-bubble span:nth-child(2) {
    animation-delay: 0.18s;
}
.typing-bubble span:nth-child(3) {
    animation-delay: 0.36s;
}

/* ===== CONTACT ===== */
.contact-left {
    opacity: 0;
}
.contact-right {
    opacity: 0;
}

#contact {
    border-top: 1px solid var(--border);
    padding-bottom: 0;
}

.contact-grid {
    max-width: 1060px;
    margin: 0 auto;
    padding: 8rem 5rem 5rem;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 5rem;
    align-items: start;
}

.contact-left h2 {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 800;
    color: var(--text);
    margin: 0.9rem 0 1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.contact-left p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 400px;
    margin-bottom: 2.5rem;
}

.contact-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-mid);
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 500;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
    transition:
        color var(--transition),
        gap var(--transition);
}

.contact-item:hover {
    color: var(--accent-text);
    gap: 1.2rem;
}

.contact-icon {
    width: 38px;
    height: 38px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent-text);
    transition: background var(--transition);
}

.contact-item:hover .contact-icon {
    background: rgba(91, 228, 212, 0.2);
}

.edu-header {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 1.4rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.8rem;
    text-align: center;
}

.edu-list {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Education block inline below resume timeline */
.edu-inline-header {
    margin-top: 2.5rem;
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0.75rem;
}

.edu-inline {
    flex-direction: column;
    gap: 0;
    margin-top: 0;
    /* padding-top: 1.25rem; */
    /* border-top: 1px solid var(--border); */
}
.edu-inline .edu-item {
    /* border-bottom: 1px solid var(--border); */
    padding: 1rem 0;
}
.edu-inline .edu-item:last-child {
    border-bottom: none;
}

.edu-item {
    display: flex;
    align-items: flex-start;
    gap: 1.8rem;
    padding: 1.4rem 0;
    /* border-bottom: 1px solid var(--border); */
}

.edu-year {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-text);
    letter-spacing: 0.04em;
    padding-top: 0.15rem;
    white-space: nowrap;
}

.edu-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.edu-info strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}
.edu-info span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.8rem 5rem;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 18, 38, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: #0d1b35;
    border: 1px solid rgba(91, 228, 212, 0.2);
    border-radius: 24px;
    padding: 3rem;
    max-width: 680px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s ease;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
}

.modal-overlay.open .modal-box {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 1.4rem;
    right: 1.4rem;
    width: 34px;
    height: 34px;
    background: rgba(91, 228, 212, 0.1);
    border: 1px solid rgba(91, 228, 212, 0.2);
    border-radius: 50%;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: rgba(91, 228, 212, 0.2);
    color: white;
}

.modal-head {
    margin-bottom: 2.5rem;
}
.modal-head .section-tag {
    color: var(--accent);
    background: rgba(91, 228, 212, 0.1);
    border-color: rgba(91, 228, 212, 0.3);
}
.modal-head h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #fbfffe;
    margin-top: 0.7rem;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.modal-block h4 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.modal-block p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.85;
}

.modal-stack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.modal-stack-tags span {
    padding: 0.28rem 0.82rem;
    background: rgba(91, 228, 212, 0.08);
    border: 1px solid rgba(91, 228, 212, 0.2);
    border-radius: 50px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.03em;
}

/* ===== ANIMATIONS ===== */
@keyframes scrollPulse {
    0%,
    100% {
        opacity: 0.45;
        transform: scaleY(1);
        transform-origin: top;
    }
    50% {
        opacity: 1;
        transform: scaleY(1.25);
        transform-origin: top;
    }
}

@keyframes typingBounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .navbar {
        padding: 1.2rem 3rem;
    }
    #resume,
    #arsenal,
    #projects,
    #callie {
        padding: 6rem 3rem;
    }
    .contact-grid {
        padding: 6rem 3rem 4rem;
    }
    .site-footer {
        padding: 1.5rem 3rem;
    }
    .callie-featured {
        gap: 2.5rem;
    }
}

/* Back-to-top FAB — hidden on desktop, shown on mobile */
.back-to-top {
    display: none;
}

@media (max-width: 768px) {
    .projects-nav-btn {
        display: none;
    }

    .projects-scroll-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--text-muted);
        margin-bottom: 0.75rem;
    }

    /* Nav: full-width links bar, logo hidden */
    .navbar {
        padding: 0;
        justify-content: center;
    }
    .nav-logo {
        display: none;
    }
    .nav-links {
        width: 100%;
        justify-content: space-around;
        gap: 0;
        padding: 0.85rem 0.5rem;
    }
    .nav-links a {
        font-size: 0.75rem;
    }

    /* Back-to-top FAB — bottom-right corner */
    .back-to-top {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        position: fixed;
        bottom: 1.4rem;
        right: 1.4rem;
        z-index: 800;
        width: 46px;
        height: 46px;
        background: var(--accent);
        color: var(--hero-bg);
        border-radius: 50%;
        font-size: 0.75rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-decoration: none;
        justify-content: center;
        box-shadow: 0 4px 20px var(--accent-glow);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    .back-to-top.visible {
        opacity: 1;
        pointer-events: auto;
    }
    .back-to-top:active {
        transform: scale(0.92);
    }

    #resume,
    #arsenal,
    #projects,
    #callie {
        padding: 5rem 1.5rem;
    }
    .contact-grid {
        padding: 5rem 1.5rem 3rem;
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .site-footer {
        padding: 1.2rem 1.5rem;
        flex-direction: column;
        gap: 0.4rem;
        text-align: center;
    }

    .project-card {
        /* flex: 0 0 100px; */
        min-width: auto;
        /* width: 100px !important; */
    }

    .project-card:hover {
        scale: 1 !important;
        transform: none !important;
    }

    #stack {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .callie-featured {
        grid-template-columns: 1fr;
    }
    .callie-featured-phone {
        order: -1;
    }
    .callie-cards {
        grid-template-columns: 1fr;
    }

    .timeline-wrap {
        padding-left: 40px;
    }
    .timeline-dot {
        left: -35px;
    }
    .timeline-card {
        padding: 1.4rem 1.5rem;
    }

    .modal-box {
        padding: 2rem 1.5rem;
    }
    .modal-head h2 {
        font-size: 1.5rem;
    }
}
