@import './tokens.css';

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

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100%;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-base);
}

img, video {
  max-width: 100%;
  display: block;
}

/* ── Foco visível (acessibilidade) ─────────────
   Aparece só em navegação por teclado, não em clique de mouse. */
:focus:not(:focus-visible) { outline: none; }

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

/* ── Reduzir movimento para quem prefere ─────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Skip link (usado em todas as páginas) ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  z-index: 999;
}
.skip-link:focus { top: var(--space-4); }

/* ── Entrada da página (micro-interações no load) ── */
@keyframes intro-rise {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes intro-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes intro-underline {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.nav {
  opacity: 0;
  animation: intro-rise 1200ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero__title-part,
.hero__title-accent {
  opacity: 0;
  animation: intro-fade 2000ms ease-out forwards;
}

.nav                { animation-delay: 0ms;   }
.hero__title-part   { animation-delay: 400ms; }
.hero__title-accent { animation-delay: 900ms; }

/* Underline desenhando sob "clarity" */
.hero__title-accent {
  position: relative;
  display: inline-block;
}
.hero__title-accent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.05em;
  height: 3px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  animation: intro-underline 900ms cubic-bezier(0.22, 1, 0.36, 1) 2400ms forwards;
}

/* Cards: animam via IntersectionObserver quando entram na viewport */
.work-list > .project-card {
  opacity: 0;
}
.work-list > .project-card.is-visible {
  animation: intro-rise 1200ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .nav,
  .hero__title-part,
  .hero__title-accent,
  .work-list > .project-card {
    opacity: 1;
    animation: none;
  }
}
