/* ============================================================
   matheuscarino.com.br — visual inspirado em maciejbis.net:
   fundo cream, tipografia grotesque expressiva, chips com seta,
   painéis escuros de destaque e bandas suaves com muito respiro.
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f5f1e9;
  --band: #fbf8f2;
  --ink: #1f1b16;
  --muted: #6f6759;
  --line: #ddd4c3;
  --panel: #1f1b16;
  --panel-text: #f5f1e9;
  --panel-muted: #b7ae9e;
  --panel-line: #3b362d;
  --radius: 20px;
  --radius-sm: 14px;
  --font-display: "Bricolage Grotesque", "Hanken Grotesk", sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

/* fundos decorativos do tema antigo — aposentados */
.ambient {
  display: none;
}

.page-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px 80px;
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 4px;
  margin: 0 -4px 40px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav a:hover {
  color: var(--ink);
}

.lang-toggle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-toggle:hover {
  background: var(--ink);
  color: var(--panel-text);
}

/* ---------- Tipografia ---------- */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: 14px;
}

h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  margin-bottom: 10px;
}

h3 {
  font-size: 1.2rem;
}

p {
  margin-bottom: 10px;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.section-heading {
  margin-bottom: 8px;
}

.section-lead,
.hero-summary,
.project-desc {
  color: var(--muted);
  max-width: 62ch;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin-bottom: 14px;
}

/* ---------- Seções (bandas) ---------- */

.section-card {
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 56px);
  margin-bottom: 26px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 26px;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 6px;
}

/* Chips (botões) — pílulas com seta */

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 20px;
  border: 1px solid var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}

.button::after {
  content: "→";
  font-weight: 500;
  transition: transform 0.15s ease;
}

.button:hover::after {
  transform: translateX(3px);
}

.button-primary {
  background: var(--ink);
  color: var(--panel-text);
}

.button-primary:hover {
  background: #3a352c;
  border-color: #3a352c;
}

.button-secondary {
  background: transparent;
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--ink);
  color: var(--panel-text);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 16px;
}

.social-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.social-links a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Painel escuro do hero — o "stat panel" */

.hero-panel {
  background: var(--panel);
  color: var(--panel-text);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.portrait-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portrait-badge {
  align-self: flex-start;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: var(--panel-text);
}

.portrait-role {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--panel-text);
  margin-bottom: 2px;
}

.portrait-note {
  color: var(--panel-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.info-grid article {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--panel-line);
}

.info-grid span {
  color: var(--panel-muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.info-grid strong {
  font-size: 0.92rem;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

/* ---------- Cards genéricos ---------- */

.feature-grid,
.domains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

/* certificados: uma linha por certificado */
.cert-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

.feature-card,
.domain-card,
.cert-card,
.mini-panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
}

.feature-card span,
.domain-card span,
.cert-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.feature-card strong,
.domain-card strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

/* ---------- Timeline (experiência) ---------- */

.timeline {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
}

.timeline-item {
  border-top: 1px solid var(--line);
  padding: 26px 0;
}

.timeline-item:last-child {
  padding-bottom: 4px;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin-bottom: 10px;
}

.timeline-role {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}

.timeline-company {
  color: var(--muted);
  font-weight: 600;
}

.timeline-period {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.timeline-item ul,
.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}

.timeline-item ul li::before,
.check-list li::before {
  content: "→";
  margin-right: 10px;
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Pills (skills / stack) ---------- */

.stack-pills,
.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pill-accent,
.stack-pills span,
.pill-grid span {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
}

.stack-list {
  list-style: none;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
}

.stack-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 12px 2px;
}

/* ---------- Educação / certificados ---------- */

.degree-highlight {
  background: var(--panel);
  color: var(--panel-text);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
  margin: 32px 8px 8px;
  /* anel de destaque ao redor do painel escuro */
  outline: 2px solid var(--ink);
  outline-offset: 6px;
}

.degree-kicker {
  color: var(--panel-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.degree-name {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.degree-school {
  color: var(--panel-muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0;
}

.degree-item {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.cert-subheading {
  margin-top: 26px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.cert-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  font-size: 0.9em; /* 10% menor que o corpo */
}

.cert-card > div {
  display: flex;
  flex-wrap: nowrap; /* título e emissão na mesma linha */
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 18px;
  flex: 1;
  min-width: 0;
}

.cert-card strong {
  font-weight: 600;
}

.cert-period {
  white-space: nowrap;
}

@media (max-width: 700px) {
  /* no mobile a linha única não cabe — emissão desce para baixo do título */
  .cert-card > div {
    flex-wrap: wrap;
  }
}

.cert-icon {
  font-size: 1.3rem;
}

.cert-period {
  color: var(--muted);
  font-size: 0.85rem;
}

.year-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 22px;
}

.year-group {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* ---------- Contato (banda escura) ---------- */

.contact-card {
  background: var(--panel);
  color: var(--panel-text);
  border: none;
}

.contact-card .eyebrow,
.contact-card .section-lead {
  color: var(--panel-muted);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.contact-grid a {
  background: transparent;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  color: var(--panel-text);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease;
}

.contact-grid a:hover {
  border-color: var(--panel-text);
}

.contact-grid span {
  color: var(--panel-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.contact-grid strong {
  font-weight: 600;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

/* ---------- Página de projetos ---------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.back-link:hover {
  color: var(--ink);
}

.project-hero h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.project-title-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  transition: background 0.15s ease, color 0.15s ease;
}

.project-links a:hover {
  background: var(--ink);
  color: var(--panel-text);
}

.split-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.accent-item {
  border-left: 3px solid var(--ink);
  padding-left: 16px;
  margin: 14px 0;
}

/* ---------- Diagramas (projetos) ---------- */

.diagram-section {
  margin-top: 10px;
}

.diagram-wrap {
  overflow-x: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.box-label,
.box-label2 {
  font-weight: 700;
  font-size: 0.85rem;
  fill: var(--ink);
}

.box-sub,
.box-sub2 {
  color: var(--muted);
  fill: var(--muted);
  font-size: 0.78rem;
}

.z-label,
.z-label2 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  fill: var(--muted);
}

.arr-line,
.arr2 {
  stroke: var(--muted);
}

.arr-dim {
  stroke: var(--line);
}

/* ---------- Animação de entrada ---------- */

.reveal {
  animation: rise 0.7s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* ---------- Responsivo ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    padding-top: 6px;
  }

  .timeline-period {
    margin-left: 0;
    width: 100%;
  }
}

/* ---------- Impressão da página inicial (Ctrl+P / Cmd+P) ---------- */

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  :root {
    --bg: #ffffff;
    --band: #ffffff;
    --line: #d5d5d5;
  }

  body {
    font-size: 10.5pt;
    line-height: 1.45;
    background: #ffffff;
  }

  /* elementos interativos não fazem sentido no papel */
  .topbar,
  .lang-toggle,
  .hero-actions,
  .back-link,
  .project-links {
    display: none !important;
  }

  .page-shell {
    max-width: none;
    padding: 0;
  }

  .reveal {
    animation: none;
  }

  h1 {
    font-size: 22pt;
  }

  h2 {
    font-size: 14pt;
  }

  .section-card {
    border: none;
    border-top: 1px solid #d5d5d5;
    border-radius: 0;
    padding: 14pt 0;
    margin-bottom: 0;
    break-inside: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 10pt;
  }

  /* painéis escuros viram blocos claros com borda (economia de tinta) */
  .hero-panel,
  .contact-card,
  .degree-highlight {
    background: #ffffff !important;
    color: #1f1b16 !important;
    border: 1px solid #999999;
    outline: none;
    padding: 10pt 12pt;
  }

  .hero-panel .portrait-badge,
  .hero-panel .portrait-role,
  .info-grid strong,
  .degree-name {
    color: #1f1b16 !important;
  }

  .portrait-note,
  .info-grid span,
  .degree-kicker,
  .degree-school,
  .contact-card .eyebrow,
  .contact-card .section-lead,
  .contact-grid span {
    color: #555555 !important;
  }

  .info-grid article {
    border-top-color: #dddddd;
  }

  .contact-grid a {
    color: #1f1b16 !important;
    border-color: #cccccc;
  }

  .social-links a {
    color: #1f1b16;
  }

  /* blocos que não podem ser cortados ao meio entre páginas */
  .timeline-item,
  .feature-card,
  .cert-card,
  .degree-highlight,
  .hero-panel {
    break-inside: avoid;
  }

  .timeline-item ul li::before,
  .check-list li::before {
    content: "–";
  }
}
