* {
    box-sizing: border-box;
}

:root {
    --glass-background: rgba(255, 255, 255, 0.78);
    --glass-shadow: 0 8px 24px rgba(84, 46, 0, 0.12);
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, #ffe259, #ffa751);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: "Comic Sans", "Comic Sans MS", "Chalkboard", "ChalkboardSE-Regular", sans-serif;
    text-transform: lowercase;
    cursor: none;
    transition: background 0.5s;
}

.page-scene {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

.effects-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.site-header {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 14px;
    background: var(--glass-background);
    border: 3px solid #542e00;
    border-radius: 20px 13px 18px 12px;
    box-shadow: 5px 6px 0 #542e00, var(--glass-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(calc(-100% - 24px)) rotate(-0.35deg);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
}

.site-entered .site-header {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) rotate(-0.35deg);
    pointer-events: auto;
}

.site-brand,
.site-nav a {
    color: #542e00;
    font-weight: bold;
    text-decoration: none;
}

.site-brand {
    font-size: clamp(1rem, 2vw, 1.25rem);
    white-space: nowrap;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.78);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 13px;
    border: 2px solid transparent;
    border-radius: 13px 9px 12px 10px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, translate 0.2s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    background: #fff3ba;
    border-color: #542e00;
    box-shadow: 2px 3px 0 #542e00;
    translate: 0 -2px;
}

.site-brand:focus-visible,
.site-nav a:focus-visible,
.project-link:focus-visible,
.return:focus-visible,
button:focus-visible {
    outline: 3px solid #542e00;
    outline-offset: 3px;
}

/* Page projets */

.project-page {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
}

.project-page .page-scene {
    overflow: hidden;
}

.projects-content {
    position: relative;
    z-index: 2;
    width: min(1180px, 100%);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: calc(118px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) calc(68px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

.projects-hero {
    width: min(840px, 100%);
    margin: 0 auto clamp(42px, 7vw, 72px);
    text-align: center;
}

.projects-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(2.7rem, 8vw, 6.3rem);
    line-height: 0.98;
    overflow-wrap: anywhere;
    text-shadow: 4px 5px 0 #542e00, 8px 9px 0 rgba(123, 44, 255, 0.38);
    animation: projectTitleFloat 2.2s ease-in-out infinite alternate;
}

@keyframes projectTitleFloat {
    from { transform: translateY(0) rotate(-0.4deg); }
    to { transform: translateY(-8px) rotate(0.4deg); }
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: clamp(28px, 4vw, 46px);
}

.project-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(300px, 0.95fr) minmax(320px, 1.05fr);
    grid-template-rows: minmax(360px, auto);
    min-width: 0;
    overflow: hidden;
    color: #542e00;
    background: rgba(255, 255, 255, 0.88);
    border: 4px solid #542e00;
    border-radius: 29px 17px 33px 20px / 20px 31px 18px 29px;
    box-shadow: 10px 12px 0 rgba(84, 46, 0, 0.9), 0 22px 40px rgba(84, 46, 0, 0.16);
    rotate: var(--project-tilt, -1deg);
    transition: rotate 0.25s ease, translate 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover,
.project-card:focus-within {
    box-shadow: 7px 8px 0 rgba(84, 46, 0, 0.9), 0 18px 34px rgba(84, 46, 0, 0.2);
    rotate: 0deg;
    translate: 0 -5px;
}

.project-visual {
    position: relative;
    min-height: 360px;
    overflow: hidden;
    background: #7b2cff;
    border-right: 4px solid #542e00;
}

.project-visual img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.project-visual-fallback {
    isolation: isolate;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 16% 18%, #fff36d 0 4px, transparent 5px),
        radial-gradient(circle at 82% 76%, #fff 0 3px, transparent 4px),
        linear-gradient(145deg, #7b2cff, #d839a6 55%, #ff5722);
    background-size: 44px 44px, 36px 36px, auto;
}

.project-visual-fallback::before,
.project-visual-fallback::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 68%;
    height: 54%;
    border: 8px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    rotate: -18deg;
}

.project-visual-fallback::after {
    width: 90%;
    height: 34%;
    border-color: rgba(255, 243, 109, 0.2);
    rotate: 25deg;
}

.cinema-ticket {
    position: relative;
    z-index: 2;
    width: min(76%, 330px);
    min-height: 172px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    padding: 25px 28px;
    color: #542e00;
    background: #fff3ba;
    border: 4px dashed #542e00;
    box-shadow: 8px 9px 0 rgba(46, 15, 69, 0.6);
    text-align: center;
    rotate: -5deg;
}

.cinema-ticket::before,
.cinema-ticket::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 28px;
    height: 28px;
    background: #b936aa;
    border: 4px solid #542e00;
    border-radius: 50%;
    translate: 0 -50%;
}

.cinema-ticket::before { left: -18px; }
.cinema-ticket::after { right: -18px; }

.cinema-ticket-label,
.cinema-ticket-code {
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.12em;
}

.cinema-ticket strong {
    font-size: clamp(1.75rem, 4vw, 3rem);
    line-height: 1;
}

.cinema-ticket-code {
    font-size: 1rem;
    letter-spacing: 0.3em;
}

.gacha-capsule {
    position: absolute;
    z-index: 1;
    width: 44px;
    height: 44px;
    background: linear-gradient(#fff 0 46%, #542e00 47% 54%, #ffca28 55%);
    border: 3px solid #542e00;
    border-radius: 50%;
    box-shadow: 3px 4px 0 rgba(46, 15, 69, 0.45);
}

.capsule-1 { top: 9%; left: 8%; rotate: -12deg; }
.capsule-2 { top: 12%; right: 8%; rotate: 15deg; scale: 0.8; }
.capsule-3 { bottom: 8%; left: 13%; rotate: 20deg; scale: 0.72; }
.capsule-4 { right: 13%; bottom: 7%; rotate: -24deg; }
.capsule-5 { top: 46%; right: 2%; rotate: 8deg; scale: 0.55; }

.project-copy {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    padding: clamp(24px, 4vw, 38px);
}

.project-kicker {
    margin: 0 0 8px;
    color: #7b2cff;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.09em;
}

.project-copy h2 {
    margin: 0;
    color: #542e00;
    font-size: clamp(2rem, 4.5vw, 3.35rem);
    line-height: 1;
}

.project-description {
    margin: 22px 0 30px;
    font-size: clamp(1rem, 2vw, 1.16rem);
    line-height: 1.55;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
}

.project-link,
.return {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    color: #542e00;
    border: 3px solid #542e00;
    border-radius: 16px 10px 15px 12px;
    box-shadow: 4px 5px 0 #542e00;
    font-weight: bold;
    text-decoration: none;
    transition: translate 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.project-link:hover,
.return:hover {
    box-shadow: 2px 3px 0 #542e00;
    translate: 2px 2px;
}

.project-link-primary {
    color: #fff;
    background: #ff5722;
}

.project-link-primary:hover {
    background: #e64a19;
}

.project-link-secondary {
    background: #fff3ba;
}

.project-link-secondary:hover {
    background: #fff9dc;
}

.return {
    width: fit-content;
    margin: clamp(48px, 7vw, 76px) auto 0;
    background: rgba(255, 255, 255, 0.84);
    rotate: 1deg;
}

.projects-message {
    width: fit-content;
    max-width: 620px;
    margin: 0 auto;
    padding: 16px 20px;
    color: #542e00;
    background: #fff3ba;
    border: 3px solid #542e00;
    border-radius: 16px 10px 15px 12px;
    box-shadow: 4px 5px 0 #542e00;
    font-weight: bold;
    text-align: center;
}

.projects-message-error {
    background: #ffd0bd;
}

/* Transition trou noir */

.vortex-transition {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.vortex-transition::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
}

.vortex-glow,
.vortex-ring,
.vortex-core {
    position: absolute;
    width: 15vmax;
    height: 15vmax;
    border-radius: 50%;
    transform: scale(0);
}

.vortex-glow {
    background: conic-gradient(from 30deg, #fff36d, #ff5722, #7b2cff, #33ccff, #fff36d);
    filter: blur(30px);
    opacity: 0.85;
}

.vortex-ring {
    background: conic-gradient(from 90deg, #fff36d, #ff5722 27%, #7b2cff 58%, #33ccff 78%, #fff36d);
    box-shadow: 0 0 24px #fff36d, 0 0 60px rgba(123, 44, 255, 0.95);
}

.vortex-ring::after {
    content: "";
    position: absolute;
    inset: 18%;
    background: #000;
    border-radius: 50%;
}

.vortex-core {
    width: 11vmax;
    height: 11vmax;
    background: #000;
    box-shadow: inset 0 0 30px rgba(123, 44, 255, 0.35), 0 0 26px rgba(0, 0, 0, 0.95);
}

.is-transitioning {
    overflow: hidden !important;
}

.is-transitioning .banana-cursor {
    opacity: 0;
}

.vortex-leaving .vortex-transition,
.vortex-arriving .vortex-transition,
html[data-vortex-arrival] .vortex-transition {
    opacity: 1;
    visibility: visible;
}

.vortex-leaving .page-scene {
    transform-origin: center center;
    animation: vortexSuck 1.05s cubic-bezier(0.55, 0, 0.9, 0.38) forwards;
}

.vortex-leaving .vortex-transition::before {
    animation: vortexBlackout 1.05s ease-in forwards;
}

.vortex-leaving .vortex-glow {
    animation: vortexGlowIn 1.05s ease-in forwards, vortexSpin 0.48s linear infinite;
}

.vortex-leaving .vortex-ring {
    animation: vortexRingIn 1.05s ease-in forwards, vortexSpin 0.36s linear infinite;
}

.vortex-leaving .vortex-core {
    animation: vortexCoreIn 1.05s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

html[data-vortex-arrival] body {
    background: #000;
    overflow: hidden;
}

html[data-vortex-arrival] .page-scene {
    opacity: 0;
    transform: scale(0.04) rotate(-10deg);
    filter: blur(18px);
}

html[data-vortex-arrival] .vortex-transition::before {
    background: #000;
}

html[data-vortex-arrival] .vortex-core,
html[data-vortex-arrival] .vortex-glow,
html[data-vortex-arrival] .vortex-ring {
    transform: scale(16);
}

.vortex-arriving .page-scene {
    animation: vortexSpit 1.1s cubic-bezier(0.18, 0.78, 0.28, 1) forwards;
}

.vortex-arriving .vortex-transition::before {
    animation: vortexReveal 1.1s ease-out forwards;
}

.vortex-arriving .vortex-glow {
    animation: vortexGlowOut 1.1s ease-out forwards, vortexSpinReverse 0.48s linear infinite;
}

.vortex-arriving .vortex-ring {
    animation: vortexRingOut 1.1s ease-out forwards, vortexSpinReverse 0.36s linear infinite;
}

.vortex-arriving .vortex-core {
    animation: vortexCoreOut 1.1s cubic-bezier(0.1, 0.65, 0.35, 1) forwards;
}

@keyframes vortexSuck {
    0% { opacity: 1; transform: scale(1) rotate(0); filter: blur(0); }
    22% { opacity: 1; transform: scale(1.025) rotate(-0.5deg); filter: blur(0); }
    74% { opacity: 0.8; transform: scale(0.32) rotate(8deg); filter: blur(3px); }
    100% { opacity: 0; transform: scale(0.015) rotate(24deg); filter: blur(16px); }
}

@keyframes vortexBlackout {
    0%, 38% { background: rgba(0, 0, 0, 0); }
    100% { background: #000; }
}

@keyframes vortexGlowIn {
    0% { opacity: 0; transform: scale(0); }
    16% { opacity: 0.9; transform: scale(0.72); }
    72% { opacity: 0.95; transform: scale(1.45); }
    100% { opacity: 0; transform: scale(16); }
}

@keyframes vortexRingIn {
    0% { opacity: 0; transform: scale(0); }
    18% { opacity: 1; transform: scale(0.6); }
    72% { opacity: 1; transform: scale(1.15); }
    100% { opacity: 0; transform: scale(16); }
}

@keyframes vortexCoreIn {
    0% { transform: scale(0); }
    18% { transform: scale(0.55); }
    72% { transform: scale(1); }
    100% { transform: scale(22); }
}

@keyframes vortexSpit {
    0%, 10% { opacity: 0; transform: scale(0.04) rotate(-10deg); filter: blur(18px); }
    64% { opacity: 1; transform: scale(1.045) rotate(1deg); filter: blur(0); }
    82% { transform: scale(0.985) rotate(-0.25deg); }
    100% { opacity: 1; transform: none; filter: none; }
}

@keyframes vortexReveal {
    0%, 32% { background: #000; }
    100% { background: rgba(0, 0, 0, 0); }
}

@keyframes vortexGlowOut {
    0% { opacity: 0; transform: scale(16); }
    34% { opacity: 0.95; transform: scale(1.4); }
    84% { opacity: 0.75; transform: scale(0.5); }
    100% { opacity: 0; transform: scale(0); }
}

@keyframes vortexRingOut {
    0% { opacity: 0; transform: scale(16); }
    32% { opacity: 1; transform: scale(1.2); }
    82% { opacity: 1; transform: scale(0.55); }
    100% { opacity: 0; transform: scale(0); }
}

@keyframes vortexCoreOut {
    0% { transform: scale(22); }
    44% { transform: scale(1); }
    88% { transform: scale(0.45); }
    100% { transform: scale(0); }
}

@keyframes vortexSpin {
    to { rotate: 360deg; }
}

@keyframes vortexSpinReverse {
    to { rotate: -360deg; }
}

.site-content {
    position: relative;
    z-index: 2;
    width: min(100%, 960px);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: calc(92px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    text-align: center;
}

.bouncy-text {
    max-width: 100%;
    margin: 0;
    font-size: clamp(2rem, 7vw, 3.75rem);
    line-height: 1.15;
    font-weight: bold;
    text-shadow: 4px 5px 0 #542e00, 8px 9px 0 rgba(123, 44, 255, 0.38);
    transition: color 0.2s;
    color: white;
    overflow-wrap: anywhere;
}

.bounce-normal {
    animation: projectTitleFloat 2.2s ease-in-out infinite alternate;
}

.bounce-rainbow {
    animation: bounceRave 0.4s ease-in-out infinite alternate, rainbowText 2s infinite;
}

@keyframes bounceRave {
    from { transform: translateY(0); }
    to { transform: translateY(-50px); }
}

@keyframes rainbowText {
    0% { color: red; }
    16% { color: orange; }
    33% { color: yellow; }
    50% { color: limegreen; }
    66% { color: cyan; }
    83% { color: violet; }
    100% { color: red; }
}

.button-container {
    display: flex;
    gap: 20px;
    margin-top: clamp(56px, 12vh, 100px);
}

button {
    min-width: 44px;
    min-height: 44px;
    padding: 15px 20px;
    font-size: 1rem;
    background-color: #ffffffcc;
    border: none;
    border-radius: 12px;
    cursor: none;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background 0.3s, color 0.3s, scale 0.3s;
}

button:hover {
    background-color: #fff;
    scale: 1.05;
}

button:active {
    scale: 0.95;
}

#rave-button,
#sound-toggle {
    color: #542e00;
    background: var(--glass-background);
    border: 3px solid #542e00;
    box-shadow: 4px 5px 0 #542e00, var(--glass-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: translate 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

#rave-button {
    border-radius: 16px 10px 15px 12px;
}

#rave-button:hover,
#sound-toggle:hover {
    background: var(--glass-background);
    box-shadow: 2px 3px 0 #542e00, var(--glass-shadow);
    scale: 1;
    translate: 2px 2px;
}

#rave-button:active,
#sound-toggle:active {
    box-shadow: 1px 1px 0 #542e00, var(--glass-shadow);
    scale: 1;
    translate: 3px 4px;
}

.sound-toggle {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 10;
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 46% 54% 43% 57% / 55% 44% 56% 45%;
    font-size: 1.35rem;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease, filter 0.2s, scale 0.3s;
}

.site-entered .sound-toggle {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.start-button {
    padding: 20px 30px;
    font-size: 1.5rem;
    color: #fff;
    background-color: #ff5722;
    border: none;
    border-radius: 8px;
    cursor: none;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2), 0 0 10px #ff5722, 0 0 20px #ff5722, 0 0 30px #ff5722;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s, scale 0.3s;
}

.start-button:hover {
    background-color: #e64a19;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2), 0 0 15px #e64a19, 0 0 25px #e64a19, 0 0 35px #e64a19;
    scale: 1.05;
}

.start-button:active {
    scale: 0.95;
}


.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: red;
    opacity: 0.8;
    animation: fall 3s linear forwards;
    z-index: 1;
}

@keyframes fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.banana-cursor {
    position: fixed;
    width: 64px;
    height: 64px;
    background: url(../assets/images/curseur-banane.png) no-repeat center center;
    background-size: contain;
    pointer-events: none;
    z-index: 9999;
    rotate: -15deg;
}

.star {
    position: fixed;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    opacity: 0.7;
    animation: twinkle 2s infinite ease-in-out;
    z-index: 0;
}

@keyframes twinkle {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.5); opacity: 1; }
}

.particle {
    position: fixed;
    border-radius: 50%;
    opacity: 0.6;
    z-index: 0;
    animation: float 10s linear infinite;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-100vh) scale(0.5) rotate(360deg); }
}

.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: calc(20px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    background-color: #000000ee; /* Fond sombre */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Au-dessus de tout */
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.intro-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 760px) {
    .projects-content {
        padding-right: max(18px, env(safe-area-inset-right));
        padding-left: max(18px, env(safe-area-inset-left));
    }

    .projects-grid { gap: 32px; }

    .project-card {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(270px, auto) auto;
    }

    .project-visual {
        min-height: 300px;
        border-right: 0;
        border-bottom: 4px solid #542e00;
    }
}

@media (max-width: 600px) {
    .site-header {
        gap: 8px;
        top: calc(8px + env(safe-area-inset-top));
        left: max(9px, env(safe-area-inset-left));
        right: max(9px, env(safe-area-inset-right));
        padding: 7px 9px;
        box-shadow: 3px 4px 0 #542e00, var(--glass-shadow);
    }

    .site-brand {
        font-size: clamp(0.82rem, 4vw, 1rem);
    }

    .site-nav {
        gap: 2px;
    }

    .site-nav a {
        padding-inline: clamp(7px, 2.5vw, 10px);
        font-size: clamp(0.78rem, 3.8vw, 0.95rem);
    }

    .site-content {
        padding-top: calc(82px + env(safe-area-inset-top));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-left: max(20px, env(safe-area-inset-left));
    }

    .bouncy-text {
        font-size: clamp(1.8rem, 10vw, 2.75rem);
    }

    .button-container {
        margin-top: clamp(48px, 10vh, 72px);
    }

    button {
        min-height: 48px;
        padding: 14px 18px;
    }

    .sound-toggle {
        right: max(16px, env(safe-area-inset-right));
        bottom: max(16px, env(safe-area-inset-bottom));
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        padding: 0;
    }

    .projects-content {
        padding-top: calc(98px + env(safe-area-inset-top));
        padding-right: max(18px, env(safe-area-inset-right));
        padding-left: max(18px, env(safe-area-inset-left));
    }

    .projects-hero {
        margin-bottom: 38px;
    }

    .projects-hero h1,
    .bouncy-text {
        text-shadow: 3px 4px 0 #542e00, 6px 7px 0 rgba(123, 44, 255, 0.38);
    }

    .projects-hero h1 {
        font-size: clamp(2.55rem, 14vw, 4.2rem);
    }

    .projects-grid { gap: 32px; }

    .project-card {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(250px, auto) auto;
        box-shadow: 7px 9px 0 rgba(84, 46, 0, 0.9), 0 18px 30px rgba(84, 46, 0, 0.16);
    }

    .project-visual {
        min-height: 270px;
        border-right: 0;
        border-bottom: 4px solid #542e00;
    }

    .project-copy {
        padding: 25px 22px 29px;
    }

    .project-actions {
        width: 100%;
    }

    .project-link {
        flex: 1 1 150px;
    }

    .cinema-ticket {
        min-height: 150px;
    }
}

@media (max-width: 600px), (hover: none), (pointer: coarse) {
    body,
    button,
    a {
        cursor: auto;
    }

    .banana-cursor {
        display: none;
    }

    button:hover,
    .start-button:hover,
    .site-nav a:hover,
    .project-card:hover,
    .project-card:focus-within {
        transform: none;
        scale: 1;
        translate: none;
    }

    button:active {
        scale: 0.97;
    }

    #rave-button:hover,
    #sound-toggle:hover,
    #sound-toggle:active {
        translate: none;
    }

    #rave-button:hover {
        box-shadow: 4px 5px 0 #542e00, var(--glass-shadow);
        translate: none;
    }

    #rave-button:active,
    #sound-toggle:active {
        box-shadow: 2px 3px 0 #542e00, var(--glass-shadow);
        translate: 2px 2px;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .site-content {
        padding-top: calc(70px + env(safe-area-inset-top));
    }

    .button-container {
        margin-top: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .bouncy-text,
    .site-header,
    .projects-hero h1,
    .project-card {
        transform: none;
        rotate: 0deg;
    }

    .project-card {
        transition: none;
    }

    .vortex-leaving .page-scene {
        animation-name: reducedMotionExit;
    }

    .vortex-arriving .page-scene {
        animation-name: reducedMotionArrival;
    }

    .vortex-glow,
    .vortex-ring {
        display: none;
    }

}

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

@keyframes reducedMotionArrival {
    from { opacity: 0; }
    to { opacity: 1; transform: none; filter: none; }
}
