/* =====================================================================
   inicio.css · só a página inicial
   ===================================================================== */

section {
  padding: 96px 0;
}

h2 { font-size: clamp(32px, 4.2vw, 48px); line-height: 1.08; letter-spacing: -0.035em; text-wrap: balance; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 760px;
  margin-bottom: 56px;
}

.section-head p.lead {
  margin: 0;
  max-width: 680px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--body);
}

/* ---------- Apresentação ---------- */

#apresentacao { padding-top: 96px; padding-bottom: 80px; }

#apresentacao .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 72px;
}

.hero-copy {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero-copy .kicker {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--muted);
}

.hero-copy h1 {
  font-size: clamp(38px, 5.6vw, 64px);
  line-height: 1.05;
}

.hero-copy h1 .fade { color: var(--muted); }

.hero-copy p.sub {
  margin: 0;
  max-width: 600px;
  font-size: 21px;
  line-height: 1.5;
  color: var(--body);
}

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

.hero-visual {
  width: 460px;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.card-tile {
  box-sizing: border-box;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: var(--radius-md);
  background: #fff;
}

.card-tile .tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tile-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.tile-index { font-size: 12px; color: var(--soft); }

.bar-row { display: flex; flex-direction: column; gap: 10px; }
.bar { height: 8px; border-radius: 999px; background: var(--ink); }
.bar.soft { background: var(--blue-dot); }
.bar.w92 { width: 92%; } .bar.w78 { width: 78%; } .bar.w54 { width: 54%; }

.tile-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.swatches { display: flex; gap: 6px; }
.swatch { width: 24px; height: 24px; border-radius: 999px; }

.type-sample { display: flex; align-items: baseline; gap: 10px; }
.type-sample .big { font-size: 40px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.type-sample .small { font-size: 18px; color: var(--muted); line-height: 1; }

.comp-row { display: flex; gap: 8px; }
.pill-demo {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 14px; border-radius: 999px; font-size: 12px; font-weight: 500;
}
.pill-demo.dark { background: var(--ink); color: #fff; }
.pill-demo.light { background: var(--blue-bg); color: var(--blue-ink); }

.field-demo {
  height: 32px; box-sizing: border-box; padding: 0 12px;
  display: flex; align-items: center; border-radius: 12px; background: var(--surface);
}
.field-demo .fill { height: 6px; width: 46%; border-radius: 999px; background: var(--soft); }

.code-tile {
  background: var(--ink);
  color: #fff;
}
.code-tile .tile-label { color: #C9C9CE; }
.code-tile .tile-index { color: #8E8E93; }
.code-tile pre {
  margin: 0;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
}
.code-tile .ln { color: #8E8E93; }
.code-tile .k { color: var(--code-key); }
.code-tile .s { color: var(--code-str); }

/* ---------- Temas ---------- */

#temas { padding-top: 0; padding-bottom: 96px; }
#temas .wrap { display: flex; flex-wrap: wrap; gap: 12px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 10px 16px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  color: var(--body);
}

/* ---------- Percurso: separadores ---------- */

.exp-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  margin-bottom: 40px;
}
.exp-toggle button {
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
}
.exp-toggle button.active { background: #fff; color: var(--ink); }
.exp-toggle button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.exp-panel { display: none; }
.exp-panel.active { display: block; }

.edu-panel { display: none; }
.edu-panel.active { display: block; }

.edu-subtabs {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.edu-subtabs button {
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  padding: 0 0 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.edu-subtabs button.active { color: var(--ink); border-bottom-color: var(--ink); }
.edu-subtabs button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.edu-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  font-size: 15px;
  font-weight: 500;
}

/* ---------- Percurso: carrossel de experiência ---------- */

.carousel-wrap { position: relative; }

.exp-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 40px) / 3);
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0;
  padding-bottom: 4px;
  margin: 0 -2px;
  scrollbar-width: none;
}
.exp-carousel::-webkit-scrollbar { display: none; }
.exp-carousel .exp-card { scroll-snap-align: start; }

.carousel-nav {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--soft);
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.carousel-btn:hover { background: var(--surface); }
.carousel-btn:disabled { opacity: 0.35; cursor: default; }
.carousel-btn:disabled:hover { background: #fff; }

.exp-card {
  box-sizing: border-box;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.exp-card .role { display: flex; flex-direction: column; gap: 6px; }
.exp-card .role strong { font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.exp-card .role span { font-size: 15px; color: var(--body); }
.exp-card .period { font-size: 14px; color: var(--muted); }
.exp-card .role-sub {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.exp-card p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--body); }

/* ---------- Áreas ---------- */

.area-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.area-list .area-row:last-child { border-bottom: 1px solid var(--line); }

.area-num {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}

.area-title { font-size: 28px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; }
.area-desc { font-size: 18px; line-height: 1.5; color: var(--body); }

/* ---------- Publicações em destaque ---------- */

#publicacoes { background: var(--surface); }

.pub-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 56px;
}
.pub-head .section-head { margin-bottom: 0; }

.pub-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 260px;
  gap: 20px;
}

.pub-card {
  box-sizing: border-box;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: var(--radius-lg);
  background: #fff;
}

.pub-card.featured {
  grid-column: span 7;
  grid-row: span 2;
}
.pub-card.side { grid-column: span 5; flex-direction: row; gap: 20px; }

.pub-card .pub-thumb { border-radius: 24px; }
.pub-card.featured .pub-thumb { height: 268px; flex-shrink: 0; }
.pub-card.side .pub-thumb {
  width: 140px; flex-shrink: 0; border-radius: var(--radius-md);
}

.pub-body {
  flex-grow: 1;
  box-sizing: border-box;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}
.pub-card.side .pub-body { padding: 8px 8px 8px 0; }

.pub-card h3 { font-size: 30px; line-height: 1.2; letter-spacing: -0.03em; }
.pub-card.side h3 { font-size: 21px; line-height: 1.25; letter-spacing: -0.02em; }

/* ---------- Competências ---------- */

.tool-scroll {
  margin: 0 -4px 56px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tool-scroll::-webkit-scrollbar { display: none; }

.tool-grid {
  display: flex;
  gap: 16px;
  width: max-content;
}

.tool-tile {
  width: 124px;
  height: 124px;
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: var(--radius-md);
}
.tool-tile span { font-size: 14px; font-weight: 500; }
.tool-tile.lilac { background: var(--lilac-bg); color: var(--lilac-ink); }
.tool-tile.sand  { background: var(--sand-bg);  color: var(--sand-ink);  }
.tool-tile.green { background: var(--green-bg); color: var(--green-ink); }
.tool-tile.blue  { background: var(--blue-bg);  color: var(--blue-ink);  }
.tool-tile.rose  { background: var(--rose-bg);  color: var(--rose-ink);  }

.skill-row {
  border-top: 1px solid var(--line);
}
.skill-list .skill-row:last-child { border-bottom: 1px solid var(--line); }

.skill-trigger {
  width: 100%;
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0;
  cursor: pointer;
  text-align: left;
}
.skill-trigger:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
.skill-row .label { display: flex; align-items: center; gap: 18px; font-size: 26px; font-weight: 500; letter-spacing: -0.025em; color: var(--ink); }
.skill-row .dot { width: 10px; height: 10px; flex-shrink: 0; }

.skill-icon {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 999px; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
}
.skill-row[data-open="true"] .skill-icon { transform: rotate(45deg); }

.skill-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.skill-row[data-open="true"] .skill-panel { grid-template-rows: 1fr; }
.skill-panel-inner { overflow: hidden; }
.skill-panel p {
  margin: 0;
  padding: 0 0 28px;
  max-width: 640px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--body);
}

/* ---------- Sobre ---------- */

#sobre .wrap {
  display: flex;
  align-items: flex-start;
  gap: 96px;
}
#sobre .col { flex: 1 1 0; min-width: 0; }
#sobre .col.right { padding-top: 44px; }
#sobre h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.1; }
#sobre p { margin: 0; font-size: 20px; line-height: 1.55; color: var(--body); }

/* ---------- Contacto ---------- */

#contacto { padding-top: 0; }

.contact-panel {
  box-sizing: border-box;
  padding: 80px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-radius: 40px;
  background: var(--surface);
}

.contact-panel h2 { font-size: clamp(34px, 5vw, 64px); line-height: 1.06; letter-spacing: -0.035em; max-width: 900px; }

.contact-row {
  display: flex;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}

.contact-note { max-width: 500px; display: flex; flex-direction: column; gap: 8px; }
.contact-note p { margin: 0; font-size: 19px; line-height: 1.5; color: var(--body); }
.contact-note span { font-size: 15px; color: var(--muted); }

/* ---------- Ecrãs pequenos ---------- */

@media (max-width: 980px) {
  #apresentacao .wrap { flex-direction: column; align-items: stretch; gap: 40px; }
  .hero-visual { width: 100%; }
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 4px; }
  .hero-actions .btn { width: auto; }

  .exp-carousel { grid-auto-columns: calc((100% - 20px) / 2); }

  .area-row { grid-template-columns: 48px minmax(0, 1fr); }
  .area-row .area-desc { grid-column: 2 / 3; grid-row: 2; }

  .pub-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .pub-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .pub-card.featured, .pub-card.side { grid-column: span 1; }
  .pub-card.side { flex-direction: row; }
  .pub-card.featured .pub-thumb { height: 200px; }

  #sobre .wrap { flex-direction: column; gap: 24px; }
  #sobre .col.right { padding-top: 0; }

  .contact-panel { padding: 48px 32px; }
  .contact-row { flex-direction: column; align-items: flex-start; gap: 24px; }
}

@media (max-width: 620px) {
  section { padding: 64px 0; }
  #apresentacao { padding-top: 40px; padding-bottom: 56px; }
  #temas { padding-bottom: 64px; }
  .section-head { margin-bottom: 32px; }
  .exp-carousel { grid-auto-columns: 88%; }
  .tool-grid { gap: 10px; }
  .tool-tile { width: 96px; height: 96px; gap: 10px; }
  .skill-row .label { font-size: 21px; gap: 14px; }
  .area-title { font-size: 23px; }
  .area-desc { font-size: 16px; }
  .pub-card h3 { font-size: 23px; }
  .contact-panel { padding: 40px 24px; border-radius: 32px; }
}
