/* ---------- Tokens ---------- */
:root {
  --paper: #EFE6DA;
  --surface: #F7F1E9;
  --ink: #3B2A20;
  --slate: #6F5B4C;
  --rule: #D6C4AF;

  --caramel: #B9875A;
  --caramel-tint: #E6D3BC;
  --caramel-deep: #7A5530;
  --brown: #7B5034;
  --brown-deep: #553520;

  --night: #4A3326;
  --night-soft: #DCC8B3;

  --font: "Lexend", system-ui, sans-serif;

  /* Escala tipográfica clássica (Bringhurst) */
  --t-12: 0.75rem;
  --t-14: 0.875rem;
  --t-16: 1rem;
  --t-18: 1.125rem;
  --t-21: 1.3125rem;
  --t-24: 1.5rem;
  --t-36: 2.25rem;
  --t-48: 3rem;

  --index-w: 17rem;
  --gutter: clamp(1rem, 5vw, 5rem);
  --measure: 38rem;

  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-18);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}

p { margin: 0; }

a { color: inherit; }

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

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

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: #fff;
  font-size: var(--t-14);
}
.skip:focus { top: 1rem; }

/* ---------- Índice lateral ---------- */
.index {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--index-w);
  display: flex;
  flex-direction: column;
  padding: 3rem 2rem 2.5rem;
  border-right: 1px solid var(--rule);
  background: var(--paper);
  z-index: 10;
}

.index__id {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  text-decoration: none;
}

.index__mark {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  margin-top: 0.1rem;
}
.index__mark path { fill: var(--brown); }
.index__mark circle { fill: var(--paper); }

.index__name {
  display: block;
  font-size: var(--t-21);
  line-height: 1.2;
}

.index__role {
  display: block;
  margin-top: 0.2rem;
  font-size: var(--t-14);
  color: var(--slate);
}

.index__toggle { display: none; }

.index__nav { margin-top: 4rem; }

.index__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.index__nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0;
  font-size: var(--t-16);
  color: var(--slate);
  text-decoration: none;
  transition: color 0.2s ease;
}

/* A linha que indica a secção atual cresce, como uma pausa que se estende */
.index__nav a::before {
  content: "";
  flex: none;
  width: 0.75rem;
  height: 2px;
  border-radius: 2px;
  background: var(--rule);
  transition: width 0.35s ease, height 0.35s ease, background-color 0.35s ease;
}

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

.index__nav a[aria-current="true"] { color: var(--ink); font-weight: 500; }
.index__nav a[aria-current="true"]::before {
  width: 2rem;
  height: 4px;
  background: var(--brown);
}

.index__contact {
  margin-top: auto;
  display: grid;
  gap: 0.5rem;
  font-size: var(--t-14);
}

.index__contact a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--slate);
  text-decoration: none;
  overflow-wrap: anywhere;
}
/* O e-mail é longo: letra mais pequena para caber numa só linha */
.index__contact a[href^="mailto:"] { font-size: 0.7rem; white-space: nowrap; }
.index__contact .icon { width: 1.1rem; height: 1.1rem; color: var(--brown); }
.index__contact a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Conteúdo ---------- */
main { margin-left: var(--index-w); }

.section { padding: 7rem var(--gutter); }

.section h2 {
  font-size: var(--t-36);
  margin-bottom: 2.5rem;
}

.prose {
  max-width: var(--measure);
  display: grid;
  gap: 1.25rem;
}

.prose__lead {
  font-size: var(--t-21);
  line-height: 1.55;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-block;
  padding: 0.9rem 1.75rem;
  border-radius: 999px;
  background: var(--brown);
  color: #fff;
  font-size: var(--t-16);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.btn:hover { background: var(--brown-deep); }

/* ---------- Início ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  grid-template-areas:
    "title art"
    "body  art";
  align-content: center;
  align-items: end;
  gap: 3rem clamp(2rem, 4vw, 4rem);
  padding: 6rem var(--gutter);
  background: var(--caramel-tint);
  overflow: hidden;
}

.hero__title {
  grid-area: title;
  font-size: clamp(2.75rem, 6vw, 5.75rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 10ch;
  text-wrap: initial;
}

.hero__media {
  grid-area: art;
  position: relative;
  align-self: center;
  justify-self: end;
  width: 100%;
  max-width: 26rem;
}

/* Um bloco de cor por trás da fotografia, com o canto do balão de conversa */
.hero__media::before,
.contact__media::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: -1.5rem;
  width: 55%;
  height: 40%;
  border-radius: 1.5rem 1.5rem 1.5rem 0.3rem;
  background: var(--brown);
}

.hero__photo {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 2rem 2rem 2rem 0.4rem;
  overflow: hidden;
  background: var(--caramel);
}

.hero__photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 9rem;
  font-weight: 300;
  color: var(--caramel-tint);
}

.hero__body {
  grid-area: body;
  align-self: start;
  max-width: 32rem;
}

.hero__lede {
  font-size: var(--t-18);
  line-height: 1.6;
  color: #5E4A3C;
}

.hero__license {
  margin-top: 1rem;
  font-size: var(--t-14);
  color: var(--slate);
}


/* Revelação: cada palavra chega no seu tempo */
.js .hero__title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.12em);
  animation: arrive 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
  animation-delay: var(--d, 0s);
}

.js .hero__body {
  opacity: 0;
  animation: arrive 0.9s ease forwards;
  animation-delay: var(--body-d, 2.6s);
}

@keyframes arrive {
  to { opacity: 1; transform: none; }
}

/* ---------- Gaguez ---------- */
.gaguez__grid {
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) minmax(0, 22rem);
  gap: 3rem clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.belief {
  margin: 0;
  padding: 2.25rem 2rem 2.5rem;
  border-radius: 1.5rem 1.5rem 1.5rem 0.3rem;
  background: var(--brown);
  color: #fff;
  font-size: var(--t-24);
  font-weight: 300;
  line-height: 1.4;
}

/* ---------- A minha missão ---------- */
.mission { background: var(--surface); }

.insta {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.5rem;
  padding: 0.5rem 1.5rem 0.5rem 0.5rem;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--rule);
  font-size: var(--t-16);
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: box-shadow 0.2s ease;
}
.insta:hover { box-shadow: inset 0 0 0 1.5px var(--brown); }

.insta__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--brown);
  color: #fff;
}

/* ---------- Marcar uma consulta ---------- */
.booking__sub {
  font-size: var(--t-21);
  margin-bottom: 1.5rem;
}

.places {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.25rem;
  max-width: 62rem;
}

.place {
  padding: 1.75rem;
  border-radius: 1.5rem;
  background: var(--surface);
}

.place__icon {
  display: inline-grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem 1rem 1rem 0.3rem;
  background: var(--caramel-tint);
  color: var(--brown-deep);
}

.place h4 {
  margin: 1.25rem 0 0.35rem;
  font-size: var(--t-18);
}

.place p {
  font-size: var(--t-16);
  color: var(--slate);
}

.place a {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.25em;
}
.place a:hover { color: var(--ink); text-decoration-color: var(--brown); }

.booking__contact {
  margin-top: 3.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2.5rem 4rem;
}

.booking__contact .booking__sub { margin-bottom: 0.75rem; }

.booking__note {
  max-width: var(--measure);
  margin: 0 0 1.25rem;
  color: var(--slate);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.contact-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

.contact-list .icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--brown);
}

.contact-list a {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.25em;
  overflow-wrap: anywhere;
}
.contact-list a:hover { text-decoration-color: var(--brown); }

/* ---------- O meu percurso: linha temporal com dois lados ---------- */
#percurso { background: var(--surface); }

.timeline__heads,
.timeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4rem minmax(0, 1fr);
  max-width: 60rem;
}

.timeline__heads { margin-bottom: 1.5rem; }

.timeline__head {
  font-size: var(--t-14);
  font-weight: 500;
  color: var(--slate);
}
.timeline__head--edu { grid-column: 1; text-align: right; }
.timeline__head--work { grid-column: 3; }

.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  row-gap: 1.75rem;
}

/* A linha central */
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  margin-left: -1px;
  background: var(--rule);
}

.tl {
  position: relative;
  grid-row: var(--row, auto);
}

.tl--edu {
  grid-column: 1;
  text-align: right;
}

.tl--work { grid-column: 3; }

/* O ponto de cada etapa, sobre a linha central */
.tl::after {
  content: "";
  position: absolute;
  top: 0.3rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--surface);
}
.tl--edu::after { right: calc(-2rem - 0.45rem); background: var(--caramel); }
.tl--work::after { left: calc(-2rem - 0.45rem); background: var(--brown); }

.tl__kind {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tl__year {
  display: block;
  margin-bottom: 0.2rem;
  font-size: var(--t-14);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tl--edu .tl__year { color: var(--caramel-deep); }
.tl--work .tl__year { color: var(--brown); }

.tl h3 {
  font-size: var(--t-18);
  line-height: 1.35;
}

.tl p {
  margin-top: 0.2rem;
  font-size: var(--t-16);
  color: var(--slate);
}

/* As experiências ficam num cartão, para se distinguirem da formação */
.tl--work {
  padding: 1.25rem 1.5rem;
  border-radius: 1.25rem 1.25rem 1.25rem 0.3rem;
  background: var(--caramel-tint);
}
.tl--work::after { top: 1.55rem; left: calc(-2rem - 0.45rem); }

/* ---------- Outras formações ---------- */
.courses {
  margin-top: 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1.25rem;
  align-items: start;
  max-width: 72rem;
}

.course-group {
  padding: 2rem;
  border-radius: 1.5rem;
  background: var(--paper);
}

.course-group h3 {
  font-size: var(--t-18);
  line-height: 1.35;
  margin-bottom: 1.25rem;
}

.course-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.course-group li {
  display: grid;
  gap: 0.15rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  font-size: var(--t-16);
  line-height: 1.45;
}
.course-group li:last-child { padding-bottom: 0; }

.course-group strong { font-weight: 500; }

.course-group span { color: var(--slate); }

.course-group .course-group__where {
  font-size: var(--t-14);
  color: var(--caramel-deep);
}

.course-group--dark {
  background: var(--brown);
  color: #fff;
}
.course-group--dark li { border-top-color: rgba(255, 255, 255, 0.25); }
.course-group--dark strong { font-weight: 400; }

/* ---------- Contactos ---------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  column-gap: 4rem;
  background: var(--night);
  color: #fff;
}

.contact__media {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: center;
  position: relative;
  width: clamp(17rem, 28vw, 24rem);
}

.contact h2 {
  grid-column: 1;
  font-size: var(--t-48);
}

.contact__list {
  grid-column: 1;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
  max-width: 60rem;
}

.contact__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.85rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.contact__list dt {
  font-size: var(--t-14);
  color: var(--night-soft);
}

.contact__list dd {
  margin: 0.15rem 0 0;
  font-size: var(--t-14);
  overflow-wrap: anywhere;
}

.contact__list a {
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}
.contact__list a:hover { border-bottom-color: #fff; }

.contact :focus-visible { outline-color: #fff; }

/* ---------- Rodapé ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 2rem var(--gutter);
  background: var(--night);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--night-soft);
  font-size: var(--t-14);
}

/* ---------- Ecrãs médios ---------- */
@media (max-width: 75rem) {
  .gaguez__grid { grid-template-columns: minmax(0, var(--measure)); }
}

/* ---------- Ecrãs pequenos: o índice passa a barra no topo ---------- */
@media (max-width: 56rem) {
  :root { --bar-h: 4rem; }

  .index {
    inset: 0 0 auto 0;
    width: auto;
    height: var(--bar-h);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .index__id { align-items: center; }
  .index__mark { width: 1.75rem; height: 1.75rem; margin: 0; }
  .index__name { font-size: var(--t-18); }
  .index__role { display: none; }

  .index__toggle {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font: 500 var(--t-14) var(--font);
    cursor: pointer;
  }

  .index__nav {
    position: absolute;
    top: var(--bar-h);
    left: 0;
    right: 0;
    margin: 0;
    padding: 1rem 1rem 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    display: none;
  }
  .index.is-open .index__nav { display: block; }

  .index__nav a { padding: 0.7rem 0; font-size: var(--t-18); }

  .index__contact { display: none; }

  main { margin-left: 0; }

  .section {
    padding: 4.5rem 1rem;
    scroll-margin-top: var(--bar-h);
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "body"
      "art";
    gap: 2rem;
    padding: calc(var(--bar-h) + 2rem) 1rem 3.5rem;
    min-height: 0;
  }

  .hero__title { max-width: none; }
  .hero__media { justify-self: start; max-width: 18rem; margin: 1rem 0 0 1.5rem; }

  .section h2 { font-size: var(--t-24); margin-bottom: 1.75rem; }
  .contact h2 { font-size: var(--t-36); }

  .prose__lead { font-size: var(--t-18); }

  .belief { font-size: var(--t-21); padding: 1.75rem 1.5rem 2rem; }

  .place { padding: 1.5rem; }

  /* Linha temporal numa só coluna, com a linha à esquerda */
  .timeline__heads { display: none; }

  .timeline {
    grid-template-columns: 2rem minmax(0, 1fr);
    row-gap: 1.25rem;
  }

  .timeline::before { left: 0.45rem; margin-left: 0; }

  .tl--edu,
  .tl--work {
    grid-column: 2;
    grid-row: auto;
    text-align: left;
  }

  .tl--edu::after { right: auto; left: -2rem; }
  .tl--work::after { left: -2rem; }

  .tl--work { padding: 1rem 1.25rem; }

  /* Em coluna única, o tipo de cada etapa passa a estar escrito */
  .tl__kind {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    display: block;
    font-size: var(--t-12);
    font-weight: 500;
    color: var(--slate);
  }

  .courses { margin-top: 3.5rem; }
  .course-group { padding: 1.5rem; }

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

  .contact__media {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: 18rem;
    margin: 1rem 0 3rem 1.5rem;
  }

  .footer { padding: 1.5rem 1rem; }
}

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

  .js .hero__title .word,
  .js .hero__body {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .index__nav a,
  .index__nav a::before { transition: none; }
}
