@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/Inter-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/Inter-500.woff2') format('woff2');
}

:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.5);
  --border: rgba(233, 230, 225, 0.24);
  --accent: #FFCB05;

  /* Gutters fluidos: escalam suavemente entre mobile e desktop.
     clamp(mínimo, preferencial, máximo) */
  --gutter-x: clamp(1.5rem, 5vw, 6rem);        /* 24 → 96 */
  --gutter-bottom: clamp(2rem, 4vw, 4.5rem);   /* 32 → 72 */
  --gutter-top: clamp(3rem, 6vw, 6rem);        /* 48 → 96 */

  /* Gaps entre blocos */
  --gap-logo-identity: 1.75rem;                /* 28 */
  --gap-identity-links: 2.25rem;               /* 36 */

  /* Tipografia */
  --fs-body: 0.75rem;    /* 12 */
  --fs-micro: 0.625rem;  /* 10 */
}

html.light {
  --bg: #f0f0f0;
  --fg: #000;
  --muted: rgba(0, 0, 0, 0.5);
  --border: rgba(0, 0, 0, 0.12);
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  transition: background-color 200ms ease;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.7;
}

.frame {
  position: relative;
  height: 100vh;                /* fallback para browsers antigos */
  height: 100svh;               /* evita que a barra do mobile cubra o rodapé */
  height: 100dvh;               /* acompanha a barra do navegador dinamicamente */
  padding:
    calc(var(--gutter-top) + env(safe-area-inset-top))
    var(--gutter-x)
    calc(var(--gutter-bottom) + env(safe-area-inset-bottom));
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
}

.logo {
  width: 2.75rem;   /* 44 */
  height: 1.25rem;  /* 20 */
  display: block;
  color: var(--fg);
}

.identity {
  margin-top: var(--gap-logo-identity);
  display: flex;
  flex-direction: column;
}

.identity .name,
.identity .role {
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 200%;
  color: var(--fg);
  white-space: nowrap;
}

.identity .role {
  opacity: 0.5;
}

.links {
  margin-top: var(--gap-identity-links);
  display: flex;
  gap: 1.5rem;  /* 24 */
}

.links a {
  position: relative;
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 200%;
  color: var(--fg);
}

.links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.links a:hover,
.links a:focus-visible {
  opacity: 1;
}

.links a:hover::after,
.links a:focus-visible::after {
  transform: scaleX(1);
}

@media (hover: none) {
  .links a::after {
    display: none;
  }
}

.location {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;  /* 8 */
}

.theme-toggle {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: inherit;
  line-height: 0;
}

.theme-toggle:focus-visible {
  outline: 1px solid var(--border);
  outline-offset: 0.25rem;
  border-radius: 0.25rem;
}

.location-icon {
  width: 1.5rem;   /* 24 */
  height: 1.5rem;
  flex-shrink: 0;
  display: block;
  transform-origin: 50% 50%;
}

.location-icon.spinning {
  animation: sun-spin 0.5s linear infinite;
}

@keyframes sun-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(90deg); }
}

.location-text {
  display: flex;
  flex-direction: column;
  font-size: var(--fs-micro);
  font-weight: 400;
  line-height: 120%;
  color: var(--fg);
  white-space: nowrap;
}

.location-text .muted {
  opacity: 0.5;
}

@media (max-width: 640px) {
  /* No mobile: logo no topo, identity+links centralizados verticalmente,
     location no rodapé. margin-top: auto nos dois (identity e location)
     distribui o espaço livre igualmente, sem hacks. */
  .identity {
    margin-top: auto;
  }

  .identity .name,
  .identity .role {
    white-space: normal;
  }
}

/* Respeita preferência de usuários que pediram menos animação */
@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;
  }
}
