/* ============================================================
   1. Hero Section
   ============================================================ */

.projects-hero {
    position: relative;
    isolation: isolate;
    padding-top: var(--sp-5);
    padding-bottom: var(--sp-6);
    border-bottom: 1px solid var(--line);
}

.projects-hero .blob-1 {
    top: -25%;
    inset-inline-start: -8%;
    opacity: 0.55;
}

.projects-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}

/* Breadcrumbs */

.projects-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 14px;
    border-radius: var(--r-pill);
    background: var(--bg-elev);
    border: 1px solid var(--line);
    font-family: var(--ff-mono);
    font-size: var(--fs-12);
    color: var(--fg-mute);
    box-shadow: var(--sh-1);
}

.projects-breadcrumb a {
    color: var(--fg-soft);
    font-weight: 500;
    transition: color var(--d-fast) var(--ease-out);
}

.projects-breadcrumb a:hover {
    color: var(--accent-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.projects-breadcrumb-sep {
    color: var(--fg-mute);
    user-select: none;
}

.projects-breadcrumb-current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fg);
    font-weight: 600;
}

.projects-breadcrumb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* Hero grid */

.projects-hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: var(--sp-6);
    align-items: end;
}

.projects-hero-title {
    font-family: var(--ff-display);
    font-size: clamp(2.5rem, 5.4vw, 4.75rem);
    line-height: 108%;
    letter-spacing: -0.02em;
    font-weight: 500;
    color: var(--fg);
    margin-top: var(--sp-3);
}

.projects-hero-title .it {
    font-style: italic;
    color: var(--accent);
}

.projects-hero-side {
    display: grid;
    gap: var(--sp-4);
    align-content: end;
}

.projects-hero-lead {
    font-size: var(--fs-16);
    line-height: var(--lh-normal);
    color: var(--fg-soft);
}

.projects-hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-1);
}

.projects-hero-metric {
    background: var(--bg-elev);
    padding: 14px 12px;
    text-align: center;
}

.projects-hero-metric-val {
    display: block;
    font-family: var(--ff-display);
    font-style: italic;
    font-weight: 600;
    font-size: var(--fs-24);
    line-height: 1;
    color: var(--fg);
}

.projects-hero-metric-lbl {
    display: block;
    margin-top: 5px;
    font-family: var(--ff-mono);
    font-size: var(--fs-11);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--fg-mute);
}

.projects-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

/* ============================================================
   2. Projects Showcase
   ============================================================ */

.projects-grid-section {
    padding-top: var(--sp-6);
}

/* Project filters */

.projects-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-5);
}

.projects-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    background: var(--bg-elev);
    color: var(--fg-soft);
    font-size: var(--fs-14);
    font-weight: 500;
    cursor: pointer;
    transition:
        background var(--d-fast) var(--ease-out),
        color var(--d-fast) var(--ease-out),
        border-color var(--d-fast) var(--ease-out),
        transform var(--d-fast) var(--ease-out);
}

.projects-filter-btn:hover {
    border-color: var(--fg);
    color: var(--fg);
    transform: translateY(-1px);
}

.projects-filter-btn.is-active {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.filter-count {
    font-family: var(--ff-mono);
    font-size: var(--fs-12);
    color: var(--fg-mute);
}

.projects-filter-btn.is-active .filter-count {
    color: inherit;
}

.projects-count {
    margin-inline-start: auto;
    font-family: var(--ff-mono);
    font-size: var(--fs-12);
    color: var(--fg-mute);
    padding-block: 6px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.projects-card {
    min-width: 0;
    background: var(--bg-elev);
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--sh-1);
    transition:
        border-color var(--d-base) var(--ease-out),
        box-shadow var(--d-base) var(--ease-out),
        transform var(--d-base) var(--ease-out);
}

.projects-card.is-hidden {
    display: none;
}

.projects-card:hover {
    border-color: var(--accent);
    box-shadow: var(--sh-2);
}

.projects-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.projects-card-media {
    position: relative;
    overflow: hidden;
    background: var(--bg-sunk);
    aspect-ratio: 4 / 3;
    flex-shrink: 0;
}

.projects-card-media picture,
.projects-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 600ms var(--ease-out);
}

.projects-card:hover .projects-card-media img {
    transform: scale(1.04);
}

/* Solid opaque badge guarantees deterministic axe-core contrast over photos */
.projects-tag {
    position: absolute;
    top: var(--sp-3);
    inset-inline-start: var(--sp-3);
    padding: 4px 12px;
    border-radius: var(--r-pill);
    background: var(--fg);
    color: var(--bg);
    font-size: var(--fs-12);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: var(--sh-2);
    z-index: 2;
}

.projects-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--sp-4);
    gap: var(--sp-3);
    background: var(--bg-elev);
}

.projects-card-body h3 {
    font-family: var(--ff-display);
    font-size: var(--fs-20);
    font-style: italic;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--fg);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.projects-card-body h3::after {
    content: "";
    display: block;
    width: 32px;
    height: 2px;
    margin-top: var(--sp-2);
    background: var(--accent);
    border-radius: var(--r-pill);
}

.projects-card[data-type="figma"] .projects-card-body h3::after {
    background: #a259ff;
}

.projects-desc {
    font-size: var(--fs-14);
    line-height: var(--lh-normal);
    color: var(--fg-soft);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    background: var(--bg-sunk);
    color: var(--fg-soft);
    font-size: var(--fs-13);
    line-height: 1.3;
    transition:
        background var(--d-fast) var(--ease-out),
        color var(--d-fast) var(--ease-out),
        border-color var(--d-fast) var(--ease-out);
}

.feature-tag:hover {
    color: var(--accent-text);
    border-color: var(--accent);
}

.projects-card-body .btn {
    margin-top: auto;
}

/* ============================================================
   3. Values Section
   ============================================================ */

.scene-3d {
    perspective: 1200px;
    perspective-origin: 50% 50%;
    content-visibility: auto;
    contain-intrinsic-size: auto 680px;
}

.cards-3d {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--sp-5);
}

.card-3d {
    --mx: 50%;
    --my: 50%;
    position: relative;
    padding: var(--sp-6);
    border-radius: var(--r-xl);
    background: linear-gradient(145deg, var(--bg-elev), var(--bg-sunk));
    border: 1px solid var(--line);
    min-height: 268px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: var(--sh-1);
}

.tilt {
    transform-style: preserve-3d;
    transition:
        transform 400ms var(--ease-out),
        border-color var(--d-base) var(--ease-out),
        box-shadow var(--d-base) var(--ease-out);
    will-change: transform;
}

.tilt.is-tilting {
    transition:
        transform 90ms linear,
        border-color var(--d-base) var(--ease-out),
        box-shadow var(--d-base) var(--ease-out);
    border-color: var(--line-strong);
    box-shadow: var(--sh-3);
}

.tilt-inner {
    transform-style: preserve-3d;
    position: relative;
    z-index: 2;
}

.tilt-layer {
    transform: translateZ(24px);
    transition: transform 400ms var(--ease-out);
}

.tilt-deep {
    transform: translateZ(42px);
}

.card-3d .tilt-num {
    font-family: var(--ff-display);
    font-style: italic;
    font-weight: 600;
    font-size: var(--fs-display-s);
    color: var(--accent-text);
    line-height: 1;
    margin-bottom: var(--sp-4);
}

.card-3d h3 {
    font-family: var(--ff-display);
    font-style: italic;
    font-size: var(--fs-24);
    font-weight: 600;
    line-height: var(--lh-snug);
    color: var(--fg);
    margin-block-end: var(--sp-2);
}

.card-3d p {
    color: var(--fg-soft);
    font-size: var(--fs-14);
    line-height: var(--lh-normal);
}

.card-3d .glyph {
    position: absolute;
    inset-block-end: -10px;
    inset-inline-end: -6px;
    font-family: var(--ff-display);
    font-style: italic;
    font-size: 8.5rem;
    color: transparent;
    -webkit-text-stroke: 1px var(--line-strong);
    line-height: 1;
    pointer-events: none;
    transform: translateZ(12px);
    opacity: 0.7;
    transition:
        opacity var(--d-base) var(--ease-out),
        -webkit-text-stroke-color var(--d-base) var(--ease-out);
}

.card-3d:hover .glyph {
    opacity: 1;
    -webkit-text-stroke-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
}

.tilt-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(280px circle at var(--mx) var(--my),
            color-mix(in srgb, var(--accent) 12%, transparent),
            transparent 65%);
    opacity: 0;
    transition: opacity 320ms var(--ease-out);
    z-index: 1;
}

.tilt:hover .tilt-shine {
    opacity: 1;
}

/* ============================================================
   5. CTA Banner
   ============================================================ */

.banner-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 380px;
}

.news {
    padding: var(--sp-8) var(--sp-6);
    border-radius: var(--r-2xl);
    background: var(--fg);
    color: var(--bg);
    display: grid;
    gap: var(--sp-5);
    text-align: center;
    justify-items: center;
    position: relative;
    overflow: hidden;
}

.news .eyebrow {
    color: color-mix(in srgb, var(--bg) 82%, var(--fg));
}

.news h2 {
    font-family: var(--ff-display);
    font-style: italic;
    font-size: var(--fs-display-m);
    line-height: 105%;
    font-weight: 500;
    max-width: 16ch;
}

.news h2 .it {
    color: var(--svc-ink-accent, var(--c-accent-hi));
}

.news p:not(.eyebrow) {
    color: color-mix(in srgb, var(--bg) 88%, var(--fg));
    max-width: 540px;
}

.news .btn-accent {
    background: var(--accent-fill);
    color: var(--accent-fg);
}

.news .btn-accent:hover {
    background: var(--bg);
    color: var(--fg);
}

/* Theme transition support for page-specific blocks */
.theme-transition .projects-breadcrumb,
.theme-transition .projects-hero-metric,
.theme-transition .projects-card,
.theme-transition .projects-card-body,
.theme-transition .card-3d,
.theme-transition .news {
    transition:
        background-color 350ms var(--ease-out),
        color 350ms var(--ease-out),
        border-color 350ms var(--ease-out);
}
