/* Portrait-led editorial theme. */
:root {
    --black: #030907;
    --dark: #07100c;
    --dark-2: #0d1712;
    --gray: #a3ada7;
    --border: rgba(166, 222, 192, .18);
}

body { background: var(--black); color: #eef2ef; }
section { scroll-margin-top: 76px; }
::selection { background: #00e676; color: #031009; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

.navbar {
    height: 76px;
    padding: 0 5%;
    background: rgba(3, 9, 7, .9);
    border-color: rgba(210, 239, 222, .12);
}
.logo { display: inline-flex; align-items: center; gap: 12px; font-family: Arial, sans-serif; line-height: 1; }
.logo .logo-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid #00e67666;
    border-radius: 11px;
    background: linear-gradient(145deg, #00e67622, #00e67605);
    color: var(--accent);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -2px;
}
.logo .logo-dot { position: absolute; right: 7px; bottom: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.logo-type { display: flex; flex-direction: column; gap: 7px; }
.logo .logo-name { color: #eef2ef; font-size: 18px; font-weight: 800; letter-spacing: -0.4px; }
.logo .logo-detail { color: #97afa1; font-size: 7px; font-weight: 400; letter-spacing: 1.65px; }
.logo:hover .logo-mark { border-color: var(--accent); }
.nav-menu { gap: 8px; }
.nav-link { padding: 9px 15px; border-radius: 6px; font-size: 10px; font-weight: 500; letter-spacing: 1.2px; }
.nav-link:hover, .nav-link.active { background: #00e67612; }
.nav-link::after { display: none; }
.menu-btn { width: 40px; height: 40px; border: 1px solid #00e67644; border-radius: 9px; font-size: 24px; line-height: 1; }
.mobile-menu { background: #07110c; }

.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 900px;
    min-height: max(850px, 100svh);
    padding: 160px 5% 112px;
    gap: 0;
    overflow: hidden;
    text-align: center;
    background: radial-gradient(ellipse at 64% 34%, rgba(0, 230, 118, .28), transparent 43%),
        radial-gradient(ellipse at 30% 18%, #073023, transparent 57%), #030907;
}
.hero-topline, .hero-bottomline {
    position: absolute;
    left: 5%;
    right: 5%;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: #9aada1;
    font-size: 11px;
    letter-spacing: .7px;
    text-align: left;
}
.hero-topline { top: 110px; }
.hero-bottomline { bottom: 30px; align-items: center; }
.hero-bottomline a:first-child { font-size: 16px; font-weight: 300; letter-spacing: -.5px; }
.hero-bottomline a:hover { color: var(--accent); }
.hero-wordmark {
    position: absolute;
    top: 138px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(100px, 19.5vw, 340px);
    line-height: 1;
    font-weight: 400;
    letter-spacing: -.075em;
    color: transparent;
    background: linear-gradient(100deg, #0a3525 15%, #00d76e 68%, #095735);
    background-clip: text;
    -webkit-background-clip: text;
    opacity: .75;
    user-select: none;
    z-index: -2;
}
.hero-photo {
    position: absolute;
    inset: 120px 0 0;
    z-index: -1;
    pointer-events: none;
    align-items: flex-start;
    order: initial;
}
.photo-frame {
    width: min(950px, 90vw);
    height: 100%;
    aspect-ratio: auto;
    border: 0;
    padding: 0;
    mask-image: linear-gradient(to bottom, black 0%, black 62%, transparent 98%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 62%, transparent 98%);
}
.photo-frame::before { display: none; }
.photo-frame::after {
    display: none;
}
.photo-frame img { object-position: center top; filter: grayscale(1) brightness(.72) contrast(1.1); }
.hero-content { width: 100%; max-width: 1000px; margin: 0 auto; }
.small-title { font-size: 10px; font-weight: 400; letter-spacing: 3px; margin-bottom: 12px; }
.hero h1 { font-size: clamp(78px, 10.8vw, 158px); font-weight: 400; letter-spacing: -.065em; line-height: 1.05; }
.hero h1 .title-period { display: inline; color: var(--accent); }
.hero h2 { margin-top: 10px; font-size: clamp(17px, 2vw, 25px); font-weight: 400; letter-spacing: -.7px; }
.hero h2::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin: 0 10px 3px 0; box-shadow: 0 0 14px #00e67666; }
.hero h2 span { color: #a3ada7; }
.hero-buttons { justify-content: center; gap: 12px; margin-top: 28px; }
.btn { border-radius: 7px; font-weight: 500; font-size: 10px; letter-spacing: 1px; padding: 13px 22px; }
.primary-btn { background: linear-gradient(#f0f2f0, #b8c0ba); border: 1px solid #ffffff88; color: #0a120d; }
.primary-btn:hover { background: #fff; box-shadow: 0 8px 30px #00e67622; }
.secondary-btn { border-color: #a5c1b044; color: #dbe6df; background: #04100966; }
.secondary-btn:hover { background: #00e676; border-color: #00e676; }

.section { border-top: 1px solid var(--border); }
.section-header h2, .about-content h2 { font-weight: 400; letter-spacing: -.05em; }
.section-label { font-weight: 400; letter-spacing: 3px; }
.project-card, .contact-card { background: #08110c; border-color: var(--border); border-radius: 10px; }
.project-info { padding: 24px; }
.project-image { aspect-ratio: auto; }
.project-image img { height: auto; object-fit: contain; }
.project-card:hover .project-image img { transform: none; }
.project-info h3 { font-weight: 400; }
.project-info p, .contact-card p { color: #a3ada7; }
.filter-btn, .skills span { border-radius: 5px; }
.about-image { padding: 0; border: 0; border-radius: 12px; overflow: hidden; }
.about-image img { filter: grayscale(1); }
.footer { border-color: var(--border); }
.footer h3 { font-weight: 400; letter-spacing: 1px; }
.footer p { color: #91a297; }
.contact-section { padding: 80px 7%; }
.contact-section .section-header { max-width: 680px; margin-bottom: 36px; }
.contact-section .section-header h2 { font-size: clamp(28px, 3.4vw, 44px); }
.contact-section .section-header > p:last-child { font-size: 14px; }
.contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1080px; margin: 0 auto; gap: 14px; }
.contact-card { min-height: 148px; padding: 22px; }
.contact-card p { overflow-wrap: anywhere; }
.social-icon {
    display: block;
    width: 25px;
    height: 25px;
    color: var(--accent);
    transition: transform .25s ease;
}
.contact-card h3 { margin-top: 18px; font-size: 17px; }
.contact-card:hover .social-icon { transform: translateY(-3px); }
.modal-content { border-color: var(--border); border-radius: 12px; }
.modal-gallery { background: #030907; }
.modal-gallery img { display: block; width: auto; max-width: 100%; height: auto; max-height: 78vh; margin: 0 auto 14px; object-fit: contain; }
.modal-close { position: sticky; float: right; margin-bottom: -40px; top: 12px; right: 12px; }

@media (min-width: 1600px) {
    .hero-photo { inset-block-start: 120px; }
    .photo-frame { width: min(1100px, 85vw); }
}
@media (max-width: 800px) {
    .hero { min-height: 820px; min-height: max(780px, 100svh); padding: 150px 5% 110px; }
    .hero-topline { font-size: 10px; }
    .hero-wordmark { top: 170px; font-size: 20vw; }
    .hero-photo { inset-block-start: 220px; }
    .photo-frame { width: min(620px, 100vw); }
    .hero h1 { font-size: clamp(76px, 15vw, 120px); }
    .small-title { letter-spacing: 2px; }
    .hero-buttons .btn { font-size: 10px; padding: 13px 22px; }
}
@media (max-width: 480px) {
    .hero { min-height: 760px; min-height: max(740px, 100svh); padding-bottom: 115px; }
    .hero-topline { flex-direction: column; gap: 4px; align-items: center; }
    .hero-wordmark { top: 181px; }
    .hero-photo { inset-block-start: 235px; }
    .photo-frame { width: 115vw; flex-shrink: 0; }
    .hero h1 { font-size: 21vw; }
    .hero h2 { font-size: 16px; }
    .small-title { font-size: 8px; }
    .hero-bottomline { font-size: 8px; }
    .hero-bottomline a:first-child { font-size: 13px; }
    .hero-buttons { gap: 8px; }
    .btn { padding: 12px 17px; }
    .hero-buttons .btn { padding: 12px 17px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
    .project-card { opacity: 1; transform: none; }
}
@media (max-width: 600px) {
    .contact-grid { grid-template-columns: 1fr; }
}


.project-empty { grid-column: 1 / -1; text-align: center; color: #97afa1; padding: 48px 16px; }

/* PHANNA hero motion */
.hero-wordmark {
    background-size: 120% 100%;
    background-position: 0% 50%;
    pointer-events: none;
    animation: phanna-reveal 1.2s cubic-bezier(.22, 1, .36, 1) both,
        phanna-shimmer 18s ease-in-out 1.2s infinite;
}

@keyframes phanna-reveal {
    from {
        opacity: 0;
        transform: translate(-50%, 16px);
        clip-path: inset(0 0 100% 0);
    }
    to {
        opacity: .75;
        transform: translate(-50%, 0);
        clip-path: inset(0);
    }
}

@keyframes phanna-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-wordmark {
        animation: none;
        background-size: 100% 100%;
        opacity: .75;
        transform: translateX(-50%);
        clip-path: none;
    }
}

/* Project gallery */
.projects-section { padding: 100px 7%; }
.projects-section .section-header { max-width: 1400px; text-align: left; margin: 0 auto 36px; }
.projects-section .section-label { font-size: 11px; letter-spacing: 2.5px; }
.projects-section .section-header h2 { font-size: clamp(36px, 5vw, 68px); line-height: 1.1; margin-bottom: 16px; }
.projects-section .section-header > p:last-child { max-width: 540px; line-height: 1.7; color: #a3ada7; }
.projects-section .filter-buttons { max-width: 1400px; margin: 0 auto 18px; justify-content: flex-start; gap: 8px; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.projects-section .filter-btn { border-radius: 999px; border-color: transparent; color: #aab8af; padding: 11px 17px; min-height: 44px; font-size: 10px; font-weight: 500; letter-spacing: .8px; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.projects-section .filter-btn:hover { background: #10231a; color: #eff5f1; }
.projects-section .filter-btn.active { background: var(--accent); color: #03150c; border-color: var(--accent); }
.gallery-status { max-width: 1400px; margin: 0 auto 24px; color: #9aafa1; font-size: 12px; letter-spacing: .3px; }
.projects-section .project-grid { max-width: 1400px; margin: 0 auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; align-items: stretch; }
.projects-section .project-card { min-width: 0; border-radius: 12px; background: #08110c; display: flex; flex-direction: column; }
.projects-section .project-image { aspect-ratio: 4 / 3; background: #101913; border-bottom: 1px solid var(--border); }
.projects-section .project-image img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 16px; transition: transform .5s cubic-bezier(.22, 1, .36, 1); }
.projects-section .project-card:hover .project-image img, .projects-section .project-card:focus-visible .project-image img { transform: scale(1.025); }
.projects-section .project-overlay { padding: 20px; background: linear-gradient(transparent 55%, #020a06cc); }
.projects-section .project-card:focus-visible .project-overlay { opacity: 1; }
.projects-section .view-project { color: #e7f4ec; font-size: 10px; letter-spacing: 1.2px; }
.projects-section .project-info { padding: 22px; }
.projects-section .project-info .project-category { color: var(--accent); font-size: 10px; font-weight: 500; letter-spacing: 1.5px; margin-bottom: 10px; }
.projects-section .project-info h3 { font-size: 19px; font-weight: 500; line-height: 1.65; margin: 0; overflow-wrap: anywhere; }
.projects-section .project-info > p:last-child:not(.project-category) { display: none; }
.projects-section .filter-btn:focus-visible, .projects-section .project-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.projects-section .projects-more { margin-top: 40px; }
@media (max-width: 1000px) { .projects-section .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (max-width: 600px) {
    .projects-section { padding: 64px 5%; }
    .projects-section .project-grid { grid-template-columns: minmax(0, 1fr); }
    .projects-section .filter-buttons { gap: 4px; }
    .projects-section .filter-btn { padding: 10px 12px; font-size: 9px; }
    .projects-section .project-info { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .projects-section .project-card, .projects-section .project-card .project-image img { transform: none; }
}
/* Interface refinement inspired by the portrait reference */
body { -webkit-font-smoothing: antialiased; }
.navbar { height: 72px; padding-inline: 5%; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
section { scroll-margin-top: 72px; }
.nav-menu { gap: 6px; }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; font-size: 11px; letter-spacing: 1px; color: #b6c2ba; }
.nav-link.active, .nav-link:hover { color: var(--accent); }
.logo .logo-name { font-size: 19px; letter-spacing: -.65px; }
.logo .logo-detail { font-size: 8px; letter-spacing: 1.5px; }
.hero { min-height: max(780px, 100svh); padding: 160px 5% 108px; background: radial-gradient(ellipse at 60% 28%, #00c56826, transparent 46%), radial-gradient(ellipse at 28% 15%, #073023, transparent 60%), #030907; }
.hero-topline { top: 108px; font-size: 11px; letter-spacing: .5px; }
.hero-wordmark { top: clamp(150px, 16svh, 210px); font-size: clamp(100px, 19vw, 340px); letter-spacing: -.07em; white-space: nowrap; }
.hero-photo { inset: 140px 0 0; }
.hero .photo-frame { width: min(980px, 82vw); mask-image: linear-gradient(to bottom, black 0%, black 54%, transparent 99%); -webkit-mask-image: linear-gradient(to bottom, black 0%, black 54%, transparent 99%); }
.hero .photo-frame img { filter: grayscale(1) brightness(.8) contrast(1.06); }
.hero-content { max-width: 900px; position: relative; text-shadow: 0 2px 24px #0006; }
.hero .small-title { font-size: 10px; letter-spacing: 2.6px; margin-bottom: 20px; color: var(--accent); }
.hero h1 { font-size: clamp(88px, 9vw, 148px); line-height: 1; letter-spacing: -.065em; }
.hero h2 { font-size: clamp(18px, 1.6vw, 24px); line-height: 1.5; letter-spacing: -.6px; margin-top: 24px; }
.hero h2::before { width: 6px; height: 6px; box-shadow: none; }
.hero-buttons { margin-top: 30px; gap: 12px; }
.hero-buttons .btn { min-height: 48px; display: inline-flex; justify-content: center; align-items: center; padding: 14px 24px; font-size: 10px; letter-spacing: 1px; border-radius: 6px; text-shadow: none; transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.hero-buttons .primary-btn { background: #edf3ef; border-color: #edf3ef; color: #091810; }
.hero-buttons .primary-btn:hover { background: #fff; border-color: #fff; box-shadow: 0 6px 24px #0003; }
.hero-buttons .secondary-btn { background: #07120db3; border-color: #9cb7a54d; color: #e1eae4; }
.hero-buttons .secondary-btn:hover { background: #10281b; border-color: #00e67680; }
.hero-bottomline { bottom: 28px; font-size: 10px; letter-spacing: 1px; }
.hero-bottomline a:first-child { font-size: 13px; letter-spacing: -.2px; }
@media (min-width: 1600px) { .hero .photo-frame { width: min(1100px, 78vw); } }
@media (max-width: 800px) {
    .navbar { height: 68px; }
    section { scroll-margin-top: 68px; }
    .hero { min-height: max(780px, 100svh); padding: 150px 5% 110px; }
    .hero-topline { top: 100px; font-size: 10px; }
    .hero-wordmark { top: 155px; font-size: 20vw; }
    .hero-photo { inset: 195px 0 0; }
    .hero .photo-frame { width: min(760px, 110vw); flex-shrink: 0; }
    .hero h1 { font-size: clamp(78px, 14vw, 112px); }
    .hero h2 { font-size: 19px; margin-top: 18px; }
}
@media (max-width: 480px) {
    .logo .logo-name { font-size: 16px; }
    .logo .logo-detail { font-size: 7px; }
    .hero { min-height: max(740px, 100svh); padding-bottom: 108px; }
    .hero-topline { flex-direction: column; gap: 6px; align-items: center; }
    .hero-wordmark { top: 165px; }
    .hero-photo { inset-block-start: 205px; }
    .hero .photo-frame { width: 125vw; }
    .hero .small-title { font-size: 8px; letter-spacing: 1.7px; margin-bottom: 16px; }
    .hero h1 { font-size: 21vw; }
    .hero h2 { font-size: 16px; letter-spacing: -.4px; }
    .hero-buttons { gap: 10px; margin-top: 24px; }
    .hero-buttons .btn { font-size: 9px; padding: 12px 16px; }
    .hero-bottomline { font-size: 8px; letter-spacing: .5px; }
}
/* Keep the title below the portrait's face. */
.hero { padding-bottom: 68px; }
@media (max-width: 800px) { .hero { padding-bottom: 68px; } }
@media (max-width: 480px) { .hero { padding-bottom: 64px; } }
.hero-bottomline { bottom: 20px; }
/* Reserve portrait space before the foreground title. */
.hero {
    padding-top: calc(140px + min(57vw, 650px));
    padding-bottom: 88px;
}
.hero-photo { inset: 140px 0 auto; height: auto; }
.hero .photo-frame { height: auto; }
.hero .photo-frame img { height: auto; object-fit: contain; }
.hero-content { flex-shrink: 0; }
@media (max-width: 800px) {
    .hero { padding-top: calc(195px + min(70vw, 490px)); padding-bottom: 88px; }
    .hero-photo { inset: 195px 0 auto; }
}
@media (max-width: 480px) {
    .hero { padding-top: calc(205px + 78vw); padding-bottom: 88px; }
    .hero-photo { inset: 205px 0 auto; }
}
/* Refinements to the original portrait-led design. */
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 3000; padding: 12px 20px; background: var(--accent); color: #031009; }
.skip-link:focus { top: 12px; }
.hero-description { max-width: 460px; margin: 18px auto 0; color: #b5c3ba; font-size: 14px; line-height: 1.8; }
.hero-topline { padding-bottom: 16px; border-bottom: 1px solid #a6dec015; }
.hero .small-title { color: #8cebb9; }
.hero-buttons .btn { min-height: 48px; }
.section { padding-block: 96px; }
.section-label { font-size: 11px; }
.projects-section .section-header { margin-bottom: 32px; }
.projects-section .project-card { box-shadow: 0 8px 30px #00000014; transition: opacity .4s, transform .4s, border-color .25s, box-shadow .25s; }
.projects-section .project-card:hover { border-color: #00e67666; box-shadow: 0 12px 32px #00000035; }
.projects-section .project-info { position: relative; padding-right: 48px; }
.projects-section .project-info::after { content: '↗'; position: absolute; right: 22px; top: 22px; color: #8ea899; font-size: 21px; transition: color .2s; }
.projects-section .project-card:hover .project-info::after { color: var(--accent); }
.projects-section .project-info h3 { font-size: 18px; line-height: 1.7; }
.gallery-pagination { display: flex; justify-content: center; margin-top: 36px; }
.gallery-pagination .btn { cursor: pointer; min-height: 48px; }
.projects-section .projects-more { margin-top: 22px; }
.about-section { gap: clamp(32px, 6vw, 90px); background: #06100b; }
.about-image { max-width: 480px; border: 1px solid var(--border); }
.about-content > p { line-height: 1.9; }
.about-content .section-label { color: var(--accent); }
.skills { padding-top: 22px; border-top: 1px solid var(--border); }
.skills span { background: #ffffff03; border-color: var(--border); }
.contact-email { display: flex; justify-content: center; align-items: center; gap: 20px; width: fit-content; max-width: 100%; margin: 0 auto 40px; padding-bottom: 10px; border-bottom: 1px solid #00e67650; font-size: clamp(16px, 2.2vw, 28px); }
.contact-email span, .contact-email:hover { color: var(--accent); }
.contact-card { position: relative; }
.contact-card::after { content: '↗'; position: absolute; top: 22px; right: 22px; color: #8ea899; }
.contact-card:hover::after { color: var(--accent); }
.contact-card h3 { font-weight: 500; }
.footer { align-items: center; }
.footer-top { color: #bfd2c6; font-size: 12px; }
.footer-top:hover { color: var(--accent); }
@media (min-width: 1700px) { .section, .footer { padding-inline: calc((100vw - 1440px) / 2); } }
@media (max-width: 800px) { .mobile-menu { top: 68px; } .section { padding-block: 72px; } }
@media (max-width: 480px) {
    .hero-description { max-width: 290px; font-size: 12px; }
    .hero-topline { border-bottom: none; }
    .hero h2 { font-size: 15px; }
    .contact-email { gap: 12px; font-size: 16px; }
    .footer { align-items: flex-start; }
}

/* Bilingual controls and Khmer typesetting. */
.language-switch { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 7px; margin-left: 18px; flex-shrink: 0; }
.language-switch button { min-height: 38px; min-width: 40px; padding: 5px 9px; border: 0; border-radius: 4px; background: transparent; color: #a3ada7; font-family: inherit; font-size: 12px; cursor: pointer; }
.language-switch button[aria-pressed="true"] { background: #00e67620; color: var(--accent); }
.language-switch button:hover { color: #fff; }
.nav-menu { margin-left: auto; }
html[lang="km"] body { font-family: 'Kantumruy Pro', 'Noto Sans Khmer', 'Leelawadee UI', sans-serif; }
html[lang="km"] h1, html[lang="km"] h2, html[lang="km"] h3,
html[lang="km"] .nav-link, html[lang="km"] .btn, html[lang="km"] .section-label,
html[lang="km"] .small-title, html[lang="km"] .filter-btn, html[lang="km"] .project-category,
html[lang="km"] .logo-detail { letter-spacing: normal; }
html[lang="km"] .hero h1 { font-size: clamp(60px, 8vw, 110px); line-height: 1.5; }
html[lang="km"] .hero h2 { line-height: 1.9; }
html[lang="km"] .section-header h2, html[lang="km"] .about-content h2 { line-height: 1.65; font-size: clamp(28px, 3.8vw, 48px); }
html[lang="km"] .hero-description, html[lang="km"] .about-content > p, html[lang="km"] .section-header > p { line-height: 2; }
html[lang="km"] .hero-wordmark { font-family: Arial, sans-serif; }
@media (max-width: 1000px) and (min-width: 801px) { .nav-link { padding-inline: 10px; } .navbar { padding-inline: 3%; } }
@media (max-width: 800px) { .language-switch { margin-left: auto; margin-right: 10px; } }
@media (max-width: 480px) {
    .navbar { padding-inline: 4%; }
    .logo { gap: 7px; }
    .logo .logo-name { font-size: 13px; }
    .logo .logo-detail { font-size: 6px; letter-spacing: .7px; }
    .logo .logo-mark { width: 32px; height: 34px; font-size: 25px; }
    .language-switch { margin-right: 6px; margin-left: auto; gap: 0; padding: 2px; }
    .language-switch button { min-width: 32px; min-height: 38px; padding: 4px 6px; font-size: 11px; }
    .menu-btn { width: 34px; flex-shrink: 0; }
    html[lang="km"] .hero h1 { font-size: 17vw; }
    html[lang="km"] .hero .small-title { font-size: 10px; }
    html[lang="km"] .hero h2 { font-size: 14px; }
}

.language-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.language-flag { display: block; width: 21px; height: 14px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
@media (max-width: 360px) { .logo .logo-detail { display: none; } .logo .logo-name { font-size: 11px; } .logo { gap: 5px; } .language-switch button { padding-inline: 4px; gap: 4px; } }

/* Raise the introduction while reserving clear space below the face. */
.hero { justify-content: flex-start; padding-top: calc(140px + min(44vw, 500px)); }
@media (max-width: 800px) {
    .hero { padding-top: calc(195px + min(55vw, 390px)); }
}
@media (max-width: 480px) {
    .hero { padding-top: calc(205px + 59vw); }
}

/* Consistent finishing pass for navigation, work, and contact. */
.navbar { box-shadow: 0 8px 32px #00000018; }
.nav-link { color: #bdc9c1; transition: color .2s, background .2s; }
.nav-link.active { background: #00e67614; }
.btn { min-height: 46px; border-radius: 6px; }
.hero-content { text-shadow: 0 2px 20px #0009; }
.hero-description { color: #c1cbc5; }
.projects-section .section-header { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0 60px; align-items: end; }
.projects-section .section-label { grid-column: 1 / -1; }
.projects-section .section-header h2 { margin-bottom: 0; font-size: clamp(36px, 4.4vw, 64px); }
.projects-section .section-header > p:last-child { margin: 0; max-width: 470px; justify-self: end; font-size: 14px; line-height: 1.85; }
.projects-section .filter-buttons { margin-top: 36px; padding-block: 16px; }
.gallery-status { font-size: 12px; color: #a9bbb0; margin-bottom: 22px; }
.projects-section .project-grid { gap: 24px; }
.projects-section .project-card { border-radius: 10px; background: #0a130e; border-color: #afc4b51f; }
.projects-section .project-image { background: radial-gradient(ellipse at center, #1c2a21, #101a14); }
.projects-section .project-image img { padding: 22px; }
.projects-section .project-info { padding-top: 20px; padding-bottom: 22px; }
.projects-section .project-info h3 { font-size: 17px; line-height: 1.75; }
.projects-section .project-info::after { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #a6dec029; border-radius: 50%; right: 16px; top: 19px; font-size: 16px; }
.projects-section .project-card:hover .project-info::after { background: #00e67612; border-color: #00e67655; }
.projects-section .project-card:focus-visible { border-color: var(--accent); }
.projects-more .primary-btn { background: transparent; border-color: transparent; color: #b6c7bd; box-shadow: none; font-size: 10px; }
.projects-more .primary-btn:hover { color: var(--accent); }
.about-content > p:not(.section-label) { color: #b2c0b7; max-width: 580px; }
.about-image { padding: 7px; border-radius: 12px; background: #ffffff03; }
.about-image img { border-radius: 6px; }
.skills span { color: #ccd7d0; border-radius: 5px; padding: 9px 14px; }
.contact-section { background: radial-gradient(ellipse at 50% 0, #0d2b1c55, transparent 65%); }
.contact-section .section-header { margin-bottom: 26px; }
.contact-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.contact-actions .primary-btn { background: #edf3ef; border-color: #edf3ef; }
.contact-actions .primary-btn:hover { background: white; }
.contact-email { font-size: clamp(15px, 1.6vw, 21px); color: #b7c9be; border: 0; margin-bottom: 46px; }
.contact-grid { gap: 14px; }
.contact-card { background: #0a140f; border-color: #afc4b526; border-radius: 8px; }
.contact-card p { line-height: 1.8; margin-top: 5px; }
.contact-card:hover { background: #102219; border-color: #00e67666; transform: translateY(-3px); }
.footer { padding-block: 36px; }
.footer h3 { font-size: 17px; letter-spacing: 2px; }
.footer p { line-height: 1.9; }
.modal-content { box-shadow: 0 24px 100px #0008; }
.modal-close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #ffffff33; background: #07100cef; }
.modal-info { padding: 30px 36px; border-top: 1px solid var(--border); }
.modal-info h2 { line-height: 1.7; }
@media (max-width: 800px) {
    .projects-section .section-header { grid-template-columns: 1fr; gap: 12px; }
    .projects-section .section-header > p:last-child { justify-self: start; }
    .projects-section .filter-buttons { margin-top: 24px; }
}
@media (max-width: 480px) {
    .projects-section .project-image img { padding: 16px; }
    .contact-actions { gap: 10px; }
    .contact-actions .btn { padding: 12px 15px; font-size: 9px; }
    .contact-email { margin-bottom: 30px; }
    .modal { padding: 12px; }
    .modal-content { width: 100%; max-height: 92svh; }
    .modal-info { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { .contact-card:hover { transform: none; } }

/* Khmer typography, including project titles shown in English mode. */
body { font-family: Arial, 'Kantumruy Pro', sans-serif; }
[lang="km"], .language-switch button[lang="km"] { font-family: 'Kantumruy Pro', sans-serif; }
html[lang="km"] button, html[lang="km"] .logo-detail { font-family: 'Kantumruy Pro', sans-serif; }

/* Gentle motion that leaves the portrait and title positions unchanged. */
@keyframes portfolio-enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes portrait-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-enter { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
    .hero-photo { animation: portrait-enter 1.1s ease-out both; }
    .hero-content > * { animation: portfolio-enter .8s cubic-bezier(.22,1,.36,1) both; }
    .hero-content .small-title { animation-delay: .12s; }
    .hero-content h1 { animation-delay: .22s; }
    .hero-content h2 { animation-delay: .32s; }
    .hero-content .hero-description { animation-delay: .42s; }
    .hero-content .hero-buttons { animation-delay: .52s; }
    .section-header, .about-image, .about-content, .contact-actions, .contact-email, .contact-card { transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1), border-color .25s, background-color .25s; }
    .reveal-pending { opacity: 0; transform: translateY(22px); }
    .reveal-pending:focus-within { opacity: 1; transform: none; }
    .modal.show .modal-content { animation: modal-enter .28s ease-out both; }
    .mobile-menu.show { animation: portfolio-enter .22s ease-out both; }
    .btn { transition: transform .22s ease, background-color .22s, border-color .22s, box-shadow .22s; }
    .btn:hover { transform: translateY(-3px); }
    .btn:active { transform: translateY(0); }
    .projects-section .project-info::after { transition: transform .25s, color .25s, background-color .25s; }
    .projects-section .project-card:hover .project-info::after { transform: rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal-pending { opacity: 1; transform: none; }
}
