/* ==========================================================================
   LIVINGHAPP.COM — Design System & Estilos Principais (Mobile First)
   Estética minimalista, contemporânea e sofisticada
   ========================================================================== */

:root {
  /* Paleta de Cores Neutra e Sofisticada */
  --bg-primary: #FAF9F6;
  --bg-elevated: #FFFFFF;
  --bg-subtle: #F3F1EC;
  --bg-pill-hover: #FFFFFF;

  /* Tipografia & Hierarquia Cromática */
  --text-primary: #1F2022;
  --text-secondary: #55585E;
  --text-muted: #848890;

  /* Acentos Sutis */
  --accent-sage: #5E7368;
  --accent-sage-soft: rgba(94, 115, 104, 0.12);
  --accent-stone: #A69B8D;

  /* Bordas & Sombras Delicadas */
  --border-subtle: rgba(31, 32, 34, 0.08);
  --border-hover: rgba(31, 32, 34, 0.18);
  --focus-ring: rgba(94, 115, 104, 0.35);

  --shadow-xs: 0 1px 2px rgba(24, 25, 28, 0.03);
  --shadow-sm: 0 4px 16px rgba(24, 25, 28, 0.04);
  --shadow-md: 0 12px 32px rgba(24, 25, 28, 0.07);

  /* Tipografia */
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;

  /* Raios de Borda */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-pill: 9999px;

  /* Espaçamento & Layout */
  --container-max: 920px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  /* Transições */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 180ms;
  --duration-normal: 320ms;
  --duration-slow: 650ms;
}

/* Reset Limpo e Seguro */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Utilitários de Acessibilidade */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 100;
  background: var(--text-primary);
  color: var(--bg-elevated);
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: top var(--duration-fast) ease;
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--accent-sage);
  outline-offset: 2px;
}

/* Textura Ambiental Sutil (Sem gradientes genéricos exagerados) */
.ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(31, 32, 34, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.15) 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.15) 75%, transparent 100%);
}

/* Estrutura Principal Flexível */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ==========================================================================
   A. CABEÇALHO MINIMALISTA
   ========================================================================== */
.site-header {
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--border-subtle);
  background-color: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--text-primary);
  padding: 0.35rem 0.5rem;
  margin-left: -0.5rem;
  border-radius: var(--radius-sm);
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.brand:hover {
  opacity: 0.8;
}

.brand:focus-visible {
  outline: 2px solid var(--accent-sage);
  outline-offset: 2px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-sage);
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.brand:hover .brand-mark {
  transform: rotate(-4deg) scale(1.04);
}

.brand-name {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}

/* Seletor de Idioma Discreto */
.language-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.language-control:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.language-control:focus-within {
  border-color: var(--accent-sage);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.lang-icon {
  position: absolute;
  left: 0.75rem;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  pointer-events: none;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  padding: 0.48rem 2rem 0.48rem 2.15rem;
  min-height: 38px;
  cursor: pointer;
  border-radius: var(--radius-pill);
}

.lang-select:focus {
  outline: none;
}

.lang-chevron {
  position: absolute;
  right: 0.7rem;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  pointer-events: none;
}

/* ==========================================================================
   B. SEÇÃO PRINCIPAL — BOAS-VINDAS (Mobile First)
   ========================================================================== */
.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(2.75rem, 7vh, 5rem);
}

.hero-section {
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

.hero-inner {
  max-width: 680px;
  margin-inline: 0;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 1.35rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-sage);
  box-shadow: 0 0 0 3px var(--accent-sage-soft);
}

.hero-title {
  font-size: clamp(2rem, 6.2vw, 3.35rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 1.1rem;
}

.hero-description {
  font-size: clamp(1rem, 2.3vw, 1.15rem);
  font-weight: 300;
  line-height: 1.68;
  color: var(--text-secondary);
  max-width: 56ch;
}

/* ==========================================================================
   C. SEÇÃO DE PROJETOS E PÁGINAS (Diretório Visual Sofisticado)
   ========================================================================== */
.projects-section {
  width: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  white-space: nowrap;
}

.section-divider {
  height: 1px;
  flex: 1;
  background-color: var(--border-subtle);
}

/* Lista Mobile-First: Botões/Pills confortáveis ao toque com quebra fluida */
.projects-grid {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.project-item {
  width: 100%;
}

.project-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  width: 100%;
  min-height: 56px;
  padding: 0.85rem 1.2rem;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  color: var(--text-primary);
  text-decoration: none;
  transition:
    transform var(--duration-normal) var(--ease-out-expo),
    box-shadow var(--duration-normal) var(--ease-out-expo),
    border-color var(--duration-fast) ease,
    background-color var(--duration-fast) ease;
  -webkit-tap-highlight-color: transparent;
}

.project-pill-left {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.project-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  color: var(--accent-sage);
  transition:
    background-color var(--duration-normal) var(--ease-out-expo),
    color var(--duration-normal) var(--ease-out-expo),
    transform var(--duration-normal) var(--ease-out-expo);
}

.project-pill-icon svg {
  width: 15px;
  height: 15px;
}

.project-pill-name {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  line-height: 1.35;
  overflow-wrap: break-word;
}

.project-pill-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  color: var(--text-muted);
  transition:
    transform var(--duration-normal) var(--ease-out-expo),
    color var(--duration-fast) ease,
    background-color var(--duration-fast) ease;
}

/* Estados Interativos: Hover, Focus e Active (Clique) */
.project-pill:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  background-color: var(--bg-pill-hover);
}

.project-pill:hover .project-pill-icon {
  background-color: var(--accent-sage-soft);
  transform: scale(1.05);
}

.project-pill:hover .project-pill-arrow {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
  transform: translate(2px, -2px);
}

.project-pill:focus-visible {
  outline: none;
  border-color: var(--accent-sage);
  box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-sm);
}

.project-pill:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--shadow-xs);
  transition-duration: 90ms;
}

.projects-empty {
  font-size: 0.9375rem;
  color: var(--text-muted);
  padding: 1.5rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-subtle);
}

/* ==========================================================================
   6. RODAPÉ DISCRETO
   ========================================================================== */
.site-footer {
  padding-block: 1.75rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.footer-copy {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* ==========================================================================
   ANIMAÇÕES DE ENTRADA E TRANSIÇÕES DE ESTADO
   ========================================================================== */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  animation: fadeSlideUp var(--duration-slow) var(--ease-out-expo) forwards;
  animation-delay: var(--delay, 0ms);
}

.project-item-animate {
  opacity: 0;
  animation: fadeSlideUp 520ms var(--ease-out-expo) forwards;
  animation-delay: var(--item-delay, 240ms);
}

/* Transição suave durante troca de idioma */
.is-translating [data-i18n] {
  opacity: 0.35;
  transition: opacity 140ms ease;
}

[data-i18n] {
  transition: opacity 220ms ease;
}

/* ==========================================================================
   BREAKPOINTS RESPONSIVOS (Tablet, Notebook, Monitores Alta Resolução)
   ========================================================================== */

/* Tablet e telas médias (>= 640px) */
@media (min-width: 640px) {
  .projects-grid {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.95rem;
  }

  .project-item {
    width: auto;
    flex: 0 1 auto;
  }

  .project-pill {
    width: auto;
    min-height: 52px;
    padding: 0.72rem 1.1rem 0.72rem 0.85rem;
    gap: 1.15rem;
  }

  .footer-inner {
    flex-direction: row;
    align-items: center;
  }
}

/* Notebooks e Desktop (>= 960px) */
@media (min-width: 960px) {
  .site-header {
    padding-block: 1.65rem;
  }

  .hero-section {
    margin-bottom: 4.25rem;
  }

  .projects-grid {
    gap: 1.05rem;
  }

  .project-pill {
    padding: 0.78rem 1.25rem 0.78rem 0.9rem;
  }
}

/* Monitores de Alta Resolução (>= 1440px) */
@media (min-width: 1440px) {
  :root {
    --container-max: 1020px;
  }
}

/* ==========================================================================
   ACESSIBILIDADE: PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .project-item-animate {
    opacity: 1 !important;
    transform: none !important;
  }
}
