/* =============================================================================
   Portfolio - site.css
   Faithful reproduction of sonytumen.com (master.css) using modern CSS.
   Replaces: jQuery animations → CSS transitions, jScrollPane → CSS scrollbars,
             Cufon.js → @font-face
   ============================================================================= */

/* --- Font --- */
@font-face {
    font-family: 'FrancophilSans';
    src: url('/fonts/FrancophilSans.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* --- CSS Custom Properties --- */
:root {
    --bg-dark: #252525;
    --bg-darker: #1a1a1a;
    --text-primary: #b5b5b5;
    --text-white: #ffffff;
    --text-hover: #bababa;
    --border-dark: #1a1a1a;
    --border-light: #353535;
    --border-input: #343434;
    --accent-red: #d04519;
    --accent-yellow: #ebb100;
    --accent-green: #53b123;
    --accent-blue: #00a4cd;
    --container-width: 54.6875rem;
    --card-width: 12.5rem;
    --card-height: 29.25rem;
    --card-bg-height: 26.875rem;
    --card-bg-width: 11.875rem;
    --page-width: 40.625rem;
    --page-height: 29.25rem;
    --page-left: 14.0625rem;
    --separator-spacing: 3rem;
    --content-height: calc(var(--card-height) + var(--separator-spacing) + var(--separator-spacing));
    --animation-speed: 300ms;
    --easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Breakpoints (reference only - CSS custom properties cannot be used in @media queries).
       These values are the single source of truth; keep @media rules in sync. */
    --bp-tablet: 57.5rem;   /* tablet & mobile shared */
    --bp-mobile: 37.5rem;   /* mobile-only */
}

/* Pixel exceptions: one-pixel hairlines, raster sprite geometry, SVG animation
   coordinates, and the conventional one-pixel visually-hidden field. */

/* --- Reset --- */
*,
*::before,
*::after {
    padding: 0;
    margin: 0;
    z-index: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    width: 100%;
    min-width: 20rem;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--text-primary);
}

@media (hover: hover) {
    a:hover {
        text-decoration: underline;
    }
}

.new-line {
    margin-top: 0.75rem;
}

/* --- Curtain overlay --- */
.curtain {
    position: fixed;
    padding: 0;
    margin: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.curtain.hidden {
    display: none;
}

/* --- Header --- */
#header {
    margin: auto;
    width: var(--container-width);
    display: flex;
    border-bottom: 1px solid var(--border-dark);
    padding-top: 1.5625rem;
    padding-bottom: var(--separator-spacing);
    flex-direction: row;
    justify-content: space-between;
}

#header a,
#header a:active {
    border: none;
    color: white;
    text-decoration: none;
}

#header a:focus-visible,
#header button:focus-visible {
    outline: 0.125rem solid var(--accent-blue);
    outline-offset: 0.125rem;
}

#header #name {
    font-family: 'FrancophilSans', Arial, sans-serif;
    font-size: 2.3125rem;
    text-align: center;
    color: var(--text-white);
    margin: 0;
    line-height: 1.1;
    outline: none;
}

#header #title {
    font-family: 'FrancophilSans', Arial, sans-serif;
    color: var(--text-hover);
}

#header #menu {
    margin-top: 1.75rem;
}

#header #menu ul {
    display: flex;
    list-style: none;
    gap: 0;
}

#header #menu li {
    list-style: none;
    float: left;
    margin-left: 0.9375rem;
}

#header #menu a {
    font-family: 'FrancophilSans', Arial, sans-serif;
    color: var(--text-white);
    text-decoration: none;
}

@media (hover: hover) {
    #header #menu a:hover {
        border-bottom: solid 1px var(--text-hover);
        text-decoration: none;
    }
}

/* Active navigation link */
#header #menu a.nav-active {
    color: var(--text-white);
    border-bottom: 0.125rem solid;
    text-decoration: none;
}
#header #menu a.nav-active[href="#AboutMe"] { border-color: var(--accent-red); }
#header #menu a.nav-active[href="#Cv"] { border-color: var(--accent-yellow); }
#header #menu a.nav-active[href="#Productions"] { border-color: var(--accent-green); }
#header #menu a.nav-active[href="#Contact"] { border-color: var(--accent-blue); }

#header #menu .language-switch {
    border: 1px solid var(--text-primary);
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
    border-radius: 0.125rem;
    color: var(--text-primary);
}

@media (hover: hover) {
    #header #menu .language-switch:hover {
        color: var(--text-white);
        border-color: var(--text-white);
    }
}

/* --- Content area --- */
#content {
    margin: auto;
    width: var(--container-width);
    display: flex;
    height: var(--content-height);
    padding-top: 0;
    padding-bottom: 0;
    position: relative;
    border-bottom: 1px solid var(--border-dark);
    border-top: 1px solid var(--border-light);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* --- Home page (cards container) --- */
#home-page {
    width: 100%;
    transition: width var(--animation-speed) var(--easing) var(--animation-speed);
    contain: layout style;
}

#home-page.compressed {
    width: 13.125rem;
    transition-delay: 0ms;
}

/* --- Cards --- */
#home-page .card {
    height: var(--card-height);
    width: var(--card-width);
    position: absolute;
    background-image: url('/images/sprite.png?v=2');
    transition: left var(--animation-speed) var(--easing) var(--animation-speed);
    top: var(--separator-spacing);
}

#home-page .card .background {
    margin: 0.3125rem;
    height: var(--card-bg-height);
    width: var(--card-bg-width);
    background-image: url('/images/sprite.png?v=2');
}

#home-page .card a {
    text-decoration: none;
    color: white;
    width: 100%;
    height: 100%;
    display: block;
    text-align: center;
    padding-top: 16.875rem;
    font-size: 1.5rem;
    font-family: 'FrancophilSans', Arial, sans-serif;
    text-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.4);
}

@media (hover: hover) {
    #home-page .card a:hover {
        text-decoration: none;
    }
}

/* Card positions (default = expanded) */
.aboutme-card { left: 0; }
.cv-card { left: 14.0625rem; }
.productions-card { left: 28.125rem; }
.contact-card { left: 42.1875rem; }

/* Cards compressed state: all stacked at left:0 */
#home-page.compressed .card {
    left: 0;
    transition-delay: 0ms;
}

/* Card z-index management when compressed */
#home-page.compressed .card {
    z-index: 1;
}

#home-page.compressed .card * {
    z-index: 1;
}

#home-page.compressed .active-card {
    z-index: 2;
}

#home-page.compressed .active-card .background {
    z-index: 3;
}

#home-page.compressed .active-card a {
    z-index: 4;
}

/* Card background sprite positions */
.aboutme-card .background {
    background-position: -200px 0px;
}

.cv-card .background {
    background-position: -390px 0px;
}

.productions-card .background {
    background-position: -580px 0px;
}

.contact-card .background {
    background-position: -770px 0px;
}

@media (hover: hover) {
    .aboutme-card .background:hover {
        background-position: -200px -430px;
    }

    .cv-card .background:hover {
        background-position: -390px -430px;
    }

    .productions-card .background:hover {
        background-position: -580px -430px;
    }

    .contact-card .background:hover {
        background-position: -770px -430px;
    }
}

/* --- Page panels --- */
.page {
    max-height: var(--page-height);
    position: absolute;
    left: var(--page-left);
    top: var(--separator-spacing);
    color: var(--text-primary);
    height: var(--page-height);
    width: 0;
    overflow: hidden;
    transition: width var(--animation-speed) var(--easing);
}

.page.page-open {
    width: var(--page-width);
    transition-delay: var(--animation-speed);
}

.page .page-bottom-background {
    background-image: url('/images/sprite.png?v=2');
    background-position: 0px -860px;
    height: 2.0625rem;
    position: absolute;
    top: 27rem;
    width: var(--page-width);
}

.page .page-content {
    height: 26.125rem;
    top: 0;
    position: absolute;
    left: 0;
    width: var(--page-width);
    padding-top: 1rem;
    z-index: 2;
}

.page .scrollable {
    height: 26.125rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding-left: 0;
    padding-right: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.35;
}

/* CSS scrollbar styling (replaces jScrollPane) */
.page .scrollable::-webkit-scrollbar {
    width: 0.5rem;
}
.page .scrollable::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 0.25rem;
}
.page .scrollable::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 0.25rem;
}
.page .scrollable::-webkit-scrollbar-thumb:hover {
    background: #555;
}
.page .scrollable {
    scrollbar-width: thin;
    scrollbar-color: #444 var(--bg-darker);
}

/* Close button */
.page .close-page {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 19px;
    height: 15px;
    background-image: url('/images/sprite.png?v=2');
    z-index: 10;
    cursor: pointer;
    outline: none;
}

.page::before {
    content: '';
    position: absolute;
    top: 0.375rem;
    left: 0;
    right: 1.5625rem;
    height: 0.1875rem;
    z-index: 1;
}

/* Page headings */
.page h2:first-child {
    margin-top: 0;
}

.page h2 {
    margin-bottom: 0.9375rem;
    margin-top: 1.5rem;
    font-family: 'FrancophilSans', Arial, sans-serif;
    color: var(--text-white);
}

.page a {
    text-decoration: underline;
}

/* --- About Me page --- */
#aboutme-page {
    border-top: none;
}

#aboutme-page::before {
    background-color: var(--accent-red);
}

#aboutme-page .close-page {
    background-position: 0px -469px;
    background-color: var(--accent-red);
}

#aboutme-page .page-content {
    text-align: justify;
}
/* --- CV page --- */
#cv-page {
    border-top: none;
}

#cv-page::before {
    background-color: var(--accent-yellow);
}

#cv-page .close-page {
    background-position: -20px -469px;
    background-color: var(--accent-yellow);
}

#cv-page .cv-information {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: row;
}

#cv-page .cv-left {
    min-width: 30%;
    font-style: italic;
    font-weight: bold;
}

#cv-page .cv-right {
    min-width: 70%;
    text-align: justify;
}

#cv-page .cv-resume {
    font-style: italic;
    margin-top: 0.1875rem;
}

#cv-page .cv-skills {
    margin-top: 0.75rem;
    display: flex;
    flex-flow: row wrap;
}

#cv-page .stars2,
#cv-page .stars3,
#cv-page .stars4,
#cv-page .stars5,
#cv-page .starsNull {
    background-image: url('/images/sprite.png?v=2');
    width: 111px;
    height: 16px;
}

#cv-page .starsNull {
    background-image: none;
}

#cv-page .stars2 {
    background-position: -57px -520px;
}

#cv-page .stars3 {
    background-position: -38px -520px;
}

#cv-page .stars4 {
    background-position: -19px -520px;
}

#cv-page .stars5 {
    background-position: 0px -520px;
}

/* Star rating text label */
.star-label {
    font-size: 0.6875rem;
    color: var(--text-primary);
    margin-left: 0.25rem;
    vertical-align: middle;
}

#cv-page .cv-left,
#cv-page .title {
    font-weight: 600;
}

/* --- Productions page --- */
#productions-page {
    border-top: none;
}

#productions-page::before {
    background-color: var(--accent-green);
}

#productions-page .close-page {
    background-position: -40px -469px;
    background-color: var(--accent-green);
}

#productions-page .page-content {
    text-align: justify;
}

#productions-page .productions:first-child {
    border-top: none;
    padding-top: 0;
}

#productions-page .productions {
    border-bottom: 1px solid var(--border-dark);
    border-top: 1px solid var(--border-light);
    padding: 1.5625rem 0;
}

#productions-page .production {
    padding-top: 0.75rem;
}

#productions-page h3 {
    font-style: italic;
}

/* --- Contact page --- */
#contact-page {
    border-top: none;
}

#contact-page::before {
    background-color: var(--accent-blue);
}

#contact-page .close-page {
    background-position: -60px -469px;
    background-color: var(--accent-blue);
}

#contact-page .page-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

#contact-page .page-content .contact-form-full {
    width: 100%;
}

#contact-page .page-content .contact-form-full input,
#contact-page .page-content .contact-form-full textarea {
    display: block;
    margin-bottom: 0.625rem;
    margin-top: 0.3125rem;
    color: var(--text-primary);
    font: 0.75rem Arial;
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-input);
    background: none;
    box-sizing: border-box;
}

#contact-page .page-content .contact-form-full textarea {
    overflow: auto;
    height: 5rem;
}

#contact-page .page-content .contact-form-full input[type="submit"],
#contact-page .page-content .contact-form-full button[type="submit"] {
    width: 100%;
    cursor: pointer;
    color: var(--text-white);
    font: 0.875rem Arial;
    font-weight: 600;
    padding: 0.75rem;
    border: 1px solid var(--accent-blue);
    background-color: var(--accent-blue);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

@media (hover: hover) {
    #contact-page .page-content .contact-form-full button[type="submit"]:hover {
        background-color: #008ba8;
        border-color: #008ba8;
    }
}

/* --- Informations (footer icons + sidebar contact) --- */
.informations > div {
    margin-bottom: 0.625rem;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.informations .info-icons {
    width: 16px;
    height: 16px;
    margin-right: 0.3125rem;
    flex-shrink: 0;
    background-image: url('/images/sprite.png?v=2');
}

.informations .cv-icon {
    background-position: 0px -504px;
}

.informations .phone-icon {
    background-position: -32px -504px;
}

.informations .mail-icon {
    background-position: -16px -504px;
}

.informations a {
    text-decoration: none;
    line-height: 1.25rem;
}

.informations-right > div {
    margin-bottom: 0.625rem;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}

.informations-right a {
    line-height: 1.25rem;
    text-decoration: none;
    margin-left: 0.625rem;
}

.lang-select-wrapper {
    position: relative;
    display: inline-block;
}

.lang-select-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.625rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.25rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: bold;
    letter-spacing: 0.03125rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

@media (hover: hover) {
    .lang-select-toggle:hover {
        background: rgba(255, 255, 255, 0.14);
        border-color: rgba(255, 255, 255, 0.35);
    }
}

.lang-select-toggle svg {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.125rem;
}

.lang-chevron {
    font-size: 0.625rem;
    margin-left: 0.125rem;
    transition: transform 0.2s ease;
}

.lang-select-wrapper.open .lang-chevron {
    transform: rotate(180deg);
}

.lang-select-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.25rem;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.25rem;
    overflow: hidden;
    min-width: 100%;
    box-shadow: 0 -0.25rem 0.75rem rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.lang-select-wrapper.open .lang-select-dropdown {
    display: block;
}

.lang-select-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.6875rem;
    font-weight: bold;
    letter-spacing: 0.03125rem;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

@media (hover: hover) {
    .lang-select-item:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

.lang-select-item.selected {
    background: rgba(255, 255, 255, 0.06);
}

.lang-select-item svg {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.125rem;
}

/* --- Footer --- */
#footer {
    margin: 0 auto;
    font-size: 0.75rem;
    border-top: 1px solid var(--border-light);
    width: var(--container-width);
    padding-top: var(--separator-spacing);
    padding-bottom: 1.5625rem;
    color: var(--text-primary);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

#footer #social-links {
    margin-top: 1.75rem;
}

#footer #social-links a {
    width: 20px;
    height: 20px;
    background-image: url('/images/sprite.png?v=2');
    display: inline-block;
}

#footer #social-links .linkedin {
    background-position: -60px -484px;
}

/* --- Phone information (hidden on desktop) --- */
#phone-information {
    display: none;
}

/* --- Validation --- */
.validation-message {
    color: #ff6b6b;
    font-size: 0.6875rem;
    margin-bottom: 0.3125rem;
}

/* Invalid field highlight */
.invalid {
    border-color: #ff6b6b !important;
}

/* --- Toast notification --- */
.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    margin-top: 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    animation: toast-in 0.3s ease;
}

.toast-success {
    background: rgba(83, 177, 35, 0.15);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.toast-error {
    background: rgba(208, 69, 25, 0.15);
    border: 1px solid var(--accent-red);
    color: #ff6b6b;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0 0 0 0.625rem;
    line-height: 1;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-0.5rem); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pageSlideDown {
    from { opacity: 0; transform: translateY(-1rem); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Scroll to top button --- */
.scroll-to-top {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--bg-darker);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 500;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, background 0.3s ease;
}

@media (hover: hover) {
    .scroll-to-top:hover {
        background: var(--accent-blue);
        color: var(--text-white);
    }
}

/* --- Language switcher --- */
.language-switcher {
    display: inline-block;
    margin-left: 1.25rem;
}

.language-switcher a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
}

.language-switcher a.active {
    color: var(--text-white);
    border-bottom: solid 1px var(--text-hover);
}

@media (hover: hover) {
    .language-switcher a:hover {
        color: var(--text-white);
        border-bottom: solid 1px var(--text-hover);
    }
}

/* --- Hamburger toggle (hidden on desktop) --- */
.hamburger-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 200;
}

.hamburger-toggle span {
    display: block;
    width: 1.5rem;
    height: 0.125rem;
    background: var(--text-white);
    margin: 0.3125rem 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-toggle.open span:nth-child(1) {
    transform: translateY(0.4375rem) rotate(45deg);
}

.hamburger-toggle.open span:nth-child(2) {
    opacity: 0;
}

.hamburger-toggle.open span:nth-child(3) {
    transform: translateY(-0.4375rem) rotate(-45deg);
}

/* =============================================================================
   Accessibility - Focus indicators & reduced motion
   ============================================================================= */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 0.125rem solid var(--accent-blue);
    outline-offset: 0.125rem;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0ms !important;
        animation-duration: 0ms !important;
    }
}

/* =============================================================================
   Dark-mode signal - site is already dark, define scheme for native controls
   ============================================================================= */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }

    input, textarea, select {
        color-scheme: dark;
    }
}

/* =============================================================================
   Responsive - Tablet & Mobile shared (≤ 57.5rem / var(--bp-tablet))
   ============================================================================= */
@media screen and (max-width: 57.5rem) {
    #header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
        height: auto;
        width: auto;
        max-width: var(--container-width);
        margin-left: 1rem;
        margin-right: 1rem;
    }

    #header #logo {
        flex: 1;
    }

    #header #name {
        font-size: 1.875rem;
        text-align: left;
    }

    .hamburger-toggle {
        display: block;
    }

    #header #menu {
        display: none;
        width: 100%;
        margin-top: 0.625rem;
    }

    #header #menu.menu-open {
        display: block;
    }

    #header #menu ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    #header #menu li {
        margin: 0;
        border-top: 1px solid var(--border-light);
    }

    #header #menu a[href="#AboutMe"] { border-left: 0.1875rem solid var(--accent-red); }
    #header #menu a[href="#Cv"] { border-left: 0.1875rem solid var(--accent-yellow); }
    #header #menu a[href="#Productions"] { border-left: 0.1875rem solid var(--accent-green); }
    #header #menu a[href="#Contact"] { border-left: 0.1875rem solid var(--accent-blue); }

    #header #menu a {
        display: block;
        font-size: 0.8125rem;
        padding: 0.5rem 0.25rem;
    }

    /* Content area */
    #content {
        height: auto;
        padding-top: 1.875rem;
        padding-bottom: 1.25rem;
        flex-direction: column;
        width: auto;
        max-width: var(--container-width);
        margin-left: 1rem;
        margin-right: 1rem;
    }

    /* Cards: vertical list */
    #home-page {
        display: flex;
        flex-direction: column;
        gap: 0.625rem;
        width: 100%;
        padding: 0;
    }

    #home-page .card {
        position: relative;
        top: 0;
        left: 0 !important;
        width: 100%;
        height: 7.5rem;
        overflow: hidden;
        background-image: url('/images/sprite.png?v=2');
        background-repeat: no-repeat;
        background-size: 960px 2000px;
        background-position: right -895px;
        border-radius: 0.125rem;
        transition: height var(--animation-speed) var(--easing),
                    opacity var(--animation-speed) var(--easing);
        will-change: height, opacity;
        opacity: 1;
    }

    #home-page .card .background {
        background-image: none;
        width: 100%;
        height: 100%;
        position: relative;
    }

    .aboutme-card  { background-position: right -895px !important; }
    .cv-card       { background-position: right -1124px !important; }
    .productions-card { background-position: right -1354px !important; }
    .contact-card  { background-position: right -1584px !important; }

    #home-page .card a {
        padding-top: 0 !important;
        height: 100% !important;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
    }

    #home-page.compressed {
        display: flex;
        width: 100%;
        gap: 0;
    }

    #home-page.compressed .card {
        height: 0;
        opacity: 0;
        overflow: hidden;
        transition-delay: 0ms;
    }

    #home-page.compressed .active-card {
        height: 3.5rem;
        opacity: 1;
    }

    /* Page panels: hidden until open */
    .page {
        display: none;
    }

    .page.page-open {
        display: block;
        position: relative;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        max-height: none;
        overflow: visible;
        animation: pageSlideDown var(--animation-speed) var(--easing) var(--animation-speed) both;
    }

    .page .page-content {
        position: relative;
        width: 100%;
        height: auto;
        padding: 1rem 0;
    }

    .page .scrollable {
        height: auto;
        overflow-y: visible;
        padding-left: 0;
        padding-right: 0.75rem;
    }

    .page .page-bottom-background {
        display: none;
    }

    /* CV stacking */
    #cv-page .cv-information {
        flex-direction: column;
        gap: 0.25rem;
    }

    #cv-page .cv-left,
    #cv-page .cv-right {
        min-width: 0;
        width: 100%;
    }

    #cv-page .cv-skills {
        flex-direction: column;
    }

    /* Contact form stacking */
    #contact-page .page-content {
        flex-direction: column;
        gap: 1.25rem;
    }

    /* Footer stacking */
    #footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1.25rem 0;
        width: auto;
        max-width: var(--container-width);
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .informations-right > div {
        justify-content: flex-start;
    }

    .informations-right a {
        margin-left: 0;
        margin-right: 0.625rem;
    }

    #footer #social-links {
        margin-top: 0;
    }
}

/* =============================================================================
   Responsive - Mobile (≤ 37.5rem / var(--bp-mobile))
   ============================================================================= */
@media screen and (max-width: 37.5rem) {
    body {
        overflow-x: hidden;
    }

    /* Header: inherited from tablet breakpoint */

    #header #name {
        font-size: 1.5rem;
    }

    #header #title {
        font-size: 0.75rem;
    }

    #header #menu a {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 2.75rem;
    }

    #header #menu a:hover {
        background: rgba(255, 255, 255, 0.05);
        border-bottom: none;
    }

    /* Content area */
    #content {
        padding: 1rem 0;
        font-size: 0.875rem;
        line-height: 1.5;
        overflow: hidden;
    }

    /* Cards: vertical list */
    #home-page {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    #home-page .card {
        position: relative;
        top: 0;
        left: 0 !important;
        width: 100%;
        height: 7.5rem;
        overflow: hidden;
        background-image: url('/images/sprite.png?v=2');
        background-repeat: no-repeat;
        background-size: 960px 2000px;
        background-position: right -895px;
        border-radius: 0.125rem;
    }

    #home-page .card .background {
        background-image: none;
        width: 100%;
        height: 100%;
        position: relative;
    }

    .aboutme-card     { background-position: right -895px !important; }
    .cv-card          { background-position: right -1124px !important; }
    .productions-card { background-position: right -1354px !important; }
    .contact-card     { background-position: right -1584px !important; }

    #home-page .card a {
        padding-top: 0 !important;
        height: 100% !important;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        word-break: break-word;
        hyphens: auto;
    }

    #home-page.compressed {
        display: flex;
        width: 100%;
        gap: 0;
    }

    #home-page.compressed .card {
        height: 0;
        opacity: 0;
        overflow: hidden;
    }

    #home-page.compressed .active-card {
        height: 3.5rem;
        opacity: 1;
    }

    /* Page panels */
    .page {
        display: none;
    }

    .page.page-open {
        display: block;
        position: relative;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        max-height: none;
        overflow: visible;
        animation: pageSlideDown var(--animation-speed) var(--easing) var(--animation-speed) both;
    }

    .page .page-content {
        position: relative;
        width: 100%;
        height: auto;
        padding: 1rem 0;
    }

    .page .scrollable {
        height: auto;
        overflow-y: visible;
        padding-left: 0;
        padding-right: 0.75rem;
    }

    .page .page-bottom-background {
        display: none;
    }

    /* Typography / readability */
    .page h2 {
        font-size: 1.25rem;
    }

    #aboutme-page .page-content,
    #productions-page .page-content,
    #cv-page .cv-right {
        text-align: left;
        hyphens: auto;
    }

    /* CV */
    #cv-page .cv-information {
        flex-direction: column;
        gap: 0.375rem;
    }

    #cv-page .cv-left,
    #cv-page .cv-right {
        min-width: 0;
        width: 100%;
    }

    #cv-page .cv-left {
        color: var(--text-hover);
        font-size: 0.75rem;
    }

    #cv-page .cv-skills {
        flex-direction: column;
    }

    /* Contact */
    #contact-page .page-content {
        flex-direction: column;
        gap: 1rem;
    }

    /* Show scroll-to-top on mobile after scroll threshold */
    .scroll-to-top.visible {
        display: flex;
    }

    /* iOS tap highlight */
    a, button, .card, .background {
        -webkit-tap-highlight-color: transparent;
    }

    /* Language selector dropdown - open downward on mobile (more space above footer) */
    .lang-select-dropdown {
        bottom: auto;
        top: 100%;
        margin-bottom: 0;
        margin-top: 0.25rem;
        left: 0;
        right: auto;
        box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.4);
    }

    .lang-select-toggle,
    .lang-select-item {
        font-size: 0.8125rem;
        min-height: 2.75rem;
    }
}

/* =============================================================================
   Responsive - Landscape on small devices
   ============================================================================= */
@media screen and (max-width: 57.5rem) and (orientation: landscape) {
    #content {
        height: auto;
        min-height: 17.5rem;
        padding-top: 1rem;
    }

    .page,
    .page .page-content,
    .page .scrollable {
        height: auto;
        max-height: none;
    }

    #home-page .card {
        height: 9.375rem;
    }

    #home-page .card a {
        padding-top: 35%;
    }
}

/* --- 404 Not Found --- */
.not-found-page {
    text-align: center;
    padding: 5rem 1.25rem;
    color: var(--text-primary);
}

.not-found-page h1 {
    font-family: 'FrancophilSans', Arial, sans-serif;
    font-size: 7.5rem;
    color: var(--accent-red);
    margin: 0;
    line-height: 1;
}

.not-found-title {
    font-family: 'FrancophilSans', Arial, sans-serif;
    font-size: 1.5rem;
    color: var(--text-white);
    margin: 1.25rem 0 0.625rem;
}

.not-found-message {
    font-size: 0.875rem;
    margin-bottom: 1.875rem;
}

.not-found-link {
    display: inline-block;
    padding: 0.625rem 1.5rem;
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

@media (hover: hover) {
    .not-found-link:hover {
        background-color: var(--accent-red);
        color: var(--text-white);
    }
}

/* Honeypot field - visually hidden and removed from a11y/tab order; only bots fill it. */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --- Brand loader (blooming petals) - see Components/Shared/Loader.razor --- */
.loader-petals {
    --loader-size: 1em;
    --loader-color: #c3c3c3;
    --loader-accent: #c9a227;
    display: inline-flex;
    width: var(--loader-size);
    height: var(--loader-size);
    line-height: 0;
    vertical-align: middle;
}

.loader-petals svg {
    display: block;
    width: 100%;
    height: 100%;
}

.loader-petals path {
    fill: var(--loader-color);
}

.loader-petals .lp-particle {
    fill: var(--loader-accent);
}

.loader-petals .lp-bloom-l {
    transform-origin: 232px 452px;
    animation: lp-bloom 1.1s cubic-bezier(0.3, 1.5, 0.4, 1) both;
}

.loader-petals .lp-bloom-s {
    transform-origin: 146px 440px;
    animation: lp-bloom 1.1s cubic-bezier(0.3, 1.5, 0.4, 1) 0.35s both;
}

.loader-petals .lp-sway-l {
    transform-origin: 232px 452px;
    animation: lp-sway-l 5.6s ease-in-out 1.1s infinite;
}

.loader-petals .lp-sway-s {
    transform-origin: 146px 440px;
    animation: lp-sway-s 4.3s ease-in-out 1.3s infinite;
}

.loader-petals .lp-particle-1 {
    animation: lp-float 6s ease-out 1.6s infinite;
}

.loader-petals .lp-particle-2 {
    animation: lp-float 6s ease-out 3.6s infinite;
}

.loader-petals .lp-particle-3 {
    animation: lp-float 6s ease-out 5.2s infinite;
}

@keyframes lp-bloom {
    from { transform: scale(0) rotate(-10deg); }
    to { transform: scale(1) rotate(0deg); }
}

@keyframes lp-sway-l {
    0%, 100% { transform: rotate(-1.8deg); }
    50% { transform: rotate(2.4deg); }
}

@keyframes lp-sway-s {
    0%, 100% { transform: rotate(-3.2deg); }
    50% { transform: rotate(2.8deg); }
}

@keyframes lp-float {
    0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
    12% { opacity: 0.9; }
    60% { opacity: 0.5; }
    100% { opacity: 0; transform: translate(46px, -110px) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .loader-petals .lp-bloom-l,
    .loader-petals .lp-bloom-s,
    .loader-petals .lp-sway-l,
    .loader-petals .lp-sway-s,
    .loader-petals .lp-particle-1,
    .loader-petals .lp-particle-2,
    .loader-petals .lp-particle-3 {
        animation: none;
    }

    .loader-petals .lp-particle {
        opacity: 0.6;
    }
}

/* Loader inside the submit button - inherit the button's text color. */
.loader-inline {
    --loader-color: currentColor;
    --loader-accent: currentColor;
}

/* Centered full-panel loading state (sections while content loads). */
.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 15rem;
}
