:root {
    --page-bg: #f2eee8;
    --header-bg: #26231f;
    --header-border: #38312a;
    --display-font: Georgia, "Times New Roman", serif;
    --text-light: #ffffff;
    --muted-light: #ddd6ca;
    --accent: #e48a32;
    --search-bg: #f8f5f0;
    --search-text: #928978;
    --hero-tint: rgba(98, 74, 42, 0.42);
    --hero-fallback-a: #b7a083;
    --hero-fallback-b: #8a755d;
    --surface: #f7f1e8;
    --surface-strong: #efe4d6;
    --surface-elevated: rgba(255, 250, 243, 0.88);
    --surface-border: rgba(67, 49, 28, 0.14);
    --shadow-soft: 0 18px 40px rgba(38, 28, 20, 0.12);
    --shadow-strong: 0 28px 60px rgba(32, 21, 13, 0.16);
    --text-muted: #66584b;
    --panel-dark: #241b15;
    --panel-border: rgba(255, 238, 216, 0.14);
}

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

html,
body {
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
}

html {
    scroll-behavior: smooth;
}

html.card-modal-open,
body.card-modal-open {
    overflow: hidden;
    height: 100%;
}

body {
    margin: 0;
    min-height: 100svh;
    padding: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(228, 138, 50, 0.14), transparent 28%),
        radial-gradient(circle at 85% 10%, rgba(64, 44, 28, 0.08), transparent 24%),
        linear-gradient(180deg, #f5f0e9 0%, #efe7dc 100%);
    color: #1f1a16;
}

/* Global Heading Styles - Consistent across all pages */
h1 {
    margin: 0.67em 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    margin: 0.75em 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

h3 {
    margin: 0.83em 0;
    font-size: 1.17rem;
    font-weight: 700;
    line-height: 1.3;
}

h4 {
    margin: 1em 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

h5 {
    margin: 1.17em 0;
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1.4;
}

h6 {
    margin: 1.33em 0;
    font-size: 0.67rem;
    font-weight: 700;
    line-height: 1.4;
}

.page-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.section-shell,
main > section {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

main > section {
    padding: clamp(30px, 6vw, 56px) 0 clamp(48px, 7vw, 72px);
}

main {
    display: block;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 10px clamp(16px, 3vw, 22px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    color: var(--text-light);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-copy {
    min-width: 0;
}

.brand-title,
.brand-tagline {
    margin: 0;
}

.brand-title {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
}

.brand-accent {
    color: var(--accent);
}

.brand-tagline {
    margin-top: 3px;
    max-width: 240px;
    color: var(--muted-light);
    font-size: 0.64rem;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: clamp(14px, 2vw, 22px);
    flex-wrap: wrap;
    min-width: 0;
}

.site-nav a {
    color: var(--text-light);
    font-size: clamp(0.92rem, 1.3vw, 0.98rem);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s ease;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.site-nav a:hover {
    color: var(--accent);
}

.site-nav a:hover::after {
    transform: scaleX(1);
}

.header-actions {
    position: relative;
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 12px;
    min-width: 0;
    overflow: visible;
    z-index: 100;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(240px, 100%);
    width: 100%;
    max-width: 280px;
    padding: 8px 14px;
    background: var(--search-bg);
    border-radius: 999px;
    flex: 1 1 220px;
}

.search-icon {
    width: 12px;
    height: 12px;
    border: 2px solid #b6ad9f;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.search-icon::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 7px;
    height: 2px;
    background: #b6ad9f;
    border-radius: 999px;
    transform: rotate(45deg);
    transform-origin: center;
}

.search-form input {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--search-text);
    font: inherit;
    outline: none;
}

.search-form input::placeholder {
    color: var(--search-text);
}

.menu-button {
    display: grid;
    align-content: space-between;
    width: 40px;
    height: 40px;
    padding: 10px 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
    flex: 0 0 40px;
}

.menu-button span {
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: var(--text-light);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: min(220px, calc(100vw - 32px));
    max-height: min(320px, calc(100vh - 110px));
    overflow-y: auto;
    background-color: #1a1a1a;
    border: 1px solid rgba(228, 138, 50, 0.3);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.dropdown-content.active {
    display: flex;
    flex-direction: column;
}

.dropdown-content a {
    color: var(--text-light);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid rgba(228, 138, 50, 0.1);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: rgba(228, 138, 50, 0.2);
    color: var(--accent);
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: clamp(34px, 7vw, 84px) 0 clamp(48px, 8vw, 88px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(16px, 3vw, 24px);
}

.container > .header,
.container > .team-gallery,
.container > .team-member,
.container > .meet-team {
    grid-column: 1 / -1;
}

.container > .staff-grid {
    grid-column: 1 / -1;
}

.header {
    margin-bottom: clamp(28px, 5vw, 54px);
    text-align: center;
}

.header h1 {
    margin: 0 0 12px;
    color: #221912;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.header p {
    margin: 0;
    color: #675d52;
    font-size: clamp(0.98rem, 1.6vw, 1.08rem);
    line-height: 1.7;
}

.section-kicker {
    margin: 0;
    color: #9d5821;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.portfolio-section {
    display: grid;
    gap: clamp(26px, 4vw, 38px);
}

.portfolio-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.92fr);
    align-items: start;
    gap: clamp(24px, 4vw, 42px);
    padding: clamp(28px, 4vw, 42px);
    border-radius: 36px;
    border: 1px solid rgba(84, 60, 35, 0.12);
    background:
        radial-gradient(circle at top right, rgba(228, 138, 50, 0.18), transparent 28%),
        radial-gradient(circle at bottom left, rgba(102, 74, 48, 0.08), transparent 24%),
        linear-gradient(135deg, rgba(255, 252, 247, 0.96), rgba(243, 234, 223, 0.98));
    box-shadow: var(--shadow-strong);
    overflow: hidden;
}

.portfolio-hero::before,
.portfolio-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.portfolio-hero::before {
    right: -140px;
    top: -120px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(228, 138, 50, 0.16), transparent 72%);
}

.portfolio-hero::after {
    left: -150px;
    bottom: -170px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(59, 41, 26, 0.09), transparent 72%);
}

.portfolio-hero-copy,
.portfolio-hero-panel,
.portfolio-overview,
.project-shell,
.major-project-section,
.project-grid {
    position: relative;
    z-index: 1;
}

.portfolio-hero-copy {
    display: grid;
    align-content: start;
    gap: 18px;
}

.portfolio-hero-copy h1,
.project-shell h1,
.Project-record,
.other-project-title,
.flip-card-front h4 {
    font-family: var(--display-font);
}

.portfolio-hero-copy h1 {
    margin: 0;
    max-width: 11ch;
    color: #24160f;
    font-size: clamp(2.8rem, 6vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.portfolio-hero-lead {
    margin: 0;
    max-width: 64ch;
    color: #56483c;
    font-size: clamp(1rem, 1.7vw, 1.12rem);
    line-height: 1.82;
}

.portfolio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.portfolio-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.portfolio-button-primary {
    background: #2a1f18;
    color: #fff7ef;
    box-shadow: 0 14px 28px rgba(38, 27, 17, 0.18);
}

.portfolio-button-secondary {
    background: rgba(255, 250, 244, 0.85);
    border-color: rgba(74, 52, 30, 0.18);
    color: #2d2017;
}

.portfolio-button:hover {
    transform: translateY(-2px);
}

.portfolio-button-primary:hover {
    box-shadow: 0 18px 34px rgba(38, 27, 17, 0.24);
}

.portfolio-button-secondary:hover {
    background: #fff;
    border-color: rgba(228, 138, 50, 0.4);
}

.portfolio-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.portfolio-stat {
    padding: 18px 18px 16px;
    border-radius: 22px;
    border: 1px solid rgba(111, 80, 50, 0.14);
    background: rgba(255, 255, 255, 0.66);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 24px rgba(45, 31, 20, 0.06);
}

.portfolio-stat strong {
    display: block;
    color: #2b1f18;
    font-size: 1.05rem;
    line-height: 1.3;
}

.portfolio-stat span {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.portfolio-hero-panel {
    display: grid;
    align-content: start;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
    padding: clamp(20px, 3vw, 26px);
    border-radius: 28px;
    border: 1px solid var(--panel-border);
    background:
        radial-gradient(circle at 10% 12%, rgba(228, 138, 50, 0.22), transparent 26%),
        linear-gradient(145deg, #2b2119 0%, #1f1812 52%, #18120e 100%);
    box-shadow: 0 24px 50px rgba(20, 13, 9, 0.28);
    color: #fff8ef;
    overflow: hidden;
}

.portfolio-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.portfolio-panel-header .section-kicker {
    color: rgba(255, 214, 174, 0.86);
}

.portfolio-panel-header h2 {
    margin: 6px 0 0;
    color: #fff8ef;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    line-height: 1.08;
}

.portfolio-panel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 244, 230, 0.12);
    border: 1px solid rgba(255, 220, 182, 0.2);
    color: #ffe3c2;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.portfolio-panel-text {
    margin: 0;
    color: rgba(255, 243, 228, 0.84);
    font-size: 0.95rem;
    line-height: 1.65;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.portfolio-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 20px);
}

.overview-card {
    padding: clamp(20px, 3vw, 24px);
    border-radius: 24px;
    border: 1px solid rgba(74, 52, 30, 0.12);
    background: var(--surface-elevated);
    box-shadow: 0 16px 32px rgba(38, 28, 20, 0.08);
}

.overview-label {
    margin: 0 0 12px;
    color: #9d5821;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.overview-card h3 {
    margin: 0;
    color: #241912;
    font-family: var(--display-font);
    font-size: clamp(1.28rem, 2vw, 1.52rem);
    line-height: 1.15;
}

.overview-card p:last-child {
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.72;
}

.project-shell {
    text-align: center;
    max-width: 760px;
    margin-inline: auto;
    margin-bottom: clamp(32px, 5vw, 50px);
}

.project-shell h1 {
    font-size: clamp(2rem, 4.6vw, 2.75rem);
    font-weight: bold;
    margin: 0 0 10px;
    color: #24160f;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.project-shell p {
    max-width: 62ch;
    margin: 0 auto;
    text-align: center;
    font-size: clamp(0.95rem, 1.4vw, 1rem);
    line-height: 1.7;
    color: var(--text-muted);
}

.site-footer {
    background: #26211d;
    color: #f4ede4;
}

.footer-shell {
    padding: 34px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(180px, 1fr) minmax(180px, 1fr);
    gap: 32px;
    align-items: start;
}

.footer-brand-block {
    max-width: 430px;
}

.footer-brand,
.footer-intro,
.footer-description,
.footer-bottom p,
.footer-links,
.footer-contact-list {
    margin: 0;
}

.footer-brand {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
}

.footer-intro {
    margin-top: 8px;
    max-width: 300px;
    color: #d4c8bd;
    font-size: 0.98rem;
    line-height: 1.45;
}

.footer-description {
    margin-top: 14px;
    max-width: 360px;
    color: #bcae9f;
    font-size: 0.96rem;
    line-height: 1.6;
}

.footer-contact-list,
.footer-links {
    padding: 0;
    list-style: none;
}

.footer-contact-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.footer-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #e5dbd1;
    font-size: 0.95rem;
    line-height: 1.5;
}

.footer-contact-icon {
    width: 18px;
    height: 18px;
    color: #f0e7de;
    flex: 0 0 18px;
    margin-top: 2px;
}

.footer-contact-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.footer-contact-list a,
.footer-links a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-contact-list a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.footer-contact-list a:hover,
.footer-links a:hover {
    color: var(--accent);
}

.footer-column h2 {
    margin: 0 0 14px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
}

.footer-links {
    display: grid;
    gap: 10px;
}

.footer-links a {
    color: #d0c2b5;
    font-size: 0.95rem;
    line-height: 1.45;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.footer-bottom p {
    color: #bcae9f;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-legal {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 26px;
    flex-wrap: wrap;
}

.footer-legal-item {
    position: relative;
}

.footer-legal-label {
    display: inline-flex;
    align-items: center;
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: #d4c8bd;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: color 0.2s ease;
}

.footer-legal-label:focus {
    outline: 2px solid rgba(228, 138, 50, 0.7);
    outline-offset: 4px;
    border-radius: 6px;
}

.footer-legal-item:hover .footer-legal-label,
.footer-legal-item:focus-within .footer-legal-label {
    color: var(--accent);
}

.footer-legal-card {
    position: absolute;
    left: 0;
    bottom: calc(100% + 14px);
    width: min(320px, calc(100vw - 40px));
    padding: 14px 16px;
    background: #fff9f2;
    border: 1px solid rgba(72, 53, 31, 0.16);
    border-radius: 14px;
    box-shadow: 0 18px 38px rgba(12, 8, 5, 0.26);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 30;
}

.footer-legal-card::after {
    content: "";
    position: absolute;
    left: 18px;
    top: 100%;
    width: 12px;
    height: 12px;
    background: #fff9f2;
    border-right: 1px solid rgba(72, 53, 31, 0.16);
    border-bottom: 1px solid rgba(72, 53, 31, 0.16);
    transform: rotate(45deg) translateY(-6px);
}

.footer-legal-item:hover .footer-legal-card,
.footer-legal-item:focus-within .footer-legal-card {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.footer-legal-card strong {
    display: block;
    margin-bottom: 6px;
    color: #2b2018;
    font-size: 0.95rem;
}

.footer-legal-card p {
    margin: 0;
    color: #4f4135;
    font-size: 0.88rem;
    line-height: 1.55;
}

.major-project-section {
    display: flex;
    align-items: flex-start;
    gap: clamp(14px, 3vw, 20px);
    margin: clamp(36px, 6vw, 50px) 0 clamp(18px, 3vw, 24px);
    max-width: 100%;
    box-sizing: border-box;
    padding: clamp(20px, 3vw, 24px) clamp(20px, 3vw, 28px);
    border-radius: 28px;
    border: 1px solid rgba(74, 52, 30, 0.12);
    background: rgba(255, 250, 243, 0.78);
    box-shadow: 0 18px 36px rgba(38, 28, 20, 0.08);
}

.project-icon {
    flex-shrink: 0;
    width: clamp(54px, 6vw, 66px);
    height: clamp(54px, 6vw, 66px);
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(228, 138, 50, 0.16), rgba(255, 247, 237, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.project-icon svg {
    width: clamp(28px, 3vw, 34px);
    height: clamp(28px, 3vw, 34px);
    color: #4b3322;
}

.section-heading-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.Project-record {
    font-size: clamp(1.7rem, 3.6vw, 2.2rem);
    font-weight: bold;
    color: #24160f;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.project-section-intro {
    margin: 0;
    max-width: 60ch;
    color: var(--text-muted);
    font-size: 0.96rem;
    line-height: 1.7;
}

@media (max-width: 1024px) {
    .portfolio-hero {
        grid-template-columns: 1fr;
    }

    .portfolio-hero-copy h1 {
        max-width: 13ch;
    }

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

    .site-header {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .brand {
        grid-column: 1;
        grid-row: 1;
    }

    .header-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .site-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        justify-content: center;
        gap: 14px 20px;
        padding-top: 2px;
    }
}

@media (max-width: 900px) {
    .portfolio-hero {
        padding: 24px 20px;
        border-radius: 30px;
    }

    .portfolio-hero-stats,
    .portfolio-overview {
        grid-template-columns: 1fr;
    }

    .site-header {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 12px 16px;
    }

    .brand,
    .site-nav,
    .header-actions {
        grid-column: auto;
        grid-row: auto;
        width: 100%;
    }

    .site-nav {
        justify-content: start;
        gap: 12px 18px;
    }

    .header-actions {
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
    }

    .search-form {
        flex: 1 1 240px;
        width: auto;
        min-width: 0;
        max-width: none;
    }

    .dropdown-content {
        min-width: min(220px, calc(100vw - 32px));
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand-block {
        max-width: none;
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-legal {
        justify-content: flex-start;
    }
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(28px, 3vw, 40px);
    margin: 0 auto clamp(24px, 4vw, 40px);
    padding: 0;
    align-items: stretch;
    justify-content: center;
    max-width: 1180px;
}

.project-grid.other-projects {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
}

@media (max-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: 860px;
    }
}

@media (max-width: 760px) {
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 580px;
    }
}

@media (max-width: 520px) {
    .project-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
    }
}

.Project-other.card {
    background:
        radial-gradient(circle at 12% 16%, rgba(255, 179, 103, 0.12), transparent 34%),
        linear-gradient(145deg, #2a221c 0%, #1f1915 55%, #191411 100%);
    border-radius: 34px;
    padding: clamp(26px, 4vw, 40px);
    box-shadow: 0 26px 56px rgba(20, 13, 9, 0.34);
    border: 1px solid rgba(255, 245, 231, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.other-project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.other-project-header .section-kicker {
    color: rgba(255, 214, 174, 0.88);
    margin-bottom: 10px;
}

.other-project-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 214, 174, 0.18);
    background: rgba(255, 245, 232, 0.08);
    color: #ffe2c0;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.other-project-title {
    margin: 0;
    color: #fff7ec;
    font-size: clamp(1.65rem, 3.4vw, 2.05rem);
    line-height: 1.15;
    letter-spacing: 0.01em;
}

.other-project-intro {
    margin: 14px 0 24px;
    color: rgba(255, 241, 225, 0.92);
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.65;
    max-width: 70ch;
}

@media (hover: hover) and (pointer: fine) {
    .Project-other.card:hover {
        transform: translateY(-6px);
        box-shadow: 0 30px 62px rgba(17, 11, 8, 0.42);
        border-color: rgba(255, 204, 145, 0.45);
    }

    .project-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 28px 60px rgba(38, 28, 20, 0.16);
        border-color: var(--accent);
    }
}

.project-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: clamp(24px, 4vw, 40px);
    color: rgba(255, 245, 234, 0.95);
    font-size: clamp(0.95rem, 1.2vw, 1.06rem);
    line-height: 1.8;
}

.project-bullets li {
    position: relative;
    margin-bottom: 14px;
    padding-left: 28px;
    break-inside: avoid;
}

.project-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e38a32;
    box-shadow: 0 0 0 4px rgba(227, 138, 50, 0.18);
    transform: translateY(-50%);
}

.project-bullets li:last-child {
    margin-bottom: 0;
}

.minor-carousel-shell {
    margin-top: clamp(24px, 3vw, 34px);
    padding-top: 16px;
    border-top: 1px solid rgba(255, 245, 231, 0.16);
    background: transparent;
}

.minor-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 14px 0;
    touch-action: pan-y;
    cursor: grab;
}

.minor-carousel.is-dragging {
    cursor: grabbing;
}

.minor-carousel-track {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.6vw, 18px);
    will-change: transform;
}

.minor-carousel-item {
    margin: 0;
    flex: 0 0 clamp(160px, 19vw, 230px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 238, 218, 0.2);
    background: transparent;
    opacity: 1;
    transform: scale(0.93);
    filter: none;
    transition: transform 0.32s ease, opacity 0.32s ease, box-shadow 0.32s ease, border-color 0.32s ease, filter 0.32s ease;
}

.minor-carousel-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    opacity: 1;
    filter: none;
    user-select: none;
    -webkit-user-drag: none;
}

.minor-carousel-item.is-center {
    opacity: 1;
    transform: scale(1.07);
    filter: none;
    border-color: rgba(255, 193, 129, 0.86);
    box-shadow: 0 16px 34px rgba(8, 4, 2, 0.45);
}

.project-card {
    position: relative;
    display: flex;
    min-height: clamp(160px, 16vw, 190px);
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(228, 138, 50, 0.16), transparent 30%),
        linear-gradient(180deg, #fffaf4 0%, #f1e6d8 100%);
    border-radius: 26px;
    padding: clamp(20px, 3vw, 24px);
    box-shadow: 0 22px 48px rgba(38, 28, 20, 0.1);
    border: 1px solid var(--surface-border);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.35), transparent 34%),
        linear-gradient(180deg, transparent 55%, rgba(89, 63, 40, 0.06) 100%);
    pointer-events: none;
}

.project-card::after {
    content: "Click to expand";
    position: absolute;
    left: clamp(20px, 3vw, 24px);
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(42, 31, 24, 0.92);
    color: #fff6eb;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 10px 18px rgba(22, 15, 10, 0.18);
    z-index: 2;
}

.flip-card-front {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    height: 100%;
    position: relative;
    z-index: 1;
}

.flip-card-front::before {
    content: "Project brief";
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(228, 138, 50, 0.14);
    color: #8d4f1d;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.project-card h4 {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    font-weight: 700;
    color: #231710;
    margin: 0 0 2px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}

.flip-card-front h4 {
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    line-height: 1.02;
    padding-bottom: 30px;
}

.project-card p {
    margin: 0;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(49, 212, 220, 0.2);
    background: rgba(255, 255, 255, 0.66);
    color: var(--ink-soft);
    font-size: 0.95rem;
    line-height: 1.62;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
    overflow-wrap: anywhere;
}

.project-card p b,
.project-card p strong,
article p b,
article p strong {
    font-weight: 700;
    color: var(--ink);
}

.project-card p:last-of-type {
    margin-top: auto;
    padding-bottom: 52px;
    font-size: 0.9rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(232, 244, 245, 0.92), rgba(209, 237, 240, 0.96));
}

/* Flip Card Modal Styles */
.flip-card {
    cursor: pointer;
    position: relative;
}

.flip-card:not(.active) {
    aspect-ratio: 3 / 2;
}

.flip-card-placeholder {
    visibility: hidden;
    pointer-events: none;
    border-radius: 26px;
}

.flip-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.flip-card.active {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    width: 85vw;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    isolation: isolate;
}

.flip-card.flipped {
    animation: flipCardIn 0.3s ease-out;
}

.flip-card.active::before,
.flip-card.active::after {
    display: none;
}

@keyframes flipCardIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Flip Card Front and Back */
.flip-card-front, .flip-card-back {
    width: 100%;
    height: 100%;
}

.flip-card-front {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100%;
    padding-bottom: 68px;
    box-sizing: border-box;
}

.flip-card-back {
    display: none;
    flex-direction: row;
    padding: 0;
    gap: 0;
    align-items: stretch;
    overflow: hidden;
    width: 100%;
    border-radius: 18px;
    background: linear-gradient(135deg, #f8ffff 0%, #e8f4f5 100%);
    border: 1px solid rgba(49, 212, 220, 0.26);
    box-shadow: 0 26px 52px rgba(16, 42, 51, 0.22);
    box-sizing: border-box;
    height: 100%;
    min-height: min(72vh, 640px);
    position: relative;
}

.flip-card-back::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 20%, rgba(49, 212, 220, 0.15), transparent 45%),
        radial-gradient(circle at 88% 8%, rgba(15, 127, 140, 0.1), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.flip-card-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(49, 212, 220, 0.36);
    border-radius: 999px;
    background: rgba(16, 42, 51, 0.74);
    color: #f8ffff;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(16, 42, 51, 0.22);
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.flip-card-close:hover {
    transform: scale(1.05);
    background: rgba(16, 42, 51, 0.95);
    border-color: rgba(49, 212, 220, 0.6);
}

.flip-card-close:focus-visible {
    outline: 2px solid rgba(49, 212, 220, 0.95);
    outline-offset: 3px;
}

.flip-card-back .flip-back-content {
    flex: 1 1 340px;
    padding: 28px 26px;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 0.95rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(232, 244, 245, 0.98) 100%);
    border-right: 1px solid rgba(49, 212, 220, 0.22);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.flip-back-brand {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(49, 212, 220, 0.22);
}

.flip-back-brand-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.flip-back-brand-logo,
.flip-back-brand img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    object-fit: cover;
    flex-shrink: 0;
}

.flip-back-brand-title {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.flip-back-brand-tagline {
    margin-top: 4px;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.flip-card-back .flip-back-content::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #31d4dc 0%, rgba(49, 212, 220, 0.15) 100%);
}

.flip-card-back .flip-back-content h4 {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    color: var(--ink);
    letter-spacing: -0.01em;
}

.flip-card-back .flip-back-content p {
    margin: 0;
    color: var(--ink-soft);
}

.flip-card-back .flip-back-content p b,
.flip-card-back .flip-back-content p strong {
    color: var(--ink);
}

.flip-card.active .flip-card-front {
    display: none;
}

.flip-card.active .flip-card-back {
    display: flex;
}

.flip-card-back img {
    flex: 1 1 auto;
    width: 60%;
    height: auto;
    max-height: 75vh;
    object-fit: cover;
    border-radius: 0;
    padding: 0;
    filter: saturate(1.06) contrast(1.02);
    position: relative;
    z-index: 1;
}

.flip-card-back .flip-back-brand-logo,
.flip-card-back .flip-back-brand img {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    max-height: none;
    z-index: 2;
}

@media (max-width: 768px) {
    .flip-card.active {
        width: 90vw;
        max-width: 100%;
        max-height: 90vh;
    }

    .flip-card-back {
        flex-direction: column;
        height: auto;
        min-height: 0;
    }

    .flip-card-back .flip-back-content {
        flex: 0 0 auto;
        width: 100%;
        padding: 20px;
        max-height: none;
        overflow-y: visible;
        justify-content: flex-start;
        border-right: 0;
        border-bottom: 1px solid rgba(49, 212, 220, 0.22);
    }

    .flip-card-back .flip-back-content::before {
        left: 0;
        right: 0;
        top: 0;
        bottom: auto;
        height: 3px;
        width: auto;
    }

    .flip-card-back img {
        width: 100%;
        height: auto;
        max-height: min(42vh, 340px);
        order: 2;
        border-radius: 0 0 18px 18px;
    }

    .flip-card-close {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
        font-size: 1.45rem;
    }

    .flip-back-brand {
        gap: 10px;
    }

    .flip-back-brand-logo,
    .flip-back-brand img,
    .flip-card-back .flip-back-brand-logo,
    .flip-card-back .flip-back-brand img {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    .flip-card.active {
        width: 95vw;
        top: 50% !important;
        left: 50% !important;
        max-height: 95vh;
    }

    .flip-card-back .flip-back-content {
        padding: 16px 14px;
        gap: 10px;
    }

    .flip-card-back .flip-back-content h4 {
        font-size: 1.1rem;
    }

    .flip-card-back .flip-back-content p {
        font-size: 0.9rem;
    }

    .flip-card-back img {
        max-height: min(38vh, 280px);
    }

    .flip-card-close {
        top: 8px;
        right: 8px;
        width: 34px;
        height: 34px;
        font-size: 1.3rem;
    }

    .flip-back-brand {
        gap: 8px;
    }

    .flip-back-brand-logo,
    .flip-back-brand img,
    .flip-card-back .flip-back-brand-logo,
    .flip-card-back .flip-back-brand img {
        width: 36px;
        height: 36px;
    }

    .flip-back-brand-title {
        font-size: 0.84rem;
    }

    .flip-back-brand-tagline {
        font-size: 0.56rem;
    }
}


.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 32, 22, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
}

.modal-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .section-shell,
    main > section {
        width: min(1180px, calc(100% - 24px));
    }

    .site-header {
        gap: 12px;
        padding: 14px 12px;
    }

    .portfolio-hero {
        padding: 20px 16px;
        border-radius: 24px;
        gap: 20px;
    }

    .portfolio-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .portfolio-button {
        width: 100%;
    }

    .portfolio-panel-header,
    .other-project-header,
    .major-project-section {
        flex-direction: column;
    }

    .major-project-section {
        padding: 18px 16px;
        border-radius: 22px;
    }

    .project-bullets {
        columns: 1;
    }

    .brand {
        align-items: flex-start;
        gap: 10px;
    }

    .brand-title {
        font-size: 1.3rem;
    }

    .brand-tagline {
        max-width: 170px;
        font-size: 0.54rem;
    }

    .site-nav {
        gap: 10px 14px;
    }

    .site-nav a {
        font-size: 0.92rem;
    }

    .header-actions {
        align-items: stretch;
    }

    .search-form {
        order: 1;
        width: 100%;
    }

    .menu-button {
        order: 2;
        align-self: center;
        margin-left: auto;
    }

    .dropdown-content {
        top: calc(100% + 6px);
        width: min(260px, calc(100vw - 24px));
    }

    .major-project-section {
        align-items: flex-start;
    }

    .project-grid {
        gap: 24px;
    }

    .project-card,
    .Project-other.card {
        padding: 20px 16px;
        border-radius: 24px;
    }

    .project-card {
        min-height: 0;
    }

    .project-card::after {
        left: 16px;
        bottom: 16px;
    }

    .other-project-intro {
        margin: 10px 0 18px;
        line-height: 1.55;
    }

    .minor-carousel {
        padding: 10px 0;
    }

    .minor-carousel-item {
        flex-basis: clamp(144px, 34vw, 210px);
        border-radius: 14px;
    }

    .minor-carousel-item.is-center {
        transform: scale(1.04);
    }

    .project-card h4 {
        margin-bottom: 16px;
    }

    .footer-shell {
        padding: 30px 0 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-brand {
        font-size: 1.7rem;
    }

    .footer-legal {
        gap: 16px;
    }

    .footer-legal-card {
        left: 50%;
        bottom: calc(100% + 12px);
        width: min(320px, calc(100vw - 32px));
        transform: translateX(-50%) translateY(10px);
    }

    .footer-legal-card::after {
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
    }

    .footer-legal-item:hover .footer-legal-card,
    .footer-legal-item:focus-within .footer-legal-card {
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 420px) {
    .portfolio-hero-copy h1 {
        max-width: 10ch;
    }

    .brand-tagline {
        max-width: 170px;
        font-size: 0.54rem;
    }

    .dropdown-content {
        right: auto;
        left: 0;
    }

    .project-card,
    .Project-other.card {
        padding: 18px 14px;
        border-radius: 20px;
    }

    .project-card::after {
        left: 14px;
        bottom: 14px;
    }

    .project-bullets li {
        padding-left: 24px;
    }

    .minor-carousel-shell {
        margin-top: 20px;
        padding-top: 12px;
    }

    .minor-carousel-item {
        flex-basis: 140px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .minor-carousel[data-respect-motion="true"] .minor-carousel-track {
        transform: none !important;
    }

    .minor-carousel[data-respect-motion="true"] .minor-carousel-item,
    .minor-carousel[data-respect-motion="true"] .minor-carousel-item.is-center {
        transition: none;
        transform: none;
    }
}

/* Footer legal popovers must stay inside the viewport. */
.footer-legal,
.footer-legal-item {
    max-width: 100%;
    overflow: visible;
}

.footer-legal-card {
    box-sizing: border-box;
    max-width: calc(100vw - 32px);
    overflow-wrap: anywhere;
}

.footer-legal-item:last-child .footer-legal-card {
    left: auto;
    right: 0;
    transform: translateY(10px);
}

.footer-legal-item:last-child .footer-legal-card::after {
    left: auto;
    right: 28px;
}

.footer-legal-item:last-child:hover .footer-legal-card,
.footer-legal-item:last-child:focus-within .footer-legal-card {
    transform: translateY(0);
}

@media (max-width: 640px) {
    .footer-bottom {
        align-items: stretch;
    }

    .footer-legal {
        position: relative;
        width: 100%;
        justify-content: flex-start;
        gap: 12px 16px;
    }

    .footer-legal-item {
        position: static;
    }

    .footer-legal-label {
        white-space: normal;
    }

    .footer-legal-card {
        left: 0;
        right: auto;
        width: min(320px, calc(100vw - 32px));
        transform: translateY(10px);
    }

    .footer-legal-card::after {
        left: 24px;
        right: auto;
        transform: rotate(45deg) translateY(-6px);
    }

    .footer-legal-item:hover .footer-legal-card,
    .footer-legal-item:focus-within .footer-legal-card {
        transform: translateY(0);
    }

    .footer-legal-item:last-child .footer-legal-card {
        left: auto;
        right: 0;
        transform: translateY(10px);
    }

    .footer-legal-item:last-child .footer-legal-card::after {
        left: auto;
        right: 28px;
        transform: rotate(45deg) translateY(-6px);
    }

    .footer-legal-item:last-child:hover .footer-legal-card,
    .footer-legal-item:last-child:focus-within .footer-legal-card {
        transform: translateY(0);
    }
}

/* Minimal portfolio refresh */
body {
    background: #f7f7f4;
}

.portfolio-section {
    gap: clamp(24px, 4vw, 34px);
}

.portfolio-hero {
    border-radius: 18px;
    padding: clamp(24px, 5vw, 42px);
    background: #ffffff;
    border-color: rgba(43, 34, 26, 0.1);
    box-shadow: 0 16px 38px rgba(40, 31, 23, 0.08);
}

.portfolio-hero::before,
.portfolio-hero::after {
    display: none;
}

.portfolio-hero-copy h1 {
    max-width: 15ch;
    font-family: var(--display-font);
    font-size: clamp(2.25rem, 5vw, 4.05rem);
    line-height: 1;
    letter-spacing: 0;
}

.portfolio-hero-lead {
    max-width: 66ch;
    line-height: 1.68;
}

.portfolio-button {
    min-height: 44px;
    border-radius: 8px;
}

.portfolio-hero-stats,
.portfolio-overview {
    gap: 12px;
}

.portfolio-stat,
.overview-card,
.major-project-section {
    border-radius: 12px;
    box-shadow: none;
    background: #ffffff;
    border-color: rgba(43, 34, 26, 0.1);
}

.overview-card h3 {
    font-family: var(--display-font);
    font-size: clamp(1.05rem, 1.7vw, 1.2rem);
    line-height: 1.35;
    letter-spacing: 0;
}

.portfolio-hero-panel {
    border-radius: 14px;
    background: #25211d;
    box-shadow: none;
}

.project-shell {
    margin-bottom: clamp(20px, 4vw, 32px);
}

.project-shell h1,
.Project-record,
.other-project-title {
    font-family: var(--display-font);
    letter-spacing: 0;
}

.major-project-section {
    align-items: center;
    margin: clamp(24px, 5vw, 40px) 0 18px;
    padding: 18px 20px;
}

.project-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: #eef3ef;
    box-shadow: none;
}

.project-icon svg {
    width: 24px;
    height: 24px;
}

.Project-record {
    font-size: clamp(1.45rem, 3vw, 1.95rem);
}

.project-section-intro {
    max-width: 68ch;
}

.project-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    max-width: 1180px;
    margin-bottom: clamp(28px, 5vw, 46px);
}

.project-card:not(.active) {
    display: block;
    min-height: 330px;
    aspect-ratio: auto;
    padding: 0;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(43, 34, 26, 0.12);
    box-shadow: none;
}

.project-card:not(.active)::before {
    inset: 0 0 auto;
    height: 58%;
    background:
        linear-gradient(180deg, rgba(14, 12, 10, 0) 45%, rgba(14, 12, 10, 0.32) 100%),
        var(--project-image, linear-gradient(135deg, #e8ded2, #cfc0b0));
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(43, 34, 26, 0.08);
}

.project-card:not(.active)::after {
    content: "View details";
    left: 16px;
    right: 16px;
    bottom: 16px;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 8px;
    background: #29231e;
    box-shadow: none;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.project-card:not(.active) .flip-card-front {
    min-height: 330px;
    padding: calc(58% + 16px) 16px 58px;
    gap: 8px;
}

.project-card:not(.active) .flip-card-front::before {
    content: "Major project";
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 9px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #554437;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
}

.project-card:not(.active) .flip-card-front h4 {
    margin: 0;
    padding: 0;
    color: #231f1b;
    font-family: var(--display-font);
    font-size: clamp(1rem, 1.5vw, 1.12rem);
    line-height: 1.25;
    letter-spacing: 0;
}

.project-card:not(.active) .project-card-meta {
    display: -webkit-box;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #75685d;
    font-size: 0.86rem;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card:not(.active):hover {
    transform: translateY(-4px);
    border-color: rgba(228, 138, 50, 0.42);
    box-shadow: 0 16px 34px rgba(39, 29, 20, 0.1);
}

.Project-other.card {
    border-radius: 12px;
    padding: clamp(20px, 3vw, 28px);
    background: #ffffff;
    border: 1px solid rgba(43, 34, 26, 0.1);
    box-shadow: none;
}

.other-project-header .section-kicker,
.other-project-title,
.other-project-intro,
.project-bullets {
    color: inherit;
}

.other-project-title {
    color: #241f1b;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.other-project-intro {
    color: #65594d;
}

.other-project-badge {
    border-radius: 8px;
    border-color: rgba(52, 96, 87, 0.18);
    background: #edf4f2;
    color: #346057;
}

.project-bullets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
    columns: initial;
    font-size: 0.92rem;
    line-height: 1.45;
}

.project-bullets li {
    min-height: 52px;
    margin: 0;
    padding: 12px 14px 12px 34px;
    border: 1px solid rgba(43, 34, 26, 0.1);
    border-radius: 10px;
    background: #f8faf8;
    color: #4f463e;
}

.project-bullets li::before {
    left: 14px;
    top: 22px;
    width: 7px;
    height: 7px;
    background: #c8742b;
    box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
    .Project-other.card:hover {
        transform: none;
        box-shadow: none;
        border-color: rgba(43, 34, 26, 0.16);
    }
}

@media (max-width: 760px) {
    .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .portfolio-hero {
        border-radius: 14px;
    }

    .portfolio-overview {
        grid-template-columns: 1fr;
    }

    .project-card:not(.active),
    .project-card:not(.active) .flip-card-front {
        min-height: 300px;
    }

    .project-card,
    .Project-other.card {
        border-radius: 12px;
        padding: 0;
    }

    .Project-other.card {
        padding: 18px;
    }

    .project-bullets {
        grid-template-columns: 1fr;
    }
}

/* Major projects carousel */
.project-carousel {
    display: grid;
    gap: 14px;
    margin-bottom: clamp(28px, 5vw, 46px);
}

.project-carousel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.project-carousel-count {
    margin: 0;
    color: #65594d;
    font-size: 0.92rem;
    font-weight: 700;
}

.project-carousel-actions {
    display: inline-flex;
    gap: 8px;
}

.project-carousel-button {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(43, 34, 26, 0.14);
    border-radius: 8px;
    background: #ffffff;
    color: #2b251f;
    font: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.project-carousel-button span {
    display: block;
    margin-top: -2px;
    font-size: 1.75rem;
    line-height: 1;
}

.project-carousel-button:hover,
.project-carousel-button:focus-visible {
    background: #eef3ef;
    border-color: rgba(52, 96, 87, 0.28);
}

.project-carousel-button:active {
    transform: translateY(1px);
}

.project-carousel-window {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(43, 34, 26, 0.28) transparent;
    padding: 2px 2px 16px;
}

.project-carousel-window::-webkit-scrollbar {
    height: 8px;
}

.project-carousel-window::-webkit-scrollbar-track {
    background: transparent;
}

.project-carousel-window::-webkit-scrollbar-thumb {
    background: rgba(43, 34, 26, 0.24);
    border-radius: 999px;
}

.project-carousel .project-grid {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 16px;
    max-width: none;
    width: max-content;
    margin: 0;
}

.project-carousel .project-card:not(.active) {
    flex: 0 0 clamp(230px, 28vw, 320px);
    scroll-snap-align: start;
}

.project-grid.other-projects {
    margin-bottom: clamp(24px, 4vw, 40px);
}

@media (max-width: 760px) {
    .project-carousel .project-card:not(.active) {
        flex-basis: min(82vw, 330px);
    }
}

@media (max-width: 520px) {
    .project-carousel-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .project-carousel-actions {
        width: 100%;
    }

    .project-carousel-button {
        flex: 1 1 0;
    }
}

/* Compact project page spacing */
main > section {
    padding-top: clamp(14px, 3vw, 26px);
    padding-bottom: clamp(34px, 5vw, 54px);
}

.portfolio-section {
    gap: clamp(16px, 2.5vw, 24px);
}

.portfolio-hero {
    gap: clamp(16px, 3vw, 28px);
    padding: clamp(18px, 3.5vw, 30px);
}

.portfolio-hero-copy {
    gap: 12px;
}

.portfolio-hero-panel {
    gap: 12px;
    padding: clamp(16px, 2.5vw, 22px);
}

.portfolio-hero-stats {
    gap: 10px;
}

.portfolio-stat,
.overview-card {
    padding: clamp(14px, 2.4vw, 18px);
}

.overview-card p:last-child {
    margin-top: 8px;
}

.project-shell {
    margin-bottom: clamp(10px, 2vw, 18px);
}

.project-shell h1 {
    margin-bottom: 6px;
}

.major-project-section {
    margin: clamp(14px, 3vw, 24px) 0 12px;
    padding: 14px 16px;
}

.project-carousel {
    gap: 10px;
    margin-bottom: clamp(20px, 4vw, 34px);
}

.project-carousel-window {
    padding-bottom: 10px;
}

/* Blue-green glowing treatment for the minor project panel. */
.portfolio-hero-panel {
    position: relative;
    isolation: isolate;
    border-radius: 20px;
    border-color: rgba(107, 255, 238, 0.26);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.09), transparent 28%),
        radial-gradient(circle at 16% 0%, rgba(70, 230, 214, 0.28), transparent 34%),
        radial-gradient(circle at 100% 78%, rgba(36, 171, 178, 0.22), transparent 35%),
        linear-gradient(150deg, #12363d 0%, #0c2b31 50%, #092025 100%);
    box-shadow:
        0 28px 70px rgba(4, 26, 31, 0.36),
        0 0 46px rgba(40, 217, 207, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 255, 236, 0.1);
}

.portfolio-hero-panel::before,
.portfolio-hero-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: -1;
}

.portfolio-hero-panel::before {
    inset: -2px;
    border-radius: inherit;
    background:
        linear-gradient(120deg, rgba(118, 255, 238, 0.48), transparent 24%, transparent 70%, rgba(45, 173, 191, 0.42));
    filter: blur(10px);
    opacity: 0.62;
}

.portfolio-hero-panel::after {
    left: 9%;
    right: 9%;
    bottom: -24px;
    height: 34px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(66, 255, 239, 0.32), rgba(11, 114, 125, 0.16) 48%, transparent 72%);
    filter: blur(9px);
}

.portfolio-panel-header .section-kicker {
    color: #49d8df;
    text-shadow: 0 0 15px rgba(73, 216, 223, 0.45);
}

.portfolio-panel-header h2 {
    text-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
}

.portfolio-panel-badge {
    background: rgba(85, 247, 230, 0.1);
    border-color: rgba(118, 255, 238, 0.32);
    color: #b9fff6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 18px rgba(58, 225, 216, 0.16);
}

@media (max-width: 640px) {
    main > section {
        padding-top: 10px;
    }

    .portfolio-hero {
        padding: 16px 14px;
        gap: 14px;
    }

    .major-project-section {
        padding: 14px;
    }

}

/* Photo-forward project cards */
.project-card:not(.active) {
    min-height: 372px;
    overflow: hidden;
    background:
        linear-gradient(180deg, #ffffff 0%, #fbfbf8 100%);
    border-color: rgba(39, 34, 29, 0.13);
    box-shadow: 0 18px 42px rgba(31, 27, 22, 0.1);
}

.project-card:not(.active)::before {
    display: none;
}

.project-card:not(.active) .flip-card-front {
    display: flex;
    min-height: 372px;
    padding: 0 16px 58px;
    gap: 10px;
}

.project-card-media {
    position: relative;
    flex: 0 0 auto;
    width: calc(100% + 32px);
    height: 190px;
    margin: 0 -16px 6px;
    overflow: hidden;
    background: linear-gradient(135deg, #d9dfdc, #f4f1eb);
    border-bottom: 1px solid rgba(39, 34, 29, 0.1);
}

.project-card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(13, 17, 15, 0.04) 0%, rgba(13, 17, 15, 0.08) 45%, rgba(13, 17, 15, 0.42) 100%);
    pointer-events: none;
}

.project-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform 0.45s ease, filter 0.45s ease;
}

.project-card:not(.active) .flip-card-front::before {
    z-index: 2;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(20, 18, 16, 0.12);
    backdrop-filter: blur(8px);
}

.project-card:not(.active) .flip-card-front h4 {
    font-size: clamp(1.06rem, 1.55vw, 1.22rem);
}

.project-card:not(.active) .project-card-meta {
    color: #675d53;
}

.project-card:not(.active)::after {
    background: linear-gradient(135deg, #24282a 0%, #161819 100%);
    transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.project-card:not(.active):hover {
    transform: translateY(-7px);
    border-color: rgba(52, 96, 87, 0.34);
    box-shadow: 0 24px 52px rgba(31, 27, 22, 0.16);
}

.project-card:not(.active):hover .project-card-media img {
    transform: scale(1.08);
    filter: saturate(1.08) contrast(1.03);
}

.project-card:not(.active):hover::after {
    background: linear-gradient(135deg, #346057 0%, #222827 100%);
    box-shadow: 0 10px 22px rgba(52, 96, 87, 0.24);
}

.project-carousel-window {
    padding-top: 8px;
}

.project-carousel .project-card:not(.active) {
    flex-basis: clamp(260px, 30vw, 350px);
}

@media (max-width: 640px) {
    .project-card:not(.active),
    .project-card:not(.active) .flip-card-front {
        min-height: 350px;
    }

    .project-card-media {
        height: 178px;
    }
}

/* Theme-rich carousel polish */
.project-carousel {
    position: relative;
    padding: clamp(16px, 2.8vw, 24px);
    border: 1px solid rgba(38, 35, 31, 0.12);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(247, 241, 233, 0.88) 52%, rgba(238, 243, 239, 0.9) 100%);
    box-shadow: 0 22px 54px rgba(35, 29, 23, 0.12);
    overflow: hidden;
}

.project-carousel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, #346057 54%, var(--header-bg) 100%);
    pointer-events: none;
}

.project-carousel-toolbar {
    position: relative;
    z-index: 1;
    padding-bottom: 4px;
}

.project-carousel-count {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 12px;
    border: 1px solid rgba(228, 138, 50, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #4a3c31;
    box-shadow: 0 8px 18px rgba(35, 29, 23, 0.08);
}

.project-carousel-button {
    border-color: rgba(38, 35, 31, 0.16);
    background: #26231f;
    color: #fff8ef;
    box-shadow: 0 10px 20px rgba(25, 21, 17, 0.16);
}

.project-carousel-button:hover,
.project-carousel-button:focus-visible {
    background: var(--accent);
    border-color: rgba(228, 138, 50, 0.45);
    color: #1f1a16;
    box-shadow: 0 12px 24px rgba(228, 138, 50, 0.24);
}

.project-carousel-window {
    position: relative;
    z-index: 1;
    padding: 10px 4px 14px;
}

.project-carousel .project-grid {
    gap: 20px;
}

.project-card:not(.active) {
    border: 1px solid rgba(38, 35, 31, 0.12);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 247, 242, 0.98) 100%);
    box-shadow:
        0 18px 42px rgba(37, 31, 25, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.project-card:not(.active)::after {
    left: 16px;
    right: 16px;
    bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, var(--header-bg) 0%, #191714 100%);
    box-shadow: 0 12px 24px rgba(27, 22, 17, 0.2);
}

.project-card-media {
    height: 198px;
    border-bottom: 3px solid var(--accent);
}

.project-card-media::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.32);
    pointer-events: none;
    z-index: 1;
}

.project-card-media::after {
    background:
        linear-gradient(180deg, rgba(16, 18, 17, 0.02) 0%, rgba(16, 18, 17, 0.06) 46%, rgba(16, 18, 17, 0.36) 100%),
        linear-gradient(135deg, rgba(228, 138, 50, 0.14), transparent 42%);
}

.project-card:not(.active) .flip-card-front::before {
    color: #4b3322;
    border: 1px solid rgba(228, 138, 50, 0.2);
    background: rgba(255, 249, 241, 0.92);
}

.project-card:not(.active) .flip-card-front h4 {
    position: relative;
    padding-left: 12px;
    color: #241f1a;
}

.project-card:not(.active) .flip-card-front h4::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.16em;
    bottom: 0.16em;
    width: 3px;
    border-radius: 999px;
    background: var(--accent);
}

.project-card:not(.active) .project-card-meta {
    padding-left: 12px;
    color: #65584d;
}

.project-card:not(.active):hover {
    border-color: rgba(228, 138, 50, 0.42);
    box-shadow:
        0 28px 62px rgba(37, 31, 25, 0.2),
        0 0 0 4px rgba(228, 138, 50, 0.08);
}

.project-card:not(.active):hover::after {
    background: linear-gradient(135deg, var(--accent) 0%, #b76524 100%);
    color: #1f1a16;
}

@media (max-width: 640px) {
    .project-carousel {
        padding: 14px;
        border-radius: 14px;
    }

    .project-card-media {
        height: 178px;
    }
}

/* Homepage-inspired major project carousel */
.project-carousel {
    position: relative;
    isolation: isolate;
    gap: clamp(18px, 3vw, 28px);
    padding: clamp(58px, 8vw, 92px) clamp(18px, 5vw, 64px) clamp(34px, 5vw, 54px);
    border-radius: 30px;
    border: 1px solid rgba(209, 255, 253, 0.15);
    border-top-color: rgba(209, 255, 253, 0.25);
    background: linear-gradient(135deg, rgba(9, 38, 43, 0.92) 0%, rgba(6, 23, 26, 0.96) 100%);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.project-carousel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    height: auto;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.05"/></svg>');
    opacity: 0.8;
    pointer-events: none;
}

.project-carousel::after {
    content: "";
    position: absolute;
    inset: -50%;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 30%, rgba(50, 183, 228, 0.6) 0%, transparent 25%),
        radial-gradient(circle at 70% 20%, rgba(80, 252, 255, 0.5) 0%, transparent 20%),
        radial-gradient(circle at 50% 60%, rgba(60, 210, 240, 0.4) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(20, 185, 200, 0.5) 0%, transparent 25%),
        radial-gradient(circle at 30% 80%, rgba(120, 251, 255, 0.3) 0%, transparent 35%);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: projectCarouselGlowRotate 20s linear infinite, projectCarouselGlowPulse 8s ease-in-out infinite alternate;
    transform-origin: center;
}

@keyframes projectCarouselGlowRotate {
    0% {
        transform: rotate(0deg) scale(0.9);
    }

    50% {
        transform: rotate(180deg) scale(1.15);
    }

    100% {
        transform: rotate(360deg) scale(0.9);
    }
}

@keyframes projectCarouselGlowPulse {
    0% {
        opacity: 0.6;
        filter: blur(15px);
    }

    100% {
        opacity: 1;
        filter: blur(25px);
    }
}

.project-carousel-toolbar {
    position: absolute;
    inset: clamp(18px, 3vw, 24px) clamp(18px, 3vw, 24px) auto;
    z-index: 3;
    align-items: center;
    padding: 0;
    pointer-events: none;
}

.project-carousel-count {
    min-height: 36px;
    padding: 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #eefcfd;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: auto;
}

.project-carousel-actions {
    gap: 10px;
    pointer-events: auto;
}

.project-carousel-button {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border-color: rgba(209, 255, 253, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #e9fbfc;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.project-carousel-button span {
    margin-top: -3px;
    font-size: 2rem;
}

.project-carousel-button:hover,
.project-carousel-button:focus-visible {
    transform: scale(1.08);
    border-color: rgba(59, 232, 241, 0.8);
    background: rgba(255, 255, 255, 0.15);
    color: #3be8f1;
    box-shadow: 0 10px 40px rgba(59, 232, 241, 0.4);
}

.project-carousel-button:active {
    transform: scale(0.95);
}

.project-carousel-window {
    z-index: 1;
    width: 100%;
    padding: 18px 6px 58px;
    cursor: grab;
    scroll-snap-type: none;
    scrollbar-width: none;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.project-carousel-window.is-pointer-down,
.project-carousel.is-dragging .project-carousel-window {
    cursor: grabbing;
    scroll-behavior: auto;
}

.project-carousel-window::-webkit-scrollbar {
    display: none;
}

.project-carousel .project-grid {
    gap: clamp(18px, 2.2vw, 24px);
}

.project-carousel .project-card:not(.active) {
    flex-basis: clamp(250px, 27vw, 320px);
    scroll-snap-align: none;
    overflow: visible;
    border-color: rgba(220, 255, 255, 0.2);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.93) 0%, rgba(250, 253, 251, 0.9) 100%);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.24),
        0 0 34px rgba(59, 232, 241, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.project-carousel .project-card:not(.active)::before {
    content: "";
    position: absolute;
    left: 9%;
    right: 9%;
    bottom: -44px;
    display: block;
    height: 42px;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at center, rgba(188, 255, 255, 0.3) 0%, rgba(79, 208, 222, 0.15) 46%, transparent 72%);
    filter: blur(7px);
    transform: scaleY(0.62);
    pointer-events: none;
}

.project-carousel .project-card:not(.active)::after {
    background: linear-gradient(135deg, #24282a 0%, #161819 100%);
    border-color: rgba(255, 255, 255, 0.12);
}

.project-carousel .project-card-media {
    height: 186px;
    border-bottom-color: #3be8f1;
    border-radius: 15px 15px 0 0;
}

.project-carousel .project-card-media img {
    filter: brightness(1.13) contrast(1.08) saturate(1.08);
}

.project-carousel .project-card:not(.active) .flip-card-front::before {
    border-color: rgba(59, 232, 241, 0.28);
    background: rgba(255, 255, 255, 0.88);
    color: #25434a;
}

.project-carousel .project-card:not(.active) .flip-card-front h4::before {
    background: #3be8f1;
    box-shadow: 0 0 16px rgba(59, 232, 241, 0.7);
}

.project-carousel .project-card:not(.active):hover {
    border-color: rgba(59, 232, 241, 0.52);
    box-shadow:
        0 26px 52px rgba(0, 0, 0, 0.32),
        0 0 34px rgba(59, 232, 241, 0.2);
}

.project-carousel .project-card:not(.active):hover::after {
    background: linear-gradient(135deg, rgba(59, 232, 241, 0.95) 0%, rgba(31, 125, 136, 0.95) 100%);
    color: #062023;
}

.project-carousel.is-dragging .project-card,
.project-carousel.is-dragging .project-card * {
    cursor: grabbing;
}

@media (max-width: 760px) {
    .project-carousel {
        padding: 76px 14px 34px;
        border-radius: 24px;
    }

    .project-carousel-toolbar {
        inset: 18px 14px auto;
    }

    .project-carousel-button {
        width: 44px;
        height: 44px;
    }

    .project-carousel-button span {
        font-size: 1.65rem;
    }

    .project-carousel-window {
        padding-bottom: 48px;
    }

    .project-carousel .project-card:not(.active) {
        flex-basis: min(82vw, 330px);
    }
}

@media (max-width: 520px) {
    .project-carousel-toolbar {
        flex-direction: row;
    }

    .project-carousel-actions {
        width: auto;
    }

    .project-carousel-button {
        flex: 0 0 auto;
    }
}

/* Major project carousel performance tuning */
.project-carousel {
    contain: layout paint;
}

.project-carousel-window {
    overscroll-behavior-inline: contain;
}

.project-carousel .project-card:not(.active) {
    contain: layout paint;
}

.project-carousel .project-card-media img {
    transition: transform 0.24s ease;
}

@media (hover: none), (max-width: 760px), (prefers-reduced-motion: reduce) {
    .project-carousel {
        box-shadow: 0 18px 34px rgba(5, 22, 28, 0.24);
    }

    .project-carousel::after {
        animation: none;
        filter: none;
        opacity: 0.22;
        transform: none;
    }

    .project-carousel-count,
    .project-carousel-button {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .project-carousel .project-card:not(.active) {
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    }

    .project-carousel .project-card:not(.active)::before {
        display: none;
    }

    .project-carousel .project-card-media img,
    .project-card:not(.active):hover .project-card-media img {
        filter: none;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .project-carousel::after {
        animation: none;
    }

    .project-carousel-window {
        scroll-behavior: auto;
    }

    .project-carousel-button,
    .project-carousel .project-card-media img {
        transition-duration: 0.01ms;
    }
}
