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

:root {
    --bg: #0a0a0f;
    --bg-elev: #12121a;
    --bg-elev-2: #1a1a26;
    --text: #e6e6f0;
    --text-muted: #9090a8;
    --accent: #7c5cff;
    --accent-2: #00d4ff;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 6rem 0;
    position: relative;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 4px 14px rgba(124, 92, 255, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 92, 255, 0.5);
}

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

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent-2);
    transform: translateY(-2px);
}

/* ===== Header / Nav ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}

.header.scrolled {
    background: rgba(10, 10, 15, 0.9);
    border-bottom-color: var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    padding: 0.25rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--accent-2);
    transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 72px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 92, 255, 0.2), transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.15), transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 4rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

.hero-greeting {
    color: var(--accent-2);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.hero-name {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fff 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-role {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    min-height: 2.5rem;
}

.hero-role .typed {
    color: var(--accent-2);
    border-right: 2px solid var(--accent-2);
    padding-right: 4px;
    animation: blink 0.8s infinite;
}

.hero-description {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 540px;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.hero-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
}

.social-link:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-3px);
    border-color: var(--accent);
}

.hero-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 1s ease-out;
}

.hero-blob {
    position: absolute;
    width: 360px;
    height: 360px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    filter: blur(2px);
    animation: morph 8s ease-in-out infinite;
    opacity: 0.4;
}

.hero-avatar {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-elev-2), var(--bg-elev));
    border: 4px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    font-weight: 800;
    background-clip: padding-box;
    color: #fff;
    box-shadow: var(--shadow);
    z-index: 1;
    overflow: hidden;
}

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

.hero-avatar.has-image {
    font-size: 0;
}

.scroll-down {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 42px;
    border: 2px solid var(--text-muted);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
    z-index: 2;
}

.scroll-down span {
    width: 4px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 2px;
    animation: scroll 1.5s ease-in-out infinite;
}

/* ===== About ===== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    display: flex;
    justify-content: center;
}

.about-avatar {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 800;
    color: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.about-avatar.has-image {
    font-size: 0;
}

.about-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.about-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    color: var(--text);
    font-weight: 500;
}

.info-value.available {
    color: #4ade80;
}

/* ===== Skills ===== */
.skills {
    background: var(--bg-elev);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: all var(--transition);
    text-align: center;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(124, 92, 255, 0.15);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.skill-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.skill-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.skill-card ul {
    color: var(--text-muted);
    text-align: left;
}

.skill-card li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.skill-card li:last-child {
    border-bottom: none;
}

/* ===== Projects ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
}

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

.project-image {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.project-image[data-color="1"] {
    background: linear-gradient(135deg, #7c5cff, #00d4ff);
}

.project-image[data-color="2"] {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.project-image[data-color="3"] {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.project-image::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    backdrop-filter: blur(8px);
    transition: transform var(--transition);
}

.project-card:hover .project-image::after {
    transform: translate(-50%, -50%) scale(1.1);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.project-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.project-tags span {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(124, 92, 255, 0.15);
    color: var(--accent-2);
    border-radius: 100px;
    font-weight: 500;
}

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

.project-link {
    color: var(--accent-2);
    font-weight: 500;
    font-size: 0.9rem;
}

.project-link:hover {
    color: #fff;
}

/* ===== Contact ===== */
.contact {
    background: var(--bg-elev);
    text-align: center;
}

.contact-subtitle {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-size: 1.05rem;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.875rem 1rem;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition);
    resize: vertical;
}

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

.form-submit {
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 0.5rem;
    min-width: 200px;
}

.form-status {
    margin-top: 1.5rem;
    color: #4ade80;
    font-weight: 500;
    min-height: 1.5rem;
}

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

/* ===== Footer ===== */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

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

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.back-to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    font-size: 1.25rem;
    transition: all var(--transition);
}

.back-to-top:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-3px);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

@keyframes scroll {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(14px); opacity: 0; }
}

@keyframes morph {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    50% {
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
    }
}

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

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
/* Tablet: 7 nav links don't fit at full size — tighten before hamburger kicks in. */
@media (max-width: 900px) {
    .nav-menu { gap: 1.1rem; }
    .nav-link { font-size: 0.85rem; }
    .nav-logo { font-size: 1.1rem; }
}
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: center;
        padding: 1.5rem 0;
        gap: 1.25rem;
        transform: translateY(-150%);
        transition: transform var(--transition);
        border-bottom: 1px solid var(--border);
    }

    .nav-menu.open {
        transform: translateY(0);
    }

    section {
        padding: 4rem 0;
    }

    .section-title {
        margin-bottom: 2.25rem;
    }

    /* Hero */
    .hero {
        padding-top: 90px;
        min-height: auto;
    }

    .hero-container,
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }

    .hero-image {
        order: -1;
        max-width: 260px;
        margin: 0 auto;
    }

    .hero-avatar {
        width: 200px;
        height: 200px;
        font-size: 3.5rem;
    }

    .hero-blob {
        width: 260px;
        height: 260px;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
        gap: 0.75rem;
    }

    .hero-buttons .btn {
        flex: 1 1 auto;
        min-width: 0;
        text-align: center;
    }

    .hero-social {
        justify-content: center;
    }

    .scroll-down {
        display: none;
    }

    /* About */
    .about-image {
        max-width: 240px;
        margin: 0 auto;
    }

    .about-avatar {
        width: 200px;
        height: 200px;
        font-size: 3rem;
    }

    .about-info {
        grid-template-columns: 1fr;
        text-align: left;
    }

    /* Skills */
    .skills-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-image {
        height: 170px;
    }

    /* Contact */
    .contact-form {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-submit {
        width: 100%;
        min-width: 0;
    }

    /* Footer */
    .footer {
        text-align: center;
    }

    .footer .container {
        flex-direction: column;
        justify-content: center;
    }
}

/* Extra small screens — iPhone SE / 360px wide */
@media (max-width: 480px) {
    html {
        scroll-padding-top: 72px;
    }

    .container {
        padding: 0 1rem;
    }

    .nav {
        height: 64px;
    }

    .nav-menu {
        top: 64px;
    }

    section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    /* Hero */
    .hero {
        padding-top: 80px;
    }

    .hero-greeting {
        font-size: 1rem;
    }

    .hero-name {
        font-size: 2.25rem;
        line-height: 1.15;
        word-break: break-word;
    }

    .hero-role {
        font-size: 1.1rem;
        min-height: 2rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .hero-image {
        max-width: 220px;
    }

    .hero-avatar {
        width: 170px;
        height: 170px;
        font-size: 3rem;
    }

    .hero-blob {
        width: 220px;
        height: 220px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        padding: 0.95rem 1rem;
    }

    .hero-social {
        gap: 0.75rem;
    }

    .social-link {
        width: 40px;
        height: 40px;
    }

    /* About */
    .about-image {
        max-width: 200px;
    }

    .about-avatar {
        width: 170px;
        height: 170px;
        font-size: 2.5rem;
    }

    .about-text h3 {
        font-size: 1.2rem;
    }

    /* Skills */
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .skill-card {
        padding: 1.5rem;
    }

    /* Project */
    .project-image {
        height: 150px;
    }

    .project-content {
        padding: 1.25rem;
    }

    .project-content h3 {
        font-size: 1.1rem;
    }

    /* Form */
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* prevents iOS zoom on focus */
        padding: 0.8rem 0.875rem;
    }
}

/* ===== Experience ===== */
.exp-timeline {
    display: grid;
    gap: 1.25rem;
    max-width: 860px;
    margin: 0 auto;
}
.exp-card {
    display: flex;
    gap: 1.1rem;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
    transition: all var(--transition);
}
.exp-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.exp-logo {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c5cff, #00d4ff);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}
.exp-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.exp-body { flex: 1; min-width: 0; }
.exp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.exp-top h3 { font-size: 1.15rem; margin: 0 0 .15rem; }
.exp-company { color: var(--accent); font-weight: 600; margin: 0; }
.exp-badge {
    font-size: .75rem; font-weight: 600; white-space: nowrap;
    background: rgba(124,92,255,.15); color: var(--accent);
    border: 1px solid var(--border); padding: .25rem .6rem; border-radius: 999px;
}
.exp-time { color: var(--text-muted); font-size: .85rem; margin: .4rem 0; }
.exp-text { color: var(--text-muted); font-size: .95rem; margin: 0; }
@media (max-width: 640px) {
    .exp-card { flex-direction: row; padding: 1rem; }
    .exp-logo { flex-basis: 48px; width: 48px; height: 48px; }
    .exp-top { flex-direction: column; }
}

/* ===== Blog (responsive list + reader) ===== */
.page-top { padding-top: 7rem; }
.blog-filters {
    display: flex; flex-wrap: wrap; gap: .6rem;
    justify-content: center; margin: 1.2rem 0 2rem;
}
.blog-filters select, .blog-filters input[type="search"] {
    padding: .6rem .9rem; border: 1px solid var(--border);
    border-radius: 10px; background: var(--bg-elev); color: var(--text);
    font-size: .95rem; max-width: 100%;
}
.blog-filters input[type="search"] { min-width: min(240px, 100%); }
.blog-grid {
    display: grid; gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
}
/* Compact variant for narrow contexts (related posts inside reader). */
.blog-grid-related {
    grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
    gap: 1rem;
}
.blog-card {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: all var(--transition); display: flex; flex-direction: column;
    min-width: 0;
}
.blog-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.blog-card-featured { border: 1.5px solid var(--accent); box-shadow: 0 8px 28px rgba(124, 92, 255, 0.18); }
/* Purple Featured badge over the banner. */
.featured-badge {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    padding: .32rem .8rem; border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .02em;
    box-shadow: 0 4px 14px rgba(124, 92, 255, 0.45);
    white-space: nowrap;
}
.featured-badge-static { position: static; box-shadow: 0 4px 14px rgba(124, 92, 255, 0.35); }
/* Category + language tags. */
.blog-tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.cat-tag {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    background: rgba(124, 92, 255, 0.14); color: var(--accent);
    border: 1px solid rgba(124, 92, 255, 0.35);
    padding: .22rem .65rem; border-radius: 999px; white-space: nowrap;
}
.lang-tag {
    font-size: .72rem; font-weight: 600;
    background: var(--bg); color: var(--text-muted);
    border: 1px solid var(--border);
    padding: .22rem .65rem; border-radius: 999px; white-space: nowrap;
}
.blog-title { font-size: 1.3rem !important; line-height: 1.35 !important; font-weight: 700 !important; }
.blog-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-meta-item { display: inline-flex; align-items: center; gap: .3rem; color: var(--text-muted); white-space: nowrap; }
/* Smooth Read More link. */
.read-more {
    display: inline-flex; align-items: center; gap: .35rem;
    color: var(--accent-2); font-weight: 700; font-size: .93rem; text-decoration: none;
    margin-top: auto; padding-top: .4rem; width: fit-content;
}
.read-more span { display: inline-block; transition: transform 0.25s ease; }
.read-more:hover span { transform: translateX(5px); }
.read-more:hover { color: var(--accent); }
/* Rich-text body typography (Quill output). */
.post-rich h1, .post-rich h2, .post-rich h3, .post-rich h4 { line-height: 1.3; margin: 1.6em 0 .6em; overflow-wrap: break-word; }
.post-rich h1 { font-size: 1.7rem; }
.post-rich h2 { font-size: 1.45rem; }
.post-rich h3 { font-size: 1.25rem; }
.post-rich h4 { font-size: 1.1rem; }
.post-rich p { margin: 0 0 1.1em; }
.post-rich ul, .post-rich ol { margin: 0 0 1.2em; padding-left: 1.6rem; }
.post-rich li { margin-bottom: .4em; }
.post-rich blockquote {
    margin: 0 0 1.2em; padding: .9rem 1.2rem;
    border-left: 4px solid var(--accent); background: var(--bg-elev);
    border-radius: 0 10px 10px 0; color: var(--text-muted); font-style: italic;
}
.post-rich pre {
    background: #0f172a; color: #e2e8f0; padding: 1rem 1.2rem; border-radius: 10px;
    overflow-x: auto; font-size: .88rem; margin: 0 0 1.2em;
}
.post-rich code { background: rgba(124, 92, 255, 0.12); padding: .1rem .4rem; border-radius: 6px; font-size: .9em; }
.post-rich pre code { background: none; padding: 0; }
.post-rich a { color: var(--accent-2); }
.post-rich hr { border: none; border-top: 1px solid var(--border); margin: 1.8em 0; }
@media (max-width: 640px) {
    .blog-title { font-size: 1.15rem !important; }
    .featured-badge { top: 10px; left: 10px; font-size: .7rem; }
}
.blog-cover { display: block; aspect-ratio: 16/9; background: var(--bg); overflow: hidden; text-decoration: none; }
.blog-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-cover-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 160px; font-size: 3rem; }
.blog-body { padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; min-width: 0; }
.blog-body h2 { margin: 0; font-size: 1.15rem; line-height: 1.4; overflow-wrap: break-word; }
.blog-body h2 a { color: var(--text); text-decoration: none; overflow-wrap: break-word; }
.blog-body h2 a:hover { color: var(--accent); }
.blog-body p { color: var(--text-muted); font-size: .93rem; margin: 0; }
.blog-meta { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; font-size: .8rem; }
.blog-share-mini { display: flex; gap: .7rem; margin-top: auto; padding-top: .5rem; font-size: 1.1rem; }
.blog-share-mini a { text-decoration: none; opacity: .8; }
.blog-share-mini a:hover { opacity: 1; }
.empty-box { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }
.post-wrap { max-width: 760px; margin: 0 auto; width: 100%; }
.post-wrap-wide { max-width: 1080px; }
.post-crumb { margin: 0 0 1.5rem; }
/* Premium editorial hero: media + title side-by-side on desktop. */
.post-hero {
    display: grid; gap: 2.5rem; align-items: center;
    grid-template-columns: 1.05fr 0.95fr;
    min-width: 0;
}
.post-hero-media {
    margin: 0; aspect-ratio: 3/2; border-radius: 20px; overflow: hidden;
    background: linear-gradient(135deg, #7c5cff, #00d4ff);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    min-width: 0;
}
.post-hero-media img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.6s ease;
}
.post-hero-media:hover img { transform: scale(1.03); }
.post-hero-fallback {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; min-height: 220px; font-size: 4rem;
}
.post-hero-text { min-width: 0; }
.post-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-bottom: 1rem; font-size: .85rem; }
.post-hero-title {
    margin: 0 0 1rem; font-weight: 800;
    font-size: clamp(1.9rem, 1.2rem + 2.5vw, 3rem);
    line-height: 1.15; letter-spacing: -0.02em;
    overflow-wrap: break-word;
}
.post-lede { color: var(--text-muted); font-size: 1.1rem; line-height: 1.7; margin: 0 0 1.4rem; overflow-wrap: break-word; }
.post-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; font-size: .88rem; color: var(--text-muted); }
.post-meta-item { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.post-meta-dot { opacity: .5; }
.post-author { color: var(--text); font-weight: 600; }
.post-author-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; font-size: .8rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.post-divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
@media (max-width: 900px) {
    .post-hero { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 640px) {
    .post-hero-media { border-radius: 16px; }
    .post-hero-fallback { min-height: 180px; font-size: 3rem; }
    .post-lede { font-size: 1rem; }
    .post-meta-row { font-size: .8rem; }
    .post-divider { margin: 2rem 0; }
}
.post-title { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.25; margin: .8rem 0 1.2rem; overflow-wrap: break-word; }
.post-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin-bottom: 1.5rem; }
.post-content { font-size: 1.05rem; line-height: 1.85; overflow-wrap: break-word; }
.share-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.share-btn {
    padding: .5rem .9rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
    border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
    text-decoration: none; cursor: pointer;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px) {
    .page-top { padding-top: 5.5rem; }
    .blog-filters { flex-direction: column; align-items: stretch; }
    .blog-filters select, .blog-filters input[type="search"],
    .blog-filters .btn { width: 100%; }
    .blog-body { padding: 1rem; }
    .post-content { font-size: 1rem; }
    .share-row .share-btn { flex: 1 1 auto; text-align: center; }
}

/* Very small screens — 360px and below */
@media (max-width: 360px) {
    .hero-name {
        font-size: 2rem;
    }

    .hero-avatar {
        width: 150px;
        height: 150px;
        font-size: 2.5rem;
    }

    .hero-blob {
        width: 190px;
        height: 190px;
    }
}

/* ===== Accessibility ===== */
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 2000;
    background: var(--accent); color: #fff; font-weight: 700;
    padding: 0.7rem 1.2rem; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}
