/* ═══════════════════════════════════════════════════
   Tadbirsaz Researcher Portfolio
   Inspired by Apple / Stripe / Linear / Notion / Framer
   ═══════════════════════════════════════════════════ */

.rp {
    --rp-bg: #f6f7f9;
    --rp-surface: #ffffff;
    --rp-ink: #0b1220;
    --rp-muted: #5b6577;
    --rp-line: rgba(15, 23, 42, 0.08);
    --rp-accent: #0f766e;
    --rp-accent-deep: #115e59;
    --rp-accent-2: #0e7490;
    --rp-soft: #ecfdf5;
    --rp-radius: 18px;
    --rp-radius-lg: 24px;
    --rp-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 40px rgba(15, 23, 42, 0.06);
    --rp-shadow-hover: 0 2px 8px rgba(15, 23, 42, 0.06), 0 20px 50px rgba(15, 23, 42, 0.1);
    --rp-ease: cubic-bezier(0.22, 1, 0.36, 1);

    position: relative;
    isolation: isolate;
    /* base.html main already clears fixed header (margin-top: 85px) */
    padding: 1.75rem 0 4.5rem;
    background: var(--rp-bg);
    color: var(--rp-ink);
    overflow: visible;
}

.rp-ambient {
    position: absolute;
    inset: 0 0 auto 0;
    height: 520px;
    background:
        radial-gradient(ellipse 70% 60% at 85% 0%, rgba(15, 118, 110, 0.12), transparent 60%),
        radial-gradient(ellipse 50% 45% at 10% 10%, rgba(14, 116, 144, 0.08), transparent 55%),
        linear-gradient(180deg, #eefcf8 0%, var(--rp-bg) 100%);
    pointer-events: none;
    z-index: -1;
}

/* Do not use global .wrapper (height:85px) — causes footer/content overlap */
.rp-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 3.5rem;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding-inline: 1.25rem;
    box-sizing: border-box;
    height: auto !important;
    min-height: 0;
    overflow: visible;
}

/* Breadcrumb */
.rp-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0;
}

.rp-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: var(--rp-surface);
    border: 1px solid var(--rp-line);
    color: var(--rp-ink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 650;
    box-shadow: var(--rp-shadow);
    transition: transform 0.25s var(--rp-ease), box-shadow 0.25s var(--rp-ease);
}

.rp-back:hover {
    transform: translateY(-1px);
    box-shadow: var(--rp-shadow-hover);
}

.rp-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--rp-muted);
    font-size: 0.88rem;
}

.rp-crumbs li:not(:last-child)::after {
    content: "/";
    margin-right: 0.45rem;
    opacity: 0.45;
}

.rp-crumbs a {
    color: var(--rp-accent-2);
    text-decoration: none;
}

.rp-crumbs a:hover {
    text-decoration: underline;
}

/* Hero */
.rp-hero {
    background: var(--rp-surface);
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-radius-lg);
    box-shadow: var(--rp-shadow);
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

.rp-hero-grid {
    display: grid;
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
    gap: clamp(1.5rem, 3vw, 2.75rem);
    align-items: center;
}

.rp-hero-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.rp-photo-frame {
    width: min(100%, 260px);
    aspect-ratio: 1;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(145deg, #ecfdf5, #e0f2fe);
    border: 1px solid var(--rp-line);
    box-shadow: 0 18px 48px rgba(15, 118, 110, 0.16);
}

.rp-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rp-photo-fallback {
    width: 100%;
    height: 100%;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--rp-accent);
}

.rp-photo-fallback.sm {
    min-height: 0;
    font-size: 1.35rem;
}

.rp-trust-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: var(--rp-soft);
    color: var(--rp-accent-deep);
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid rgba(15, 118, 110, 0.14);
}

.rp-kicker {
    margin: 0 0 0.55rem;
    color: var(--rp-accent);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rp-hero-copy h1 {
    margin: 0;
    font-size: clamp(1.85rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--rp-ink);
}

.rp-title {
    margin: 0.65rem 0 0;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--rp-muted);
    font-weight: 550;
    line-height: 1.6;
}

.rp-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    list-style: none;
    margin: 1.15rem 0 0;
    padding: 0;
}

.rp-hero-meta li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.86rem;
}

.rp-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.15rem;
}

.rp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(15, 118, 110, 0.18);
    color: var(--rp-accent-deep);
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.rp-badge-soft {
    background: var(--rp-soft);
    color: var(--rp-accent-deep);
}

.rp-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.5rem;
}

.rp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 48px;
    padding: 0.75rem 1.35rem;
    border-radius: 14px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform 0.25s var(--rp-ease), box-shadow 0.25s var(--rp-ease), background 0.25s ease;
}

.rp-btn:hover {
    transform: translateY(-2px);
}

.rp-btn:focus-visible {
    outline: 3px solid rgba(14, 116, 144, 0.35);
    outline-offset: 2px;
}

.rp-btn-primary {
    background: linear-gradient(135deg, var(--rp-accent), var(--rp-accent-2));
    color: #fff;
    box-shadow: 0 10px 28px rgba(15, 118, 110, 0.28);
}

.rp-btn-ghost {
    background: var(--rp-surface);
    color: var(--rp-ink);
    border-color: var(--rp-line);
}

.rp-btn-light {
    background: #fff;
    color: var(--rp-accent-deep);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.rp-btn-outline-light {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

/* Stats */
.rp-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.rp-stat {
    background: var(--rp-surface);
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
    padding: 1.25rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: transform 0.3s var(--rp-ease), box-shadow 0.3s var(--rp-ease);
}

.rp-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--rp-shadow-hover);
}

.rp-stat-label {
    font-size: 0.82rem;
    color: var(--rp-muted);
    font-weight: 650;
}

.rp-stat-value {
    font-size: clamp(1.7rem, 3vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--rp-ink);
    line-height: 1.1;
}

.rp-stat-hint {
    font-size: 0.78rem;
    color: #94a3b8;
}

/* Sections */
.rp-section {
    scroll-margin-top: 110px;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.rp-section-head {
    max-width: 640px;
    margin-bottom: 1.6rem;
}

.rp-section-head-row {
    max-width: none;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.rp-eyebrow {
    margin: 0 0 0.45rem;
    color: var(--rp-accent);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rp-eyebrow.light {
    color: rgba(204, 251, 241, 0.9);
}

.rp-section-head h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 1.95rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--rp-ink);
}

.rp-lede {
    margin: 0.55rem 0 0;
    color: var(--rp-muted);
    line-height: 1.75;
    font-size: 1rem;
}

.rp-panel {
    background: var(--rp-surface);
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
    padding: 1.5rem 1.6rem;
}

.rp-panel-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 750;
}

.rp-prose {
    font-size: 1.05rem;
    line-height: 2;
    color: #334155;
}

.rp-prose p {
    margin: 0;
}

/* Cards */
.rp-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.rp-card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rp-card {
    background: var(--rp-surface);
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
    padding: 1.25rem 1.3rem;
}

.rp-card-lift {
    transition: transform 0.3s var(--rp-ease), box-shadow 0.3s var(--rp-ease), border-color 0.25s ease;
}

.rp-card-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--rp-shadow-hover);
    border-color: rgba(15, 118, 110, 0.22);
}

.rp-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--rp-soft);
    color: var(--rp-accent);
    margin-bottom: 0.9rem;
}

.rp-card-icon-gold {
    background: #fff7ed;
    color: #c2410c;
}

.rp-card h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 750;
    color: var(--rp-ink);
    line-height: 1.45;
}

.rp-card-org {
    margin: 0.4rem 0 0;
    color: #334155;
    font-weight: 600;
}

.rp-card-meta {
    margin: 0.45rem 0 0;
    color: var(--rp-muted);
    font-size: 0.88rem;
}

.rp-card-body {
    margin: 0.75rem 0 0;
    color: #475569;
    line-height: 1.8;
}

.rp-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.rp-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    font-size: 0.75rem;
    font-weight: 750;
}

/* Timeline */
.rp-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    position: relative;
}

.rp-timeline::before {
    content: "";
    position: absolute;
    top: 0.8rem;
    bottom: 0.8rem;
    right: 9px;
    width: 2px;
    background: linear-gradient(180deg, var(--rp-accent), rgba(14, 116, 144, 0.12));
}

.rp-timeline-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.rp-timeline-marker {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid var(--rp-accent);
    background: #fff;
    margin-top: 1.25rem;
    z-index: 1;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.rp-timeline-item.is-current .rp-timeline-marker {
    background: var(--rp-accent);
}

/* Split / contacts */
.rp-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.rp-contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.rp-contact-list li {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--rp-line);
}

.rp-contact-type {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--rp-accent-deep);
}

.rp-contact-value {
    color: #334155;
    word-break: break-word;
}

/* Slider */
.rp-slider-controls {
    display: flex;
    gap: 0.5rem;
}

.rp-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--rp-line);
    background: var(--rp-surface);
    color: var(--rp-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.rp-icon-btn:hover {
    background: var(--rp-soft);
    transform: translateY(-1px);
}

.rp-icon-btn:focus-visible {
    outline: 3px solid rgba(14, 116, 144, 0.35);
    outline-offset: 2px;
}

.rp-slider {
    overflow: hidden;
    border-radius: var(--rp-radius);
}

.rp-slider-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.rp-slider-track::-webkit-scrollbar {
    display: none;
}

.rp-slide {
    flex: 0 0 min(280px, 82vw);
    scroll-snap-align: start;
    padding: 0;
    overflow: hidden;
}

.rp-slide-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.rp-slide-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    overflow: hidden;
    background: #e2e8f0;
    margin-bottom: 0.35rem;
}

.rp-slide-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rp-slide h3 {
    font-size: 1rem;
}

.rp-slide p {
    margin: 0;
    color: var(--rp-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.rp-slide-cta {
    margin-top: auto;
    padding-top: 0.75rem;
    color: var(--rp-accent-2);
    font-size: 0.88rem;
    font-weight: 700;
}

/* Accordion */
.rp-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.rp-acc-item {
    background: var(--rp-surface);
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
    overflow: hidden;
}

.rp-acc-item h3 {
    margin: 0;
}

.rp-acc-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: right;
    background: transparent;
    border: 0;
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    color: var(--rp-ink);
    font: inherit;
    font-weight: 700;
    font-size: 0.98rem;
}

.rp-acc-trigger i {
    color: var(--rp-accent);
    transition: transform 0.25s var(--rp-ease);
}

.rp-acc-trigger[aria-expanded="true"] i {
    transform: rotate(45deg);
}

.rp-acc-trigger:focus-visible {
    outline: 3px solid rgba(14, 116, 144, 0.35);
    outline-offset: -3px;
}

.rp-acc-panel {
    padding: 0 1.25rem 1.15rem;
    color: #475569;
    line-height: 1.85;
}

.rp-acc-panel[hidden] {
    display: none;
}

.rp-acc-panel p {
    margin: 0;
}

/* Final CTA */
.rp-final-cta {
    border-radius: var(--rp-radius-lg);
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.14), transparent 40%),
        linear-gradient(125deg, #0f766e 0%, #0e7490 55%, #155e75 100%);
    box-shadow: 0 24px 60px rgba(15, 118, 110, 0.28);
    color: #fff;
}

.rp-final-cta-inner {
    padding: clamp(2rem, 4vw, 3.25rem);
    max-width: 720px;
}

.rp-final-cta h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.rp-final-cta p {
    margin: 0.85rem 0 0;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.8;
    font-size: 1.02rem;
}

.rp-final-cta .rp-cta-row {
    margin-top: 1.5rem;
}

/* Reveal animation */
.rp-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--rp-ease), transform 0.7s var(--rp-ease);
}

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

@media (prefers-reduced-motion: reduce) {
    .rp-reveal,
    .rp-btn,
    .rp-card-lift,
    .rp-stat,
    .rp-back,
    .rp-acc-trigger i {
        transition: none !important;
        transform: none !important;
    }

    .rp-reveal {
        opacity: 1;
    }

    .rp-slider-track {
        scroll-behavior: auto;
    }
}

/* Responsive */
@media (max-width: 1100px) {
    .rp-card-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .rp {
        padding-top: 1.25rem;
        padding-bottom: 3.25rem;
    }

    .rp-shell {
        gap: 2.5rem;
        padding-inline: 1rem;
        width: 100%;
        max-width: 100%;
        height: auto !important;
        box-sizing: border-box;
    }

    .rp-crumbs {
        display: none;
    }

    .rp-hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .rp-hero-copy {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .rp-hero-meta,
    .rp-badges,
    .rp-cta-row {
        justify-content: center;
    }

    .rp-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rp-card-grid,
    .rp-card-grid-3,
    .rp-split {
        grid-template-columns: 1fr;
    }

    .rp-section-head-row {
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .rp-cta-row {
        flex-direction: column;
        width: 100%;
    }

    .rp-cta-row .rp-btn {
        width: 100%;
    }

    .rp-stats {
        grid-template-columns: 1fr;
    }

    .rp-photo-frame {
        width: 200px;
    }
}
