/* Sergio-style resume SPA — sidebar + animated panels */

:root {
    --sv-sidebar-w: 270px;
    --sv-bg: #e3f2fd;
    --sv-bg-soft: #f0f9ff;
    --sv-sidebar-bg: #ffffff;
    --sv-sidebar-text: #475569;
    --sv-sidebar-border: rgba(25, 118, 210, 0.12);
    --sv-accent: #1976d2;
    --sv-accent-2: #42a5f5;
    --sv-accent-soft: rgba(25, 118, 210, 0.1);
    --sv-text: #1e293b;
    --sv-muted: #64748b;
    --sv-card: #ffffff;
    --sv-radius: 16px;
    --sv-shadow: 0 8px 32px rgba(25, 118, 210, 0.08);
    --sv-font: 'Vazirmatn', Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

.sv-body {
    margin: 0;
    font-family: var(--sv-font);
    background: linear-gradient(165deg, #e8f4fc 0%, #dbeafe 45%, #e0f2fe 100%);
    background-color: var(--sv-bg);
    color: var(--sv-text);
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.sv-skip {
    position: absolute;
    top: -100px;
    right: 1rem;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: var(--sv-accent);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
}

.sv-skip:focus { top: 1rem; }

.sv-loading {
    text-align: center;
    padding: 4rem;
    color: var(--sv-muted);
}

/* ===== App layout ===== */
.sv-app {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ===== Sidebar ===== */
.sv-sidebar {
    width: var(--sv-sidebar-w);
    flex-shrink: 0;
    background: var(--sv-sidebar-bg);
    color: var(--sv-sidebar-text);
    border-left: 1px solid var(--sv-sidebar-border);
    box-shadow: -4px 0 24px rgba(25, 118, 210, 0.06);
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.75rem 1.5rem;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sv-profile {
    text-align: center;
    margin-bottom: 2rem;
}

.sv-avatar {
    width: 110px;
    height: 110px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sv-accent), var(--sv-accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 8px 24px rgba(25, 118, 210, 0.25);
    border: 4px solid #fff;
}

.sv-avatar--photo {
    padding: 0;
    overflow: hidden;
    background: #e2e8f0;
}

.sv-avatar--photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    display: block;
}

.resume-avatar--photo {
    padding: 0;
    overflow: hidden;
    background: #eee;
}

.resume-avatar--photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    display: block;
}

.sv-sidebar-name {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--sv-text);
}

.sv-sidebar-title {
    margin: 0;
    font-size: 0.85rem;
    color: var(--sv-accent);
    font-weight: 600;
}

.sv-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sv-nav-link {
    display: block;
    padding: 0.85rem 1rem;
    margin-bottom: 0.25rem;
    color: var(--sv-sidebar-text);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.25s, color 0.25s, transform 0.25s;
    position: relative;
}

.sv-nav-link:hover {
    color: var(--sv-accent);
    background: var(--sv-accent-soft);
}

.sv-nav-link.is-active {
    color: var(--sv-accent);
    background: var(--sv-accent-soft);
    font-weight: 700;
}

.sv-nav-link.is-active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--sv-accent);
    border-radius: 4px;
}

.sv-sidebar-social {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.5rem;
}

.sv-sidebar-social a {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--sv-accent-soft);
    color: var(--sv-accent);
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s, transform 0.2s, color 0.2s;
}

.sv-sidebar-social a:hover {
    background: var(--sv-accent);
    color: #fff;
    transform: translateY(-2px);
}

.sv-back-link {
    display: block;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--sv-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.sv-back-link:hover { color: var(--sv-accent); }

/* ===== Main content ===== */
.sv-main {
    flex: 1;
    margin-right: var(--sv-sidebar-w);
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    position: relative;
    overflow: hidden;
}

.sv-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 110;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--sv-accent);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--sv-shadow);
}

.sv-panels {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.sv-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    min-height: 100vh;
    max-height: 100vh;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, 48px, 0);
    transition:
        opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.42s;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    pointer-events: none;
    z-index: 1;
    -webkit-overflow-scrolling: touch;
}

.sv-panel.is-active {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
    z-index: 2;
}

.sv-panel.is-leaving {
    opacity: 0;
    transform: translate3d(0, -36px, 0);
    pointer-events: none;
    z-index: 1;
}

.sv-panel.is-entering {
    opacity: 0;
    transform: translate3d(0, 48px, 0);
    z-index: 3;
    visibility: visible;
    pointer-events: none;
}

.sv-panel.is-entering.is-active {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
}

.sv-panel-inner {
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(2rem, 5vh, 3.5rem) 2.5rem 4rem;
    padding-top: max(clamp(2rem, 5vh, 3.5rem), env(safe-area-inset-top, 0px));
}

/* ===== Home panel ===== */
.sv-home.sv-panel-inner,
.sv-panel-inner.sv-home {
    max-width: 920px;
}

.sv-home {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: clamp(0.75rem, 3vh, 2rem);
    padding-bottom: 2.5rem;
}

/* Hero card */
.sv-hero-card {
    position: relative;
    border-radius: calc(var(--sv-radius) + 4px);
    overflow: hidden;
    background: var(--sv-card);
    box-shadow: var(--sv-shadow);
    border: 1px solid rgba(25, 118, 210, 0.12);
}

.sv-hero-card-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(66, 165, 245, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 0% 100%, rgba(25, 118, 210, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.sv-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.sv-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sv-accent);
    background: var(--sv-accent-soft);
    border: 1px solid rgba(25, 118, 210, 0.15);
    border-radius: 999px;
}

.sv-hero-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    animation: sv-pulse 2s ease-out infinite;
}

@keyframes sv-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.sv-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 0.65rem;
    color: var(--sv-text);
}

.sv-hero-highlight {
    color: var(--sv-accent);
    position: relative;
}

.sv-hero-subtitle {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--sv-muted);
    margin: 0 0 0.85rem;
}

.sv-hero-lead {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--sv-muted);
    max-width: 34rem;
    margin: 0 0 1.25rem;
}

.sv-hero-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.sv-hero-keyword {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(25, 118, 210, 0.08);
    color: var(--sv-accent);
    border: 1px solid rgba(25, 118, 210, 0.12);
}

.sv-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sv-hero-aside {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    text-align: center;
}

.sv-avatar--hero {
    width: 148px;
    height: 148px;
    font-size: 2.5rem;
    border-width: 5px;
    box-shadow: 0 12px 40px rgba(25, 118, 210, 0.2);
}

.sv-avatar--hero img {
    width: 100%;
    height: 100%;
}

.sv-hero-location {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--sv-muted);
}

.sv-hero-location svg {
    color: var(--sv-accent);
    flex-shrink: 0;
}

/* Bento grid */
.sv-bento {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1rem;
}

.sv-bento-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.sv-bento-stats .sv-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.1rem 0.85rem;
    background: var(--sv-card);
    border-radius: var(--sv-radius);
    box-shadow: var(--sv-shadow);
    border: 1px solid rgba(25, 118, 210, 0.1);
    text-align: center;
    min-height: 100%;
}

.sv-bento-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.sv-bento-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 1rem 1.1rem;
    background: var(--sv-card);
    border: 1px solid rgba(25, 118, 210, 0.1);
    border-radius: var(--sv-radius);
    box-shadow: var(--sv-shadow);
    cursor: pointer;
    font-family: inherit;
    text-align: right;
    transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}

.sv-bento-link:hover {
    transform: translateY(-2px);
    border-color: rgba(25, 118, 210, 0.28);
    box-shadow: 0 12px 28px rgba(25, 118, 210, 0.12);
}

.sv-bento-link-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
}

.sv-bento-link-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sv-text);
}

.sv-bento-link-desc {
    font-size: 0.78rem;
    color: var(--sv-muted);
    line-height: 1.5;
}

.sv-bento-link-arrow {
    font-size: 1rem;
    color: var(--sv-accent);
    opacity: 0;
    transform: translateX(6px);
    transition: opacity 0.22s, transform 0.22s;
}

.sv-bento-link:hover .sv-bento-link-arrow {
    opacity: 1;
    transform: translateX(0);
}

.sv-skill-level {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sv-accent);
}

.sv-summary .sv-text:last-child {
    margin-bottom: 0;
}

.sv-main {
    background: transparent;
}

.sv-stats--about {
    margin-bottom: 2rem;
}

.sv-summary {
    padding: 1.5rem;
    background: var(--sv-card);
    border-radius: var(--sv-radius);
    box-shadow: var(--sv-shadow);
    border-right: 4px solid var(--sv-accent);
}

.sv-summary .sv-text {
    margin: 0 0 1rem;
}

.sv-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.sv-stat-val {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--sv-accent);
    line-height: 1.2;
}

.sv-stat-lbl {
    font-size: 0.85rem;
    color: var(--sv-muted);
}

.sv-home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}

.sv-btn--primary {
    background: linear-gradient(135deg, var(--sv-accent), var(--sv-accent-2));
    color: #fff;
    box-shadow: 0 8px 24px rgba(25, 118, 210, 0.25);
}

.sv-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(25, 118, 210, 0.3);
}

.sv-btn--ghost {
    background: transparent;
    color: var(--sv-text);
    border-color: rgba(0, 0, 0, 0.12);
}

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

/* ===== Section panels ===== */
.sv-section-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.sv-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--sv-accent), var(--sv-accent-2));
    border-radius: 4px;
}

.sv-section-title--spaced { margin-top: 2.5rem; }

.sv-section-lead {
    color: var(--sv-accent);
    font-weight: 600;
    margin: 0 0 1.25rem;
}

.sv-text {
    line-height: 1.95;
    color: var(--sv-muted);
    margin: 0 0 1.5rem;
}

.sv-block { margin-top: 2rem; }

.sv-block-title {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    color: var(--sv-text);
}

/* ===== Timeline ===== */
.sv-timeline {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0 1.25rem 0 0;
    border-right: 2px solid rgba(25, 118, 210, 0.2);
}

.sv-timeline-item {
    position: relative;
    padding: 0 0 2rem 0;
    padding-right: 1.75rem;
}

.sv-timeline-item::before {
    content: '';
    position: absolute;
    right: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--sv-accent);
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.15);
}

.sv-timeline-date {
    display: inline-block;
    font-size: 0.82rem;
    color: var(--sv-accent);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.sv-timeline-body h4 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
}

.sv-timeline-org {
    margin: 0 0 0.5rem;
    color: var(--sv-muted);
    font-size: 0.92rem;
}

.sv-bullets {
    margin: 0;
    padding-right: 1.1rem;
    line-height: 1.85;
    font-size: 0.92rem;
    color: var(--sv-muted);
}

/* ===== Skills ===== */
.sv-skill-bars {
    margin: 1.5rem 0 2rem;
}

.sv-skill-row { margin-bottom: 1.25rem; }

.sv-skill-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.sv-skill-track {
    height: 8px;
    background: rgba(25, 118, 210, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.sv-skill-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sv-accent), var(--sv-accent-2));
    border-radius: 999px;
    transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.sv-skill-group {
    margin-bottom: 1.75rem;
}

.sv-skill-group h4 {
    font-size: 0.95rem;
    margin: 0 0 0.65rem;
    color: var(--sv-muted);
}

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

.sv-tag {
    font-size: 0.82rem;
    padding: 0.4rem 0.85rem;
    background: var(--sv-card);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sv-tag--cert {
    background: var(--sv-accent-soft);
    border-color: rgba(25, 118, 210, 0.2);
    color: var(--sv-accent);
}

.sv-tag--soft {
    background: rgba(25, 118, 210, 0.06);
}

.sv-lang-list {
    list-style: none;
    margin: 0;
    padding: 0;
    line-height: 2;
}

/* ===== Contact ===== */
.sv-contact-list {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
}

.sv-contact-list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--sv-card);
    border-radius: var(--sv-radius);
    box-shadow: var(--sv-shadow);
}

.sv-contact-icon { font-size: 1.5rem; }

.sv-contact-list strong {
    display: block;
    margin-bottom: 0.25rem;
}

.sv-contact-list p { margin: 0; color: var(--sv-muted); }

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

.sv-contact-list a:hover { text-decoration: underline; }

.sv-phone-list {
    margin: 0;
    line-height: 1.9;
}

/* ===== Overlay mobile ===== */
.sv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.sv-overlay[hidden] { display: none; }

/* ===== Mobile ===== */
@media (max-width: 900px) {
    .sv-sidebar {
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.2);
    }

    .sv-sidebar-open .sv-sidebar {
        transform: translateX(0);
    }

    .sv-main {
        margin-right: 0;
    }

    .sv-menu-toggle { display: flex; align-items: center; justify-content: center; }

    .sv-panel-inner {
        padding: 1.25rem 1.25rem 3rem;
        padding-top: max(4.75rem, calc(env(safe-area-inset-top, 0px) + 3.75rem));
    }

    .sv-home {
        padding-top: 0.25rem;
        gap: 1rem;
    }

    .sv-hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.25rem;
    }

    .sv-hero-aside {
        order: -1;
    }

    .sv-hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .sv-hero-lead {
        max-width: none;
    }

    .sv-hero-keywords {
        justify-content: center;
    }

    .sv-hero-actions {
        justify-content: center;
        width: 100%;
    }

    .sv-bento {
        grid-template-columns: 1fr;
    }

    .sv-bento-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 520px) {
    .sv-bento-stats,
    .sv-bento-nav {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sv-hero-pulse { animation: none; }
    .sv-bento-link-arrow { opacity: 1; transform: none; }
    .sv-panel,
    .sv-panel.is-leaving,
    .sv-panel.is-entering {
        transition: none !important;
        transform: none !important;
    }

    .sv-skill-fill { transition: none !important; }
}
