:root {
    color-scheme: light;
    --bg: #fcf7f0;
    --surface: #fffaf4;
    --surface-soft: #f6ecdf;
    --text: #10203d;
    --muted: #4d5869;
    --primary: #f5a12b;
    --primary-dark: #a75114;
    --border: #e6dcd0;
    --shadow: 0 3px 9px rgba(37, 30, 21, 0.09);
    --radius-card: 18px;
}

* {
    box-sizing: border-box;
}
[hidden] {
    display: none !important;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    line-height: 1.65;
}
a {
    color: inherit;
    text-underline-offset: 0.2em;
}
img {
    max-width: 100%;
}
:where(a, button, input, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--primary-dark);
    outline-offset: 4px;
}
.container {
    width: min(100% - 3rem, 1200px);
    max-width: 1200px;
    padding-inline: 0;
    margin-inline: auto;
}

/* Keep Bootstrap navigation and its existing collapse behavior. */
.site-nav {
    min-height: 76px;
    background: transparent;
    border-bottom: 1px solid transparent;
    box-shadow: none;
}
.site-nav.is-solid {
    background: #054677;
    border-bottom-color: rgba(255, 255, 255, 0.12);
}
.site-nav .container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}
.nav-socials,
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.nav-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
}
.nav-socials a:hover {
    text-decoration: underline;
}
.nav-socials svg {
    width: 20px;
    height: 20px;
}
.site-nav .navbar-collapse {
    justify-content: center;
    min-width: 0;
}
.nav-actions {
    justify-self: end;
}
.cv-download {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--surface);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
}
.cv-download-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.45rem 0.8rem;
    border-radius: 999px 0 0 999px;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.cv-download-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0 999px 999px 0;
    color: var(--text);
    background: transparent;
}
.cv-download-toggle svg {
    width: 18px;
    height: 18px;
}
.cv-download-main:hover,
.cv-download-toggle:hover {
    color: var(--text);
    background: var(--surface-soft);
}
.cv-short-label {
    display: none;
}
.cv-download-menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    z-index: 1050;
    min-width: 185px;
    margin: 0;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(15, 32, 61, 0.2);
    list-style: none;
}
.cv-download-menu a {
    display: block;
    padding: 0.6rem 0.7rem;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
}
.cv-download-menu a:hover {
    background: var(--surface-soft);
}
.navbar-dark .navbar-nav .nav-link {
    padding: 0.5rem 0.65rem;
    border-radius: 12px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
}
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
    background: rgba(113, 212, 239, 0.25);
}
.language-switch {
    display: inline-flex;
    gap: 0.15rem;
    padding: 0.2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}
.language-option {
    min-width: 40px;
    min-height: 36px;
    padding: 0.2rem 0.55rem;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 700;
}
.language-option.active {
    color: var(--text);
    background: var(--surface);
}
.site-nav :focus-visible,
.hero :focus-visible,
.contact-landscape :focus-visible {
    outline-color: #fff;
}
.site-nav .cv-download :focus-visible {
    outline-color: var(--primary-dark);
}

/* Decorative panorama; all copy and links remain HTML. */
.hero {
    position: relative;
    display: grid;
    align-items: start;
    min-height: 100vh;
    min-height: 100svh;
    color: #fff;
    background: #0564a5;
}
.hero-landscape {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right bottom;
}
.hero-content {
    position: relative;
    padding-top: clamp(120px, 16vh, 220px);
    padding-top: clamp(120px, 16svh, 220px);
    padding-bottom: 3rem;
}
.hero-inner {
    max-width: 50%;
}
.hero-copy, .hero-title {
    min-width: 0;
}
.eyebrow {
    margin-bottom: 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(2.6rem, 3.8vw, 4rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.045em;
    text-shadow: 0 2px 12px rgba(0, 38, 75, 0.65);
}
.hero-statement {
    max-width: 560px;
    margin: 1rem 0 0;
    font-size: clamp(1.5rem, 2.4vw, 2.1rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.035em;
    text-wrap: balance;
    text-shadow: 0 2px 12px rgba(0, 38, 75, 0.65);
}
.hero-subtitle {
    max-width: 540px;
    margin: 1rem 0 0;
    color: #fff;
    font-size: clamp(0.95rem, 1.35vw, 1.15rem);
    line-height: 1.6;
    text-shadow: 0 1px 5px rgba(0, 44, 79, 0.7);
}
.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 0.65rem;
    margin-top: 1.65rem;
}
.hero-primary-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}
.action-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
}
.hero-primary-actions .btn {
    gap: 0.5rem;
}
.btn-primary-custom, .btn-outline-custom, .btn-project {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.65rem 1.2rem;
    border: 1px solid var(--primary-dark);
    border-radius: 999px;
    color: #fff;
    background: var(--primary-dark);
    font-size: 0.88rem;
    font-weight: 600;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary-custom:hover, .btn-project:hover {
    border-color: #823a0b;
    color: #fff;
    background: #823a0b;
}
.btn-outline-custom, .btn-project-outline {
    color: var(--text);
    background: transparent;
    border-color: var(--border);
}
.btn-outline-custom:hover, .btn-project-outline:hover {
    color: var(--text);
    background: var(--surface-soft);
    border-color: var(--primary-dark);
}
.hero .btn-primary-custom, .contact-landscape .btn-primary-custom {
    color: var(--text);
    background: var(--surface);
    border-color: var(--surface);
    box-shadow: var(--shadow);
}
.hero .btn-outline-custom {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(3, 81, 140, 0.3);
}
.hero .btn:hover, .contact-landscape .btn-primary-custom:hover {
    color: var(--text);
    background: #fff;
    border-color: #fff;
}

main {
    background: var(--bg);
}
.section-block {
    position: relative;
    padding: clamp(2.6rem, 5vw, 4.5rem) 0;
}
.section-block + .section-block {
    padding-top: 1.5rem;
}
.section-heading, .section-heading.centered {
    margin-bottom: 2rem;
    text-align: left;
}
/* Retain category and kicker content for assistive technology. */
.section-kicker, .section-icon {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.section-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.8rem, 3.1vw, 2.65rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.045em;
}
.section-heading::after {
    content: '';
    display: block;
    width: 54px;
    height: 5px;
    margin-top: 0.75rem;
    border-radius: 999px;
    background: var(--primary);
}
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
}
.about-copy p {
    margin: 0;
    line-height: 1.85;
}
.profile-card {
    padding-left: 2rem;
    border-left: 1px solid var(--border);
}
.profile-portrait {
    width: 78px;
    flex: 0 0 78px;
}
.about-heading-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.profile-portrait img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 18px;
}
.info-label, .course-kicker {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 600;
}
.profile-features {
    display: grid;
    gap: 1.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.profile-feature {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}
.feature-icon,
.language-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    color: var(--text);
    background: var(--surface-soft);
}
.feature-icon svg,
.language-icon svg {
    width: 26px;
    height: 26px;
}
.profile-feature h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}
.profile-feature p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Compact groups on a continuous cream background. */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 3rem;
    align-items: start;
}
.stack-card {
    min-width: 0;
}
.stack-card > h3 {
    margin: 0 0 1.1rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}
.tech-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 1.25rem 0.65rem;
    align-items: start;
}
.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    text-align: center;
}
.tech-icon {
    width: 64px;
    height: 64px;
    padding: 13px;
    object-fit: contain;
    border-radius: 17px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.tech-item span {
    font-size: 0.73rem;
    font-weight: 500;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.projects-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.projects-heading-row .section-heading {
    margin-bottom: 0;
}
.project-carousel-controls {
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
}
.project-carousel-controls button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    background: var(--surface);
}
.project-carousel-controls button:hover:not(:disabled) {
    border-color: var(--primary);
}
.project-carousel-controls button:disabled {
    opacity: 0.35;
}
.project-carousel-controls svg {
    width: 22px;
    height: 22px;
}
.projects-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 4.2rem) / 4);
    gap: 1.4rem;
    align-items: stretch;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0.15rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--surface-soft);
    padding: 0.35rem 0.15rem 1rem;
    transition: opacity 0.3s ease, filter 0.3s ease;
}
.project-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: pointer;
    scroll-snap-align: start;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.project-card:hover, .project-card:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(37, 30, 21, 0.14);
}
.projects-grid.is-dimmed {
    opacity: 0.34;
    filter: saturate(0.72) brightness(0.82);
    pointer-events: none;
}
.project-media {
    background: var(--surface-soft);
}
.project-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center top;
}
.project-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: start;
    padding: 1.1rem;
}
.project-subtitle {
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.4;
}
.project-content h3,
.project-content h4 {
    margin: 0 0 0.7rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.project-content p {
    margin: 0 0 1.1rem;
    font-size: 0.83rem;
    line-height: 1.6;
}
.tech-pills, .project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.tech-pills {
    margin-top: auto;
}
.tech-pills span, .project-stack span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    color: var(--text);
    background: #eee6de;
    font-size: 0.66rem;
    font-weight: 500;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.tech-pills img, .project-stack img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* Preserve the shared panel's class/state contract with script.js. */
.project-detail-panel {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 2.5rem);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.36s ease, visibility 0s linear 0.36s;
}
.project-detail-panel.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}
.project-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 28, 47, 0.7);
    backdrop-filter: blur(3px);
}
.project-detail-dialog {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 1.5rem;
    width: min(100%, 1120px);
    max-height: min(86vh, 780px);
    overflow: hidden;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 22px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(11, 28, 47, 0.25);
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    transition: opacity 0.42s ease, transform 0.42s ease;
}
.project-detail-panel.is-visible .project-detail-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.project-detail-panel.is-closing .project-detail-dialog {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
}
.project-detail-image-wrap {
    min-height: 280px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}
.project-detail-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 620px;
    object-fit: contain;
}
.project-detail-body {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-width: 0;
    max-height: calc(min(86vh, 780px) - 3rem);
    overflow-y: auto;
    padding-right: 0.5rem;
}
.project-detail-category {
    padding-right: 2.5rem;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 600;
}
.project-detail-body h3 {
    margin: 0;
    padding-right: 1.5rem;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
}
.project-detail-short, .project-detail-description {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.7;
}
.project-detail-description, .project-highlights {
    color: var(--muted);
}
.project-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: 1.5rem;
    line-height: 1;
}
.project-close:hover {
    background: var(--surface-soft);
}
.project-highlights {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
}
.project-highlights li::marker {
    color: var(--primary-dark);
}
.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.project-work-items {
    display: grid;
    gap: 1.2rem;
}
.project-work-item {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.project-work-item h4 {
    margin: 0 0 0.6rem;
    font-size: 1.05rem;
    font-weight: 600;
}
.project-work-item p {
    margin: 0 0 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.project-stack-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.credentials-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
    padding-block: clamp(2.6rem, 5vw, 4.5rem);
}
.credentials-layout > .section-block,
.credentials-sidebar > .section-block {
    min-width: 0;
    padding: 0;
}
.credentials-layout > .section-block > .container,
.credentials-sidebar > .section-block > .container {
    width: 100%;
    margin: 0;
}
.credentials-sidebar {
    display: grid;
    gap: 2.5rem;
    min-width: 0;
    padding-left: 3rem;
    border-left: 1px solid var(--border);
}
.education-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}
.education-timeline, .experience-timeline {
    display: grid;
    gap: 1.5rem;
}
.education-timeline-item, .experience-timeline-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 1rem;
}
.education-timeline-marker, .experience-timeline-marker {
    display: grid;
    place-items: start center;
    padding-top: 0.5rem;
}
.education-timeline-marker {
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border-radius: 12px;
    background: var(--surface-soft);
}
.education-timeline-marker svg {
    width: 24px;
    height: 24px;
}
.experience-timeline-marker::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 3px solid var(--primary);
    border-radius: 4px;
    background: var(--surface-soft);
}
.education-timeline-content h3, .relevant-course-card h3, .experience-timeline-content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
}
.education-timeline-content p, .experience-timeline-content p {
    margin: 0.35rem 0 0;
    font-size: 0.93rem;
}
.relevant-course-card {
    padding: 0;
}
.course-description, .experience-summary {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.8;
}
.course-description {
    margin-bottom: 0;
}
.course-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.85rem;
}
.experience-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.25rem 3rem;
}
.experience-timeline-content {
    min-width: 0;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.experience-timeline-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem;
}
.experience-current-badge {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    color: var(--primary-dark);
    background: var(--surface-soft);
    font-size: 0.7rem;
    font-weight: 600;
}
.languages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.language-card {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0;
}
.language-icon {
    align-self: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin-right: 0.25rem;
}
.language-icon svg {
    width: 24px;
    height: 24px;
}
.language-card h3, .language-card p {
    margin: 0;
    font-size: 1rem;
}
.language-card h3 {
    font-weight: 600;
}
.language-card p {
    color: var(--muted);
}
.language-card p::before {
    content: '—';
    margin-right: 0.5rem;
}
.certificate-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 36px;
    padding: 0.2rem 0.55rem;
    border: 1px solid #8352be;
    border-radius: 8px;
    color: #66329d;
    background: var(--surface);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
}
.certificate-link:hover {
    color: #512080;
    background: #f2e8fc;
}
.certificate-link svg {
    width: 15px;
    height: 15px;
}

.contact-landscape {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: clamp(340px, 36vw, 560px);
    color: #fff;
    background-color: #193b50;
    background-image: linear-gradient(180deg, rgba(29, 35, 66, 0.18), rgba(13, 40, 56, 0.35)), url('assets/pixel-art/footer-pixel-art.webp');
    background-position: center;
    background-size: cover;
}
#contact {
    padding-top: 3rem;
    padding-bottom: 2rem;
}
#contact .section-heading {
    text-align: center;
}
#contact .section-heading h2 {
    color: #fff;
    text-shadow: 0 2px 10px rgba(34, 38, 60, 0.5);
}
#contact .section-heading::after {
    margin-inline: auto;
}
.contact-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 48px;
    max-width: 100%;
    padding: 0.25rem;
    border: 0;
    border-radius: 8px;
    color: inherit;
    background: transparent;
    font: inherit;
    letter-spacing: inherit;
    text-shadow: inherit;
    cursor: pointer;
}
.contact-chevron {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    transition: transform 0.24s ease;
}
.contact-toggle[aria-expanded="true"] .contact-chevron {
    transform: rotate(180deg);
}
.contact-form-panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.24s ease, opacity 0.24s ease;
}
.contact-form-panel.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
}
.contact-form-content {
    min-height: 0;
    overflow: hidden;
}
#contact-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    width: min(100%, 850px);
    margin: 0 auto;
    padding: 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 22px;
    background: rgba(16, 38, 57, 0.9);
    box-shadow: 0 12px 32px rgba(12, 25, 45, 0.15);
}
.form-group {
    min-width: 0;
}
.form-group:nth-of-type(3), #form-status {
    grid-column: 1 / -1;
}
#contact-form label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.85rem;
    font-weight: 500;
}
#contact-form input, #contact-form textarea {
    width: 100%;
    min-width: 0;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
    font: inherit;
    font-size: 0.9rem;
}
#contact-form textarea {
    min-height: 135px;
    resize: vertical;
}
#contact-form input::placeholder, #contact-form textarea::placeholder {
    color: #d5dfeb;
    opacity: 1;
}
#contact-form input:focus, #contact-form textarea:focus {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}
#contact-form > button {
    grid-column: 1 / -1;
    justify-self: end;
}
#email-error, #form-status {
    display: none;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
}
#email-error {
    color: #ffd0c5;
}
#form-status {
    color: #fff;
}
.site-footer {
    padding: 0.5rem 1rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}
.site-footer p {
    margin: 0.25rem 0;
}
.site-footer a {
    color: #fff;
}

/* Keep section ancestors untransformed: the fixed project panel must stay
   attached to the viewport and above the navigation. */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: none;
}
.section-block.reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
}

@media (min-width: 1200px) {
    .language-switch {
        margin-top: 0 !important;
    }
}

@media (max-width: 1199px) {
    .site-nav .navbar-collapse {
        order: 3;
        flex-basis: 100%;
        max-height: calc(100dvh - 90px);
        overflow-y: auto;
        padding-bottom: 1rem;
    }
    .site-nav .navbar-nav {
        align-items: stretch !important;
        padding-top: 0.75rem;
    }
    .site-nav .navbar-collapse.show,
    .site-nav .navbar-collapse.collapsing {
        margin-top: 0.5rem;
        border-radius: 14px;
        background: #054677;
    }
    .site-nav .nav-link {
        min-height: 44px;
        padding-inline: 1rem;
    }
    .language-switch {
        margin-left: 0 !important;
    }
    .site-nav .container {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .nav-actions {
        order: 1;
        margin-left: auto;
    }
    .site-nav .navbar-toggler {
        order: 2;
    }
    .hero-inner {
        max-width: 52%;
    }
    .projects-grid {
        grid-auto-columns: calc((100% - 1.4rem) / 2);
    }
}

@media (max-width: 991px) {
    /* Give copy its own sky area while the proportional panorama fills the
       remaining screen height, framed toward the person and the peaks. */
    .hero {
        grid-template-rows: auto minmax(0, 1fr);
        background: linear-gradient(110deg, #055498, #087ec4);
    }
    .hero-landscape {
        position: static;
        grid-row: 2;
        min-height: 0;
        height: 100%;
        object-fit: cover;
    }
    .hero-content {
        grid-row: 1;
        padding-top: 120px;
        padding-bottom: 2rem;
    }
    .hero-inner {
        max-width: 680px;
    }
    .hero h1 {
        font-size: clamp(2.5rem, 6vw, 3.75rem);
    }
    .hero-subtitle {
        max-width: 620px;
        font-size: 1rem;
    }
    .about-grid,
    .credentials-layout {
        gap: 2rem;
    }
    .profile-card {
        padding-left: 1.5rem;
    }
    .credentials-sidebar {
        padding-left: 2rem;
    }
    .experience-timeline {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
}

@media (max-width: 767px) {
    .container {
        width: calc(100% - 2.5rem);
    }
    .section-block {
        padding-block: 3rem;
    }
    .section-block + .section-block {
        padding-top: 1rem;
    }
    .about-grid,
    .credentials-layout {
        grid-template-columns: 1fr;
    }
    .profile-card {
        padding: 1.5rem 0 0;
        border-left: 0;
        border-top: 1px solid var(--border);
    }
    .stack-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .credentials-sidebar {
        padding: 2rem 0 0;
        border-left: 0;
        border-top: 1px solid var(--border);
    }
    .projects-grid {
        grid-auto-columns: min(86%, 340px);
        gap: 1rem;
    }
    .project-content {
        padding: 1.3rem;
    }
    .project-content h3,
    .project-content h4 {
        font-size: 1.15rem;
    }
    .project-detail-panel {
        padding: 0.75rem;
    }
    .project-detail-dialog {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        max-height: 88vh;
        max-height: 88dvh;
        overflow-y: auto;
        padding: 1rem;
    }
    .project-detail-image-wrap {
        min-height: 0;
        height: 200px;
    }
    .project-detail-body {
        max-height: none;
        overflow: visible;
        padding: 0;
    }
    .languages-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    #contact-form {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }
    .site-footer .container {
        width: 100%;
    }
}

@media (max-width: 575px) {
    .site-nav .container {
        gap: 0.5rem;
    }
    .nav-socials {
        gap: 0.25rem;
    }
    .nav-socials a {
        min-width: 36px;
        min-height: 40px;
    }
    .nav-socials span,
    .cv-download-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .nav-actions {
        gap: 0.5rem;
    }
    .language-option {
        min-width: 30px;
        min-height: 32px;
        padding-inline: 0.35rem;
    }
    .cv-short-label {
        display: inline;
    }
    .cv-download-main {
        min-height: 40px;
        padding-inline: 0.55rem;
        font-size: 0.78rem;
    }
    .cv-download-main .action-icon {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }
    .cv-download-toggle {
        width: 30px;
    }
    .site-nav .navbar-toggler {
        padding: 0.35rem 0.45rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 420px) {
    .hero-primary-actions {
        gap: 0.6rem;
        width: 100%;
    }
    .hero-primary-actions .btn {
        flex: 1 1 auto;
        padding-inline: 0.9rem;
    }
    .experience-timeline-item {
        grid-template-columns: 20px minmax(0, 1fr);
        gap: 0.75rem;
    }
    .project-actions .btn, #contact-form > button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        transition: none !important;
    }
    .reveal-on-scroll {
        opacity: 1;
        transform: none;
    }
}
