/* ============================================
   RAVRANI.DEV — Editorial Design System
   ============================================ */

:root {
    --bg: #0a0a0a;
    --bg-elevated: #141414;
    --bg-dark: #0a0a0a;
    --bg-dark-elevated: #1a1a1a;
    --text: #f5f5f4;
    --text-secondary: #a8a8a8;
    --text-muted: #737373;
    --border: rgba(255, 255, 255, 0.1);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --accent: #E07A2F;
    --accent-hover: #F08A3F;
    --accent-muted: rgba(224, 122, 47, 0.12);
    --accent-border: rgba(224, 122, 47, 0.35);
    --btn-primary-bg: #f5f5f4;
    --btn-primary-fg: #0a0a0a;
    --btn-primary-hover: #e5e5e5;
    --radius: 10px;
    --radius-lg: 16px;
    --font-sans: 'DM Sans', system-ui, sans-serif;
    --font-serif: 'Instrument Serif', Georgia, serif;
    --max-width: 1080px;
    --section-gap: clamp(4rem, 7vw, 6rem);
    --section-gap-top: clamp(3.5rem, 6vw, 5.5rem);
    --section-gap-bottom: clamp(3.5rem, 6vw, 5.5rem);
    --content-width: 42rem;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    color-scheme: dark;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    line-height: 1.65;
    font-size: 1rem;
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(224, 122, 47, 0.16);
    color: var(--text);
}

/* ---- Layout ---- */
.site-wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2rem);
}

.section {
    padding-top: var(--section-gap-top);
    padding-bottom: var(--section-gap-bottom);
}

.section--compact {
    padding: clamp(2.5rem, 5vw, 3.5rem) 0;
}

.section--tight-top {
    padding-top: clamp(2.75rem, 5vw, 4rem);
}

.section--tight-bottom {
    padding-bottom: clamp(2.5rem, 4vw, 3.5rem);
}

/* Extra breathing room after dark sections */
.tech-section + .section,
.site-footer {
    padding-top: clamp(4rem, 7vw, 6rem);
}

.section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.875rem;
}

.section-label::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 2px;
    background: var(--accent);
    margin-right: 0.625rem;
    vertical-align: middle;
    position: relative;
    top: -1px;
    border-radius: 1px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.875rem, 3.5vw, 2.625rem);
    font-weight: 400;
    line-height: 1.12;
    color: var(--text);
    letter-spacing: -0.025em;
}

.section-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: var(--content-width);
    margin-top: 0.875rem;
    line-height: 1.7;
}

.section-header {
    /* intro block only — grids below stay full width */
}

.section-header .section-desc {
    max-width: var(--content-width);
}

.page-intro__content {
    margin-top: 2.5rem;
}

.page-intro__content > .expertise-grid,
.page-intro__content > .portfolio-featured,
.page-intro__content > .projects-bento,
.page-intro__content > .portfolio-grid {
    margin-top: 0;
}

.page-intro__content .section-cta {
    margin-top: 2rem;
}

.page-hero {
    padding-bottom: 0;
}

.page-hero .section-title {
    max-width: none;
    font-size: clamp(2.25rem, 4.5vw, 3.25rem);
}

/* ---- Hero ---- */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: var(--navbar-height, 72px);
    padding-bottom: clamp(2rem, 5vh, 3.5rem);
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(224, 122, 47, 0.1) 0%, transparent 55%),
        linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 100%);
}

.hero > .site-wrap {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 4vh, 3rem);
    align-items: center;
    width: 100%;
}

@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: 1.05fr 0.95fr;
        gap: clamp(2rem, 4vw, 4rem);
    }
}

@media (min-width: 900px) {
    .hero-grid {
        gap: clamp(2.5rem, 5vw, 4.5rem);
    }
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.hero-content .section-label {
    margin-bottom: 1.25rem;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.hero-headline {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5.5vw, 4rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: var(--text);
    margin-bottom: 1.25rem;
    margin-top: 0;
}

.hero-headline em {
    font-style: italic;
    color: var(--accent);
}

.hero-summary {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.75;
    max-width: 44ch;
    margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
    .hero-headline {
        font-size: clamp(2.125rem, 8vw, 2.75rem);
        margin-bottom: 1rem;
    }

    .hero-summary {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }

    .hero-stats {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .hero-visual {
        padding-block: 0.25rem 0;
    }
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0;
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding-block: 0.75rem;
}

.hero-image-wrap {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: min(28dvh, 220px);
    margin-inline: auto;
    background: var(--bg-dark);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

@media (min-width: 768px) {
    .hero-image-wrap {
        aspect-ratio: 4 / 5;
        max-height: min(calc(100dvh - var(--navbar-height, 72px) - 5rem), 480px);
        max-width: 360px;
        margin-inline: 0;
        margin-left: auto;
    }
}

@media (min-width: 900px) {
    .hero-image-wrap {
        max-width: 380px;
        max-height: min(calc(100dvh - var(--navbar-height, 72px) - 5rem), 520px);
    }
}

.hero-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 12%;
    opacity: 0.95;
    filter: grayscale(8%) contrast(1.02);
}

.hero-image-frame {
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: calc(var(--radius-lg) - 4px);
    pointer-events: none;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    margin-top: 2rem;
    margin-bottom: 0;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    max-width: 28rem;
}

.hero-stat {
    background: transparent;
    padding: 0 1rem 0 0;
    text-align: left;
    border-right: 1px solid var(--border);
}

.hero-stat:last-child {
    border-right: none;
    padding-right: 0;
    padding-left: 1rem;
}

.hero-stat:nth-child(2) {
    padding-left: 1rem;
}

.hero-stat-value {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
    margin-bottom: 0.35rem;
    letter-spacing: -0.03em;
}

@media (max-width: 479px) {
    .hero-stat {
        padding: 0 0.5rem 0 0;
    }

    .hero-stat:nth-child(2),
    .hero-stat:last-child {
        padding-left: 0.5rem;
    }

    .hero-stat-value {
        font-size: 1.375rem;
    }
}

.hero-stat-label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6875rem 1.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: 0.01em;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-fg);
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.btn-primary:focus-visible {
    outline-color: var(--accent);
}

.btn-outline {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--text-secondary);
    background: var(--bg-elevated);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn:focus-visible,
.project-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn--compact {
    padding: 0.625rem 1.125rem;
    font-size: 0.8125rem;
}

.btn--compact i {
    font-size: 0.65rem;
}

.section-cta {
    margin-top: 2.5rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.75rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

.btn-ghost i {
    transition: transform 0.2s ease;
}

.btn-ghost:hover i {
    transform: translateX(3px);
}

/* Legacy compat */
.btn-primary-blue {
    background: var(--btn-primary-bg) !important;
    color: var(--btn-primary-fg) !important;
    border: none !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.btn-primary-blue:hover {
    background: var(--btn-primary-hover) !important;
    transform: translateY(-1px) !important;
    box-shadow: none !important;
}

.btn-primary-blue i {
    width: auto !important;
    height: auto !important;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: inherit !important;
    font-size: 0.75rem !important;
}

.btn-link-blue {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2px;
    transition: border-color 0.2s;
}

.btn-link-blue:hover {
    border-color: var(--text);
    color: var(--text);
}

/* ---- Clients strip ---- */
.clients-strip {
    padding: 1.75rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.clients-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 0;
}

@media (min-width: 768px) {
    .clients-inner {
        gap: 0;
    }
}

.clients-label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    margin-right: 1.5rem;
}

.client-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
    padding: 0 1.25rem;
    border-left: 1px solid var(--border);
}

@media (max-width: 767px) {
    .client-name {
        border-left: none;
        padding: 0;
    }

    .client-name + .client-name::before {
        content: '·';
        margin: 0 0.625rem;
        color: var(--text-muted);
    }
}

.client-name + .client-name::before {
    display: none;
}

/* ---- About ---- */
.about-body {
    max-width: var(--content-width);
}

.about-body .section-title {
    margin-bottom: 1.5rem;
    max-width: 28ch;
}

.about-body p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1.125rem;
}

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

/* ---- Expertise cards ---- */
.expertise-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
    .expertise-grid {
        grid-template-columns: repeat(3, 1fr);
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}

.expertise-card {
    background: transparent;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
    transition: color 0.2s ease;
}

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

@media (min-width: 768px) {
    .expertise-card {
        padding: 2rem 1.75rem;
        border-bottom: none;
        border-right: 1px solid var(--border);
    }

    .expertise-card:last-child {
        border-bottom: none;
        border-right: none;
    }
}

.expertise-card:hover {
    background: transparent;
}

.expertise-num {
    display: none;
}

.expertise-card h3 {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.625rem;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.expertise-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.expertise-metric {
    display: block;
    margin-top: 1.125rem;
    padding-top: 1.125rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---- Projects bento ---- */
.projects-bento {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

@media (min-width: 768px) {
    .projects-bento {
        grid-template-columns: 1.15fr 0.85fr;
        grid-template-rows: auto auto;
    }
    .project-card--featured {
        grid-row: span 2;
    }
}

.project-card--featured {
    border-left: none;
    background: var(--bg-elevated);
}

.project-card,
.portfolio-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.project-card::before,
.portfolio-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    background: radial-gradient(
        420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(224, 122, 47, 0.14) 0%,
        rgba(224, 122, 47, 0.05) 28%,
        transparent 55%
    );
    pointer-events: none;
    z-index: 0;
}

.project-card.is-spotlight::before,
.portfolio-card.is-spotlight::before {
    opacity: 1;
}

.project-card > *,
.portfolio-card > * {
    position: relative;
    z-index: 1;
}

.project-card {
    background: var(--bg-elevated);
    border: none;
    border-radius: 0;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    transition: background 0.2s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

@media (min-width: 768px) {
    .project-card {
        padding: 2rem;
    }
}

a.project-card .project-card-link {
    margin-top: auto;
    padding-top: 1.25rem;
}

.project-card-tag {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.875rem;
}

.project-card h3 {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.625rem;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.project-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    flex: 1;
}

.project-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.project-metric strong {
    display: block;
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
    margin-bottom: 0.2rem;
    letter-spacing: -0.02em;
}

.project-metric span {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.project-tags span {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
}

.project-tags span + span::before {
    content: '·';
    margin: 0 0.5rem;
    color: var(--border);
}

.project-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.project-card:hover .project-card-link {
    color: var(--accent);
}

.project-card-link:hover {
    color: var(--accent);
}

.project-card-link i {
    font-size: 0.6875rem;
    transition: transform 0.2s;
}

.project-card-link:hover i {
    transform: translateX(3px);
}

/* Legacy project grid compat */
.project-grid-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.project-grid-card:hover {
    border-color: var(--accent-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    transform: none;
}

/* ---- Experience timeline ---- */
.experience-list {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
}

.experience-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
    .experience-item {
        grid-template-columns: 200px 1fr;
        gap: 3rem;
    }
}

.exp-period {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
}

.exp-role {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.exp-company {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.exp-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ---- Tech stack ---- */
.tech-section {
    background: var(--bg-elevated);
    color: var(--text);
    position: relative;
    overflow: hidden;
    padding-bottom: clamp(3rem, 6vw, 4.5rem);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.tech-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 70%);
}

.tech-section .site-wrap {
    position: relative;
    z-index: 1;
}

.tech-section .section-label {
    color: var(--text-muted);
}

.tech-section .section-label::before {
    background: var(--accent);
    opacity: 1;
}

.tech-section .section-title {
    color: var(--text);
    max-width: none;
}

.tech-categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2.5rem;
}

@media (min-width: 640px) {
    .tech-categories {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .tech-categories {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tech-category h4 {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.3125rem 0.625rem;
    border-radius: 4px;
    transition: border-color 0.2s, color 0.2s;
}

.tech-tag:hover {
    background: transparent;
    border-color: var(--accent-border);
    color: var(--text);
}

/* Legacy tech tabs - hidden on new design */
.tech-tab-content { display: none; }

/* ---- Education ---- */
.edu-list {
    margin-top: 2rem;
}

.edu-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.edu-item:first-child {
    border-top: 1px solid var(--border);
}

.edu-degree {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.edu-school {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.edu-year {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ---- Scroll reveal ---- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .scroll-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Hide old elements */
#floating-tech-icons,
#trust,
.subnav-container {
    display: none !important;
}

/* ---- Footer overrides ---- */
.site-footer {
    background: var(--bg);
    color: var(--text-secondary);
    padding-bottom: 2.5rem;
    border-top: 1px solid var(--border);
}

.site-footer .section-label {
    color: var(--text-muted);
}

.site-footer .section-label::before {
    background: var(--accent);
    opacity: 1;
}

.site-footer .section-title {
    color: var(--text);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    max-width: none;
}

.site-footer .section-desc {
    color: var(--text-secondary);
    max-width: 40ch;
}

.footer-contact-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

@media (min-width: 640px) {
    .footer-contact-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-contact-item a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-contact-item a:hover {
    color: var(--accent);
}

.footer-contact-item span {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.footer-social {
    display: flex;
    gap: 0.5rem;
    margin-top: 2rem;
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
    font-size: 0.8125rem;
}

.footer-social a:hover {
    border-color: var(--accent-border);
    color: var(--text);
    background: transparent;
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--text-muted);
}

/* ---- Portfolio section divider ---- */
.portfolio-section-note {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

/* ---- Homepage more projects grid ---- */
.home-projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 640px) {
    .home-projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .home-projects-grid { grid-template-columns: repeat(3, 1fr); }
}

.home-project-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: border-color 0.2s ease;
}

.home-project-item:hover {
    border-color: var(--accent-border);
}

.home-project-item h3 {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    margin: 0.5rem 0 0.5rem;
    color: var(--text);
    line-height: 1.3;
}

.home-project-item p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ---- Portfolio page ---- */
.page-main {
    padding-top: var(--navbar-height, 72px);
}

.page-main > .section:first-child {
    padding-top: var(--section-gap-top);
}

.portfolio-featured {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

@media (min-width: 900px) {
    .portfolio-featured {
        grid-template-columns: repeat(2, 1fr);
    }
    .portfolio-featured .project-card--featured {
        grid-column: 1 / -1;
    }
}

.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

@media (min-width: 640px) {
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}

.portfolio-card {
    background: var(--bg-elevated);
    border: none;
    border-radius: 0;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: background 0.2s ease;
}

.portfolio-card h3 {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0.375rem 0 0.625rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.portfolio-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    flex: 1;
    margin: 0;
}

.portfolio-card-outcome {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.01em;
    margin: 0.5rem 0 0.75rem;
    line-height: 1.5;
}

.portfolio-card-scope {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    line-height: 1.6;
}

.portfolio-card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
    flex: 1;
    margin: 0 0 0.75rem;
}

.portfolio-card-scope strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.portfolio-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.portfolio-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* ---- Inner pages (case studies, expertise) ---- */
body.inner-page {
    background: var(--bg);
    color: var(--text);
}

.inner-page main,
.inner-page .page-content {
    padding-top: calc(72px + 2rem);
}

.inner-page .prose-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2rem) var(--section-gap);
}

.inner-page h1,
.inner-page h2,
.inner-page h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    letter-spacing: -0.02em;
}

