/* Base, navbar, troca de tema/página, cartão de links e intro. Cores em tokens.css. */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scrollbar-width: thin;
}
html {
  -webkit-text-size-adjust: 100%;
  /* Foco pelo teclado nunca para escondido atrás da navbar. */
  scroll-padding-bottom: var(--nav-space);
}
body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  /* Respeita o notch e a barra do iPhone (o viewport usa viewport-fit=cover). As margens
     laterais ficam em .page. */
  padding: max(24px, env(safe-area-inset-top)) 0 var(--nav-space);
  transition:
    background-color 300ms var(--ease-out),
    color 300ms var(--ease-out);
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* Páginas Links e Dev, trocadas pelas abas da navbar. Ocupam a largura toda da tela e
   cortam o que passar dos lados (ex.: card do carrossel seguindo o dedo): sem isso a
   página fica mais larga que a tela por um instante e, no celular, a navbar fixa pula. */
.page {
  width: 100%;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.page[hidden] {
  display: none;
}

/* Navbar flutuante embaixo: abas das páginas + tema e som, numa barra escura. */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  margin-inline: auto;
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px));
  z-index: 40;
  width: max-content;
  display: flex;
  justify-content: center;
}
.tools {
  align-items: center;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 16px;
  background: var(--pill);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 0.5px rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 10px 24px -16px rgba(0, 0, 0, 0.35);
}
.tool {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #f5f5f7;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 150ms,
    color 150ms,
    transform 300ms var(--ease);
}
.tool svg {
  width: 20px;
  height: 20px;
}
.tool:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.tool:active {
  transform: scale(0.9);
}
@media (hover: hover) and (pointer: fine) {
  .tool:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}
.tool[aria-pressed='true'] {
  color: rgba(235, 235, 245, 0.6);
}
.tool .muted {
  display: none;
}

/* Abas: a pílula laranja desliza até a página atual. */
.tabs {
  position: relative;
  display: inline-flex;
  gap: 2px;
  /* A pílula arrasta de lado (main.js); segurar a aba não abre o menu do link no iOS. */
  touch-action: pan-y;
  user-select: none;
  -webkit-touch-callout: none;
}
/* Arrastando a pílula: ela segue o dedo, sem animação nem o "afundar" da aba. */
.tabs[data-dragging] .indicator {
  transition: none;
}
.tabs[data-dragging] .tab:active {
  transform: none;
}
.tab {
  position: relative;
  text-decoration: none;
}
.tab svg {
  position: relative;
  z-index: 1;
  width: 19px;
  height: 19px;
  transition: transform 380ms var(--ease);
}
.tab[aria-current='page'] {
  cursor: default;
}
@media (hover: hover) and (pointer: fine) {
  .tab[aria-current='page']:hover {
    background: transparent;
  }
  .tab:not([aria-current='page']):hover svg {
    transform: scale(1.1);
  }
}
.indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  pointer-events: none;
  transform: translateX(calc(var(--at, 0) * 46px));
  transition: transform 400ms cubic-bezier(0.32, 0.72, 0, 1);
}

/* Sol ⇄ lua: o ícone
   gira (90° ⇄ 40°), o miolo cresce até virar a lua enquanto um recorte desce
   e cava o crescente, e os 8 pontos do sol somem/aparecem. Curvas com mola. */
.tool .sunmoon {
  width: 20px;
  height: 20px;
  overflow: visible;
  transform: rotate(90deg);
  transition: transform 600ms cubic-bezier(0.34, 1.36, 0.5, 1);
}
.sm-core {
  r: 6px;
  transition: r 500ms cubic-bezier(0.34, 1.3, 0.5, 1);
}
.sm-cutout,
.sm-arc {
  cy: -8px;
  transition: cy 500ms cubic-bezier(0.34, 1.2, 0.5, 1);
}
.sm-dot {
  transform: scale(1);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 420ms cubic-bezier(0.34, 1.7, 0.5, 1);
}
:root[data-shown='dark'] .tool .sunmoon {
  transform: rotate(40deg);
}
:root[data-shown='dark'] .sm-core {
  r: 9.5px;
}
:root[data-shown='dark'] .sm-cutout,
:root[data-shown='dark'] .sm-arc {
  cy: 4px;
}
:root[data-shown='dark'] .sm-dot {
  transform: scale(0);
  transition-duration: 260ms;
  transition-timing-function: var(--ease-out);
}

/* Pôr do sol (bege): o ícone fica reto, o sol desce até o horizonte, o chão
   esconde a metade de baixo, só os raios de cima ficam e a linha do horizonte abre. */
.sm-sun,
.sm-ground {
  transition: transform 520ms cubic-bezier(0.34, 1.2, 0.5, 1);
}
.sm-ground {
  transform: translateY(20px);
}
.sm-horizon {
  transform: scaleX(0);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 420ms cubic-bezier(0.34, 1.4, 0.5, 1);
}
:root[data-shown='beige'] .tool .sunmoon {
  transform: rotate(0deg);
}
:root[data-shown='beige'] .sm-sun {
  transform: translateY(5px);
}
:root[data-shown='beige'] .sm-ground {
  transform: translateY(0);
}
:root[data-shown='beige'] .sm-horizon {
  transform: scaleX(1);
  transition-delay: 80ms;
}
:root[data-shown='beige'] .sm-low {
  transform: scale(0);
  transition-duration: 260ms;
  transition-timing-function: var(--ease-out);
}

/* Troca de tema: a página antiga some por cima da nova (todas as cores mudam
   juntas); a navbar fica de fora para a animação do sol/lua aparecer ao vivo. */
.nav {
  view-transition-name: nav;
}
:root[data-vt='theme']::view-transition-old(root) {
  animation: 320ms cubic-bezier(0.4, 0, 0.2, 1) both vt-fade-out;
  z-index: 1;
}
:root[data-vt='theme']::view-transition-new(root) {
  animation: none;
}
:root[data-vt='theme']::view-transition-old(nav) {
  display: none;
}
:root[data-vt='theme']::view-transition-new(nav) {
  animation: none;
}
/* Troca de página: a antiga some e a nova aparece; a navbar fica ao vivo (a pílula desliza). */
:root[data-vt='page']::view-transition-old(root) {
  animation: 160ms ease-out both vt-fade-out;
}
:root[data-vt='page']::view-transition-new(root) {
  animation: 240ms ease-out both vt-fade-in;
}
:root[data-vt='page']::view-transition-old(nav) {
  display: none;
}
:root[data-vt='page']::view-transition-new(nav) {
  animation: none;
}
@keyframes vt-fade-in {
  from {
    opacity: 0;
  }
}
@keyframes vt-fade-out {
  to {
    opacity: 0;
  }
}
.tool[aria-pressed='true'] .unmuted {
  display: none;
}
.tool[aria-pressed='true'] .muted {
  display: block;
}

.host {
  width: min(100%, 420px);
}
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: 5px;
  background: var(--card);
  box-shadow: var(--shadow);
  transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: box-shadow 360ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .host:hover .card {
    box-shadow: var(--shadow-lift);
  }
}

.name {
  font-family: var(--display);
  font-size: 32px;
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.role {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-2);
}
header {
  padding: 0 2px;
}

ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Uma linha por rede: no hover a cor da rede entra pela esquerda. */
.link {
  --brand: var(--text);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 50px;
  padding: 5px 14px 5px 5px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--r);
  background: var(--row);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 260ms var(--ease-out),
    transform 300ms var(--ease),
    box-shadow 300ms var(--ease);
}
.link::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--brand);
  clip-path: inset(0 100% 0 0 round var(--r));
  transition: clip-path 440ms var(--ease);
}
.mark {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--mark);
  color: var(--text);
  transition:
    background-color 260ms var(--ease-out),
    color 260ms var(--ease-out),
    transform 420ms cubic-bezier(0.34, 1.6, 0.5, 1);
}
.mark svg {
  width: 20px;
  height: 20px;
}
.label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform 380ms var(--ease);
}
/* Seta ↗ sempre visível; no hover gira no lugar para →, com um leve passo além do ponto. */
.out {
  display: inline-grid;
  transition: transform 460ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.out svg {
  width: 16px;
  height: 16px;
}

.link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  color: #ffffff;
}
.link:focus-visible::before {
  clip-path: inset(0 0 0 0 round var(--r));
}
.link:focus-visible .mark {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: rotate(-10deg) scale(1.08);
}
.link:focus-visible .out {
  transform: rotate(45deg);
}
/* Celular (sem hover): o toque enche o botão com a cor da rede e só depois abre o link. */
.link[data-fill] {
  color: #ffffff;
}
.link[data-fill]::before {
  clip-path: inset(0 0 0 0 round var(--r));
  transition-duration: 340ms;
}
.link[data-fill] .mark {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: rotate(-10deg) scale(1.08);
}
.link[data-fill] .out {
  transform: rotate(45deg);
}
@media (hover: hover) and (pointer: fine) {
  .link:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  }
  .link:hover::before {
    clip-path: inset(0 0 0 0 round var(--r));
  }
  .link:hover .mark {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    transform: rotate(-10deg) scale(1.08);
  }
  .link:hover .label {
    transform: translateX(3px);
  }
  .link:hover .out {
    transform: rotate(45deg);
  }
}
.link:active {
  transform: scale(0.97);
}

/* E-mail: botão que copia o endereço. Ícone de copiar no lugar da seta; ao copiar vira ✓. */
button.link {
  width: 100%;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.link[data-copy] .out {
  position: relative;
}
.link[data-copy] .out svg {
  grid-area: 1 / 1;
  transition:
    transform 420ms cubic-bezier(0.34, 1.6, 0.5, 1),
    opacity 200ms var(--ease-out);
}
.link[data-copy] .out .check {
  opacity: 0;
  transform: scale(0.4);
}
.link[data-copy]:focus-visible .out,
.link[data-copy][data-fill] .out {
  transform: scale(1.12);
}
.link[data-copied] {
  color: #ffffff;
}
.link[data-copied]::before {
  clip-path: inset(0 0 0 0 round var(--r));
}
.link[data-copied] .mark {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: rotate(-10deg) scale(1.08);
}
.link[data-copied] .out .copy {
  opacity: 0;
  transform: scale(0.4);
}
.link[data-copied] .out .check {
  opacity: 1;
  transform: none;
}
@media (hover: hover) and (pointer: fine) {
  .link[data-copy]:hover .out {
    transform: scale(1.12);
  }
}

/* Botão de destaque: escuro, embaixo. */
.featured {
  margin-top: 26px;
}
.featured .link {
  background: var(--btn);
  color: #ffffff;
  font-weight: 600;
}
.featured .mark {
  background: var(--btn-mark);
  color: #ffffff;
}

/*
  Intro "eovinicius": as letras chegam desfocadas e
  espalhadas e se juntam no centro entrando em foco; um ponto laranja aparece no fim
  da palavra; na saída a tela fecha num círculo que encolhe até esse ponto.
  html[data-splash]: "on" (antes de desenhar), "out" saindo, "done".
*/
.splash {
  display: none;
}
html[data-splash='on'] .splash,
html[data-splash='out'] .splash {
  display: flex;
}
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background: var(--page);
  color: var(--text);
  clip-path: circle(150% at var(--sx, 50%) var(--sy, 50%));
}
.splash-word {
  display: flex;
  align-items: baseline;
  font-family: var(--display);
  font-size: clamp(44px, 8vw, 92px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}
.splash-word > span:not(.splash-dot) {
  display: inline-block;
  animation: splash-focus 1000ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(80ms + var(--i) * 55ms);
}
@keyframes splash-focus {
  from {
    opacity: 0;
    filter: blur(14px);
    transform: translateX(calc((var(--i) - 4.5) * 0.22em)) scale(1.3);
  }
}
.splash-dot {
  width: 0.2em;
  height: 0.2em;
  margin-left: 0.06em;
  border-radius: 50%;
  background: var(--accent);
  animation: splash-dot 520ms cubic-bezier(0.34, 1.7, 0.5, 1) 1000ms both;
}
@keyframes splash-dot {
  from {
    transform: scale(0);
  }
}
/* Saída: a palavra perde o foco e a tela fecha até o ponto laranja. */
html[data-splash='out'] .splash-word > span:not(.splash-dot) {
  animation: splash-blur-out 320ms ease-in both;
}
@keyframes splash-blur-out {
  to {
    opacity: 0;
    filter: blur(8px);
  }
}
html[data-splash='out'] .splash {
  clip-path: circle(0 at var(--sx, 50%) var(--sy, 50%));
  transition: clip-path 760ms cubic-bezier(0.7, 0, 0.84, 0) 160ms;
}
@media (prefers-reduced-motion: reduce) {
  .splash-word > span,
  html[data-splash='out'] .splash-word > span:not(.splash-dot) {
    animation: none;
  }
  html[data-splash='out'] .splash {
    clip-path: none;
    opacity: 0;
    transition: opacity 240ms linear;
  }
}

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

@media (max-width: 560px) {
  .card {
    padding: 20px;
  }
  .link {
    min-height: 56px;
  }
  /* Sem reticências no celular: o rótulo quebra em duas linhas (o e-mail quebra no @). */
  .label {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card {
    transform: none;
  }
  .indicator,
  .tab svg {
    transition: none;
  }
  .tool:active {
    transform: none;
  }
  .tool .sunmoon,
  .sm-core,
  .sm-cutout,
  .sm-arc,
  .sm-dot,
  .sm-sun,
  .sm-ground,
  .sm-horizon {
    transition: none;
  }
  .link,
  .mark,
  .label,
  .out,
  .link::before,
  .link[data-copy] .out svg {
    transition:
      color 180ms,
      background-color 180ms,
      opacity 180ms;
  }
  .link[data-copy] .out svg {
    transform: none !important;
  }
  .link:hover,
  .link:active,
  .link:hover .mark,
  .link:hover .label,
  .link:hover .out,
  .link:focus-visible .mark,
  .link:focus-visible .out {
    transform: none;
  }
}
