/* =====================================================================
   Hafizullah Mahmudi — Professional Brand Redesign
   File: profile-redesign.css
   Loaded AFTER main.css so it safely overrides the old iPortfolio theme.
   Author: Redesign (senior ASP.NET Core / Umbraco / UI-UX)
   ===================================================================== */

/* ------------------------------------------------------------------ */
/*  1. Design tokens                                                   */
/* ------------------------------------------------------------------ */
:root {
    --brand-primary: #2563eb;
    --brand-primary-dark: #1d4ed8;
    --brand-navy: #0f172a;
    --brand-navy-soft: #1e293b;
    --brand-text: #334155;
    --brand-muted: #64748b;
    --brand-border: #e2e8f0;
    --brand-surface: #ffffff;
    --brand-soft: #f8fafc;
    --brand-soft-blue: #eff6ff;

    --container-width: 1180px;
    --section-spacing: 90px;
    --card-radius: 20px;
    --btn-radius: 12px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
    --shadow-lg: 0 20px 48px rgba(15, 23, 42, .12);

    --font-heading: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --header-height: 74px;
}

/* ------------------------------------------------------------------ */
/*  2. Base overrides                                                   */
/* ------------------------------------------------------------------ */
body.hm-body {
    font-family: var(--font-body);
    color: var(--brand-text);
    background-color: var(--brand-surface);
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Neutralise old fixed-left-sidebar layout math from main.css */
body.hm-body .hm-main,
body.hm-body .hm-footer {
    margin-left: 0 !important;
}

.hm-body h1,
.hm-body h2,
.hm-body h3,
.hm-body h4,
.hm-body h5,
.hm-body h6 {
    font-family: var(--font-heading);
    color: var(--brand-navy);
    font-weight: 600;
    line-height: 1.25;
}

.hm-body a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color .2s ease;
}

.hm-body a:hover {
    color: var(--brand-primary-dark);
}

.hm-body img {
    max-width: 100%;
    height: auto;
}

.hm-container {
    width: 100%;
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: 20px;
}

.hm-section {
    padding-block: var(--section-spacing);
    scroll-margin-top: calc(var(--header-height) + 16px);
}

.hm-section--soft {
    background-color: var(--brand-soft);
}

.hm-section--soft-blue {
    background-color: var(--brand-soft-blue);
}

/* Accessible visually-hidden helper */
.hm-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Accessible focus ring for the whole redesign */
.hm-body a:focus-visible,
.hm-body button:focus-visible,
.hm-body input:focus-visible,
.hm-body textarea:focus-visible,
.hm-body [tabindex]:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .45);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Skip link */
.hm-skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 1200;
    background: var(--brand-primary);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    transition: top .2s ease;
}

.hm-skip-link:focus {
    top: 16px;
    color: #fff;
}

/* ------------------------------------------------------------------ */
/*  3. Section headings                                                */
/* ------------------------------------------------------------------ */
.hm-section-head {
    max-width: 720px;
    margin-bottom: 48px;
}

.hm-section-head.hm-center {
    margin-inline: auto;
    text-align: center;
}

.hm-eyebrow {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brand-primary);
    margin-bottom: 12px;
}

.hm-section-title {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    margin-bottom: 14px;
}

.hm-section-lead {
    font-size: 1.075rem;
    color: var(--brand-muted);
    margin-bottom: 0;
}

/* ------------------------------------------------------------------ */
/*  4. Buttons                                                         */
/* ------------------------------------------------------------------ */
.hm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: .98rem;
    line-height: 1;
    padding: 14px 26px;
    border-radius: var(--btn-radius);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease;
    text-align: center;
    white-space: nowrap;
}

.hm-btn:active {
    transform: translateY(1px);
}

.hm-btn--primary {
    background-color: var(--brand-primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.hm-btn--primary:hover {
    background-color: var(--brand-primary-dark);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.hm-btn--outline {
    background-color: transparent;
    color: var(--brand-navy);
    border-color: var(--brand-border);
}

.hm-btn--outline:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background-color: var(--brand-soft-blue);
}

.hm-btn--ghost {
    background-color: #fff;
    color: var(--brand-navy);
    border-color: var(--brand-border);
    box-shadow: var(--shadow-sm);
}

.hm-btn--ghost:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.hm-btn--light {
    background-color: #fff;
    color: var(--brand-navy);
}

.hm-btn--light:hover {
    background-color: var(--brand-soft);
    color: var(--brand-primary-dark);
}

.hm-btn--sm {
    padding: 10px 18px;
    font-size: .9rem;
}

.hm-link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-weight: 500;
}

.hm-link-arrow i {
    transition: transform .2s ease;
}

.hm-link-arrow:hover i {
    transform: translateX(4px);
}

/* ------------------------------------------------------------------ */
/*  5. Header / navigation                                             */
/* ------------------------------------------------------------------ */
.hm-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--brand-border);
}

.hm-header.hm-scrolled {
    box-shadow: var(--shadow-sm);
}

.hm-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: var(--header-height);
}

.hm-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--brand-navy);
}

.hm-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .02em;
    box-shadow: var(--shadow-sm);
}

.hm-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.hm-brand__name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--brand-navy);
}

.hm-brand__role {
    font-size: .74rem;
    color: var(--brand-muted);
    letter-spacing: .01em;
}

.hm-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hm-nav__list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hm-nav__list a {
    display: inline-block;
    padding: 9px 14px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-size: .95rem;
    font-weight: 500;
    color: var(--brand-navy);
}

.hm-nav__list a:hover,
.hm-nav__list a.hm-active {
    color: var(--brand-primary);
    background-color: var(--brand-soft-blue);
}

.hm-header__social {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    padding-left: 12px;
    border-left: 1px solid var(--brand-border);
}

.hm-header__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: var(--brand-muted);
    font-size: 1.05rem;
}

.hm-header__social a:hover {
    color: var(--brand-primary);
    background-color: var(--brand-soft-blue);
}

.hm-nav__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    background-color: #fff;
    color: var(--brand-navy);
    font-size: 1.4rem;
    cursor: pointer;
}

.hm-nav__toggle:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.hm-nav__toggle .hm-icon-close {
    display: none;
}

/* Mobile navigation */
@media (max-width: 991.98px) {
    .hm-nav__toggle {
        display: inline-flex;
    }

    .hm-nav {
        position: fixed;
        inset: var(--header-height) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background-color: #fff;
        border-bottom: 1px solid var(--brand-border);
        box-shadow: var(--shadow-lg);
        padding: 14px 20px 22px;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    }

    .hm-header.hm-nav-open .hm-nav {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .hm-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: 100%;
    }

    .hm-nav__list a {
        display: block;
        padding: 13px 14px;
        font-size: 1.02rem;
    }

    .hm-header__social {
        margin-left: 0;
        padding-left: 0;
        padding-top: 12px;
        margin-top: 8px;
        border-left: 0;
        border-top: 1px solid var(--brand-border);
        justify-content: flex-start;
    }
}

/* ------------------------------------------------------------------ */
/*  6. Hero                                                            */
/* ------------------------------------------------------------------ */
.hm-hero {
    position: relative;
    background:
        radial-gradient(1100px 460px at 82% -6%, var(--brand-soft-blue), transparent 60%),
        linear-gradient(180deg, #fff 0%, var(--brand-soft) 100%);
    padding-block: clamp(48px, 7vw, 96px);
    overflow: hidden;
}

.hm-hero__grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 56px;
    align-items: center;
}

/* Prevent grid/flex tracks from refusing to shrink below content (mobile overflow fix) */
.hm-hero__content,
.hm-hero__media,
.hm-bio__body,
.hm-facts,
.hm-case__body,
.hm-cta__grid > *,
.hm-grid > *,
.hm-projects__grid > *,
.hm-articles__grid > * {
    min-width: 0;
}

.hm-hero__title,
.hm-hero__subtitle,
.hm-hero__desc,
.hm-section-title,
.hm-card__title,
.hm-project-card__title,
.hm-article-card__title {
    overflow-wrap: break-word;
}

.hm-hero__title {
    font-size: clamp(2.3rem, 4.8vw, 3.5rem);
    line-height: 1.08;
    margin-bottom: 14px;
    letter-spacing: -.01em;
}

.hm-hero__subtitle {
    font-family: var(--font-heading);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 500;
    color: var(--brand-primary);
    margin-bottom: 18px;
}

.hm-hero__desc {
    font-size: 1.1rem;
    color: var(--brand-text);
    max-width: 560px;
    margin-bottom: 28px;
}

.hm-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
}

.hm-hero__socials {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.hm-hero__socials a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: .92rem;
    color: var(--brand-navy);
    padding: 8px 14px;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    background: #fff;
}

.hm-hero__socials a:hover {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.hm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hm-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: .86rem;
    font-weight: 500;
    color: var(--brand-navy);
    box-shadow: var(--shadow-sm);
}

.hm-chip i {
    color: var(--brand-primary);
}

/* Hero portrait */
.hm-hero__media {
    position: relative;
    justify-self: center;
    max-width: 420px;
    width: 100%;
}

.hm-hero__portrait {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 4 / 5;
    background: linear-gradient(135deg, var(--brand-soft-blue), #fff);
}

.hm-hero__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hm-hero__float {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
}

.hm-hero__float i {
    font-size: 1.35rem;
    color: var(--brand-primary);
}

.hm-hero__float-value {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--brand-navy);
    line-height: 1.1;
    display: block;
}

.hm-hero__float-label {
    font-size: .78rem;
    color: var(--brand-muted);
}

.hm-hero__float--years {
    top: 22px;
    left: -22px;
}

.hm-hero__float--location {
    bottom: 22px;
    right: -18px;
}

/* ------------------------------------------------------------------ */
/*  7. Biography + facts                                               */
/* ------------------------------------------------------------------ */
.hm-bio__grid {
    display: grid;
    grid-template-columns: 1.3fr .9fr;
    gap: 48px;
    align-items: start;
}

.hm-bio__body {
    font-size: 1.08rem;
}

.hm-bio__body p {
    margin-bottom: 1.1rem;
}

.hm-facts {
    background-color: var(--brand-soft);
    border: 1px solid var(--brand-border);
    border-radius: var(--card-radius);
    padding: 28px;
}

.hm-facts__item {
    padding-block: 16px;
    border-bottom: 1px solid var(--brand-border);
}

.hm-facts__item:first-child {
    padding-top: 0;
}

.hm-facts__item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.hm-facts__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand-primary);
    margin-bottom: 6px;
}

.hm-facts__value {
    color: var(--brand-navy);
    font-weight: 500;
    margin: 0;
}

/* ------------------------------------------------------------------ */
/*  8. Cards grid (roles / services / generic)                        */
/* ------------------------------------------------------------------ */
.hm-grid {
    display: grid;
    gap: 24px;
}

.hm-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

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

.hm-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.hm-card {
    background-color: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--card-radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    height: 100%;
}

.hm-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #cbd8ef;
}

.hm-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background-color: var(--brand-soft-blue);
    color: var(--brand-primary);
    font-size: 1.5rem;
    margin-bottom: 18px;
}

.hm-card__title {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.hm-card__text {
    color: var(--brand-muted);
    font-size: .98rem;
    margin: 0;
}

/* ------------------------------------------------------------------ */
/*  9. Expertise                                                      */
/* ------------------------------------------------------------------ */
.hm-toolkit {
    background-color: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--card-radius);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.hm-toolkit :is(table) {
    width: 100%;
    border-collapse: collapse;
}

.hm-toolkit :is(th, td) {
    padding: 10px 12px;
    border: 1px solid var(--brand-border);
    text-align: left;
}

.hm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hm-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background-color: var(--brand-soft-blue);
    color: var(--brand-primary-dark);
    border: 1px solid #dbe6fb;
    border-radius: 999px;
    padding: 8px 15px;
    font-size: .88rem;
    font-weight: 500;
}

.hm-tag i {
    font-size: .95rem;
}

.hm-skillcard {
    background-color: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--card-radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.hm-skillcard h3 {
    font-size: 1.15rem;
    margin-bottom: 14px;
}

/* Rich-text lists inside skill cards look tidy */
.hm-skillcard :is(ul, ol) {
    margin: 0;
    padding-left: 1.15rem;
}

.hm-skillcard li {
    margin-bottom: .5rem;
}

/* ------------------------------------------------------------------ */
/* 10. Project cards                                                   */
/* ------------------------------------------------------------------ */
.hm-projects__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.hm-project-card {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    height: 100%;
}

.hm-project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #cbd8ef;
}

.hm-project-card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    background-color: var(--brand-soft);
    overflow: hidden;
}

.hm-project-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.hm-project-card:hover .hm-project-card__media img {
    transform: scale(1.04);
}

.hm-project-card__media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8c4d6;
    font-size: 2.4rem;
    background: linear-gradient(135deg, var(--brand-soft-blue), var(--brand-soft));
}

.hm-project-card__preview {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, .92);
    color: var(--brand-navy);
    box-shadow: var(--shadow-sm);
    font-size: 1.05rem;
}

.hm-project-card__preview:hover {
    background-color: #fff;
    color: var(--brand-primary);
}

.hm-project-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    flex: 1 1 auto;
}

.hm-cat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hm-cat-tag {
    font-family: var(--font-heading);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--brand-primary);
    background-color: var(--brand-soft-blue);
    border-radius: 6px;
    padding: 4px 9px;
}

.hm-project-card__title {
    font-size: 1.2rem;
    margin: 0;
}

.hm-project-card__title a {
    color: var(--brand-navy);
}

.hm-project-card__title a:hover {
    color: var(--brand-primary);
}

.hm-project-card__excerpt {
    color: var(--brand-muted);
    font-size: .95rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hm-project-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--brand-border);
}

.hm-project-card__date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: var(--brand-muted);
}

/* Isotope layout (projects page with filters) — gutter via padding */
.hm-isotope-container {
    margin-inline: -13px;
}

.hm-isotope-container::after {
    content: "";
    display: block;
    clear: both;
}

.hm-isotope-item {
    width: 33.3333%;
    padding: 0 13px 26px;
    float: left;
}

@media (max-width: 991.98px) {
    .hm-isotope-item { width: 50%; }
}

@media (max-width: 767.98px) {
    .hm-isotope-item { width: 100%; float: none; }
}

/* Filters */
.hm-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
    list-style: none;
    padding: 0;
}

.hm-filters li {
    display: inline-flex;
}

.hm-filter {
    font-family: var(--font-heading);
    font-size: .88rem;
    font-weight: 500;
    color: var(--brand-navy);
    background-color: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    padding: 8px 18px;
    cursor: pointer;
    transition: all .18s ease;
}

.hm-filter:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.hm-filter.hm-filter-active {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

/* ------------------------------------------------------------------ */
/* 11. Articles cards                                                  */
/* ------------------------------------------------------------------ */
.hm-articles__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.hm-article-card {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    height: 100%;
}

.hm-article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #cbd8ef;
}

.hm-article-card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: var(--brand-soft);
}

.hm-article-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.hm-article-card:hover .hm-article-card__media img {
    transform: scale(1.04);
}

.hm-article-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: rgba(37, 99, 235, .92);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: var(--shadow-md);
}

.hm-article-card__play:hover {
    background-color: var(--brand-primary-dark);
    color: #fff;
}

.hm-article-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    flex: 1 1 auto;
}

.hm-article-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: .82rem;
    color: var(--brand-muted);
}

.hm-article-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hm-article-card__title {
    font-size: 1.2rem;
    margin: 0;
}

.hm-article-card__title a {
    color: var(--brand-navy);
}

.hm-article-card__title a:hover {
    color: var(--brand-primary);
}

.hm-article-card__excerpt {
    color: var(--brand-muted);
    font-size: .95rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hm-article-card__footer {
    margin-top: auto;
    padding-top: 8px;
}

/* ------------------------------------------------------------------ */
/* 12. Experience / résumé restyle (overrides main.css)               */
/* ------------------------------------------------------------------ */
.hm-resume .section-title-resume {
    text-align: left;
    padding: 0;
    margin-bottom: 28px;
}

/* Tame the partial's own "Resume" heading so it doesn't fight the section head */
.hm-resume .section-title-resume h2 {
    font-size: 1.35rem;
    text-align: left;
    padding: 0;
    margin: 0 0 8px;
}

.hm-resume .section-title-resume h2::after,
.hm-resume .section-title-resume h2::before {
    content: none !important;
}

/* Two-column résumé stacks cleanly and stays readable */
.hm-resume .row {
    display: flex;
    flex-wrap: wrap;
}

.hm-resume .col-lg-6 {
    padding-inline: 12px;
}

.hm-resume .resume-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--brand-navy);
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--brand-border);
}

.hm-resume .resume-item {
    background-color: #fff;
    border: 1px solid var(--brand-border);
    border-left: 4px solid var(--brand-primary);
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease;
    /* neutralise old iPortfolio timeline pseudo-elements */
    position: relative;
}

.hm-resume .resume-item::before,
.hm-resume .resume-item::after {
    content: none !important;
}

.hm-resume .resume-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.hm-resume .resume-item h5 {
    font-family: var(--font-heading);
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--brand-navy);
    background: transparent;
    padding: 0;
    text-transform: none;
    margin-bottom: 4px;
}

/* Remove the italic-heavy styling requested */
.hm-resume em {
    font-style: normal;
}

.hm-resume .resume-item ul li {
    color: var(--brand-text);
    font-size: .96rem;
    line-height: 1.65;
}

.hm-resume .resume-item .text-muted {
    color: var(--brand-muted) !important;
}

.hm-resume .list-unstyled {
    list-style: none;
    padding-left: 0;
}

/* ------------------------------------------------------------------ */
/* 13. Contact CTA                                                     */
/* ------------------------------------------------------------------ */
.hm-cta {
    background:
        radial-gradient(900px 380px at 15% 0%, rgba(37, 99, 235, .28), transparent 60%),
        var(--brand-navy);
    color: #e2e8f0;
    border-radius: 28px;
    padding: clamp(36px, 5vw, 64px);
}

.hm-cta__grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 44px;
    align-items: start;
}

.hm-cta h2 {
    color: #fff;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    margin-bottom: 16px;
}

.hm-cta__text {
    color: #cbd5e1;
    font-size: 1.08rem;
    margin-bottom: 26px;
}

.hm-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 26px;
}

.hm-cta__contacts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hm-cta__contacts a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #e2e8f0;
    font-weight: 500;
}

.hm-cta__contacts a:hover {
    color: #fff;
}

.hm-cta__contacts i {
    color: #60a5fa;
    font-size: 1.15rem;
}

.hm-form-frame {
    background-color: #fff;
    border-radius: 18px;
    padding: 10px;
    box-shadow: var(--shadow-lg);
}

.hm-form-frame iframe {
    width: 100%;
    min-height: 780px;
    border: 0;
    border-radius: 10px;
    display: block;
}

/* ------------------------------------------------------------------ */
/* 14. Footer                                                          */
/* ------------------------------------------------------------------ */
.hm-footer {
    background-color: var(--brand-navy);
    color: #94a3b8;
    padding-block: 56px 28px;
}

.hm-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.hm-footer__brand-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.hm-footer__desc {
    font-size: .95rem;
    max-width: 340px;
    margin-bottom: 18px;
}

.hm-footer h4 {
    color: #fff;
    font-size: .85rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hm-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hm-footer__links a {
    color: #94a3b8;
    font-size: .95rem;
}

.hm-footer__links a:hover {
    color: #fff;
}

.hm-footer__social {
    display: flex;
    gap: 10px;
}

.hm-footer__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, .08);
    color: #e2e8f0;
    font-size: 1.05rem;
}

.hm-footer__social a:hover {
    background-color: var(--brand-primary);
    color: #fff;
}

.hm-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 22px;
    font-size: .88rem;
}

/* ------------------------------------------------------------------ */
/* 15. Scroll-to-top                                                   */
/* ------------------------------------------------------------------ */
.hm-scroll-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 900;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background-color: var(--brand-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease, background-color .2s ease;
}

.hm-scroll-top.hm-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hm-scroll-top:hover {
    background-color: var(--brand-primary-dark);
}

/* ------------------------------------------------------------------ */
/* 16. Breadcrumbs & page hero (internal pages)                       */
/* ------------------------------------------------------------------ */
.hm-page-hero {
    background:
        radial-gradient(900px 340px at 85% -10%, var(--brand-soft-blue), transparent 60%),
        linear-gradient(180deg, #fff, var(--brand-soft));
    border-bottom: 1px solid var(--brand-border);
    padding-block: clamp(36px, 5vw, 64px);
}

.hm-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    font-size: .85rem;
    color: var(--brand-muted);
}

.hm-breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hm-breadcrumb li:not(:last-child)::after {
    content: "/";
    color: var(--brand-border);
}

.hm-breadcrumb a {
    color: var(--brand-muted);
}

.hm-breadcrumb a:hover {
    color: var(--brand-primary);
}

.hm-breadcrumb .hm-current {
    color: var(--brand-navy);
    font-weight: 500;
}

.hm-page-hero__title {
    font-size: clamp(2rem, 4vw, 2.9rem);
    margin-bottom: 12px;
}

.hm-page-hero__lead {
    font-size: 1.1rem;
    color: var(--brand-muted);
    max-width: 720px;
    margin: 0;
}

/* ------------------------------------------------------------------ */
/* 17. Case study (project item)                                      */
/* ------------------------------------------------------------------ */
.hm-case__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 44px;
    align-items: start;
}

.hm-case__body {
    min-width: 0;
}

.hm-prose {
    font-size: 1.06rem;
    color: var(--brand-text);
}

.hm-prose > h1,
.hm-prose > h2,
.hm-prose > h3,
.hm-prose > h4 {
    margin-top: 2rem;
    margin-bottom: .8rem;
}

.hm-prose p {
    margin-bottom: 1.15rem;
}

.hm-prose img {
    border-radius: 14px;
    margin-block: 1.2rem;
}

/* Neutralise the old main.css `.img-fluid { height: 250px }` inside rich text */
.hm-prose img,
.hm-prose img.img-fluid,
.hm-skillcard img.img-fluid,
.hm-toolkit img.img-fluid,
.hm-content-card img.img-fluid {
    height: auto;
    max-width: 100%;
}

.hm-prose :is(ul, ol) {
    margin-bottom: 1.15rem;
    padding-left: 1.3rem;
}

.hm-prose li {
    margin-bottom: .45rem;
}

.hm-prose blockquote {
    margin: 1.5rem 0;
    padding: 4px 20px;
    border-left: 4px solid var(--brand-primary);
    background-color: var(--brand-soft-blue);
    border-radius: 0 10px 10px 0;
    color: var(--brand-navy);
}

.hm-prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.4rem;
    display: block;
    overflow-x: auto;
}

.hm-prose :is(th, td) {
    border: 1px solid var(--brand-border);
    padding: 10px 12px;
    text-align: left;
}

.hm-block-title {
    font-size: 1.5rem;
    margin: 40px 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brand-border);
}

/* Feature cards (bulletWriter) */
.hm-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-block: 24px;
}

.hm-feature {
    display: flex;
    gap: 14px;
    background-color: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.hm-feature__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background-color: var(--brand-soft-blue);
    color: var(--brand-primary);
    font-size: 1.25rem;
}

.hm-feature__name {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--brand-navy);
    margin-bottom: 4px;
}

.hm-feature__desc {
    font-size: .93rem;
    color: var(--brand-muted);
    margin: 0;
}

/* Technical highlights list */
.hm-tech-list {
    display: grid;
    gap: 14px;
    margin-block: 20px;
}

.hm-tech-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    background-color: var(--brand-soft);
    border: 1px solid var(--brand-border);
    border-radius: 12px;
}

.hm-tech-item > i {
    color: var(--brand-primary);
    font-size: 1.2rem;
    margin-top: 2px;
}

.hm-tech-item .hm-tech-name {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--brand-navy);
    display: block;
    margin-bottom: 2px;
}

/* Screenshot gallery */
.hm-shots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-block: 22px;
}

.hm-shot {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--brand-border);
    box-shadow: var(--shadow-sm);
}

.hm-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.hm-shot:hover img {
    transform: scale(1.05);
}

.hm-shot__zoom {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background-color: rgba(15, 23, 42, .35);
    opacity: 0;
    transition: opacity .25s ease;
    font-size: 1.6rem;
}

.hm-shot:hover .hm-shot__zoom {
    opacity: 1;
}

.hm-shot__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 12px;
    font-size: .8rem;
    color: #fff;
    background: linear-gradient(transparent, rgba(15, 23, 42, .8));
}

/* Code samples */
.hm-code {
    margin-block: 22px;
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background-color: #1e293b;
}

.hm-code__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background-color: var(--brand-navy);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.hm-code__title {
    font-family: var(--font-heading);
    font-size: .9rem;
    font-weight: 500;
    color: #e2e8f0;
}

.hm-code__lang {
    font-family: var(--font-heading);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #93c5fd;
    background-color: rgba(96, 165, 250, .15);
    border-radius: 6px;
    padding: 4px 9px;
}

.hm-code pre {
    margin: 0;
    padding: 18px;
    overflow-x: auto;
    max-width: 100%;
    background: transparent;
    border-radius: 0;
}

.hm-code pre code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: .88rem;
    line-height: 1.6;
    white-space: pre;
}

/* Sticky project-info sidebar */
.hm-case__aside {
    position: sticky;
    top: calc(var(--header-height) + 20px);
}

.hm-info-card {
    background-color: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--card-radius);
    padding: 26px;
    box-shadow: var(--shadow-sm);
}

.hm-info-card h3 {
    font-size: 1.1rem;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--brand-border);
}

.hm-info-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.hm-info-list li {
    padding-block: 12px;
    border-bottom: 1px solid var(--brand-border);
}

.hm-info-list li:last-child {
    border-bottom: 0;
}

.hm-info-label {
    display: block;
    font-family: var(--font-heading);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--brand-muted);
    margin-bottom: 4px;
}

.hm-info-value {
    color: var(--brand-navy);
    font-weight: 500;
    word-break: break-word;
}

/* ------------------------------------------------------------------ */
/* 18. Editorial article (blog post)                                  */
/* ------------------------------------------------------------------ */
.hm-article {
    max-width: 820px;
    margin-inline: auto;
}

.hm-article__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    color: var(--brand-muted);
    font-size: .9rem;
    margin-bottom: 20px;
}

.hm-article__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hm-article__title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.15;
    margin-bottom: 18px;
}

.hm-article__excerpt {
    font-size: 1.2rem;
    color: var(--brand-text);
    margin-bottom: 26px;
}

.hm-article__hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 18px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
}

.hm-article__video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 32px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.hm-article__video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.hm-author-card {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 44px;
    padding: 24px;
    background-color: var(--brand-soft);
    border: 1px solid var(--brand-border);
    border-radius: var(--card-radius);
}

.hm-author-card__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.hm-author-card__name {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--brand-navy);
    margin-bottom: 2px;
}

.hm-author-card__role {
    font-size: .9rem;
    color: var(--brand-muted);
    margin: 0;
}

/* ------------------------------------------------------------------ */
/* 19. Content page card                                              */
/* ------------------------------------------------------------------ */
.hm-content-card {
    max-width: 860px;
    margin-inline: auto;
    background-color: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--card-radius);
    padding: clamp(28px, 4vw, 52px);
    box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------------ */
/* 20. Category filter row (blog)                                     */
/* ------------------------------------------------------------------ */
.hm-empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--brand-soft);
    border: 1px dashed var(--brand-border);
    border-radius: var(--card-radius);
    color: var(--brand-muted);
}

.hm-empty-state i {
    font-size: 2.4rem;
    color: #c4d2ea;
    margin-bottom: 12px;
    display: block;
}

/* ------------------------------------------------------------------ */
/* 21. Utility                                                        */
/* ------------------------------------------------------------------ */
.hm-mt-40 { margin-top: 40px; }
.hm-text-center { text-align: center; }
.hm-flex-center { display: flex; align-items: center; justify-content: center; }

/* ------------------------------------------------------------------ */
/* 22. Responsive breakpoints                                         */
/* ------------------------------------------------------------------ */
@media (max-width: 1199.98px) {
    :root { --section-spacing: 76px; }

    .hm-hero__float--years { left: -6px; }
    .hm-hero__float--location { right: -4px; }
}

@media (max-width: 991.98px) {
    .hm-hero__grid { grid-template-columns: 1fr; gap: 40px; }
    .hm-hero__media { order: -1; max-width: 340px; }
    .hm-bio__grid { grid-template-columns: 1fr; gap: 32px; }
    .hm-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .hm-projects__grid,
    .hm-articles__grid { grid-template-columns: repeat(2, 1fr); }
    .hm-cta__grid { grid-template-columns: 1fr; gap: 32px; }
    .hm-case__grid { grid-template-columns: 1fr; gap: 32px; }
    .hm-case__aside { position: static; }
    .hm-footer__grid { grid-template-columns: 1fr 1fr; }
    .hm-shots { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767.98px) {
    body.hm-body { font-size: 16px; }
    :root { --section-spacing: 60px; }

    .hm-grid--2,
    .hm-grid--3,
    .hm-grid--4 { grid-template-columns: 1fr; }
    .hm-projects__grid,
    .hm-articles__grid { grid-template-columns: 1fr; }
    .hm-feature-grid { grid-template-columns: 1fr; }
    .hm-shots { grid-template-columns: 1fr 1fr; }
    .hm-footer__grid { grid-template-columns: 1fr; gap: 28px; }
    .hm-hero__float--years { top: 12px; left: 6px; }
    .hm-hero__float--location { bottom: 12px; right: 6px; }
}

@media (max-width: 479.98px) {
    .hm-shots { grid-template-columns: 1fr; }
    .hm-hero__actions .hm-btn { flex: 1 1 100%; justify-content: center; }
}

/* ------------------------------------------------------------------ */
/* 23. Reduced motion                                                 */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}
