@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(255, 255, 255, 0.12);
  --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 (margin do grid) */
  --gutter-bottom: clamp(2rem, 4vw, 4.5rem);   /* 32 → 72 */
  --gutter-top: clamp(3rem, 6vw, 6rem);        /* 48 → 96 */

  /* Grid de 12 colunas: 24px de gutter entre colunas */
  --grid-gutter: 1.5rem;                       /* 24 */

  /* 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 */

  /* Quanto o fogo preenche o stage. 1 = fit apertado; <1 = menor com padding. */
  --flame-fill: 1;
}

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;
}

.page {
  position: relative;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gutter);
  padding-left: var(--gutter-x);
  padding-right: var(--gutter-x);
  background: var(--bg);
  overflow: hidden;
}

.frame {
  grid-column: 1 / span 6;
  position: relative;
  min-height: 0;
  padding-top: calc(var(--gutter-top) + env(safe-area-inset-top));
  padding-bottom: calc(var(--gutter-bottom) + env(safe-area-inset-bottom));
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
}

.showcase {
  grid-column: 7 / span 6;
  position: relative;
  min-height: 0;
  background: var(--bg);
  color: var(--fg);
  padding-top: calc(var(--gutter-top) + env(safe-area-inset-top));
  padding-bottom: calc(var(--gutter-bottom) + env(safe-area-inset-bottom));
  overflow: hidden;
}

.showcase-visual {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
}

.flame-stage {
  position: absolute;
  inset: 0;
}

.flame-stage canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: grab;
  touch-action: none;
}

.flame-stage canvas:active {
  cursor: grabbing;
}

.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: 860px) {
  :root {
    --flame-fill: 0.8;
  }

  /* No mobile troca o grid pra flex column. O .frame vira display: contents
     pra seus filhos (logo/identity/links/location) ficarem no mesmo fluxo
     do .showcase, permitindo ordenar o showcase entre links e location. */
  .page {
    display: flex;
    flex-direction: column;
    padding-top: calc(var(--gutter-top) + env(safe-area-inset-top));
    padding-bottom: calc(var(--gutter-bottom) + env(safe-area-inset-bottom));
  }

  .frame {
    display: contents;
  }

  .logo      { order: 1; }
  .identity  { order: 2; }
  .links     { order: 3; }
  .showcase  {
    order: 4;
    flex: 1;
    min-height: 0;
    padding: 0;
    margin-top: 2rem;
  }
  .location  { order: 5; }
}

@media (max-width: 640px) {
  .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;
  }
}
