/* ── About Intro Section ─────────────────────────────────────────────────── */
.about-intro-section {
    padding: 80px 0;
}

/* Centered section header — matches all other sections */
.about-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.about-eyebrow {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #06b6d4;
    text-transform: uppercase;
    margin: 0 0 8px;
}

.about-heading {
    font-size: 38px;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    color: var(--primary-color);
}

.about-heading::after {
    content: "";
    display: block;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border-radius: 2px;
    margin: 8px auto 0;
}

/* 2-col layout: photo | text */
.about-section-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-intro-body {
    font-size: 18px;
    color: #374151;
    line-height: 1.9;
    text-align: justify;
}

.about-intro-body p {
    margin-bottom: 20px;
}

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

/* ── About Visual (image side) ───────────────────────────────────────────── */
.about-visual {
    position: relative;
    overflow: hidden;
}

.about-image-container {
    position: relative;
    width: 80%;
    margin: 0 auto;
    padding-top: 96%;
    overflow: hidden;
    border-radius: 30px;
    transform: rotate(-3deg);
}

.about-image-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    opacity: 0.1;
    border-radius: 30px;
    transform: rotate(6deg) scale(0.95);
}

.about-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px;
    filter: grayscale(20%) contrast(1.05);
}

.about-decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

.about-decoration {
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
    opacity: 0.15;
}

.about-decoration:nth-child(1) {
    width: 150px;
    height: 150px;
    top: -20px;
    left: -50px;
    background: #06b6d4;
}

.about-decoration:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -30px;
    right: -60px;
    background: #3b82f6;
}

.about-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
    margin: 2px 0 0;
}

.about-section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
    padding-bottom: 0;
    border-bottom: none;
}

.about-section-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.about-section-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
}

.about-section-header h2::after {
    content: "";
    display: block;
    width: 40px;
    height: 2px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    margin-top: 6px;
    border-radius: 2px;
}

.about-timeline {
    position: relative;
    padding-left: 1.75rem;
}

.about-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(to bottom, #06b6d4, #bae6fd);
    opacity: 1;
}

.about-entry {
    position: relative;
    padding-bottom: 2rem;
}

.about-entry:last-child {
    padding-bottom: 0;
}

.about-entry::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px #06b6d4;
}

.about-entry-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.about-entry-card:hover {
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.12);
    border-color: #bae6fd;
    transform: translateY(-2px);
}

.about-entry-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    margin-bottom: 0.2rem;
}

.about-entry-title {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.about-entry-date {
    background: #e0f2fe;
    color: #0284c7;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.about-entry-org {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0284c7;
    margin-bottom: 0.2rem;
    transition: text-decoration 0.15s ease;
}

.about-entry-org:hover {
    text-decoration: underline;
}

.about-entry-org-link {
    color: inherit;
    text-decoration: none;
}

.about-entry-org-link:hover {
    text-decoration: underline;
}

.about-entry-location {
    font-size: 13px;
    color: #0d0d0d;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.about-entry-desc {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 0.5rem;
}

.about-entry-desc li {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    padding-left: 1rem;
    position: relative;
    line-height: 1.7;
}

.about-entry-desc li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #06b6d4;
    font-size: 10px;
    top: 4px;
}

.about-entry-docs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.about-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    border: 1.5px solid var(--primary-color);
    border-radius: 6px;
    padding: 0.25rem 0.7rem;
    transition: background 0.15s, color 0.15s;
}

.about-doc-link:hover {
    background: var(--primary-color);
    color: #fff;
}

@media (max-width: 1024px) {
    .about-section-body {
        gap: 3rem;
    }

    .about-columns {
        gap: 32px;
    }
}

@media (max-width: 900px) {
    .about-intro-section {
        padding: 60px 0;
    }

    .about-section-body {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* photo above text on mobile */
    .about-visual { order: -1; }

    .about-image-container {
        padding-top: 70%;
        transform: rotate(-2deg);
    }
}

@media (max-width: 750px) {
    .about-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .about-intro-section {
        padding: 40px 0;
    }

    .about-heading {
        font-size: 30px;
    }

    .about-image-container {
        padding-top: 100%;
        transform: none;
    }
}

@media (max-width: 768px) {
    .about-intro-body {
        text-align: justify;
    }

    .timeline-description {
        text-align: justify;
    }

    /* Remove GPU-expensive paint operations that cause scroll jank on first render.
       filter: blur() and filter: grayscale() both force compositor layer promotion.
       On mobile they fire exactly as the user first scrolls into the section,
       causing a dropped frame. The decorations are invisible at 0.15 opacity anyway. */
    .about-decoration {
        display: none;
    }

    .about-image {
        filter: none;
    }

    /* Lighter shadow on mobile — a 24px-blur shadow on every timeline card
       repaints as the user first scrolls past experience/education and shows up
       as a few dropped frames on low-end phones. 6px is visually similar at the
       phone's pixel density but ~4× cheaper to paint. */
    .timeline-content {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    }

    /* Isolate each timeline card's paint so the browser can skip painting
       cards that are outside the viewport during the initial scroll.
       Without this, a section with 6+ timeline cards forces a single
       monolithic paint when the section first enters view. */
    .timeline-item {
        contain: layout paint;
    }

    /* Same containment for about-section entry cards */
    .about-entry-card {
        contain: layout paint;
    }
}

@media (max-width: 480px) {
    .about-intro-section {
        padding: 32px 0;
    }

    .about-heading {
        font-size: 26px;
    }

    .about-intro-body {
        font-size: 16px;
    }

    .about-entry-card {
        padding: 14px 16px;
    }

    .about-entry-title {
        font-size: 16px;
    }
}

[dir="rtl"] .about-tagline {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .about-tagline::before {
    background: linear-gradient(to left, #06b6d4, #3b82f6);
}

[dir="rtl"] .about-divider {
    background: linear-gradient(270deg, #06b6d4, #3b82f6);
}

[dir="rtl"] .about-timeline {
    padding-left: 0;
    padding-right: 1.75rem;
}

[dir="rtl"] .about-timeline::before {
    left: auto;
    right: 6px;
}

[dir="rtl"] .about-entry::before {
    left: auto;
    right: -1.75rem;
}

[dir="rtl"] .about-entry-desc li {
    padding-left: 0;
    padding-right: 1rem;
}

[dir="rtl"] .about-entry-desc li::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .about-section-header h2::after {
    background: linear-gradient(270deg, #06b6d4, #3b82f6);
}

[dir="rtl"] .about-intro-body {
    text-align: justify;
}

/* ── Dark mode overrides ─────────────────────────────────────────────────── */
[data-theme="dark"] .about-heading {
    color: #e2e8f0;
}

[data-theme="dark"] .home-experience-section {
    background:
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
}

[data-theme="dark"] .home-education-section {
    background:
        radial-gradient(ellipse at 20% 20%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
}

[data-theme="dark"] .about-intro-body {
    color: #94a3b8;
}

[data-theme="dark"] .about-section-header h2 {
    color: #e2e8f0;
}


[data-theme="dark"] .about-image {
    filter: grayscale(20%) contrast(1.05) brightness(0.85);
}

[data-theme="dark"] .about-entry-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .about-entry-title {
    color: #e2e8f0;
}

[data-theme="dark"] .about-entry-date {
    background: #1e3a5f;
    color: #60a5fa;
}

[data-theme="dark"] .about-entry-location {
    color: #94a3b8;
}

[data-theme="dark"] .about-entry-desc {
    border-top-color: #334155;
}

[data-theme="dark"] .about-entry-desc li {
    color: #94a3b8;
}

[data-theme="dark"] .about-entry::before {
    box-shadow: 0 0 0 3px #0f172a, 0 0 0 5px #06b6d4;
}

/* ── Home page experience & education sections ──────────────────────────────── */
.home-experience-section {
    padding: 70px 0 90px;
    background:
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(6, 182, 212, 0.04) 0%, transparent 50%);
}

.home-education-section {
    padding: 70px 0 90px;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(16, 185, 129, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
}

/* ── Timeline section header ────────────────────────────────────────────────── */
.tl-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tl-section-title {
    font-size: 38px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 0.5rem;
    text-align: center;
}

.tl-section-divider {
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border-radius: 2px;
    margin: 8px auto 0;
}

/* ── Alternating center timeline ────────────────────────────────────────────── */
.timeline {
    position: relative;
    max-width: 1380px;
    margin: 0 auto;
}

/* Center vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #06b6d4, #3b82f6);
    transform: translateX(-50%);
    z-index: 0;
}

/* Grid: left-card | icon | right-card */
.timeline-item {
    display: grid;
    grid-template-columns: 1fr 48px 1fr;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    padding-top: 0.75rem;
}

/* Icon always in center column, centered on the line */
.timeline-icon {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    justify-self: center;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    z-index: 2;
    box-shadow: 0 0 0 4px #fff, 0 0 0 6px #bae6fd;
    margin-top: 1rem;
}

/* ODD items: card on LEFT */
.timeline-content {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    min-width: 0;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: 1.5rem 1.75rem;
    padding-top: 1.75rem;
    margin-right: 1rem;
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.5s ease, transform 0.5s ease,
                box-shadow 0.3s ease, border-color 0.3s ease;
}

.timeline-content.animated {
    opacity: 1;
    transform: translateX(0);
}

.timeline-content:hover {
    box-shadow: 0 8px 32px rgba(6, 182, 212, 0.13);
    border-color: #bae6fd;
}

/* ODD: connector arrow pointing right (toward center icon) */
.timeline-content::after {
    content: '';
    position: absolute;
    top: 1.6rem;
    right: -9px;
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 9px solid #e2e8f0;
    z-index: 1;
}

/* ODD: date badge at top-right of card (near center) */
.timeline-date {
    position: absolute;
    top: -0.75rem;
    right: 1.25rem;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: #fff;
    padding: 0.3rem 0.85rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 3;
    letter-spacing: 0.01em;
}

/* EVEN items: card on RIGHT */
.timeline-item:nth-child(even) .timeline-content {
    grid-column: 3;
    margin-right: 0;
    margin-left: 1rem;
    transform: translateX(24px);
}

.timeline-item:nth-child(even) .timeline-content.animated {
    transform: translateX(0);
}

/* EVEN: connector arrow pointing left (toward center icon) */
.timeline-item:nth-child(even) .timeline-content::after {
    right: auto;
    left: -9px;
    border-left: none;
    border-right: 9px solid #e2e8f0;
}

/* EVEN: date badge at top-left of card (near center) */
.timeline-item:nth-child(even) .timeline-date {
    right: auto;
    left: 1.25rem;
}

/* ── Typography hierarchy ───────────────────────────────────────────────────── */
.timeline-title {
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 0.4rem;
    line-height: 1.3;
}

.timeline-subtitle {
    color: #06b6d4;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.timeline-org-link {
    color: inherit;
    text-decoration: none;
}

.timeline-org-link:hover {
    text-decoration: underline;
}

.timeline-location {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.timeline-description {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.75;
    margin-top: 0.6rem;
    text-align: justify;
}

.timeline-docs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* ── Responsive: collapse to left-aligned at ≤ 768px ───────────────────────── */
@media (max-width: 768px) {
    /* Drop the dual radial-gradient backgrounds on mobile for experience and
       education. Same rationale as tech-stack / recommendations / contact:
       full-section radial gradients are a known paint hotspot on mobile and
       cause a sub-second jank spike the first time the user scrolls into the
       section. The rule applies to both light and dark themes — the dark-mode
       overrides higher up in this file set their own gradients, so we have to
       unset here explicitly with `background: none` to win the cascade. */
    .home-experience-section,
    .home-education-section,
    [data-theme="dark"] .home-experience-section,
    [data-theme="dark"] .home-education-section {
        background: none;
    }

    .home-experience-section,
    .home-education-section {
        padding: 50px 0 70px;
    }

    .timeline::before {
        left: 21px;
        transform: translateX(-50%);
    }

    .timeline-item {
        display: flex;
        gap: 1rem;
        padding-top: 0.75rem;
    }

    /* Reset even overrides */
    .timeline-item:nth-child(even) .timeline-content {
        grid-column: unset;
        margin-left: 0;
        transform: translateY(20px);
    }
    .timeline-item:nth-child(even) .timeline-content.animated {
        transform: translateY(0);
    }
    .timeline-item:nth-child(even) .timeline-date {
        right: 1.25rem;
        left: auto;
    }

    .timeline-icon {
        grid-column: unset;
        justify-self: unset;
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
        margin-top: 0.85rem;
    }

    .timeline-content {
        margin-right: 0;
        transform: translateY(20px);
    }
    .timeline-content.animated {
        transform: translateY(0);
    }

    /* Hide connector arrows on mobile */
    .timeline-content::after,
    .timeline-item:nth-child(even) .timeline-content::after {
        display: none;
    }

    .timeline-title {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .home-experience-section,
    .home-education-section {
        padding: 40px 0 60px;
    }

    .tl-section-title {
        font-size: 26px;
    }

    .timeline::before {
        left: 16px;
    }

    .timeline-item {
        gap: 0.75rem;
        padding-top: 0.6rem;
        margin-bottom: 1.5rem;
    }

    .timeline-icon {
        width: 32px;
        height: 32px;
        font-size: 0.78rem;
        margin-top: 0.7rem;
    }

    .timeline-content {
        padding: 1rem 1.25rem;
        padding-top: 1.35rem;
    }

    .timeline-date {
        font-size: 0.72rem;
        padding: 0.25rem 0.65rem;
        right: 0.75rem;
        top: -0.6rem;
    }

    .timeline-item:nth-child(even) .timeline-date {
        right: 0.75rem;
        left: auto;
    }

    .timeline-title {
        font-size: 0.88rem;
    }

    .timeline-subtitle {
        font-size: 0.83rem;
    }

    .timeline-description {
        font-size: 0.83rem;
    }
}

@media (max-width: 400px) {
    .timeline::before {
        left: 14px;
    }

    .timeline-icon {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
        margin-top: 0.65rem;
    }

    .timeline-item {
        gap: 0.6rem;
    }
}

/* ── Dark mode ──────────────────────────────────────────────────────────────── */
[data-theme="dark"] .tl-section-title {
    color: #e2e8f0;
}

[data-theme="dark"] .timeline-content {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .timeline-content:hover {
    border-color: #06b6d4;
    box-shadow: 0 8px 30px rgba(6, 182, 212, 0.1);
}

[data-theme="dark"] .timeline-content::after {
    border-left-color: #334155;
}

[data-theme="dark"] .timeline-item:nth-child(even) .timeline-content::after {
    border-left-color: transparent;
    border-right-color: #334155;
}

[data-theme="dark"] .timeline-title {
    color: #e2e8f0;
}

[data-theme="dark"] .timeline-subtitle {
    color: #38bdf8;
}

[data-theme="dark"] .timeline-description {
    color: #94a3b8;
}

[data-theme="dark"] .timeline-location {
    color: #64748b;
}

[data-theme="dark"] .timeline-icon {
    box-shadow: 0 0 0 4px #0f172a, 0 0 0 6px rgba(6, 182, 212, 0.4);
}

/* ── RTL ────────────────────────────────────────────────────────────────────── */
[dir="rtl"] .timeline-item {
    direction: rtl;
}

/* RTL odd → card on RIGHT (col 1 = right in RTL grid), arrow points left */
[dir="rtl"] .timeline-content {
    margin-right: 0;
    margin-left: 1rem;
    transform: translateX(24px);
}
[dir="rtl"] .timeline-content.animated {
    transform: translateX(0);
}
[dir="rtl"] .timeline-content::after {
    right: auto;
    left: -9px;
    border-left: none;
    border-right: 9px solid #e2e8f0;
}
[dir="rtl"] .timeline-date {
    right: auto;
    left: 1.25rem;
}

/* RTL even → card on LEFT (col 3 = left in RTL grid), arrow points right */
[dir="rtl"] .timeline-item:nth-child(even) .timeline-content {
    margin-left: 0;
    margin-right: 1rem;
    transform: translateX(-24px);
}
[dir="rtl"] .timeline-item:nth-child(even) .timeline-content.animated {
    transform: translateX(0);
}
[dir="rtl"] .timeline-item:nth-child(even) .timeline-content::after {
    left: auto;
    right: -9px;
    border-right: none;
    border-left: 9px solid #e2e8f0;
}
[dir="rtl"] .timeline-item:nth-child(even) .timeline-date {
    left: auto;
    right: 1.25rem;
}

[dir="rtl"] .timeline-description {
    text-align: justify;
}

[dir="rtl"] .timeline-location {
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    [dir="rtl"] .timeline::before {
        left: auto;
        right: 21px;
        transform: translateX(50%);
    }
    /* No flex-direction override needed: dir=rtl already makes row flow right→left,
       so icon (first in HTML) appears on the right, card on the left — correct. */
    [dir="rtl"] .timeline-content,
    [dir="rtl"] .timeline-item:nth-child(even) .timeline-content {
        margin-left: 0;
        margin-right: 0;
    }
    [dir="rtl"] .timeline-date,
    [dir="rtl"] .timeline-item:nth-child(even) .timeline-date {
        right: 1.25rem;
        left: auto;
    }
}

@media (max-width: 576px) {
    [dir="rtl"] .timeline::before {
        right: 16px;
    }
    [dir="rtl"] .timeline-date,
    [dir="rtl"] .timeline-item:nth-child(even) .timeline-date {
        right: 0.75rem;
        left: auto;
    }
}