:root {
  --black: #000000;
  --white: #FFFFFF;
  --zinc: #A1A1AA;
  --zinc-line: rgba(161, 161, 170, .22);
  --zinc-fill: #71717A;

  --font: 'Archivo', system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(1.25rem, 4vw, 4rem);
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

:focus-visible {
  outline: 2px solid var(--zinc);
  outline-offset: 4px;
}

.shell {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--gutter);
}

/* hairlines decorativas */
.grid-lines { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.grid-lines span {
  position: absolute;
  background: var(--zinc-line);
  transform: scaleX(0);
  transform-origin: center;
  animation: drawX .6s var(--ease) forwards;
}
.grid-lines span:nth-child(1) { top: calc(var(--gutter) * 2); left: 0; right: 0; height: 1px; }
.grid-lines span:nth-child(2) { bottom: calc(var(--gutter) * 2); left: 0; right: 0; height: 1px; animation-delay: .1s; }

@keyframes drawX { to { transform: scaleX(1); } }

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

.stage { display: grid; place-items: center; position: relative; z-index: 1; }
.hero { text-align: center; }

.wordmark { margin: 0; line-height: .84; }

.wordmark-main, .wordmark-sub { display: block; }

.wordmark-main {
  font-size: clamp(4rem, 19vw, 15rem);
  font-weight: 900;
  letter-spacing: -.02em;
}

.wordmark-sub {
  font-size: clamp(1.1rem, 4.4vw, 3.4rem);
  font-weight: 600;
  letter-spacing: .34em;
  padding-left: .34em;      /* compensa o tracking da última letra */
  text-align: right;
  color: var(--zinc);
}

.ltr {
  display: inline-block;
  transform: translateY(110%);
  animation: riseIn .9s var(--ease) forwards;
}
.wordmark-main .ltr:nth-child(1) { animation-delay: .20s; }
.wordmark-main .ltr:nth-child(2) { animation-delay: .26s; }
.wordmark-main .ltr:nth-child(3) { animation-delay: .32s; }
.wordmark-main .ltr:nth-child(4) { animation-delay: .38s; }
.wordmark-sub  .ltr:nth-child(1) { animation-delay: .56s; }
.wordmark-sub  .ltr:nth-child(2) { animation-delay: .60s; }
.wordmark-sub  .ltr:nth-child(3) { animation-delay: .64s; }
.wordmark-sub  .ltr:nth-child(4) { animation-delay: .68s; }
.wordmark-sub  .ltr:nth-child(5) { animation-delay: .72s; }

@keyframes riseIn { to { transform: translateY(0); } }

/* o clip que faz as letras "subirem de dentro" */
.wordmark-main, .wordmark-sub {
  overflow: hidden;
  /* headroom extra para o ink de fontes em peso 900/600 não cortar no topo/base
     em certos tamanhos (hinting arredonda as métricas de forma não-linear em
     telas pequenas); compensado para não deslocar o layout. */
  padding-block: .08em;
  margin-block: -.08em;
}

.descriptor {
  margin: clamp(1.2rem, 3vw, 2.2rem) 0 0;
  font-size: clamp(.7rem, 1.5vw, .95rem);
  font-weight: 600;
  letter-spacing: .42em;
  padding-left: .42em;
  text-transform: uppercase;
  color: var(--zinc);
  opacity: 0;
  animation: fadeUp .8s var(--ease) .9s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

body.is-zh .descriptor,
body.is-zh .cta,
body.is-zh .project-tag,
body.is-zh .lang-menu {
  font-family: 'Noto Sans SC', var(--font);
}

.top { display: flex; justify-content: flex-end; position: relative; z-index: 3; }
.lang { position: relative; }

.lang-btn, .lang-menu button {
  display: flex; align-items: center; gap: .55rem;
  min-height: 44px; padding: .4rem .7rem;
  background: transparent; border: 1px solid var(--zinc-line);
  color: var(--white); font: inherit; font-size: .8rem;
  font-weight: 600; letter-spacing: .12em; cursor: pointer;
  /* 中文 tem 2 glifos largos: sem isto o rótulo quebra em duas linhas dentro do menu */
  white-space: nowrap;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.lang-btn:hover, .lang-menu button:hover { border-color: var(--zinc); background: rgba(161,161,170,.08); }

.flag { width: 21px; height: 15px; flex: none; display: block; }

.lang-menu {
  position: absolute; top: calc(100% + .4rem); right: 0;
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: .25rem; min-width: 100%;
  background: var(--black); border: 1px solid var(--zinc-line);
}
.lang-menu[hidden] { display: none; }
.lang-menu button { width: 100%; border: 0; }
.lang-menu button[aria-current="true"] { color: var(--zinc); }

.cta, .back {
  margin-top: clamp(1.8rem, 4vw, 3rem);
  min-height: 44px; padding: .85rem 1.6rem;
  background: transparent; border: 1px solid var(--zinc);
  color: var(--white); font: inherit; font-size: .78rem;
  font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  cursor: pointer; opacity: 0;
  animation: fadeUp .8s var(--ease) 1.15s forwards;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.cta:hover, .back:hover { background: var(--white); color: var(--black); }

/* desmonte do wordmark */
.hero.is-leaving .wordmark-main .ltr,
.hero.is-leaving .wordmark-sub .ltr { animation: none; transition: transform .7s var(--ease), opacity .7s var(--ease); opacity: 0; }
.hero.is-leaving .wordmark-main .ltr:nth-child(1) { transform: translate(-140%, -30%) rotate(-8deg); }
.hero.is-leaving .wordmark-main .ltr:nth-child(2) { transform: translate(-60%, 120%); }
.hero.is-leaving .wordmark-main .ltr:nth-child(3) { transform: translate(70%, -110%); }
.hero.is-leaving .wordmark-main .ltr:nth-child(4) { transform: translate(150%, 40%) rotate(9deg); }
.hero.is-leaving .wordmark-sub .ltr { transform: translateY(160%); }
.hero.is-leaving .descriptor, .hero.is-leaving .cta { animation: none; opacity: 0; transition: opacity .35s var(--ease); }

/* faixas */
.projects { display: grid; gap: clamp(.5rem, 1.6vw, 1rem); width: min(100%, 68rem); }
.projects[hidden] { display: none; }

.project {
  position: relative; display: grid;
  grid-template-columns: auto 1fr auto; align-items: center;
  gap: clamp(.8rem, 2vw, 1.6rem);
  padding: clamp(.9rem, 2.2vw, 1.5rem) clamp(.8rem, 2vw, 1.4rem);
  border-top: 1px solid var(--zinc-line);
  color: var(--white); text-decoration: none;
  opacity: 0; transform: translateX(-40px);
  animation: slideIn .7s var(--ease) forwards;
  overflow: hidden;
}
.project:nth-child(1) { animation-delay: .10s; }
.project:nth-child(2) { animation-delay: .19s; }
.project:nth-child(3) { animation-delay: .28s; }

@keyframes slideIn { to { opacity: 1; transform: translateX(0); } }

.project::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--zinc-fill);
  transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--ease);
}
.project:hover::before, .project:focus-visible::before { transform: scaleX(1); }
.project:hover, .project:focus-visible { color: var(--black); }

.project-name {
  font-size: clamp(1.3rem, 4.5vw, 3rem);
  font-weight: 900; letter-spacing: -.01em;
}
.project-rule { height: 1px; background: currentColor; opacity: .35; }
.project-tag {
  font-size: clamp(.65rem, 1.4vw, .85rem); font-weight: 600;
  letter-spacing: .24em; text-transform: uppercase; color: inherit;
}
.back { justify-self: end; animation-delay: .42s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
  .ltr { transform: none; }
  .descriptor, .cta, .project { opacity: 1; transform: none; }
  .stage { grid-auto-flow: row; gap: clamp(2rem, 6vw, 4rem); align-content: center; }
  .projects[hidden] { display: grid; }
  .cta, .back { display: none; }
  body { overflow: auto; }
}
