:root {
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    --color-black: #000000;
    --color-gray-dark: #323232;
    --color-gray-med: #777777;
    --color-gray-light: #B2B2B2;
    --color-gray-xlight: #D9D9D9;
    --color-bg: #FFFFFF;
    --color-player-bg: #101218;
    --page-padding: 8vw; 
    /* Cor de fundo do card bem clarinha para o modo padrão (Light) */
    --color-card-bg: #F2F2F7; 
    --color-card-border: rgba(0, 0, 0, 0.05);
    
    /* PAINEL DE CONTROLE DE VELOCIDADE */
    --speed-fast: 0.2s; /* Para hovers, cliques e botões */
    --speed-main: 1s; /* Para transições de tela, fundos e slides */
    
    /* PAINEL DE CONTROLE DO DEVICE */
    --device-aspect-ratio: 1 / 2.03; /* Proporção padrão do iPhone */
    
    /* Alturas para cada tela (Ajuste aqui para aumentar/diminuir) */
    --device-h-gallery: 60vh;  /* Home */
    --device-h-case: 75vh;     /* Detalhes do Case */
    --device-h-player: 85vh;   /* Player de Vídeo */

    /* Limites máximos (para telas muito grandes não ficarem gigantes) */
    --device-max-h-gallery: 600px;
    --device-max-h-case: 700px;
    --device-max-h-player: 800px;
    
    --device-w-ratio: -0.4926; /* 👈 Nova linha */
}



/* --- VARIAÇÕES DE DEVICES --- */

/* iPhone 17 (Super Pro Max) */
.iphone-17 {
    --device-aspect-ratio: 1 / 2.15; 
    --device-h-gallery: 62vh;
    /* AJUSTE FINO: Diminuímos a largura e altura para caber dentro da borda */
    --screen-w: 91%;  /* Era 91.5% */
    --screen-h: 92%;  /* Era 96% */
    --screen-r: 10%;  /* Canto arredondado ajustado */
    --device-offset-y: 12px; /* 👈 Ajuste fino */
    
    --device-w-ratio: -0.4651; /* 👈 Nova linha */
}

/* Apple Watch - Proporção Fina para Gallery e Case View */
.apple-watch {
    --device-aspect-ratio: 1 / 1.6;
    --device-h-gallery: 35vh;      
    --device-h-case: 50vh;         
    --screen-w: 74%;  /* O vídeo fica dentro do 'corpo' do relógio */
    --screen-h: 46%;  
    --screen-r: 18%; 
    --device-offset-y: 30px;
    
    --device-w-ratio: -0.625; /* 👈 Nova linha */
}

/* Apple Watch - Quadrado apenas no Player */
.player-wrapper.apple-watch {
    --device-aspect-ratio: 1 / 1.6; 
    --device-h-player: 70vh;      
    --screen-w: 88%; 
    --screen-h: 88%;
    --screen-r: 22%;
}



/* iPhone 12 */
.iphone-12 {
    --device-aspect-ratio: 1 / 2.1;
    --device-h-gallery: 58vh;
    --screen-w: 105%;  /* Era 89% */
    --screen-h: 100%;  /* Era 95% */
    --screen-r: 9%;
    --device-offset-y: 15px; /* 👈 Valor negativo desce o aparelho */
    
    --device-w-ratio: -0.4761; /* 👈 Nova linha */
}


/* iPhone X */
.iphone-x {
    --device-aspect-ratio: 1 / 2.1;
    --device-h-gallery: 55vh;
    --screen-w: 87%;  /* Era 89% */
    --screen-h: 92%;  /* Era 95% */
    --screen-r: 9%;
    --device-offset-y: 8px; /* 👈 Valor negativo desce o aparelho */
    
    --device-w-ratio: -0.4761; /* 👈 Nova linha */
}

/* iPhone 8 */
.iphone-8 {
    --device-aspect-ratio: 1 / 1.8; 
    --device-h-gallery: 49vh;       
    --device-h-case: 70vh;
    --screen-w: 83%;  /* Era 85% */
    --screen-h: 72%;  /* Era 74% */
    --screen-r: 1%; 
    --device-offset-y: 23px;
    
    --device-w-ratio: -0.5555; /* 👈 Nova linha */
}



/* --- NOVA CLASSE PARA A THUMBNAIL ESTÁTICA --- */
.case-thumb-img {
    width: 100%; 
    height: 100%; 
    position: absolute; 
    left: 0;
    top: 0;
    object-fit: contain;
    object-position: center; /* Garante o alinhamento perfeito com o frame */
    z-index: 1; /* Fica logo atrás da phone-frame-overlay (z-index: 2) */
    pointer-events: none;
}

/* ========================================= */
/* RESET & GLOBAL
/* ========================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-black);
    overflow: hidden; 
    height: 100vh;
    width: 100vw;
    transition: background-color 0.4s ease;
    
    /* BLOQUEIOS ANTI-CÓPIA */
    user-select: none; 
    -webkit-user-select: none;
    -webkit-touch-callout: none; 
}

.nav-link { 
    cursor: pointer; 
    transition: color 0.2s ease; 
    text-decoration: none;
}

.nav-link:hover { 
    color: var(--color-black); 
}

body.player-active { background-color: var(--color-player-bg); }

/* Tipografia */
h1 { font-weight: 500; font-size: 32px; letter-spacing: -0.04em; line-height: 0.8; color: var(--color-black); }
h2 { font-weight: 600; font-size: 38px; letter-spacing: -0.02em; line-height: 1.0; color: var(--color-black); }
h3 { font-weight: 600; font-size: 20px; letter-spacing: -0.02em; line-height: 1.0; color: var(--color-black); }
h4 { font-weight: 400; font-size: 19px; letter-spacing: -0.04em; line-height: 0.8; color: var(--color-gray-med); }
.p1 { font-weight: 400; font-size: 18px; letter-spacing: -0.02em; line-height: 1.1; color: var(--color-black); }
.p2 { font-weight: 400; font-size: 17px; letter-spacing: -0.02em; line-height: 0.8; color: var(--color-gray-light); }
.p3 { font-weight: 500; font-size: 13px; letter-spacing: 0em; line-height: 1.0; color: var(--color-gray-xlight); text-decoration: none;}

/* ========================================= */
/* BARRA DE PROGRESSO DO PLAYER
/* ========================================= */

#progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

body.player-active #progress-container {
    opacity: 1;
    visibility: visible;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, rgba(79, 172, 254, 0.8) 0%, rgba(0, 242, 254, 1) 100%);
    position: relative;
    transition: width 0.1s linear;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

#progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    filter: blur(2px);
}

/* ========================================= */
/* LAYOUT BASE & NAVEGAÇÃO
/* ========================================= */

#app-container {
    width: 100vw;
    padding: 15vh 0 60px; 
    height: 100vh;
    display: flex; flex-direction: column;
    position: relative;
}

header {
    width: 100%; max-width: 1440px; margin: 0 auto 50px auto;
    padding: 0 var(--page-padding);
    display: flex; justify-content: space-between; align-items: center;
    z-index: 10; transition: opacity 0.1s ease;
    view-transition-name: main-header-view; 
}

.header-right { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.header-left h1 { margin-bottom: 12px; }

header.hidden-header { 
    opacity: 0; 
    pointer-events: none; 
    visibility: hidden; /* 👈 Adicione isso para remover do TAB */
}

/* BOTÕES FLUTUANTES */
.floating-back-btn {
    position: fixed;
    top: 50px; 
    left: max(4vw, calc((100vw - 1440px) / 2 + 4vw)); 
    width: 44px; height: 44px; 
    display: flex; justify-content: flex-start; align-items: center;
    cursor: pointer;
    z-index: 1000; 
    transition: opacity 0.3s ease, transform 0.2s ease;
    view-transition-name: back-btn-view;
}

.floating-back-btn:active { transform: scale(0.9); }
.floating-back-btn.hidden { opacity: 0; pointer-events: none; }
body.player-active .floating-back-btn svg path { fill: white; }

/* Garante que o ícone de voltar siga as variáveis de cor do tema */
.floating-back-btn svg path {
    fill: var(--color-black);
    transition: fill 0.3s ease;
}

.floating-a11y-btn {
    position: fixed;
    top: 30px; 
    right: 40px; 
    width: 25px; height: 25px; 
    display: flex; justify-content: flex-end; align-items: center;
    background: none; border: none; cursor: pointer;
    z-index: 1000; 
    color: #2B71F0; 
    transition: color 0.3s ease, transform 0.2s ease;
}

.floating-a11y-btn:active { transform: scale(0.9); }
body.player-active .floating-a11y-btn,
html.a11y-dark-mode .floating-a11y-btn { color: #FFFFFF; }

html, body {
    /* Desativa o double-tap zoom, mas mantém o pinch-to-zoom (pinça) e o scroll */
    touch-action: manipulation;
}

/* Aplique também em elementos interativos específicos se necessário */
button, a, .nav-link, .case-thumb-wrapper {
    touch-action: manipulation;
}


/* ========================================= */
/* VIEWS
/* ========================================= */

.view-section { flex-grow: 1; display: none; height: 100%; position: relative; }
.view-section.active { 
    display: block;
}

/* --- HOME GALERIA --- */
#view-home.active { display: flex; flex-direction: column; justify-content: center; }

.gallery-container {
    display: flex; 
    gap: 140px; 
    overflow-x: auto; 
    overflow-y: hidden; 
    align-items: flex-end; /* Alinha pela base */
    height: 75vh;          /* Acomoda todos os aparelhos confortavelmente */
    padding-bottom: 95px;  /* Respiro do fundo */
    width: 100vw;
    cursor: grab;
    scrollbar-width: none;
}

.gallery-container::-webkit-scrollbar { display: none; }
.gallery-container:active { cursor: grabbing; }

.gallery-container.dragging,
.gallery-container.dragging * { cursor: grabbing !important; }

.gallery-container, 
.case-slider-container {
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.gallery-container.dragging,
.case-slider-container.dragging { transition: none !important; }

/* RESPIRO VISUAL NA HOME */
.gallery-container::after {
    content: "";
    display: block;
    width: max(4vw, calc((100vw - 1440px) / 2 + 2vw));
    flex-shrink: 0;
    height: 1px;
}
.case-thumb-wrapper:last-child { margin-right: 0 !important; }

/* --- DEVICE COMPONENT (VÍDEO + FRAME) --- */

.case-thumb-wrapper {
    flex: 0 0 auto;  
    height: var(--device-h-gallery);  
    max-height: var(--device-max-h-gallery);
    aspect-ratio: var(--device-aspect-ratio);  
    position: relative;
    transition: transform 0.2s ease;
    cursor: pointer;
    display: block; 
    /* 👇 NOVA LINHA: Adicione isso no final da classe */
    margin-bottom: var(--device-offset-y, 0px);
}

.case-thumb-wrapper:active { transform: scale(0.98); }
.case-thumb-wrapper:first-child { margin-left: max(var(--page-padding), calc((100vw - 1440px) / 2 + var(--page-padding))); }

/* 1. A CASCA (Frame PNG) */
.phone-frame-overlay {
    width: 100%; 
    height: 100%; 
    position: absolute; 
    left: 0;
    top: 0;
    object-fit: contain;
    object-position: center; /* Garante que o mockup fique perfeitamente no centro da caixa */
    pointer-events: none;
    user-select: none; 
    -webkit-user-drag: none;
    z-index: 2; /* Sempre por cima */
}

/* 2. O VÍDEO (A Tela) */
.case-thumb-video {
    position: absolute; 
    z-index: 1; /* Fica atrás da casca */
    
    /* Centraliza perfeitamente no meio geométrico da caixa */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) !important; 
    
    /* Puxa as variáveis para ter o tamanho exato do "buraco" transparente */
    width: var(--screen-w, 90%);
    height: var(--screen-h, 95%);
    border-radius: var(--screen-r, 10%); 
    
    object-fit: cover; /* Preenche a área do vidro sem amassar o vídeo */
    pointer-events: none;
}



/* Animação Contínua */
.active-morph-element { view-transition-name: case-media-view; }


/* --- VIEW: ABOUT --- */
#view-about.active {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    display: flex; justify-content: center; align-items: center;
    background-color: var(--color-bg); 
    z-index: 20; 
}

.about-layout { 
    display: flex; gap: 100px; 
    align-items: center; justify-content: center; 
    padding: 0 var(--page-padding);
    height: 100%;
    max-width: 1280px; margin: 0 auto;
}

#view-about .about-content { max-width: 450px; }
#view-about .p1 { margin-bottom: 24px; }
.about-links { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }

.about-image-container {
    flex: 0 0 auto; width: 402px; height: 279px; overflow: hidden; 
}

#about-photo { height: 100%; width: 100%; object-fit: cover; }


/* --- VIEW: CASE DETAIL (Slider) --- */

/* Layout Editorial do Case View */
#view-case .case-layout {
    max-width: 1300px; /* Alargado conforme solicitado */
    gap: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--page-padding); /* 👈 Faltava isso */
    height: 100%; /* 👈 Faltava isso */
    width: 100%; /* 👈 Faltava isso */
    margin: 0 auto; /* 👈 Faltava isso */
}

.case-info-container {
    flex: 1;
    max-width: 700px;
    height: 92vh;
    position: relative;
}

.case-year-label {
    font-weight: 600;
    font-size: 13px; /* Diminuí um pouco para compensar o All Caps, que "enche" mais o olho */
    color: var(--color-gray-med);
    margin-bottom: 8px;
    display: block;
    
    /* AS NOVAS REGRAS */
    text-transform: uppercase; 
    letter-spacing: 0.06em; /* Dá aquele aspecto chique de tipografia suíça/Apple */
}

/* Efeito Cortina de Gradiente Superior e Inferior */
.case-info-container::before,
.case-info-container::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 100px;
    z-index: 10;
    pointer-events: none;
}

.case-info-container::before {
    top: -5px;
    background: linear-gradient(to bottom, var(--color-bg) 20%, transparent 100%);
} 

.case-info-container::after {
    bottom: -5px;
    background: linear-gradient(to top, var(--color-bg) 20%, transparent 100%);
}

.case-info-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 80px 0; 
    scrollbar-width: none;
    overscroll-behavior: contain; /* 👈 NOVO: Evita que rolar o texto role o slider junto */
    pointer-events: auto; /* 👈 NOVO: Garante que o mouse interaja com o texto */
}
.case-info-scroll::-webkit-scrollbar { display: none; }

/* Botão Play Estilo Pill */
.btn-play-pill {
    display: inline-flex;
    align-self: flex-start !important;
    align-items: center;
    gap: 12px;
    background: var(--color-black);
    color: var(--color-bg);
    border: none;
    padding: 8px 16px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
   margin-top: 16px !important;       /* Distância entre o Título e o Botão */
    margin-left: 0 !important;
    margin-bottom: 0 !important;
    transform-origin: left center; 
    transition: transform 0.2s ease;
}
.btn-play-pill:hover { transform: scale(1.05); }

/* Créditos e Tipografia Editorial */
.case-credits-horizontal { 
    font-size: 16px; 
    font-weight: 600;
    color: var(--color-gray-med); 
    margin-top: 2px; /* 👈 4. NOVO: Garante distância do título quando NÃO houver botão */
    margin-bottom: 8px; 
    line-height: 1.5;
}
/* Tipografia Editorial dentro do case */
.case-description-body h3 { 
    font-size: 20px; /* Ou 18px, como preferir */
    font-weight: 600;
    color: var(--color-black);
    margin: 40px 0 12px 0; /* Dá um espaço maior em cima do título para separar os parágrafos */
    line-height: 1.2;
}
/* Texto principal do case (Desktop) */
.case-description-body .p1 {
    font-size: 17px; /* 👈 Aumente para 19px ou 20px se quiser mais legibilidade */
    line-height: 1.6; /* Um espaçamento entre linhas maior ajuda na leitura de textos longos */
    margin-bottom: 24px;
    color: var(--color-black);
    opacity: 0.9;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    #view-case.active { overflow-y: auto !important; }
    .case-layout { flex-direction: column; height: auto; padding-top: 15vh; }
    .case-info-container { height: auto; max-width: 100%; }
    .case-info-scroll { overflow: visible; padding: 0; }
    .case-info-container::before, .case-info-container::after { display: none; }
}



/* --- ALINHAMENTO DO CABEÇALHO DO CASE --- */
.case-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Alinha o botão pela base do título */
    gap: 32px;
    margin-bottom: 24px;
}

.case-title-block {
    display: flex;
    flex-direction: column;
}


/* --- AJUSTE RESPONSIVO (MOBILE) --- */
@media (max-width: 768px) {
    .case-header-row {
        flex-direction: column;
        align-items: center; /* Volta a centralizar no mobile */
        text-align: center;
        gap: 16px;
    }
}




/* ========================================= */
/* ASSETS EDITORIAIS (IMAGENS E CÓDIGO) NO CASE
/* ========================================= */

/* O agrupador geral (Caixa + Legenda) */
.case-asset-wrapper {
    margin: 40px 0; /* Espaço de respiro antes e depois do bloco */
    display: flex;
    flex-direction: column;
    gap: 12px; /* Distância entre a caixa cinza e o texto da legenda */
}

/* A caixa com fundo cinza que serve para ambos */
.case-asset-box {
    background-color: #F2F2F7; /* Cinza super claro, padrão Apple */
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    overflow-x: auto; /* Permite scroll horizontal se o código for muito longo no mobile */
    scrollbar-width: none;
}
.case-asset-box::-webkit-scrollbar { display: none; }

/* Classe extra apenas para imagens (para centralizar) */
.case-asset-box.is-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Comportamento da Imagem dentro da caixa */
.case-asset-box img {
    max-width: 100%;
    max-height: 55vh; /* Evita que a imagem ocupe mais que a tela inteira */
    object-fit: contain;
    display: block;
}

/* Comportamento do Código (Fonte Monospace) */
.case-asset-box pre {
    margin: 0;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-black); /* Usa a variável para ficar branco no Dark Mode */
}

/* O texto da legenda */
.case-caption {
    font-size: 15px;
    color: var(--color-gray-med);
    line-height: 1.4;
    margin: 0;
}

/* --- SUPORTE A ACESSIBILIDADE --- */
/* Deixa a caixa escura no Dark Mode */
html.a11y-dark-mode .case-asset-box {
    background-color: #1C1C1E; /* Cinza bem escuro para não ofuscar */
}
/* Deixa a caixa com borda no Alto Contraste */
html.a11y-high-contrast .case-asset-box {
    background-color: transparent;
    border: 2px solid white;
}


#view-case.active {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: var(--color-bg); z-index: 20; 
}

.case-slider-container {
    display: flex; width: 100vw; height: 100vh;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; scroll-behavior: smooth; 
    scrollbar-width: none; cursor: grab;
}
.case-slider-container::-webkit-scrollbar { display: none; }

.case-slider-container.dragging { 
    scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; 
}

.case-slide-wrapper {
    flex: 0 0 100vw; width: 100vw; height: 100vh;
    display: flex; justify-content: center; align-items: center;
    scroll-snap-align: center; scroll-snap-stop: always;
    position: relative; /* 👈 ADICIONE ISSO AQUI */
}

.slider-dots-container {
    position: absolute; bottom: 40px; left: 50%;
    transform: translateX(-50%); display: flex; gap: 12px; z-index: 30; 
}

.slider-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background-color: var(--color-gray-xlight); 
    transition: background-color 0.3s ease, transform 0.2s ease; cursor: pointer;
}

.slider-dot.active {
    background-color: var(--color-gray-dark); transform: scale(1.2); 
}

.case-media {
    height: var(--device-h-case); max-height: var(--device-max-h-case);
    aspect-ratio: var(--device-aspect-ratio); position: relative;
}

.case-info { display: flex; flex-direction: column; gap: 32px; max-width: 250px; }
.info-block { display: flex; flex-direction: column; gap: 8px; }
#case-credits { display: flex; flex-direction: column; gap: 16px; }


/* --- PLAYER VIEW --- */
.player-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    display: flex; justify-content: center; align-items: center; z-index: 100;
}
.player-overlay.hidden { display: none; }

.player-wrapper {
    position: relative; height: var(--device-h-player); max-height: var(--device-max-h-player);
    aspect-ratio: var(--device-aspect-ratio);
}

/* O Player agora usa a mesma inteligência geométrica dos outros vídeos */
#main-video { 
    position: absolute;
    z-index: 1; /* Fica atrás da casca */
    
    /* Centralização absoluta */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    
    /* Puxa o tamanho exato de cada aparelho */
    width: var(--screen-w, 90%); 
    height: var(--screen-h, 95%); 
    border-radius: var(--screen-r, 10%); 
    
    object-fit: cover; 
    transition: opacity 0.4s ease; 
}

.player-controls {
    position: absolute; right: -70px; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 20px; opacity: 1; transition: opacity 0.4s ease;
}
.player-controls.fade-out { opacity: 0; pointer-events: none; }
.icon-btn { background: none; border: none; cursor: pointer; width: 33px; height: 33px; }
.icon-btn span.hidden { display: none; }


/* --- LOADING INDICATOR --- */
.video-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5; /* Fica acima do vídeo, mas abaixo do frame do celular */
    width: 50px;
    height: 50px;
    background-color: white; /* Mesma cor dos seus botões */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: black; /* Cor do spinner interno */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    pointer-events: none; /* Não atrapalha cliques no player */
    transition: opacity 0.3s ease;
}

.video-loader.hidden {
    opacity: 0;
    display: none; /* O JS vai alternar entre flex e none */
}

.spinner {
    width: 25px;
    height: 25px;
    animation: rotate 1s linear infinite;
}

.spinner circle {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}


/* --- LOADING INDICATOR --- */
.video-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5; /* Fica acima do vídeo, mas abaixo do frame do celular */
    width: 50px;
    height: 50px;
    background-color: white; /* Mesma cor dos seus botões */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: black; /* Cor do spinner interno */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    pointer-events: none; /* Não atrapalha cliques no player */
    transition: opacity 0.3s ease;
}

.video-loader.hidden {
    opacity: 0;
    display: none; /* O JS vai alternar entre flex e none */
}

.spinner {
    width: 25px;
    height: 25px;
    animation: rotate 1s linear infinite;
}

.spinner circle {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}




/* --- ESTILO DO BOTÃO CC (IDÊNTICO AOS OUTROS) --- */

#btn-cc {
    transition: transform 0.2s ease;
}


/* Regras de Acessibilidade para os SVGs do Player e demais itens*/
/* Quando o Alto Contraste ou Dark Mode estiverem ativos, usamos as variáveis */

/* Para o Dark Mode */
html.a11y-dark-mode .case-thumb-wrapper:focus-visible {
    outline-color: var(--color-bg); 
}

/* Para o Alto Contraste (se quiser uma cor específica, como amarelo ou branco puro) */
html.a11y-high-contrast .case-thumb-wrapper:focus-visible {
    outline-color: #FFFFFF; 
    outline-width: 4px; /* Alto contraste geralmente pede bordas mais grossas */
}

html.a11y-high-contrast .a11y-circle-fill,
html.a11y-dark-mode .a11y-circle-fill {
    fill: var(--color-black) !important;
}

html.a11y-high-contrast .a11y-text-fill,
html.a11y-dark-mode .a11y-text-fill {
    fill: var(--color-bg) !important;
}

html.a11y-high-contrast .a11y-stroke,
html.a11y-dark-mode .a11y-stroke {
    stroke: var(--color-black) !important;
}

html.a11y-high-contrast .a11y-text-stroke,
html.a11y-dark-mode .a11y-text-stroke {
    fill: var(--color-black) !important;
}

/* Legendas */
/* 1. Mantemos o cue nativo escondido */
video::cue {
    visibility: hidden;
}

/* 2. Aplicamos o SEU estilo original ao novo container */
.custom-subtitle {
    position: absolute;
    bottom: 110px; /* Posiciona logo acima do footer, como na sua captura de tela */
    left: 50%;
    transform: translateX(-50%);
    z-index: 110;
    pointer-events: none;
    display: none; 
    text-align: center;
    max-width: 85vw;
    width: fit-content; /* Faz o fundo cinza "abraçar" o texto */

    /* COPIADO EXATAMENTE DO SEU ::CUE ORIGINAL */
    background-color: var(--color-gray-dark); 
    color: var(--color-bg); 
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    font-size: 18px; 
    letter-spacing: -0.02em; 
    line-height: 1.0; 
    padding: 4px 6px;
    
    /* Opcional: um leve arredondamento para combinar com o estilo Apple */
    border-radius: 2px; 
}

/* Ajuste para não sumir no mobile */
@media (max-width: 768px) {
    .custom-subtitle {
        bottom: 90px;
        font-size: 16px;
    }
}


/* Footer Fixo */
footer { 
    position: fixed; bottom: 20px; left: 0; width: 100%; 
    text-align: center; pointer-events: none; transition: opacity 0.4s ease; view-transition-name: footer-view;
}
footer p { font-size: 12px; color: var(--color-gray-light); letter-spacing: 0; padding: 0 var(--page-padding); }


/* ========================================= */
/* ACESSIBILIDADE
/* ========================================= */

.a11y-backdrop {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; opacity: 1; transition: opacity 0.3s ease;
}

.a11y-backdrop.hidden { 
    opacity: 0; 
    pointer-events: none; 
    visibility: hidden; /* Isso impede o Tab de entrar na modal fechada */
}

.a11y-modal {
    background: var(--color-bg); width: 90%; max-width: 400px;
    border-radius: 24px; padding: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}
/* Correção da cor do botão Fechar e Títulos na Modal */
.a11y-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-gray-xlight);
    padding-bottom: 16px;
    color: var(--color-black); /* Garante que o texto herde a cor variável */
}

/* Força o botão de fechar a usar a cor do tema atual */
#btn-close-a11y {
    color: var(--color-black) !important;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#btn-close-a11y:hover {
    opacity: 1;
}

/* Ajuste no seletor de Alto Contraste para garantir visibilidade */
html.a11y-high-contrast .a11y-modal {
    border: 3px solid white;
}
.a11y-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; font-size: 16px; font-weight: 500;}

.toggle-label { cursor: pointer; }
/* Esconde o input visualmente com a técnica padrão de acessibilidade (sr-only) */
.toggle-label input { 
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Anel de foco no Switch do iOS */
.toggle-label input:focus-visible + .ios-switch {
    outline: 3px solid #2B71F0;
    outline-offset: 4px;
    border-radius: 30px;
}

/* Adicionamos anéis de foco visíveis para os botões "A / A+" e "Fechar" também! */
.lang-btn:focus-visible,
#btn-close-a11y:focus-visible {
    outline: 3px solid #2B71F0;
    outline-offset: 2px;
    border-radius: 6px;
}
.ios-switch {
    width: 50px; height: 30px; background: var(--color-gray-xlight); border-radius: 30px;
    position: relative; transition: background 0.3s ease;
}
.ios-switch::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px;
    background: #fff; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.toggle-label input:checked + .ios-switch { background: #34C759; }
.toggle-label input:checked + .ios-switch::after { transform: translateX(20px); }

.toggle-group { display: flex; background: var(--color-gray-xlight); border-radius: 8px; padding: 2px; }
.lang-btn {
    border: none; background: transparent; padding: 6px 16px; border-radius: 6px;
    cursor: pointer; font-family: inherit; font-weight: 600; color: var(--color-gray-med); transition: all 0.2s;
}
.lang-btn.active { background: var(--color-bg); color: var(--color-black); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* Regras de Acessibilidade Ativadas */
html.a11y-dark-mode {
    --color-bg: var(--color-player-bg); --color-black: #FFFFFF;
    --color-gray-dark: #F5F5F5; --color-gray-med: #B2B2B2;
}
html.a11y-dark-mode .ios-switch::after { background: var(--color-player-bg); }

html.a11y-high-contrast {
    --color-bg: #000000; --color-black: #FFFFFF; --color-gray-dark: #FFFFFF;
    --color-gray-med: #FFFFFF; --color-gray-light: #FFFFFF; --color-gray-xlight: #555555;
}
html.a11y-high-contrast .a11y-modal { border: 2px solid white; }

html.a11y-large-text h1 { font-size: 38px; }
html.a11y-large-text h2 { font-size: 34px; }
html.a11y-large-text h3 { font-size: 24px; }
html.a11y-large-text .p1 { font-size: 22px; }
html.a11y-large-text .p2 { font-size: 20px; }

/* Detecção da legenda na Acessibilidade */
html.a11y-large-text .custom-subtitle { 
    font-size: 24px !important; 
    line-height: 1.2;
}

html.a11y-dyslexia * {
    font-family: "Comic Sans MS", "Comic Sans", cursive, sans-serif !important;
    letter-spacing: 0.05em !important; word-spacing: 0.1em !important;
}

html.a11y-focus-mode *:focus-visible {
    outline: 4px solid #2B71F0 !important; outline-offset: 4px !important; border-radius: 4px;
}

html.a11y-reduce-motion * {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
}

/* Força a remoção imediata da transição nos componentes do Switch e da Modal */
html.a11y-reduce-motion .ios-switch,
html.a11y-reduce-motion .ios-switch::after,
html.a11y-reduce-motion .a11y-backdrop,
html.a11y-reduce-motion .a11y-modal {
    transition: none !important;
    animation: none !important;
}


html.a11y-reduce-motion .view-section.active { opacity: 1 !important; }


/* ========================================= */
/* EFEITO DE ELEVADOR (VIEW TRANSITIONS)
/* ========================================= */

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.7s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

html.slide-up-transition ::view-transition-old(root) { animation-name: fadeOutUp; }
html.slide-up-transition ::view-transition-new(root) { animation-name: fadeInFromBottom; }

html.slide-down-transition ::view-transition-old(root) { animation-name: fadeOutDown; }
html.slide-down-transition ::view-transition-new(root) { animation-name: fadeInFromTop; }

@keyframes fadeOutUp { to { transform: translateY(-10%); opacity: 0; } }
@keyframes fadeInFromBottom { from { transform: translateY(15%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@keyframes fadeOutDown { to { transform: translateY(15%); opacity: 0; } }
@keyframes fadeInFromTop { from { transform: translateY(-10%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }





/* ========================================= */
/* ÍNDICE FLUTUANTE (TABLE OF CONTENTS)
/* ========================================= */

.case-toc {
    position: absolute;
    right: 3vw; 
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Mantém os traços alinhados à direita */
    gap: 12px;
    z-index: 50;
    padding: 24px 16px;
    border-radius: 16px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* O fundo e a sombra só aparecem no hover */
.case-toc:hover {
    background-color: var(--color-bg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.06); 
}

.toc-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.toc-item:hover, 
.toc-item.active {
    opacity: 1;
}

/* O traço (Dash) */
.toc-dash {
    width: 10px;
    height: 2px;
    background-color: var(--color-gray-med);
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

/* Traço ativo fica mais largo e escuro */
.toc-item.active .toc-dash {
    background-color: var(--color-black);
    width: 18px; 
}

/* O truque da Cortina para quebra de linha suave */
.toc-text-wrapper {
    direction: rtl; /* O SEGREDO: Faz a máscara abrir da direita pra esquerda */
    max-width: 0px;
    overflow: hidden;
    transition: max-width 0.3s ease;
}

.case-toc:hover .toc-text-wrapper {
    max-width: 250px; /* Abre a "cortina" revelando o texto */
}

.toc-text {
    direction: ltr; /* Volta o texto pra português normal */
    font-size: 13px;
    font-weight: 500;
    color: var(--color-gray-dark);
    line-height: 1.3;
    text-align: right;
    white-space: normal; /* PERMITE A QUEBRA DE LINHA */
    width: 200px; /* Trava a largura para formatar o texto perfeitamente */
    padding-right: 12px; /* Distância do Dash */
    
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-toc:hover .toc-text {
    opacity: 1;
    transform: translateX(0);
}

/* Suporte Acessibilidade */
html.a11y-dark-mode .case-toc:hover { background-color: #1C1C1E; }
html.a11y-high-contrast .case-toc:hover { border: 2px solid white; background-color: black; }




/* ========================================= */
/* RESPONSIVIDADE MOBILE ATUALIZADA
/* ========================================= */

@media (max-width: 768px) {
    :root {
        --device-h-player: 55vh;
    }
    
    .case-toc { display: none !important; }

    /* --- 1. ESTABILIDADE & TRAVA DE ROLAGEM --- */
    #app-container { 
        padding: 0 !important; 
        height: 100dvh;
        display: block; 
        position: relative;
        overflow: hidden !important; 
        overscroll-behavior: none; 
    }

    /* --- 2. HEADER: ABSOLUTO --- */
    header { 
        position: absolute;
        top: 10vh;
        left: 0;
        width: 100%;
        padding: 0 var(--page-padding);
        z-index: 50;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px; 
    }

    .header-left h1 { font-size: 28px; margin-bottom: 2px !important; line-height: 1.1; }
    .header-left h4 { font-size: 17px; line-height: 1.3 !important; max-width: 85%; }
    .header-right { display: flex !important; flex-direction: row !important; gap: 24px !important; }

    /* --- 3. VIEWS: COMPORTAMENTO BASE --- */
    .view-section {
        height: 100dvh;
        width: 100vw;
        display: none; 
        flex-direction: column;
        align-items: center;
        overflow: hidden; 
    }

    /* --- 4. HOME VIEW (CENTRALIZADA) --- */
    #view-home.active { 
        display: flex !important; 
        justify-content: center; /* Mantém a Home no centro */
    }

    /* Alturas da Gallery (Home) */
    #view-home .iphone-17 { --device-h-gallery: 40vh !important; }
    #view-home .iphone-12 { --device-h-gallery: 38vh !important; }
    #view-home .iphone-x  { --device-h-gallery: 38vh !important; }
    #view-home .iphone-8  { --device-h-gallery: 35vh !important; }
    #view-home .apple-watch { --device-h-gallery: 24vh !important; }

    .gallery-container {
        height: auto;
        min-height: 45vh;
        align-items: center; 
        gap: 60px;
        padding-bottom: 20px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch; 
        margin-top: 20vh; /* Controle de subida/descida da Home */
    }
    
    /* --- RESET DE OFFSETS HERDADOS --- */
.iphone-17, .iphone-12, .iphone-x, .iphone-8, .apple-watch {
    --device-offset-y: 0px !important;
}

/* Remove qualquer margem residual nas thumbs */
.case-thumb-wrapper {
    margin-bottom: 0 !important;
}
    
    
    /* --- 5. CASE VIEW (ALINHADA AO TOPO) --- */
    #view-case.active { 
        display: flex !important; 
        justify-content: flex-start; /* 👈 Muda o alinhamento para o TOPO */
    }

    /* 💡 CONTROLE DE ALTURA POR DEVICE NA CASE VIEW */
    #view-case .iphone-17 { --device-h-case: 43vh !important; }
    #view-case .iphone-12 { --device-h-case: 43vh !important; }
    #view-case .iphone-x  { --device-h-case: 43vh !important; }
    #view-case .iphone-8  { --device-h-case: 43vh !important; }
    #view-case .apple-watch { --device-h-case: 35vh !important; }
    
    /* ---. AJUSTE ÓPTICO APPLE WATCH (CASE VIEW) --- */
#view-case .apple-watch .case-media {
    /* Empurra levemente para a direita para compensar o volume da coroa */
    transform: translateX(3px) !important; 
}

    .case-layout { 
        flex-direction: column; 
        align-items: center;    
        justify-content: flex-start; /* Alinha conteúdo do case ao topo */
        text-align: center;     
        gap: 15px;
        /* 💡 Ajuste aqui o espaço para não bater no Header */
        padding-top: 5vh; 
    }

    .case-info { 
        max-width: 333px;         
        align-items: center;
        gap: 20px;
    }
    
    
    
/* --- 5.5. FONTES EXCLUSIVAS DA CASE VIEW --- */
#view-case .case-year-label { 
    font-size: 16px !important; /* Ano do projeto */
    margin-bottom: 8px !important;
}

#view-case h2 { 
    font-size: 22px !important; /* Título do Case */
    line-height: 1.1;
}

#view-case .p1 { 
    font-size: 16.5px !important; /* Descrição curta */
    line-height: 1.4;
}

#view-case .p2 { 
    font-size: 16px !important; /* Créditos (nomes da equipe) */
    color: var(--color-gray-med); /* Opcional: suavizar a cor dos créditos */
}

/* --- 5.7. CRÉDITOS EM LINHA COM VÍRGULA (MOBILE) --- */
#view-case .case-credits {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    
    /* 1. ESPAÇAMENTO: O primeiro valor (15px) é o vertical entre linhas */
    /* O segundo valor (5px) é o horizontal entre os nomes */
    gap: 10px 5px !important; 
    margin-top: 5px !important;
    line-height: 1.2 !important; 
    width: 100% !important;
}

#view-case .case-credits .p2 {
    display: inline-block !important;
    margin: 0 !important;
    white-space: nowrap !important; /* Impede que um nome quebre no meio */
}

/* Limpa qualquer regra anterior de vírgula */
#view-case .case-credits .p2::after {
    content: "" !important;
}

/* 2. VÍRGULA: Adiciona em todos, exceto nos dois últimos */
#view-case .case-credits .p2:not(:last-child):not(:nth-last-child(2))::after {
    content: "," !important;
}

/* 3. AMPERSAND (&): Adiciona especificamente no penúltimo item */
#view-case .case-credits .p2:nth-last-child(2)::after {
    content: " \0026" !important; /* Usando o código unicode do & para garantir o render */
    margin-left: 2px !important;
}

#view-case .case-credits .p2 {
    display: inline-block;
    margin: 0 !important;
}

/* Adiciona a vírgula após cada item, exceto o último */
#view-case .case-credits .p2:not(:last-child)::after {
    content: ",";
}

/* --- AJUSTE DOS DOTS NO MOBILE --- */

.slider-dots-container {
        position: fixed !important;    /* Fixa em relação à tela, não ao container */
        bottom: 20px !important;       /* "Colado" com um respiro de segurança */
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;      /* Garante que o flex não suma */
        z-index: 9999 !important;      /* Joga para a frente de TUDO */
        pointer-events: auto !important; /* Garante que o clique funcione */
        gap: 10px !important;
    }

    .slider-dot {
        width: 8px !important;
        height: 8px !important;
        /* Se eles sumirem, tente mudar essa cor para testar (ex: red) */
        background-color: var(--color-gray-med) !important; 
        opacity: 0.5 !important;
    }

    .slider-dot.active {
        opacity: 1 !important;
        background-color: var(--color-black) !important;
        transform: scale(1.2) !important;
    }

    /* --- 6. PLAYER CONTROLS --- */
    .player-controls { 
        right: auto; 
        left: 50%; 
        top: auto; 
        bottom: -70px; 
        transform: translateX(-50%); 
        flex-direction: row; 
        gap: 15px;
    }
    
    /* --- 9. PLAYER VIEW (ALINHADA AO TOPO + ALTURAS) --- */

/* 1. Alinhamento ao Topo */
#view-player.player-overlay {
    align-items: flex-start !important; /* Move o player para o topo */
    padding-top: 5vh !important; /* Espaço para não bater no cabeçalho */
}

/* 2. Controle de Altura por Device no Player */
#view-player .iphone-17 { --device-h-player: 70vh !important; }
#view-player .iphone-12 { --device-h-player: 70vh !important; }
#view-player .iphone-x  { --device-h-player: 42vh !important; }
#view-player .iphone-8  { --device-h-player: 40vh !important; }
#view-player .apple-watch { --device-h-player: 60vh !important; }

/* 3. Ajuste dos controles para não "sumirem" no topo */
#view-player .player-controls {
    bottom: -60px !important; /* Garante que fiquem abaixo do aparelho */
}


/* 4. Ajuste das cc */
.custom-subtitle {
        /* LARGURA: Aumente o max-width para ocupar quase toda a tela */
        max-width: 95vw !important; 
        width: 90%; /* Força uma largura base maior se desejar */
        
        /* POSIÇÃO VERTICAL (Padrão com controles visíveis) */
        /* Ajuste este valor para subir ou descer a legenda */
        bottom: 250px; 
        
        /* Estilo extra para legibilidade no mobile */
        font-size: 16px !important;
        padding: 6px 10px !important;
        line-height: 1.2;
        transition: bottom 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* Suaviza a subida/descida */
    }

/* Garante que a legenda cresça de 16px para 20px no mobile */
    html.a11y-large-text .custom-subtitle { 
        font-size: 20px !important; 
        bottom: 110px; /* Sobe um pouco mais para não bater nos botões grandes */
    }
    


/* --- 10. BOTÃO DE ACESSIBILIDADE (MOBILE) --- */
#btn-a11y.floating-a11y-btn {
    /* 1. POSIÇÃO VERTICAL: diminua para subir, aumente para descer */
    top: 20px !important; 

    /* 2. POSIÇÃO HORIZONTAL: */
    /* Se quiser manter na direita, ajuste o 'right' */
    right: 20px !important; 
    /* Se quiser movê-lo para a esquerda, use estas duas linhas abaixo: */
    /* left: 20px !important; */
    /* right: auto !important; */

    /* 3. TAMANHO DO BOTÃO (Hit Area) */
    width: 34px !important; 
    height: 34px !important;
}

/* 4. TAMANHO DO ÍCONE (SVG) */
#btn-a11y svg {
    width: 20px !important; 
    height: 20px !important;
}


/* --- 11. CENTRALIZAÇÃO DA MODAL (MOBILE) --- */
.a11y-backdrop {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    /* Usamos dvh para garantir que a modal considere as barras do navegador */
    height: 100dvh !important; 
    width: 100vw !important;
    padding: 20px !important; /* Respiro lateral para a modal não encostar no vidro */
}

.a11y-modal {
    /* Removemos qualquer deslocamento e garantimos a largura */
    margin: 0 !important; 
    width: 100% !important;
    max-width: 350px !important; /* Um pouco menor para telas pequenas */
    
    /* Garante que se o conteúdo da modal for grande, ela permita scroll interno nela mesma */
    max-height: 80vh !important;
    overflow-y: auto !important;
}

/* --- AJUSTE RESPONSIVO DA VIEW ABOUT --- */
    
    #view-about.active {
        display: flex !important;
        flex-direction: column;
        justify-content: flex-start; /* Alinha ao topo para permitir scroll se o texto for longo */
        overflow-y: auto; /* Permite rolar a página se o texto crescer */
        padding-top: 0vh; /* Espaço para o cabeçalho fixo */
        padding-bottom: 60px;
    }

    .about-layout {
        flex-direction: column-reverse; /* Empilha: Texto em cima, Imagem embaixo */
        gap: 40px; /* Espaço entre texto e imagem */
        padding: 0 var(--page-padding);
        max-width: 90%;
    }

    #view-about .about-content {
        max-width: 100% !important;
        text-align: left; /* Mantém o alinhamento à esquerda para legibilidade */
    }

    .about-image-container {
        width: 100% !important; /* Imagem ocupa a largura total disponível */
        height: auto !important;
        aspect-ratio: 402 / 279; /* Mantém a proporção da sua foto original */
        border-radius: 0px; /* Opcional: arredondamento suave para combinar com os devices */
    }

    #about-photo {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .about-links {
        margin-top: 32px;
        gap: 16px;
    }
    
    /* Diminuindo o texto do parágrafo na seção Sobre */
    #view-about .p1 {
        font-size: 16px !important; /* Ajuste para o tamanho desejado */
        line-height: 1.3 !important; /* Melhora a legibilidade em telas pequenas */
        margin-bottom: 16px !important; /* Diminui o espaço entre os parágrafos */
    }

    /* Diminuindo os links (Email/LinkedIn) na seção Sobre */
    #view-about .about-links .p2 {
        font-size: 14px !important;
    }

}


/* --- IMPACT DASHBOARD STYLES --- */
.impact-dashboard {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 24px 0 32px 0;
}

.metric-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Transição suave para quando as cores mudarem */
    transition: background-color var(--speed-fast), border var(--speed-fast), transform var(--speed-fast);
}

.metric-card:hover {
    transform: translateY(-2px);
    background-color: #EBEBEF; /* Um toque leve de hover */
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-black);
}

.metric-label {
    font-size: 13px;
    color: var(--color-gray-med);
    line-height: 1.2;
    font-weight: 500;
}

/* --- INTEGRAÇÃO COM ACESSIBILIDADE --- */

/* Ajustes para o Modo Escuro */
html.a11y-dark-mode {
    --color-card-bg: #1C1C1E; /* Cinza escuro profundo */
    --color-card-border: rgba(255, 255, 255, 0.1);
}
html.a11y-dark-mode .metric-value {
    color: #FFFFFF;
}
html.a11y-dark-mode .metric-label {
    color: var(--color-gray-light);
}

/* Ajustes para o Alto Contraste (Máxima legibilidade) */
html.a11y-high-contrast {
    --color-card-bg: #FFFFFF;
    --color-card-border: #000000;
}
html.a11y-high-contrast .metric-card {
    border: 2px solid #000000; /* Borda mais grossa para contraste */
}
html.a11y-high-contrast .metric-value,
html.a11y-high-contrast .metric-label {
    color: #000000;
}




/* --- EFEITO DINÂMICO DO CASE (SLIDE LATERAL SEM ENCOLHER) --- */

.case-layout {
    transition: gap 0.8s cubic-bezier(0.16, 1, 0.3, 1); 
}

.case-info-container {
    transition: max-width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    /* Garante o alinhamento central seguro */
    margin: 0 auto;
}

/* O celular na sua forma normal */
.case-media {
    /* Animamos a margem em vez da altura/largura para manter a escala física intacta */
    transition: margin 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.6s ease, 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: translateX(0);
    margin-left: 0;
    flex-shrink: 0;
}

/* --- QUANDO OCORRE O SCROLL --- */
.case-layout.is-scrolled {
    gap: 0px; /* O espaço entre os dois zera suavemente */
}

.case-layout.is-scrolled .case-media {
    /* Agora ele usa a largura invertida EXATA do aparelho ativo */
    margin-left: calc(var(--device-h-case) * var(--device-w-ratio)) !important; 
    transform: translateX(-15vw); 
    opacity: 0;
    pointer-events: none; 
}

.case-layout.is-scrolled .case-info-container {
    max-width: 800px; /* <-- É AQUI ONDE VOCÊ DEFINE O QUANTO ELE ESPICHA */
}

/* Regra Mobile (Preserva o layout em telas pequenas empilhadas) */
@media (max-width: 768px) {
    .case-layout.is-scrolled {
        gap: 15px; 
    }
    .case-layout.is-scrolled .case-media {
        margin-left: 0;
        transform: none;
        opacity: 1;
        display: none; /* Apenas desaparece para dar espaço ao leitor */
    }
}

/* ========================================= */
/* EFEITO ZOOM (LIGHTBOX) NAS IMAGENS DO CASE
/* ========================================= */

/* Prepara a caixa para receber o efeito */
.case-asset-box.is-image {
    position: relative;
    cursor: zoom-in;
    overflow: hidden; /* Garante que o zoom não vaze as bordas arredondadas */
}

/* Transição suave na imagem ao passar o mouse */
.case-asset-box.is-image img {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.case-asset-box.is-image:hover img {
    transform: scale(1.03); /* Dá um leve zoom pra frente */
    filter: brightness(0.7); /* Escurece a imagem para a lupa branca dar contraste */
}

/* Criação do Ícone de Lupa via CSS (SVG nativo) */
.case-asset-box.is-image::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 48px;
    height: 48px;
    /* Ícone de Zoom-in embutido em Base64 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3Cline x1='11' y1='8' x2='11' y2='14'%3E%3C/line%3E%3Cline x1='8' y1='11' x2='14' y2='11'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none; /* Deixa o clique passar direto para a imagem */
    z-index: 10;
}

.case-asset-box.is-image:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* --- TELA CHEIA (LIGHTBOX) --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px); /* O efeito blur da Apple */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999999; /* Fica na frente de TUDO (até da acessibilidade) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 8px; /* Cantos levemente arredondados pra ficar chique */
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}
/* ========================================= */
/* AJUSTES MOBILE: SCROLL DA PÁGINA INTEIRA
/* ========================================= */

@media (max-width: 768px) {
    /* 1. Transforma a caixa inteira do case na área rolável principal */
    .case-slide-wrapper {
        align-items: flex-start !important;
        overflow-y: auto !important; /* Ativa a rolagem natural vertical */
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important; /* Deixa o scroll nativo super macio no iOS */
    }

    /* 2. Permite que o layout cresça infinitamente para baixo */
    .case-layout {
        flex-direction: column !important;
        justify-content: flex-start !important;
        height: auto !important;
        min-height: 100vh !important;
        padding-top: 8vh !important;
        padding-bottom: 120px !important; /* Espaço pro final do texto não bater na navegação */
        width: 100% !important;
        overflow: visible !important; 
        gap: 0 !important;
    }

    /* 3. A mídia (celular/foto) solta as amarras e rola junto com a página */
    .case-media {
        flex-shrink: 0 !important;
        margin-bottom: 24px !important;
        position: relative !important;
        
        /* Força a anulação do efeito de sumir no mobile */
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
        margin-left: 0 !important;
        pointer-events: auto !important;
    }

    /* 4. A caixa de texto perde as travas de altura */
    .case-info-container {
        flex: 1 1 auto !important;
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 5. Desliga o scroll restrito do texto (pois agora a tela inteira que rola) */
    .case-info-scroll {
        height: auto !important;
        overflow-y: visible !important;
        padding: 0 !important; 
    }
    
    /* Remove os gradientes de enfeite no topo e base do texto */
    .case-info-container::before, 
    .case-info-container::after { 
        display: none !important; 
    }
    
    /* Garante a legibilidade alinhando título, botão e créditos à esquerda */
    .case-header-row, 
    .case-title-block {
        align-items: flex-start !important;
        text-align: left !important;
    }
    #view-case .case-credits {
        justify-content: flex-start !important;
        text-align: left !important;
    }
    .btn-play-pill {
        align-self: flex-start !important;
        margin-left: 0 !important;
        margin-top: 12px !important;
    }
}

/* ========================================= */
/* ALINHAR APENAS TEXTO E LEGENDAS À ESQUERDA NO MOBILE
/* ========================================= */

@media (max-width: 768px) {
    /* 1. Alinha apenas a caixa de texto principal e o que tem dentro dela */
    #view-case .case-description-body,
    #view-case .case-description-body p,
    #view-case .case-description-body h3 {
        text-align: left !important;
    }

    /* 2. Alinha apenas as legendas das imagens/códigos */
    .case-caption {
        text-align: left !important;
    }
    
    /* Garante que a caixa de texto ocupe 100% da largura para o alinhamento esquerdo fazer efeito */
    #view-case .case-description-body {
        width: 100% !important;
        align-items: flex-start !important;
    }
}

/* ========================================= */
/* CENTRALIZAR CABEÇALHO DO CASE NO MOBILE
/* ========================================= */

@media (max-width: 768px) {
    /* 1. Centraliza a linha principal que segura o título e o botão */
    #view-case .case-header-row {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }

    /* 2. Centraliza o bloco interno (Ano e Título) */
    #view-case .case-title-block {
        align-items: center !important;
        text-align: center !important;
    }

    /* 3. Centraliza o Botão de Play e remove margens residuais */
    #view-case .btn-play-pill {
        align-self: center !important;
        margin: 0 auto !important;
    }
    
    /* 4. Opcional: Centraliza os créditos (nomes) para combinar com o título */
    #view-case .case-credits-horizontal {
        text-align: center !important;
        justify-content: center !important;
        width: 100% !important;
        line-height: 1.5;
    }
}

/* ========================================= */
/* GRADIENTES FIXOS NO MOBILE (TOP & BOTTOM)
/* ========================================= */

@media (max-width: 768px) {
    /* 1. Criamos os gradientes como elementos flutuantes sobre a view do case */
    #view-case::before,
    #view-case::after {
        content: '';
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        height: 12vh; /* Altura do efeito */
        z-index: 99; /* Fica acima do conteúdo, mas abaixo dos botões de navegação */
        pointer-events: none; /* Garante que o dedo consiga clicar no que está atrás */
    }

    /* Gradiente do Topo (esconde o conteúdo vindo de baixo do Header) */
    #view-case::before {
        top: 0;
        background: linear-gradient(to bottom, 
            var(--color-bg) 30%, 
            transparent 100%);
    }

    /* Gradiente do Rodapé (suaviza o sumiço do texto antes dos dots) */
    #view-case::after {
        bottom: 0;
        background: linear-gradient(to top, 
            var(--color-bg) 30%, 
            transparent 100%);
    }

    /* Ajuste de segurança: Garante que os botões (dots) e o botão voltar 
       fiquem acima dessa cortina de gradiente */
    .slider-dots-container, 
    .floating-back-btn {
        z-index: 100 !important;
    }
}