/* =========================================================================
   Portfólio — Jeferson Carvalho
   1. Tokens (cores, sombras, tipografia) · 2. Base · 3. Layout
   4. Componentes · 5. Seções · 6. Modal · 7. Responsivo · 8. Movimento
   ========================================================================= */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #09090b;
  --text-muted: #52525b;
  --text-subtle: #6b6b74;
  --accent: #6d28d9;
  --accent-hover: #5b21b6;
  --accent-soft: rgba(109, 40, 217, 0.07);
  --accent-border: rgba(109, 40, 217, 0.28);
  --accent-glow: rgba(124, 58, 237, 0.16);
  --btn-bg: #09090b;
  --btn-text: #fafafa;
  --btn-hover: #27272a;
  --grid-line: rgba(9, 9, 11, 0.05);
  --role-end: #7c3aed;
  --role-front: #0284c7;
  --role-back: #059669;
  --role-arch: #d97706;
  --success: #15803d;
  --danger: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(9, 9, 11, 0.05);
  --shadow-md: 0 1px 2px rgba(9, 9, 11, 0.04), 0 12px 32px -12px rgba(9, 9, 11, 0.14);
  --shadow-lg: 0 2px 4px rgba(9, 9, 11, 0.04), 0 32px 64px -24px rgba(9, 9, 11, 0.24);

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #18181b;
  --surface-glass: rgba(17, 17, 19, 0.7);
  --border: #27272a;
  --border-strong: #3f3f46;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-subtle: #8b8b94;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --accent-soft: rgba(167, 139, 250, 0.08);
  --accent-border: rgba(167, 139, 250, 0.3);
  --accent-glow: rgba(139, 92, 246, 0.22);
  --btn-bg: #fafafa;
  --btn-text: #09090b;
  --btn-hover: #e4e4e7;
  --grid-line: rgba(255, 255, 255, 0.045);
  --role-end: #a78bfa;
  --role-front: #38bdf8;
  --role-back: #34d399;
  --role-arch: #fbbf24;
  --success: #4ade80;
  --danger: #f87171;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 40px 80px -24px rgba(0, 0, 0, 0.8);
}

/* 2. Base ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss03';
}

/* Enquanto a tradução carrega (só quando o idioma não é inglês) */
html.i18n-pending body {
  opacity: 0;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: var(--btn-text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

/* 3. Layout ---------------------------------------------------------------- */
.container {
  width: min(1160px, 100% - 48px);
  margin-inline: auto;
}

.section {
  padding-block: clamp(80px, 10vw, 136px);
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-head--sub {
  margin-top: clamp(80px, 9vw, 120px);
  margin-bottom: 28px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.kicker::before {
  content: '';
  width: 18px;
  height: 1px;
  background: currentColor;
}

h2,
.h2 {
  font-size: clamp(1.9rem, 1.35rem + 1.9vw, 2.75rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.section-lead {
  margin-top: 14px;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  color: var(--text-muted);
  text-wrap: pretty;
}

/* 4. Componentes ----------------------------------------------------------- */

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}

.btn .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease);
}

.btn:hover .icon {
  transform: translateX(2px);
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
}

.btn-primary:hover {
  background: var(--btn-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-2);
}

.btn-sm {
  height: 36px;
  padding: 0 13px;
  font-size: 14px;
  border-radius: 9px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Etiquetas de tecnologia */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Selos de atuação */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--role-end);
}

.badge[data-role='frontend']::before { background: var(--role-front); }
.badge[data-role='backend']::before { background: var(--role-back); }
.badge[data-role='architecture']::before { background: var(--role-arch); }

.badge--status {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.badge--status::before {
  display: none;
}

.badge--status .icon {
  width: 14px;
  height: 14px;
}

/* Grupos de stack dentro dos cards */
.stack-groups {
  display: grid;
  gap: 10px;
}

.stack-group {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: start;
  gap: 12px;
}

.stack-group__label {
  padding-top: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

/* Lista de destaques com ✓ */
.check-list {
  display: grid;
  gap: 9px;
}

.check-list li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  font-size: 15px;
  color: var(--text-muted);
}

.check-list .icon {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  color: var(--accent);
}

/* Ícone de projeto */
.project-icon {
  flex: none;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
}

.project-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-icon--logo-on-dark {
  display: grid;
  place-items: center;
  padding: 7px;
  background: #18181b;
  border-color: #27272a;
}

.project-icon--logo-on-dark img {
  object-fit: contain;
}

.project-icon--logo-on-light {
  display: grid;
  place-items: center;
  padding: 3px;
  background: #ffffff;
}

.project-icon--logo-on-light img {
  object-fit: contain;
}

.project-icon--case {
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.project-icon--case .icon {
  width: 24px;
  height: 24px;
}

/* Borda em degradê que aparece no hover (cards) */
.has-glow {
  position: relative;
  isolation: isolate;
}

.has-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), transparent 35%, transparent 65%, var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

.has-glow:hover::after,
.has-glow:focus-within::after {
  opacity: 0.9;
}

/* 5. Seções ---------------------------------------------------------------- */

/* Cabeçalho */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  background: var(--surface-glass);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  transition: border-color 0.25s;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.brand img {
  width: 28px;
  height: auto;
}

.site-nav ul {
  display: flex;
  gap: 2px;
}

.site-nav a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s, background-color 0.2s;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--text);
}

.site-nav a.is-active {
  background: var(--surface-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.lang-switch button {
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  transition: background-color 0.2s, color 0.2s;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button[aria-pressed='true'] {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.theme-toggle .icon-sun,
:root[data-theme='dark'] .theme-toggle .icon-moon {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .icon-sun {
  display: block;
}

.menu-toggle {
  display: none;
}

.menu-toggle .icon-close,
.menu-toggle[aria-expanded='true'] .icon-open {
  display: none;
}

.menu-toggle[aria-expanded='true'] .icon-close {
  display: block;
}

/* Apresentação */
.hero {
  position: relative;
  padding-block: clamp(56px, 8vw, 104px) clamp(56px, 7vw, 88px);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 10%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 10%, #000 20%, transparent 75%);
}

.hero::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  z-index: -1;
  width: 60%;
  height: 80%;
  background: radial-gradient(closest-side, var(--accent-glow), transparent);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(40px, 6vw, 72px);
}

.eyebrow {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-glass);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.eyebrow > span:nth-child(2) {
  color: var(--text);
}

.eyebrow-sep {
  color: var(--border-strong);
}

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

.hero h1 {
  max-width: 15ch;
  font-size: clamp(2.4rem, 1.25rem + 3.9vw, 4.25rem);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.hero .lead {
  max-width: 58ch;
  margin-top: 24px;
  font-size: clamp(1.03rem, 0.97rem + 0.3vw, 1.18rem);
  color: var(--text-muted);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  font-size: 14px;
  color: var(--text-subtle);
}

.hero-meta .icon {
  width: 16px;
  height: 16px;
}

.hero-stack {
  margin-top: 40px;
}

/* Cartão de código */
.hero-visual {
  position: relative;
}

.code-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: #111113;
  box-shadow: var(--shadow-lg);
  color: #e4e4e7;
}

.code-card__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #18181b;
}

.code-card__bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3f3f46;
}

.code-card__bar p {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a1a1aa;
}

.code-card__body {
  margin: 0;
  padding: 22px 24px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.8;
  tab-size: 2;
}

.code-card .k { color: #c084fc; }
.code-card .v { color: #93c5fd; }
.code-card .a { color: #e4e4e7; }
.code-card .s { color: #86efac; }
.code-card .n { color: #fcd34d; }
.code-card .p { color: #71717a; }

/* Números */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: clamp(56px, 7vw, 88px);
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.stats dt {
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.4rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.stats dd {
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--text-muted);
}

/* Projetos em destaque */
.featured-list {
  display: grid;
  gap: 24px;
}

.feature-card,
.case-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}

.feature-card:hover,
.case-card:hover {
  box-shadow: var(--shadow-md);
}

.project-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.project-head h3 {
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.7rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.project-context {
  margin-top: 3px;
  font-size: 14px;
  color: var(--text-subtle);
}

.project-summary {
  font-size: 16.5px;
  color: var(--text-muted);
  text-wrap: pretty;
}

.project-note {
  display: flex;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-subtle);
}

.project-note .icon {
  width: 15px;
  height: 15px;
  margin-top: 3px;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Case corporativo (NIQ) */
.case-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 44px);
}

.case-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 80% at 0% 0%, var(--accent-glow), transparent 70%),
    radial-gradient(50% 60% at 100% 100%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.case-card > * {
  position: relative;
}

.case-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.case-card .project-summary {
  max-width: 72ch;
  margin-top: 22px;
}

.case-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.case-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-glass);
}

.case-panel h4 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.case-panel p {
  font-size: 15px;
  color: var(--text-muted);
}

.case-panel .chip-list {
  margin-top: auto;
  padding-top: 4px;
}

/* Produto em destaque (Data Timão, VNES) */
.feature-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  overflow: hidden;
}

.feature-card--reverse .feature-body {
  order: 2;
}

.feature-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(24px, 4vw, 44px);
}

.feature-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 40px 24px;
  overflow: hidden;
  background:
    radial-gradient(70% 60% at 50% 40%, var(--accent-glow), transparent 70%),
    var(--surface-2);
  border-left: 1px solid var(--border);
}

.feature-card--reverse .feature-visual {
  border-left: 0;
  border-right: 1px solid var(--border);
}

.feature-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent);
  mask-image: radial-gradient(closest-side, #000, transparent);
}

.phones {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 460px;
}

.phone {
  position: relative;
  width: 42%;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  background: #0b0b0d;
  box-shadow: var(--shadow-lg);
  transition: transform 0.5s var(--ease);
}

.phone img {
  width: 100%;
  border-radius: 21px;
}

.phone--side {
  z-index: 1;
  width: 36%;
  opacity: 0.92;
}

.phone--left {
  margin-right: -9%;
  transform: translateY(18px) rotate(-4deg);
}

.phone--right {
  margin-left: -9%;
  transform: translateY(18px) rotate(4deg);
}

.phone--center {
  z-index: 2;
}

.feature-card:hover .phone--left {
  transform: translate(-6px, 14px) rotate(-5deg);
}

.feature-card:hover .phone--right {
  transform: translate(6px, 14px) rotate(5deg);
}

.feature-card:hover .phone--center {
  transform: translateY(-4px);
}

/* Outros projetos */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-btn[aria-pressed='true'] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.filters-count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-subtle);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 16px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
  animation: card-in 0.4s var(--ease) backwards;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.project-card .project-head {
  gap: 14px;
}

.project-card .project-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
}

.project-card h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.project-card .badges {
  margin-top: 6px;
}

.project-card .project-summary {
  font-size: 15px;
}

.project-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 550;
  color: var(--text);
}

.card-link .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease);
}

/* O botão "Ver detalhes" cobre o card inteiro (card clicável) */
.card-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.project-card:hover .card-link .icon {
  transform: translateX(3px);
}

.card-ext {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
}

.card-ext .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.card-ext .icon {
  width: 16px;
  height: 16px;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Experiência (linha do tempo) */
.timeline {
  border-top: 1px solid var(--border);
}

.timeline-item {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  padding-block: 36px;
  border-bottom: 1px solid var(--border);
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-muted);
}

.timeline-body {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.timeline-body h3 {
  font-size: clamp(1.1rem, 1.02rem + 0.35vw, 1.3rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.timeline-company {
  margin-top: -8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
}

/* Stack */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stack-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.stack-card__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent-border);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}

.stack-card h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* Sobre */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}

.prose {
  display: grid;
  gap: 18px;
  max-width: 64ch;
  font-size: clamp(1rem, 0.97rem + 0.2vw, 1.075rem);
  color: var(--text-muted);
}

.prose p:first-child {
  color: var(--text);
}

.facts-card {
  padding: 8px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.facts-card dl > div {
  padding-block: 16px;
  border-bottom: 1px solid var(--border);
}

.facts-card dl > div:last-child {
  border-bottom: 0;
}

.facts-card dt {
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.facts-card dd {
  display: grid;
  font-size: 15.5px;
  font-weight: 500;
}

.facts-card dd span {
  font-weight: 400;
  color: var(--text-muted);
}

/* Contato */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.contact-link {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text-muted);
  transition: transform 0.25s var(--ease), border-color 0.25s, color 0.25s, box-shadow 0.25s;
}

.contact-link:hover,
.contact-link:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  color: var(--accent);
  box-shadow: var(--shadow-md);
}

.icon-fill {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

/* Rodapé */
.site-footer {
  padding-block: 32px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-subtle);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-built {
  margin-left: auto;
}

/* 6. Modal (detalhes + galeria) -------------------------------------------- */
.modal {
  width: min(880px, 100% - 32px);
  max-height: min(90vh, 920px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal[open] {
  display: flex;
  flex-direction: column;
  animation: modal-in 0.25s var(--ease);
}

html:has(.modal[open]) {
  overflow: hidden;
}

.modal::backdrop {
  background: rgba(9, 9, 11, 0.62);
}

.modal__inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 18px 24px;
  border-bottom: 1px solid var(--border);
}

.modal__header .project-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

.modal__header h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.modal__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__section h3 {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.modal__section p {
  color: var(--text-muted);
}

.gallery {
  position: relative;
}

.gallery__track {
  display: flex;
  gap: 14px;
  padding-bottom: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.gallery__item {
  flex: none;
  width: 200px;
  scroll-snap-align: start;
}

.gallery__item--desktop {
  width: min(520px, 85%);
}

.gallery__item img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}

.gallery__item figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-subtle);
}

.gallery__nav {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

/* 7. Responsivo ------------------------------------------------------------ */
@media (max-width: 1080px) {
  .stack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-visual {
    max-width: 560px;
  }

  .feature-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-card .feature-visual,
  .feature-card--reverse .feature-visual {
    order: -1;
    min-height: 0;
    padding: 36px 20px 28px;
    border: 0;
    border-bottom: 1px solid var(--border);
  }

  .feature-card--reverse .feature-body {
    order: 0;
  }

  .case-panels {
    grid-template-columns: minmax(0, 1fr);
  }

  .timeline-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding-block: 28px;
  }

  .timeline-meta {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 860px) {
  .menu-toggle {
    display: inline-grid;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    display: none;
    padding: 12px 24px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    box-shadow: var(--shadow-md);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 4px;
  }

  .site-nav a {
    padding: 12px 8px;
    font-size: 18px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(1160px, 100% - 32px);
  }

  .stack-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stats {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .stats > div {
    display: flex;
    align-items: baseline;
    gap: 14px;
  }

  .stats dd {
    margin-top: 0;
  }

  .hero-meta {
    width: 100%;
    margin-left: 0;
  }

  .eyebrow {
    border-radius: 14px;
    row-gap: 2px;
  }

  .eyebrow-sep {
    display: none;
  }

  .eyebrow > span:last-child {
    flex-basis: 100%;
    padding-left: 16px;
  }

  .stack-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .stack-group__label {
    padding-top: 0;
  }

  .code-card__body {
    padding: 18px;
    font-size: 12px;
  }

  .phone {
    border-radius: 20px;
  }

  .phone img {
    border-radius: 16px;
  }

  .footer-built {
    margin-left: 0;
  }

  .modal {
    width: calc(100% - 16px);
    max-height: 92dvh;
  }

  .modal__body {
    padding: 20px;
  }
}

/* 8. Movimento ------------------------------------------------------------- */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, fill 0.35s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
